/* Oko Projektu — ciemny pulpit operatora: grafit, morski błękit tęczówki, bursztyn ostrzeżeń. */
:root {
  --bg: #0b1016; --bg2: #101821; --card: #131d28; --card2: #182433; --line: #223243; --line2: #2d4157;
  --text: #e6eef6; --muted: #9db0c3; --faint: #6b8197;
  --iris: #33e1c3; --iris2: #1fb4a0; --ok: #39d98a; --warn: #ffb547; --bad: #ff5d6c; --info: #6fb3ff;
  --display: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 14px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(1000px 500px at 80% -10%, rgba(51, 225, 195, .08), transparent 60%), var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--iris); }
button { font: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 18px 16px 60px; }

/* nagłówek */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 16, 22, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-right: auto; }
.brand svg { width: 34px; height: 34px; }
.brand b { font: 800 17px var(--display); display: block; line-height: 1.1; }
.brand small { color: var(--faint); font: 500 12px var(--mono); }
.eye-iris { transform-origin: 32px 32px; animation: look 9s ease-in-out infinite; }
@keyframes look { 0%, 40%, 100% { transform: translateX(0); } 45%, 60% { transform: translateX(4px); } 65%, 80% { transform: translateX(-4px); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--iris2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--iris), var(--iris2)); color: #032621; border-color: transparent; }
.btn.danger { border-color: rgba(255, 93, 108, .5); color: #ffb3ba; }
.btn.ghost { background: none; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 50px; font-size: 16px; padding: 0 22px; }

/* logowanie */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px 24px; box-shadow: 0 30px 80px -40px #000; }
.auth-card .eye { width: 74px; height: 74px; display: block; margin: 0 auto 10px; }
.auth-card h1 { text-align: center; font-size: 24px; }
.auth-card p.lead { text-align: center; color: var(--muted); margin: 6px 0 20px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 600; }
input, textarea, select { width: 100%; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 10px; padding: 11px 12px; font: inherit; }
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--iris2); outline-offset: 1px; }
.err { color: #ffb3ba; font-size: 14px; min-height: 1.4em; margin: 0 0 10px; }
.hint { color: var(--faint); font-size: 13px; }
.banner { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .45); background: rgba(255, 181, 71, .08); color: #ffd9a0; font-size: 14px; margin-bottom: 14px; }

/* pulpit */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 22px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.metric small { color: var(--faint); font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.metric b { display: block; font: 600 20px var(--mono); margin: 2px 0 6px; }
.bar { height: 6px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--iris); border-radius: inherit; transition: width .5s; }
.bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.sec-h h2 { font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { position: relative; display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; cursor: pointer; transition: border-color .2s, transform .2s; }
.pcard:hover { border-color: var(--line2); transform: translateY(-1px); }
.pcard-h { display: flex; gap: 12px; align-items: center; }
.picon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 13px; background: var(--card2); border: 1px solid var(--line2); }
.pcard-h div { min-width: 0; }
.pcard-h b { display: block; font: 700 17px var(--display); }
.pcard-h a { color: var(--faint); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font: 600 12px var(--sans); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: rgba(57, 217, 138, .1); } .pill.bad { color: var(--bad); background: rgba(255, 93, 108, .12); }
.pill.warn { color: var(--warn); background: rgba(255, 181, 71, .12); } .pill.info { color: var(--info); background: rgba(111, 179, 255, .12); }
.pill.ok::before { box-shadow: 0 0 0 3px rgba(57, 217, 138, .2); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(57, 217, 138, 0); } }
.pcard .pill { margin-left: auto; align-self: flex-start; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv div { background: var(--bg2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.kv small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kv b { display: block; font: 500 14px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard-f .last { color: var(--faint); font-size: 12.5px; margin-right: auto; }

/* projekt */
.phead { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 4px 0 16px; }
.phead .picon { width: 58px; height: 58px; font-size: 30px; border-radius: 16px; }
.phead h1 { font-size: 26px; }
.phead .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.phead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--iris); }
.tabs a .n { margin-left: 4px; color: var(--faint); font: 500 12px var(--mono); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.panel + .panel, .cols + .panel, .panel + .cols { margin-top: 14px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--sans); font-weight: 600; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols > * { min-width: 0; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } .kv { grid-template-columns: repeat(2, 1fr); } .phead .acts { margin-left: 0; } }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.table td.num, .table th.num { text-align: right; }
.scroll-x { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--bg2); border-radius: 12px; padding: 12px; }
.stat b { display: block; font: 600 26px var(--mono); }
.stat small { color: var(--faint); font-size: 12.5px; }
.md { font-size: 14.5px; color: var(--muted); max-height: 520px; overflow: auto; }
.md h2, .md h3 { color: var(--text); font-size: 16px; margin: 14px 0 6px; text-transform: none; letter-spacing: 0; }
.md ul { padding-left: 18px; margin: 4px 0; } .md code { font-family: var(--mono); font-size: 13px; background: var(--bg2); padding: 1px 5px; border-radius: 5px; }
.md strong { color: var(--text); }

/* aktualizacja */
.drop { display: grid; place-items: center; gap: 8px; text-align: center; padding: 34px 16px; border: 2px dashed var(--line2); border-radius: 18px; background: var(--bg2); cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--iris); background: rgba(51, 225, 195, .05); }
.drop .ico { font-size: 38px; }
.drop b { font: 700 17px var(--display); }
.drop.has { border-style: solid; border-color: var(--iris2); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.modes label { position: relative; display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line2); border-radius: 12px; cursor: pointer; background: var(--bg2); }
.modes input { position: absolute; opacity: 0; }
.modes label:has(input:checked) { border-color: var(--iris); box-shadow: 0 0 0 1px var(--iris) inset; }
.modes b { font-size: 14px; } .modes small { color: var(--faint); font-size: 12.5px; line-height: 1.35; }
@media (max-width: 640px) { .modes { grid-template-columns: 1fr; } }
.progress { height: 10px; border-radius: 10px; background: var(--bg2); overflow: hidden; margin: 12px 0 4px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--iris2), var(--iris)); transition: width .25s; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; padding: 9px 10px; border-radius: 10px; background: var(--bg2); }
.steps li .s { font-size: 16px; text-align: center; }
.steps li b { font-weight: 600; } .steps li small { display: block; color: var(--faint); white-space: pre-wrap; overflow-wrap: anywhere; }
.steps li.run { box-shadow: 0 0 0 1px var(--iris2) inset; } .steps li.fail { box-shadow: 0 0 0 1px var(--bad) inset; }
.steps li.wait, .steps li.skip { opacity: .5; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--iris); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.result { margin-top: 14px; padding: 14px 16px; border-radius: 14px; font-weight: 600; }
.result.ok { background: rgba(57, 217, 138, .1); border: 1px solid rgba(57, 217, 138, .4); color: #b5f5d4; }
.result.bad { background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .45); color: #ffc7cd; }
.result.warn { background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .4); color: #ffdca6; }
.logbox { margin-top: 10px; max-height: 260px; overflow: auto; background: #070b10; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 12.5px/1.55 var(--mono); color: #b8c8d8; white-space: pre-wrap; overflow-wrap: anywhere; }

/* historia */
.rel { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rel:last-child { border-bottom: 0; }
.rel b { font: 600 15px var(--mono); }
.rel small { display: block; color: var(--faint); }
.rel details { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; }
.rel details summary { cursor: pointer; color: var(--faint); }
.rel details pre { white-space: pre-wrap; font: 12.5px var(--mono); margin: 6px 0 0; }

/* logi */
.logbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.logbar input[type=search] { flex: 1; min-width: 160px; width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: none; color: var(--muted); padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--card2); color: var(--text); }
.logs { height: 62vh; overflow: auto; background: #070b10; border: 1px solid var(--line); border-radius: 14px; padding: 8px 0; font: 12.5px/1.6 var(--mono); }
.logs div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 1px 12px; }
.logs div:hover { background: rgba(255,255,255,.03); }
.logs time { color: var(--faint); }
.logs span { white-space: pre-wrap; overflow-wrap: anywhere; color: #c6d4e2; }
.logs .e span { color: #ff98a2; } .logs .w span { color: #ffd08a; }
.logs .e { background: rgba(255, 93, 108, .06); }

/* notatki */
.note { padding: 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.note + .note { margin-top: 10px; }
.note.pin { border-color: rgba(51, 225, 195, .45); }
.note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note .nf { display: flex; gap: 6px; align-items: center; margin-top: 10px; color: var(--faint); font-size: 12.5px; }
.note .nf span { margin-right: auto; }
.note textarea { min-height: 110px; }

/* drobne */
.empty { color: var(--faint); text-align: center; padding: 26px 10px; }
.skel { height: 120px; border-radius: 18px; background: linear-gradient(90deg, var(--card), var(--card2), var(--card)); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
#toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100% - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: #1d2b3a; border: 1px solid var(--line2); box-shadow: 0 16px 40px -16px #000; animation: up .25s; }
.toast.bad { border-color: rgba(255, 93, 108, .6); } .toast.ok { border-color: rgba(57, 217, 138, .6); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line2); border-radius: 18px; padding: 20px; width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h3 { margin-bottom: 8px; } dialog p { color: var(--muted); margin: 0 0 16px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
