/* ============================================================
   Sokół Milenium — design system
   Recreated from the Claude Design "Sokol Milenium" prototype.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #080c18;
  --s1: #0f1426;
  --s2: #161d33;
  --bd: rgba(150, 170, 220, .13);
  --tx: #eef2fb;
  --mut: #8e9bba;
  --acc: #5b8def;

  --inset: #0b1020;
  --sidebar: #0a0f1d;
  --on-acc: #06122e;
  --link: #9fbcff;
  --soft: #c6cfe3;

  --green: #46c08a;
  --gold: #f5c451;
  --red: #e0697a;

  /* Theme-adaptive tokens — overridden in the light theme below.
     Anything that was a hardcoded white/black overlay or a pale "text-on-tint"
     colour lives here so both themes stay legible. */
  --acc-soft: rgba(91, 141, 255, .15);   /* accent-tinted backgrounds (active nav, chips) */
  --acc-strong: #cdd9ff;                 /* text/icon sitting on an accent tint */
  --hover: rgba(255, 255, 255, .05);     /* subtle row hover */
  --hover-2: rgba(255, 255, 255, .06);
  --soft-fill: rgba(255, 255, 255, .1);  /* neutral filled circles/badges */
  --ph: #566179;                         /* input placeholder */
  --shadow: rgba(0, 0, 0, .55);          /* popover / modal / toast shadow */
  --gold-text: #f0d28f;                  /* readable gold on a gold tint */
  --red-text: #f0a8b2;                   /* readable red on a red tint */
  --toast-bg: #11203f;
  --toast-tx: #ffffff;
}

/* ---------------- Light theme (TRYB: JASNY) ----------------
   High-contrast palette tuned for use in bright sunlight: white surfaces,
   dark navy text, deeper accent/status colours and clearly visible borders. */
[data-theme="light"] {
  color-scheme: light;

  --bg: #eef1f8;
  --s1: #ffffff;
  --s2: #ffffff;
  --bd: rgba(33, 54, 99, .17);
  --tx: #16223d;
  --mut: #5c6986;
  --acc: #2f6fe0;

  --inset: #f1f4fb;
  --sidebar: #ffffff;
  --on-acc: #ffffff;
  --link: #2257c5;
  --soft: #3b4866;

  --green: #1f9d6b;
  --gold: #b8830f;
  --red: #d2425c;

  --acc-soft: rgba(47, 111, 224, .12);
  --acc-strong: #1b4fb8;
  --hover: rgba(20, 40, 80, .05);
  --hover-2: rgba(20, 40, 80, .06);
  --soft-fill: rgba(20, 40, 80, .07);
  --ph: #97a0b5;
  --shadow: rgba(23, 42, 84, .16);
  --gold-text: #8a6510;
  --red-text: #b32f46;
  --toast-bg: #16223d;
  --toast-tx: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Space Grotesk', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(150, 170, 220, .18); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar { display: none; }

input, select, textarea, button { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--ph); }
a { color: inherit; }

@keyframes tw { 0%, 100% { opacity: .12; } 50% { opacity: .85; } }
@keyframes fu { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sp { to { transform: rotate(360deg); } }

.fade-up { animation: fu .3s ease; }

/* ---------------- App shell ---------------- */
.app { display: flex; flex-direction: row; min-height: 100vh; }

.sidebar {
  width: 248px; flex: none; background: var(--sidebar);
  border-right: 1px solid var(--bd); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 4px 6px; }
.brand-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .02em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--mut); }
.menu-toggle {
  display: none; flex: none; background: var(--inset); border: 1px solid var(--bd);
  color: var(--tx); border-radius: 9px; width: 40px; height: 40px; font-size: 17px; cursor: pointer;
}

/* Theme switch (TRYB: JASNY / CIEMNY) — sits in the sidebar just under the brand */
.theme-switch { display: flex; align-items: center; gap: 9px; padding: 2px 6px; margin-top: 4px; flex-wrap: wrap; }
.theme-switch-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--mut); flex: none; }
.theme-seg { flex: 1; min-width: 0; }
.theme-seg .seg-btn { flex: 1; padding: 6px 8px; font-size: 12px; justify-content: center; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 10px; padding: 11px 12px;
  color: var(--mut); font-size: 14px; font-weight: 600; cursor: pointer; white-space: normal;
  text-decoration: none;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--acc-soft); color: var(--acc-strong); }
