/* ==========================================================
   InProtool 2.0 - system projektowy
   Estetyka: przemyslowy panel sterowania / dokumentacja techniczna
   Grafit + papier techniczny + sygnalowy bursztyn
   ========================================================== */

/* ---------- Fonty (IBM Plex, hostowane lokalnie) ---------- */
@font-face { font-family: 'Plex'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Plex'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Plex'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Plex'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans_latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }

@font-face { font-family: 'PlexMono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono_latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'PlexMono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono_latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'PlexMono'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono_latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'PlexMono'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono_latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }

@font-face { font-family: 'PlexCond'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans-condensed_latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'PlexCond'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans-condensed_latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'PlexCond'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans-condensed_latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'PlexCond'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-sans-condensed_latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF; }

/* ---------- Zmienne ---------- */
:root {
  --ink:        #1d2129;   /* tekst glowny */
  --ink-soft:   #555c69;
  --ink-faint:  #8a909c;
  --paper:      #f2f0ea;   /* tlo robocze - papier techniczny */
  --paper-card: #fbfaf7;   /* karty */
  --paper-deep: #e8e5dc;
  --line:       #d8d4c8;   /* linie kresek */
  --line-soft:  #e5e2d8;

  --steel:      #1a1d23;   /* sidebar - grafit */
  --steel-2:    #22262e;
  --steel-line: #32363f;
  --steel-text: #aab0bb;

  --amber:      #e8a13c;   /* sygnalowy bursztyn */
  --amber-deep: #c97f1a;
  --amber-soft: #f8e9d2;
  --green:      #4d9e6a;
  --green-soft: #e2f0e7;
  --red:        #c4554d;
  --red-soft:   #f6e3e1;
  --blue:       #4f8edc;
  --blue-soft:  #e3ecf8;

  --font-ui:   'Plex', 'Segoe UI', sans-serif;
  --font-mono: 'PlexMono', Consolas, monospace;
  --font-disp: 'PlexCond', 'Plex', sans-serif;

  --r: 3px;               /* ostre, techniczne naroza */
  --shadow: 0 1px 2px rgba(29,33,41,.06), 0 4px 14px rgba(29,33,41,.07);
  --shadow-lift: 0 2px 4px rgba(29,33,41,.08), 0 10px 28px rgba(29,33,41,.13);
  --sidebar-w: 232px;
  --speed: .18s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: inherit; }
button { font: inherit; }
img { max-width: 100%; }
.mono { font-family: var(--font-mono); }

::selection { background: var(--amber); color: #1a1d23; }

/* ---------- Szkielet ---------- */
.shell { display: flex; min-height: 100vh; }
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* papier techniczny: delikatna siatka kropek */
  background:
    radial-gradient(rgba(29,33,41,.055) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--paper);
}

/* ---------- Sidebar: panel sterowania ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 28px 100%,
    linear-gradient(180deg, var(--steel-2), var(--steel) 220px);
  color: var(--steel-text);
  border-right: 1px solid #0d0f12;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--steel-line);
}
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: var(--amber);
  color: #15171c;
  font-family: var(--font-disp);
  font-weight: 700; font-size: 17px; letter-spacing: .5px;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--amber-deep), 0 0 18px rgba(232,161,60,.32);
  transition: transform .5s cubic-bezier(.2,.9,.3,1.4);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-name {
  font-family: var(--font-disp);
  font-size: 17.5px; font-weight: 700; letter-spacing: 1.2px;
  color: #eceef1;
}
.brand-name b { color: var(--amber); font-weight: 700; }
.brand-ver {
  display: block; font-size: 9.5px; letter-spacing: 2.4px;
  color: var(--ink-faint); margin-top: -2px;
}

.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-label {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 2.2px; text-transform: uppercase;
  color: #6a7180;
  padding: 14px 8px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  color: var(--steel-text);
  text-decoration: none;
  font-size: 13.8px; font-weight: 500;
  border-radius: var(--r);
  border-left: 2px solid transparent;
  transition: background var(--speed), color var(--speed), border-color var(--speed);
}
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.nav a:hover { background: rgba(255,255,255,.05); color: #e8eaee; }
.nav a.active {
  background: linear-gradient(90deg, rgba(232,161,60,.16), rgba(232,161,60,.04));
  color: #f3d9ad;
  border-left-color: var(--amber);
}
.nav a.active svg { opacity: 1; color: var(--amber); }

.sidebar-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--steel-line);
  font-size: 11.5px; color: #7b8290;
}
.sidebar-foot .foot-text { white-space: nowrap; }
.sidebar-foot .version {
  margin-left: auto;
  background: none; border: 1px solid var(--steel-line);
  color: #7b8290; font-size: 10px; letter-spacing: 1px;
  padding: 2px 7px; border-radius: var(--r); cursor: pointer;
  transition: color var(--speed), border-color var(--speed);
}
.sidebar-foot .version:hover { color: var(--amber); border-color: var(--amber-deep); }

/* Lampki statusu */
.led {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0;
  background: #555; box-shadow: inset 0 0 2px rgba(0,0,0,.5);
}
.led-green { background: #57c97c; box-shadow: 0 0 7px rgba(87,201,124,.8); animation: ledPulse 2.6s infinite; }
.led-amber { background: var(--amber); box-shadow: 0 0 7px rgba(232,161,60,.8); }
.led-red   { background: #e06058; box-shadow: 0 0 7px rgba(224,96,88,.8); }
@keyframes ledPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  background: rgba(251,250,247,.86);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; color: var(--ink); }
.nav-toggle svg { width: 22px; height: 22px; }
.topbar-title { min-width: 0; }
.topbar-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 2.6px; color: var(--ink-faint);
  display: block;
}
.topbar h1 {
  font-family: var(--font-disp);
  font-size: 21px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.clock { font-size: 12.5px; color: var(--ink-soft); letter-spacing: 1px; }
.userbox { text-align: right; line-height: 1.25; }
.userbox-name { display: block; font-weight: 600; font-size: 13px; }
.userbox-role { font-size: 9px; letter-spacing: 1.8px; color: var(--amber-deep); }
.btn-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink-soft); background: var(--paper-card);
  transition: all var(--speed);
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon:hover { color: var(--red); border-color: var(--red); transform: translateY(-1px); }

/* ---------- Tresc ---------- */
.content { flex: 1; padding: 26px; max-width: 1280px; width: 100%; }
.pagefoot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 26px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--ink-faint);
}
.pagefoot-sep { flex: 1; border-top: 1px dashed var(--line); }