.nav-item.active svg { stroke: var(--acc); }

.main { flex: 1; min-width: 0; padding: 32px 32px 56px; }
.container { max-width: 1180px; margin: 0 auto; }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--mut); font-size: 14px; margin-top: 3px; }
.header-user { display: flex; align-items: center; gap: 12px; }
.header-user .uname { font-size: 14px; font-weight: 600; text-align: right; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border-radius: 10px; padding: 11px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; border: 1px solid var(--bd);
  background: transparent; color: var(--tx); text-decoration: none;
}
.btn-primary { background: var(--acc); color: var(--on-acc); border: none; border-radius: 11px; font-weight: 700; }
.btn-ghost { color: var(--mut); }
.btn-ghost:hover { color: var(--tx); }
.btn-add { background: rgba(91, 141, 255, .15); color: var(--acc); border: none; border-radius: 9px; font-weight: 700; font-size: 13px; padding: 9px 14px; }
.btn-danger { background: transparent; border: 1px solid rgba(224, 105, 122, .4); color: var(--red); border-radius: 8px; font-size: 13px; padding: 8px 12px; }
.btn-danger-solid { background: var(--red); color: #1a0608; border: none; border-radius: 10px; font-weight: 700; padding: 11px 18px; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn-link { background: transparent; border: none; color: var(--link); cursor: pointer; font-weight: 600; font-size: 13px; padding: 8px 12px; text-decoration: none; }
.btn:disabled, .btn.off { opacity: .4; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------------- Cards / panels ---------------- */
.card { background: var(--s1); border: 1px solid var(--bd); border-radius: 16px; padding: 20px; }
.tile { background: var(--s1); border: 1px solid var(--bd); border-radius: 16px; padding: 18px 20px; }
.entity-card { background: var(--s1); border: 1px solid var(--bd); border-radius: 14px; padding: 18px; }
.section-title { font-size: 15px; font-weight: 700; }
.muted { color: var(--mut); }
.soft { color: var(--soft); }

.tile .tile-label { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tile .tile-value { font-size: 30px; font-weight: 700; margin-top: 6px; }

/* stat grids */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.summary-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 16px; }
.label {
  display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--mut); margin-bottom: 7px; font-weight: 600;
}
.label-req { color: var(--acc); }
.input, .select, .textarea {
  width: 100%; background: var(--inset); border: 1px solid var(--bd); border-radius: 10px;
  padding: 11px 13px; color: var(--tx); font-size: 14px; outline: none;
}
.select { appearance: none; cursor: pointer; }
.textarea { resize: vertical; }
.input.accent, .select.accent { border-color: var(--acc); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: 12px; color: var(--mut); margin-top: 6px; }

/* Walidacja pól obowiązkowych po stronie klienta — patrz wwwroot/js/validate.js */
.field.invalid .input, .field.invalid .select, .field.invalid .textarea, .field.invalid .combo-input,
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; font-weight: 600; margin-top: 6px; }
.form-errors {
  background: rgba(224, 105, 122, .12); border: 1px solid rgba(224, 105, 122, .4);
  border-radius: 11px; padding: 11px 14px; color: var(--red-text); font-size: 13px; font-weight: 600;
  margin-bottom: 16px;
}

/* Wyszukiwalna lista rozwijalna (combobox) — patrz wwwroot/js/combobox.js */
.combo { position: relative; display: block; }
.combo-native {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); border: 0; opacity: 0; pointer-events: none;
}
.combo-input { width: 100%; padding-right: 34px; }
.combo::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--mut); border-bottom: 2px solid var(--mut);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.combo-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 120;
  background: var(--s2); border: 1px solid var(--bd); border-radius: 12px; padding: 6px;
  max-height: 280px; overflow-y: auto; box-shadow: 0 20px 60px var(--shadow);
}
.combo-panel-up { top: auto; bottom: calc(100% + 6px); }
.combo-opt {
  display: block; width: 100%; text-align: left; border-radius: 8px; padding: 8px 10px;
  color: var(--tx); font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-opt:hover, .combo-opt.active { background: rgba(91, 141, 255, .14); }
.combo-opt[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.combo-opt[aria-disabled="true"]:hover { background: transparent; }
.combo-mark { background: transparent; color: var(--acc); font-weight: 700; }
.combo-empty { padding: 8px 10px; color: var(--mut); font-size: 13px; }

/* ---------------- Pills / chips / badges ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--c, var(--acc)) 33%, transparent);
  background: color-mix(in srgb, var(--c, var(--acc)) 12%, transparent);
  color: var(--c, var(--acc));
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--acc)); flex: none; display: inline-block; }

/* Quick status change (Misje): a <details> dropdown whose summary is the status pill */
.status-pop { position: relative; display: inline-block; }
.status-pop > summary { list-style: none; cursor: pointer; }
.status-pop > summary::-webkit-details-marker { display: none; }
.status-pop > summary .caret { font-size: 9px; opacity: .65; margin-left: 2px; }
.status-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  background: var(--s2); border: 1px solid var(--bd); border-radius: 12px; padding: 6px;
  min-width: 195px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 20px 60px var(--shadow);
}
.status-menu form { margin: 0; }
.status-opt {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 8px;
  background: transparent; border: none; border-radius: 8px; padding: 8px 10px;
  color: var(--tx); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.status-opt:hover { background: var(--hover-2); }
.status-opt.active { background: rgba(91, 141, 255, .14); }
.role-badge {
  display: inline-block; margin-top: 3px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.role-badge.admin { background: rgba(91, 141, 255, .18); color: var(--link); }
.role-badge.pracownik { background: rgba(150, 170, 220, .12); color: var(--mut); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--bd); background: var(--inset); color: var(--mut);
}
.chip.active {
  border-color: var(--c, var(--acc));
  background: color-mix(in srgb, var(--c, var(--acc)) 13%, transparent);
  color: #fff;
}
/* On a pale tint white text is invisible — use the chip's own hue in light mode. */
[data-theme="light"] .chip.active { color: var(--c, var(--acc)); }
.fchip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--bd); background: transparent; color: var(--mut); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.fchip.active {
  border-color: var(--c, var(--acc));
  background: color-mix(in srgb, var(--c, var(--acc)) 13%, transparent);
  color: var(--acc-strong);
}
.kind-pill { font-size: 11px; color: var(--mut); border: 1px solid var(--bd); border-radius: 999px; padding: 2px 9px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* active filter pill */
.filter-pill {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(91, 141, 255, .12);
  border: 1px solid var(--acc); border-radius: 999px; padding: 6px 12px; font-size: 13px; align-self: flex-start;
}
.filter-pill a, .filter-pill button { color: var(--mut); background: none; border: none; cursor: pointer; font-size: 15px; text-decoration: none; }

/* ---------------- Segmented control ---------------- */
.seg { display: inline-flex; background: var(--inset); border: 1px solid var(--bd); border-radius: 9px; padding: 3px; }
.seg-btn { background: transparent; color: var(--mut); border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.seg-btn.active { background: var(--acc); color: var(--on-acc); font-weight: 700; }
.seg.lg { border-radius: 11px; padding: 4px; }

/* ---------------- Checkbox ---------------- */
.check {
  flex: none; width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  border: 1px solid var(--bd); background: transparent; color: var(--on-acc);
}
.check.done { border-color: var(--green); background: var(--green); }
.strike { text-decoration: line-through; color: var(--mut); }

/* ---------------- Avatar ---------------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex: none; background: rgba(91, 141, 255, .15); color: var(--acc);
}
.avatar.mut { background: rgba(150, 170, 220, .12); color: var(--mut); }

/* ---------------- Info / note / error boxes ---------------- */
.info-box { background: var(--inset); border: 1px solid var(--bd); border-radius: 12px; padding: 14px 16px; }
.info-box.dashed { border-style: dashed; }
.info-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.info-row + .info-row { margin-top: 8px; }
.divider { height: 1px; background: var(--bd); margin: 14px 0; border: none; }

.admin-note { background: rgba(245, 196, 81, .08); border: 1px solid rgba(245, 196, 81, .2); border-radius: 10px; padding: 11px 13px; font-size: 13px; color: var(--gold-text); }
.error-box { background: rgba(224, 105, 122, .12); border: 1px solid rgba(224, 105, 122, .4); border-radius: 11px; padding: 11px 14px; color: var(--red-text); font-size: 13px; }
.lost-box { background: rgba(224, 105, 122, .1); border: 1px solid rgba(224, 105, 122, .25); border-radius: 9px; padding: 9px 12px; font-size: 12px; color: var(--red-text); }

.empty { text-align: center; color: var(--mut); padding: 50px 20px; background: var(--s1); border: 1px dashed var(--bd); border-radius: 14px; }

/* list row */
.list-row { display: flex; align-items: center; gap: 12px; background: var(--inset); border: 1px solid var(--bd); border-radius: 10px; padding: 10px 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }

/* colors helpers */
.c-acc { color: var(--acc); } .c-gold { color: var(--gold); } .c-green { color: var(--green); } .c-red { color: var(--red); } .c-link { color: var(--link); }
.fw7 { font-weight: 700; } .fw6 { font-weight: 600; }
.f11 { font-size: 11px; } .f12 { font-size: 12px; } .f13 { font-size: 13px; } .f14 { font-size: 14px; }
.cap { text-transform: uppercase; letter-spacing: .05em; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt22 { margin-top: 22px; }
.mb10 { margin-bottom: 10px; } .mb14 { margin-bottom: 14px; } .mb16 { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- Modal ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(4, 7, 15, .7); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; z-index: 100; overflow-y: auto;
}
.modal.small { align-items: center; padding: 20px; z-index: 300; }
.modal-card {
  background: var(--s1); border: 1px solid var(--bd); border-radius: 18px; padding: 24px; width: 100%;
  max-width: 520px; box-shadow: 0 30px 80px var(--shadow); animation: fu .25s ease;
}
.modal.small .modal-card { border-radius: 16px; animation: fu .2s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: transparent; border: none; color: var(--mut); font-size: 22px; line-height: 1; cursor: pointer; text-decoration: none; }
.modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.modal-foot .btn-primary { flex: 1; }

/* collapsible */
.collapsible > summary {
  list-style: none; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--inset); border: 1px solid var(--bd); border-radius: 10px; padding: 11px 13px;
  color: var(--tx); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible[open] > summary .hint::after { content: 'Ukryj ▲'; }
.collapsible > summary .hint::after { content: 'Pokaż ▼'; }
.collapsible .hint { color: var(--mut); text-transform: none; font-weight: 400; }

/* ---------------- Calendar ---------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { text-align: center; font-size: 11px; color: var(--mut); font-weight: 600; }
.cal-cell {
  position: relative; min-height: 30px; border-radius: 8px; padding: 5px 6px; display: flex;
  justify-content: space-between; align-items: flex-start; gap: 3px; background: var(--inset);
  border: 1px solid var(--bd); cursor: pointer; text-decoration: none; color: var(--tx);
}
.cal-cell.out { opacity: .4; } .cal-cell.past { opacity: .65; }
.cal-cell.today { border-color: var(--acc); background: rgba(91, 141, 255, .10); }
.cal-cell.selected { outline: 2px solid var(--acc); outline-offset: -2px; }
.cal-num { font-size: 12px; font-weight: 600; }
.cal-cell.today .cal-num { font-weight: 700; }
.cal-pill { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(91, 141, 255, .22); color: var(--link); }
.cal-pill.overdue { background: rgba(224, 105, 122, .25); color: var(--red-text); }
/* One grid per week: row 1 holds the day numbers, rows below hold mission bars, plus a
   trailing spacer row. Row tracks are set inline per week (from its lane count); day cells
   span every row (grid-row: 1 / -1) so bars sit fully inside their cells. */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px 6px; margin-bottom: 6px; }
.cal-bar {
  position: relative; z-index: 2; margin: 0 2px;
  height: 19px; display: flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 11px; font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; text-decoration: none;
  color: var(--c, var(--acc));
  background: color-mix(in srgb, var(--c, var(--acc)) 13%, transparent);
  border-left: 3px solid var(--c, var(--acc)); border-radius: 7px;
}
.cal-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; font-size: 12px; color: var(--mut); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.day-mission { display: flex; align-items: center; gap: 12px; background: rgba(91, 141, 255, .10); border: 1px solid rgba(91, 141, 255, .35); border-radius: 10px; padding: 11px 13px; cursor: pointer; text-decoration: none; color: var(--tx); }

/* wizard */
.step-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--bd); background: var(--inset); color: var(--mut); text-decoration: none; }
.step-btn.active { border-color: var(--acc); background: var(--acc-soft); color: var(--acc-strong); }
.step-num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--soft-fill); color: var(--mut); }
.step-btn.active .step-num { background: var(--acc); color: var(--on-acc); }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.group-num { width: 26px; height: 26px; border-radius: 8px; background: rgba(91, 141, 255, .15); color: var(--acc); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.plan-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 300px; }
.recap { position: sticky; top: 20px; }