/* Animowane wejscie sekcji */
.content > * { animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }
.content > *:nth-child(2) { animation-delay: .06s; }
.content > *:nth-child(3) { animation-delay: .12s; }
.content > *:nth-child(4) { animation-delay: .18s; }
.content > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Naglowki sekcji w stylu dokumentacji technicznej ---------- */
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 26px 0 12px;
}
.section-head:first-child { margin-top: 0; }
.section-no {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 2px; color: var(--amber-deep);
  border: 1px solid var(--amber); border-radius: var(--r);
  padding: 2px 7px; background: var(--amber-soft);
}
.section-head h2 {
  font-family: var(--font-disp); font-size: 16.5px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
}
.section-head .section-aux { margin-left: auto; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Karty ---------- */
.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card.tight { padding: 0; overflow: hidden; }
.card-title {
  font-family: var(--font-disp); font-size: 14px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.card-title::before { content: ''; width: 8px; height: 8px; background: var(--amber); border-radius: 1px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Kafelki statystyk */
.stat {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
  overflow: hidden;
  transition: transform var(--speed), box-shadow var(--speed);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--amber);
}
.stat.green::after { background: var(--green); }
.stat.blue::after  { background: var(--blue); }
.stat.red::after   { background: var(--red); }
.stat-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--ink-faint);
}
.stat-value {
  font-family: var(--font-disp); font-size: 30px; font-weight: 700;
  line-height: 1.15; margin-top: 2px;
}
.stat-sub { font-size: 12px; color: var(--ink-soft); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  color: #f5f6f8; background: var(--steel-2);
  border: 1px solid #0e1013; border-radius: var(--r);
  cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.18);
  transition: all var(--speed);
  user-select: none;
}
.btn:hover { background: #2c313b; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 3px 8px rgba(0,0,0,.22); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(180deg, #f0b054, var(--amber));
  color: #211a0c; border-color: var(--amber-deep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 3px rgba(201,127,26,.4);
}
.btn.primary:hover { background: linear-gradient(180deg, #f4bc6c, #eaa946); box-shadow: 0 3px 10px rgba(201,127,26,.45); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--ink-soft); background: var(--paper-deep); }
.btn.danger { background: var(--red); border-color: #a3423b; }
.btn.danger:hover { background: #cf6058; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::before {
  content: ''; width: 12px; height: 12px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formularze ---------- */
label.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 5px;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 8px 11px;
  font: inherit; color: var(--ink);
  background: #fff;
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.input:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,161,60,.22);
}
.input.mono { font-family: var(--font-mono); font-size: 13px; }
textarea.input { resize: vertical; min-height: 84px; }
.input-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.input-row > * { flex: 1; min-width: 130px; }
.input-row > .shrink { flex: 0 0 auto; min-width: 0; }
.help { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--amber-deep); }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table.tab {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--paper-card);
}
.card.tight table.tab { box-shadow: none; }
table.tab th {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase;
  text-align: left; color: #c9ccd3;
  background: var(--steel-2);
  padding: 9px 12px;
  white-space: nowrap;
  position: sticky; top: 0;
}
table.tab td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tab tbody tr { transition: background var(--speed); }
table.tab tbody tr:hover { background: rgba(232,161,60,.07); }
table.tab tbody tr:nth-child(even) { background: rgba(29,33,41,.018); }
table.tab tbody tr:nth-child(even):hover { background: rgba(232,161,60,.07); }
table.tab .num { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
table.tab .actions { text-align: right; white-space: nowrap; }
table.tab .actions .btn { margin-left: 6px; }
.empty-row td { text-align: center; color: var(--ink-faint); padding: 26px; font-size: 13px; }

/* ---------- Plakietki ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r);
  border: 1px solid transparent;
}
.badge.ok     { background: var(--green-soft); color: #2c6e45; border-color: #b5d8c2; }
.badge.warn   { background: var(--amber-soft); color: #91610f; border-color: #e7cda0; }
.badge.err    { background: var(--red-soft);  color: #8e3a34; border-color: #e4b7b3; }
.badge.info   { background: var(--blue-soft); color: #2d5e9e; border-color: #b9d0ee; }
.badge.muted  { background: var(--paper-deep); color: var(--ink-soft); border-color: var(--line); }

/* dni do terminu */
.due-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.due-chip.overdue { color: var(--red); }
.due-chip.soon    { color: var(--amber-deep); }
.due-chip.fine    { color: var(--green); }

/* ---------- Strefa upuszczania plikow ---------- */
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 150px;
  border: 2px dashed var(--line);
  border-radius: var(--r);
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(29,33,41,.022) 14px 28px),
    #fff;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed), transform var(--speed);
}
.dropzone:hover { border-color: var(--amber); }
.dropzone.drag {
  border-color: var(--amber); border-style: solid;
  background: var(--amber-soft);
  transform: scale(1.008);
}
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-title { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.dropzone .dz-sub { font-size: 12px; }
.dropzone .dz-ico { width: 34px; height: 34px; color: var(--amber-deep); }

/* ---------- Pasek postepu ---------- */
.progress {
  height: 10px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.progress > i {
  display: block; height: 100%;
  width: 0%;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 10px, var(--amber-deep) 10px 20px);
  background-size: 28px 28px;
  animation: stripeMove 1s linear infinite;
  transition: width .3s ease;
}
@keyframes stripeMove { to { background-position: 28px 0; } }

/* ---------- Toasty ---------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--steel-2); color: #e8eaee;
  border-left: 3px solid var(--amber);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
  animation: toastIn .3s cubic-bezier(.2,.8,.3,1.2) both;
}
.toast.out { animation: toastOut .25s ease both; }
.toast.ok    { border-left-color: #57c97c; }
.toast.error { border-left-color: #e06058; }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-ico { font-family: var(--font-mono); font-weight: 600; font-size: 12px; margin-top: 1px; }
.toast.ok .t-ico { color: #57c97c; }
.toast.error .t-ico { color: #e06058; }
.toast img.t-gif { width: 56px; border-radius: 2px; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ---------- Modal ---------- */
.modal-root:empty { display: none; }
.modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(20,22,27,.55);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  animation: fadeIn .2s both;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 520px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
  animation: rise .25s cubic-bezier(.2,.8,.3,1.1) both;
  max-height: 90vh; overflow: auto;
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 {
  font-family: var(--font-disp); font-size: 15px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
}
.modal-close { background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink-faint); padding: 4px; }
.modal-close:hover { color: var(--red); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Zakladki ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-disp); font-size: 13px; font-weight: 600;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 9px 16px 7px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--speed), border-color var(--speed);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--amber-deep); border-bottom-color: var(--amber); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .25s both; }