/* dict rows */
.dict-row { display: flex; justify-content: space-between; align-items: center; background: var(--inset); border: 1px solid var(--bd); border-radius: 9px; padding: 9px 12px; font-size: 14px; }
.dict-ctrl { background: transparent; border: none; color: var(--mut); cursor: pointer; padding: 0 3px; font-size: 12px; }
.dict-ctrl.x { font-size: 16px; }
.dict-ctrl.x:hover { color: var(--red); }
.dict-ctrl.x.locked { opacity: .3; cursor: not-allowed; }
.dict-ctrl.x.locked:hover { color: var(--mut); }
.color-input { width: 54px; height: 40px; background: var(--inset); border: 1px solid var(--bd); border-radius: 9px; padding: 3px; cursor: pointer; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--toast-bg); border: 1px solid var(--acc); color: var(--toast-tx); padding: 12px 22px; border-radius: 11px; font-size: 14px; font-weight: 600; z-index: 200; box-shadow: 0 14px 40px var(--shadow); animation: fu .25s ease; }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; background: radial-gradient(900px 520px at 50% -5%, rgba(91, 141, 255, .12), transparent 60%); }
.login-card-wrap { position: relative; z-index: 2; width: 100%; max-width: 400px; text-align: center; animation: fu .5s ease; }
.login-logo { width: 132px; height: 132px; object-fit: contain; display: block; margin: 0 auto 4px; }
.login-eyebrow { font-size: 12px; color: var(--mut); letter-spacing: .22em; text-transform: uppercase; margin-bottom: 28px; }
.login-card { background: var(--s1); border: 1px solid var(--bd); border-radius: 18px; padding: 26px; text-align: left; box-shadow: 0 24px 70px var(--shadow); }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; color: var(--mut); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.login-divider .ln { flex: 1; height: 1px; background: var(--bd); }
.star { position: absolute; border-radius: 50%; background: #dfe8ff; animation: tw 3s ease-in-out infinite; }
[data-theme="light"] .star { display: none; }
.login-hint { font-size: 12px; color: var(--mut); margin-top: 14px; text-align: center; }

.spinner { width: 30px; height: 30px; border: 3px solid rgba(150, 170, 220, .2); border-top-color: var(--acc); border-radius: 50%; animation: sp .8s linear infinite; }

/* ---------------- Responsive ---------------- */
@media (max-width: 979px) {
  .plan-layout { grid-template-columns: 1fr; }
  .recap { position: static; }
}
@media (max-width: 899px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; border-right: none; border-bottom: 1px solid var(--bd); padding: 12px 14px; gap: 10px; z-index: 30; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .nav { display: none; margin-top: 12px; gap: 6px; }
  .sidebar.open .nav { display: flex; }
  .nav-item { padding: 9px 13px; font-size: 13px; }
  .main { padding: 20px 16px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .dict-grid { grid-template-columns: 1fr; }
  .summary-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