/* ---------- Logowanie ---------- */
body.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(232,161,60,.13), transparent 60%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 100% 30px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 30px 100%,
    #15171c;
  color: #e8eaee;
}
.login-card {
  width: min(380px, 92vw);
  background: var(--steel-2);
  border: 1px solid var(--steel-line);
  border-top: 3px solid var(--amber);
  border-radius: var(--r);
  box-shadow: 0 18px 60px rgba(0,0,0,.5);
  padding: 30px 28px 26px;
  animation: rise .5s cubic-bezier(.2,.8,.3,1) both;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 19px; }
.login-brand .brand-name { font-size: 21px; }
.login-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2.4px;
  color: #6a7180; text-transform: uppercase; margin: 0 0 22px;
}
.login-card .field-label { color: #98a0ad; }
.login-card .input {
  background: #181b21; border-color: var(--steel-line); color: #e8eaee;
}
.login-card .input:focus { border-color: var(--amber); }
.login-error {
  display: flex; gap: 8px; align-items: center;
  background: rgba(224,96,88,.12); border: 1px solid rgba(224,96,88,.4);
  color: #f0a09a; border-radius: var(--r);
  font-size: 12.5px; padding: 8px 11px; margin-bottom: 14px;
  animation: shake .4s ease;
}
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.login-foot { margin-top: 18px; text-align: center; font-size: 10.5px; color: #5d6470; font-family: var(--font-mono); letter-spacing: 1.5px; }

/* ---------- Easter eggi ---------- */
.barrel-roll { animation: barrel 1.1s cubic-bezier(.3,.6,.4,1) 1; }
@keyframes barrel { to { transform: rotate(360deg); } }
body.disco-mode { animation: discoHue 1.2s linear infinite; }
@keyframes discoHue { to { filter: hue-rotate(360deg); } }
.egg-rain {
  position: fixed; top: -120px; z-index: 500; pointer-events: none;
  animation: eggFall linear forwards;
}
@keyframes eggFall { to { transform: translateY(118vh) rotate(340deg); } }

/* ---------- Drobiazgi ---------- */
.muted { color: var(--ink-faint); }
.small { font-size: 12px; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex .push { margin-left: auto; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.divider { border: 0; border-top: 1px dashed var(--line); margin: 18px 0; }
.kbd {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--paper-deep); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 3px; padding: 1px 6px;
}

/* ---------- Responsywnosc ---------- */
@media (max-width: 920px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: none; }
  .nav-toggle { display: block; }
  .content { padding: 18px 14px; }
  .clock { display: none; }
}

/* ---------- Wydruk ---------- */
@media print {
  .sidebar, .topbar, .pagefoot, .toasts { display: none; }
  .main { background: #fff; }
  .content { padding: 0; max-width: none; }
}
