/* ===== Tokens ===== */
/* Brand: school logo — navy #1E2B6F + gold #E8A428 */
:root {
  --navy: #1E2B6F;
  --navy-deep: #141d52;
  --gold: #E8A428;
  --green: #16a34a; --green-soft: rgba(22, 163, 74, .13);
  --yellow: #d4a106; --yellow-soft: rgba(234, 179, 8, .17);
  --red: #dc2626; --red-soft: rgba(220, 38, 38, .12);
  --orange: #ea6a0c; --orange-soft: rgba(234, 106, 12, .14);
  --gray-dot: #8a90a8;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
:root, :root[data-theme="light"] {
  --accent: #1E2B6F;          /* primary actions */
  --accent-strong: #141d52;
  --accent-ink: #ffffff;
  --accent-soft: rgba(30, 43, 111, .09);
  --accent-text: #1E2B6F;     /* links / active nav text */
  --gold-text: #b5780a;       /* eyebrows, highlights */
  --gold-soft: rgba(232, 164, 40, .16);
  --bg: #f3f5fa;
  --rail: #1E2B6F;
  --rail-text: rgba(255, 255, 255, .62);
  --rail-hover: rgba(255, 255, 255, .1);
  --rail-active: #E8A428;
  --rail-active-ink: #1a1300;
  --side: #ffffff;
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #f5f7fc;
  --hover: #eef1f9;
  --line: #e3e7f1;
  --line-2: #d5dbea;
  --text: #121633;
  --text-2: #3b4266;
  --muted: #737a96;
  --input: #f7f8fc;
  --shadow: 0 12px 34px rgba(20, 29, 82, .10);
  --hero: radial-gradient(120% 160% at 100% 0%, rgba(232, 164, 40, .20) 0%, transparent 45%), linear-gradient(135deg, #1E2B6F 0%, #24357f 55%, #2b3f94 100%);
  --hero-text: #ffffff;
  --hero-sub: rgba(255, 255, 255, .78);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent: #F0B545;
  --accent-strong: #e3a42a;
  --accent-ink: #1a1200;
  --accent-soft: rgba(240, 181, 69, .14);
  --accent-text: #F0B545;
  --gold-text: #F0B545;
  --gold-soft: rgba(240, 181, 69, .14);
  --bg: #090d20;
  --rail: #070a1a;
  --rail-text: rgba(255, 255, 255, .55);
  --rail-hover: rgba(255, 255, 255, .08);
  --rail-active: #F0B545;
  --rail-active-ink: #1a1200;
  --side: #0d1330;
  --panel: #10173a;
  --card: #141c45;
  --card-2: #18214f;
  --hover: #1e2860;
  --line: #222c5e;
  --line-2: #2e3a74;
  --text: #eef0fa;
  --text-2: #bcc2df;
  --muted: #8189b4;
  --input: #0f1636;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --hero: radial-gradient(120% 160% at 100% 0%, rgba(240, 181, 69, .18) 0%, transparent 45%), linear-gradient(135deg, #16205a 0%, #1b2766 55%, #22307a 100%);
  --hero-text: #ffffff;
  --hero-sub: rgba(255, 255, 255, .75);
  color-scheme: dark;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ===== Shell ===== */
/* Desktop: full menu (sidebar) OR icon rail — never both, and the page always fills the rest */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.shell > .rail { display: none; }
.shell.side-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.shell.side-collapsed > .rail { display: flex; }
.shell.side-collapsed > .side { display: none; }
.rail .rail-expand .pill { background: rgba(255, 255, 255, .08); }

.rail {
  position: sticky; top: 0; height: 100vh; background: var(--rail);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 4px;
}
.rail a, .rail button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 66px; padding: 6px 0;
  color: var(--rail-text); font-size: 10.5px; background: none; border: 0; border-radius: 12px; text-align: center; line-height: 1.2;
}
.rail a .pill, .rail button .pill { width: 40px; height: 30px; border-radius: 10px; display: grid; place-items: center; transition: .15s; }
.rail a:hover .pill, .rail button:hover .pill { background: var(--rail-hover); color: #fff; }
.rail a.active { color: #fff; font-weight: 600; }
.rail a.active .pill { background: var(--rail-active); color: var(--rail-active-ink); }
.rail .spacer { flex: 1; }
.rail .rail-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; overflow: hidden; margin-bottom: 10px; box-shadow: 0 0 0 3px rgba(232,164,40,.45); flex: none; }
.rail .rail-logo img { width: 100%; height: 100%; object-fit: cover; }
.rail .lang-btn { font-weight: 700; font-size: 12px; letter-spacing: .04em; }

.side {
  position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--side);
  border-right: 1px solid var(--line); padding: 16px 14px; display: flex; flex-direction: column; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.brand .logo { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; background: #fff; display: grid; place-items: center; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 11.5px; }
.brand .grow { flex: 1; min-width: 0; }
.brand .grow b, .brand .grow small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted);
  background: none; border: 0;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.side-search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 11px;
  background: var(--input); border: 1px solid var(--line); color: var(--muted);
}
.side-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 13px; }
.kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.side h4 { margin: 6px 6px 2px; font-size: 13px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 13.5px;
}
.nav a .ic { width: 16px; height: 16px; color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.nav a.active .ic { color: var(--accent-text); }
.nav a .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.side .grow { flex: 1; }
.me-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.me-card .row { display: flex; align-items: center; gap: 10px; }
.me-card b { font-size: 13px; display: block; line-height: 1.25; }
.me-card small { color: var(--muted); font-size: 11.5px; }
.me-card .btn { width: 100%; margin-top: 10px; justify-content: center; }

.main { min-width: 0; padding: 28px 32px 60px; }
.page { max-width: 1180px; margin: 0 auto; }
.topbar-mobile { display: none; }

/* ===== Page heading ===== */
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 6px 0 4px; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; font-weight: 600; }
.page-head p { margin: 0; color: var(--muted); max-width: 640px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 600; }

/* ===== Buttons & inputs ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.gold { background: var(--gold); color: #1a1200; border-color: var(--gold); font-weight: 600; }
.btn.gold:hover { background: #d8951c; }
.btn.glass { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.22); }
.btn.glass:hover { background: rgba(255,255,255,.2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .kbd { background: rgba(0,0,0,.12); border-color: transparent; color: inherit; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--input); outline: 0; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 19px; background: var(--accent-ink); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* segmented tabs (pill) */
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--text); color: var(--bg); font-weight: 600; }
.tabs button .n { font-family: var(--mono); font-size: 11px; opacity: .8; }
.tabs button.active .n { background: var(--bg); color: var(--text); border-radius: 99px; padding: 0 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  border: 1px solid var(--line-2); background: var(--input); padding: 7px 14px; border-radius: 99px; font-size: 13px; color: var(--text-2);
}
.chip-opt:hover { border-color: var(--muted); }
.chip-opt.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ===== Cards ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }

.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 32px 34px; background: var(--hero); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.hero { color: var(--hero-text); border-color: transparent; box-shadow: var(--shadow); }
.hero .eyebrow { color: var(--gold); }
.hero h1 { font-size: 40px; margin: 10px 0 8px; letter-spacing: -.02em; font-weight: 700; }
.hero p { color: var(--hero-sub); margin: 0; max-width: 520px; }
.hero .badge-logo {
  width: 136px; height: 136px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 20px 60px rgba(27, 42, 107, .35); overflow: hidden;
}
.hero .badge-logo img { width: 100%; height: 100%; object-fit: cover; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.kpis .kpi { padding: 18px 20px; border-right: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.kpis .kpi:last-child { border-right: 0; }
.kpis .kpi:hover { background: var(--hover); }
.kpi .num { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.done { background: var(--green); } .dot.partial { background: var(--yellow); } .dot.not_done { background: var(--red); }
.dot.late { background: var(--orange); } .dot.none { background: var(--gray-dot); }
.dot.pending { background: var(--muted); } .dot.active { background: var(--accent); } .dot.finished { background: var(--text-2); }

.exec-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.exec-card { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: transform .15s, border-color .15s; }
.exec-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.exec-card .num { font-size: 28px; font-weight: 600; margin-top: 8px; }
.exec-card .pct { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.exec-card.done { box-shadow: inset 0 3px 0 var(--green); }
.exec-card.partial { box-shadow: inset 0 3px 0 var(--yellow); }
.exec-card.not_done { box-shadow: inset 0 3px 0 var(--red); }
.exec-card.late { box-shadow: inset 0 3px 0 var(--orange); }
.exec-card.none { box-shadow: inset 0 3px 0 var(--gray-dot); }

.stackbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--card-2); gap: 2px; }
.stackbar span { display: block; height: 100%; }
.stackbar .done { background: var(--green); } .stackbar .partial { background: var(--yellow); } .stackbar .not_done { background: var(--red); }
.stackbar .late { background: var(--orange); } .stackbar .none { background: var(--line-2); }

/* ===== Badges / status ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.done { background: var(--green-soft); color: var(--green); }
.badge.partial { background: var(--yellow-soft); color: #c99a00; }
:root[data-theme="dark"] .badge.partial { color: var(--yellow); }
.badge.not_done { background: var(--red-soft); color: var(--red); }
.badge.late { background: var(--orange-soft); color: var(--orange); }
.badge.none { background: var(--card-2); color: var(--muted); }
.badge.pending { background: var(--card-2); color: var(--text-2); }
.badge.active { background: var(--accent-soft); color: var(--accent-text); }
.badge.finished { background: var(--card-2); color: var(--text-2); border: 1px solid var(--line-2); }
.badge.overdue { background: var(--red-soft); color: var(--red); }
.badge.tag { background: var(--gold-soft); color: var(--gold-text); }
.badge.outline { border: 1px solid var(--line-2); color: var(--text-2); background: transparent; }

/* ===== Task list ===== */
.tl { padding: 6px 10px 12px; }
.tl-group { margin-top: 6px; }
.tl-group-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; user-select: none;
  background: var(--card-2);
}
.tl-group-head .ic { width: 15px; height: 15px; color: var(--muted); transition: transform .15s; }
.tl-group.closed .tl-group-head .ic { transform: rotate(-90deg); }
.tl-group.closed .tl-rows { display: none; }
.tl-group-head .n { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 12px; }
.tl-row {
  display: grid; grid-template-columns: 22px 64px 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; cursor: pointer;
  border-bottom: 1px solid transparent;
}
.tl-row:hover { background: var(--hover); }
.tl-row.sel { background: var(--accent-soft); }
.tl-row .code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tl-row .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.tl-row .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.tl-row .meta .when { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; background: var(--line-2); border-radius: 1px; }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 12px; }
.bars.l1 i:nth-child(1), .bars.l2 i:nth-child(-n+2), .bars.l3 i { background: var(--text); }
.bars.hot i { background: var(--red) !important; }
.sicon { width: 16px; height: 16px; border-radius: 50%; border: 1.6px solid var(--muted); display: inline-block; position: relative; }
.sicon.active { border-color: var(--accent); background: conic-gradient(var(--accent) 0 50%, transparent 0); }
.sicon.done { border-color: var(--green); background: var(--green); }
.sicon.done::after { content: ''; position: absolute; left: 4.5px; top: 2px; width: 4px; height: 7px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.sicon.overdue { border-color: var(--red); background: conic-gradient(var(--red) 0 75%, transparent 0); }

.avatars { display: inline-flex; }
.avatars .av { margin-left: -6px; border: 2px solid var(--panel); }
.avatars .av:first-child { margin-left: 0; }
.av {
  width: 26px; height: 26px; border-radius: 50%; background: var(--card-2); color: var(--text-2); font-size: 10.5px; font-weight: 600;
  display: inline-grid; place-items: center; overflow: hidden; flex: none; text-transform: uppercase;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.xl { width: 72px; height: 72px; font-size: 22px; }
.av.more { background: var(--line-2); }

/* ===== Empty ===== */
.empty { text-align: center; padding: 56px 20px; }
.empty .circle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }
.empty b { display: block; font-size: 15px; }
.empty p { color: var(--muted); margin: 4px 0 16px; font-size: 13px; }

/* ===== Task detail ===== */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.timer-card { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; }
.timer-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 100% at 100% 0%, var(--gold-soft), transparent 60%); pointer-events: none; }
.timer-card.warn::before { background: radial-gradient(80% 100% at 100% 0%, var(--yellow-soft), transparent 60%); }
.timer-card.over::before { background: radial-gradient(80% 100% at 100% 0%, var(--red-soft), transparent 60%); }
.timer-label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); font-weight: 600; position: relative; }
.timer-card.warn .timer-label { color: var(--yellow); }
.timer-card.over .timer-label { color: var(--red); }
.timer-card.closed .timer-label { color: var(--muted); }
.timer-card { padding: 26px 30px; }
.timer { display: flex; gap: 14px; margin: 16px 0 12px; position: relative; }
.timer .u { flex: 1; text-align: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 18px; padding: 22px 6px 14px; }
.timer .u b { display: block; font-family: var(--mono); font-size: clamp(40px, 7vw, 92px); font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.timer .u small { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.timer-card.over .timer .u b { color: var(--red); }
.timer-card.warn .timer .u b { color: var(--yellow); }
.progress { height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; position: relative; margin-top: 10px; }
.progress span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 99px; }
.timer-card.warn .progress span { background: var(--yellow); }
.timer-card.over .progress span { background: var(--red); }

.info-list { display: grid; gap: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.info-list > div:last-child { border-bottom: 0; }
.info-list span { color: var(--muted); }
.info-list b { font-weight: 500; text-align: right; }

.assignee { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.assignee:last-child { border-bottom: 0; }
.assignee .nm b { display: block; font-size: 13.5px; font-weight: 500; }
.assignee .nm small { color: var(--muted); font-size: 12px; }
.assignee .note { grid-column: 2 / -1; font-size: 12.5px; color: var(--text-2); background: var(--card-2); padding: 8px 10px; border-radius: 9px; }
.status-select { height: 32px; border-radius: 8px; padding: 0 8px; border: 1px solid var(--line-2); background: var(--input); font-size: 12.5px; max-width: 200px; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.file { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card-2); position: relative; }
.file .thumb { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--muted); background: var(--input); }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .fn { padding: 8px 10px; font-size: 12px; }
.file .fn b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.file .fn small { color: var(--muted); font-size: 11px; }
.file .del { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; border-radius: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); color: var(--accent-text); background: var(--gold-soft); }

.desc { white-space: pre-wrap; color: var(--text-2); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .num { font-family: var(--mono); text-align: center; }
.tbl .person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.tbl .person b { font-weight: 500; display: block; }
.tbl .person small { color: var(--muted); font-size: 11.5px; }
.score { font-family: var(--mono); font-weight: 600; }

/* ===== Picker ===== */
.picker { border: 1px solid var(--line-2); border-radius: 12px; background: var(--input); overflow: hidden; }
.picker .ps { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); height: 40px; color: var(--muted); }
.picker .ps input { flex: 1; background: none; border: 0; outline: 0; }
.picker .pl { max-height: 260px; overflow: auto; padding: 6px; }
.picker label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.picker label:hover { background: var(--hover); }
.picker label input { accent-color: var(--accent); width: 16px; height: 16px; }
.picker label small { color: var(--muted); margin-left: auto; font-size: 12px; }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays button { width: 42px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--input); font-size: 12.5px; }
.weekdays button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

/* ===== Modal ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.modal .mh h3 { margin: 0; font-size: 17px; }
.modal .mb { padding: 20px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.perm-grid .switch { font-size: 13px; color: var(--text-2); }
@keyframes fade { from { opacity: 0; } }

/* ===== Login ===== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login .art { background: var(--hero); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .art .eyebrow { color: var(--gold); }
.login .art .brand small, .login .art .stats-strip small { color: rgba(255,255,255,.7); }
.login .art h1 { font-size: 46px; line-height: 1.05; margin: 14px 0 12px; letter-spacing: -.02em; }
.login .art p { color: rgba(255,255,255,.8); max-width: 440px; }
.login .art .big-logo { width: 180px; height: 180px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 30px 80px rgba(27, 42, 107, .35); overflow: hidden; }
.login .art .big-logo img { width: 100%; height: 100%; object-fit: cover; }
.login .form-side { display: grid; place-items: center; padding: 32px 20px; }
.login form { width: min(380px, 100%); }
.login form h2 { font-size: 26px; margin: 0 0 6px; }
.login .err { color: var(--red); font-size: 13px; min-height: 18px; }
.login .stats-strip { display: flex; gap: 28px; }
.login .stats-strip b { display: block; font-size: 26px; }
.login .stats-strip small { color: var(--muted); }

/* ===== Toast ===== */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 360px; animation: fade .2s; }
.toast.err { background: var(--red); color: #fff; }

/* ===== Misc ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters .input { height: 38px; width: auto; min-width: 160px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.code-box { font-family: var(--mono); background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.loader { padding: 40px; text-align: center; color: var(--muted); }
.ol { margin: 0; padding-left: 18px; color: var(--text-2); }
.ol li { margin: 4px 0; }
.lb { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 80; padding: 24px; cursor: zoom-out; }
.lb img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .detail { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpis .kpi { border-bottom: 1px solid var(--line); }
  .exec-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .shell, .shell.side-collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell > .rail, .shell.side-collapsed > .rail { display: flex; }
  .rail .rail-expand { display: none; }
  .side .brand .icon-btn[data-act="collapse"] { display: none; }
  .rail {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around;
    border-right: 0; border-top: 1px solid var(--line); z-index: 40; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .rail .spacer, .rail .lang, .rail .desk { display: none; }
  .rail a, .rail button { width: auto; flex: 1; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.side-open .side { transform: none; display: flex; }
  .shell.side-collapsed > .side { display: flex; }
  .shell.side-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 44; }
  .main { padding: 14px 16px 96px; }
  .topbar-mobile { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .topbar-mobile .brand { flex: 1; }
  .page-head h1 { font-size: 24px; }
  .tabs { border-radius: 14px; }
  .tabs button { border-radius: 10px; }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .hero .badge-logo { display: none; }
  .hero h1 { font-size: 28px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .exec-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .perm-grid { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .tl-row .bars, .tl-row .code { display: none; }
  .tl-row .meta .avatars, .tl-row .meta .ptype { display: none; }
  .timer { gap: 6px; }
  .timer-card { padding: 18px; }
  .timer .u { padding: 14px 2px 8px; border-radius: 12px; }
  .timer .u b { font-size: 34px; }
  .timer .u small { font-size: 10px; }
  .login { grid-template-columns: 1fr; }
  .login .art { display: none; }
}

/* ===== v2: brand, i18n, fullscreen, quick entry, Excel ===== */
.rail { gap: 2px; }
.rail .tools { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.popover {
  position: fixed; z-index: 70; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; animation: fade .12s;
}
.popover button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 9px; font-size: 13.5px; text-align: left; color: var(--text); }
.popover button:hover { background: var(--hover); }
.popover button.on { color: var(--accent-text); font-weight: 600; }
.popover button .code { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 22px; }
.popover .sep { margin: 4px 0; }

.side-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.side-tools button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text-2); font-size: 11px;
}
.side-tools button:hover { border-color: var(--gold); color: var(--text); }

.quick { padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.quick-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 230px auto; gap: 10px; align-items: center; }
.quick-row .input { height: 46px; font-size: 15px; }
.quick-when { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.quick-when .lbl { font-size: 12px; color: var(--muted); margin-right: 4px; }
.quick-when .chip-opt { padding: 5px 12px; font-size: 12.5px; }

.bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bulk .lbl { font-size: 12px; color: var(--muted); margin-right: 4px; }
.bulk button { border: 1px solid var(--line-2); background: var(--input); border-radius: 99px; padding: 4px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.bulk button:hover { border-color: var(--muted); }

.xl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.xl-card { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.xl-card .xl-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-text); }
.xl-card .xl-ic.green { background: var(--green-soft); color: var(--green); }
.xl-card h3 { margin: 0; font-size: 15.5px; }
.xl-card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.xl-card .row .input { height: 36px; }
.imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.imp-table { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.imp-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th { position: sticky; top: 0; background: var(--card-2); text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 500; }
.imp-table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.imp-table tr.bad td { background: var(--red-soft); }
.imp-sum { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.hint-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--gold-soft); color: var(--text-2); font-size: 13px; }
.hint-box .ic { color: var(--gold-text); margin-top: 2px; }

.cred-box { border: 1px dashed var(--line-2); border-radius: 14px; padding: 14px; background: var(--card-2); display: grid; gap: 8px; }
.cred-box .kv { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.cred-box .kv b { font-family: var(--mono); font-size: 15px; }

.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-wrap .icon-btn { position: absolute; right: 5px; top: 5px; }

.kbd-hints { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }

/* full screen timer */
.timer-card:fullscreen { display: flex; flex-direction: column; justify-content: center; padding: 6vw; border-radius: 0; background: var(--bg); }
.timer-card:fullscreen .timer-label { font-size: 2.2vw; text-align: center; }
.timer-card:fullscreen .timer { gap: 2vw; margin: 4vh 0; }
.timer-card:fullscreen .timer .u { padding: 4vh 1vw 3vh; border-radius: 2vw; }
.timer-card:fullscreen .timer .u b { font-size: 12vw; }
.timer-card:fullscreen .timer .u small { font-size: 1.6vw; }
.timer-card:fullscreen .ft-title { display: block; }
.timer-card .ft-title { display: none; text-align: center; font-size: 3vw; font-weight: 600; margin-bottom: 1vh; position: relative; }
.timer-card .fs-btn { position: absolute; top: 16px; right: 16px; z-index: 1; }

@media (max-width: 1100px) {
  .xl-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .rail .rail-logo, .rail .tools { display: none; }
  .quick-row { grid-template-columns: 1fr; }
  .xl-grid, .imp-grid { grid-template-columns: 1fr; }
}
.login-mobile-brand { display: none; }
.eyebrow .ic { width: 14px; height: 14px; vertical-align: -2px; }
.section-title h2 .ic { vertical-align: -3px; color: var(--gold-text); }
@media (max-width: 860px) { .login-mobile-brand { display: flex; } }

/* ===== v3: KPI tiles, sticky tables, teacher & team dashboards, mobile hub ===== */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tiles.exec { margin-top: 10px; }
.kpi-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; font: inherit;
}
.kpi-tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kpi-tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kpi-tile .num { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi-tile .lbl { font-size: 12.5px; color: var(--muted); }
.kpi-tile.done { box-shadow: inset 0 3px 0 var(--green); } .kpi-tile.partial { box-shadow: inset 0 3px 0 var(--yellow); }
.kpi-tile.not_done { box-shadow: inset 0 3px 0 var(--red); } .kpi-tile.late { box-shadow: inset 0 3px 0 var(--orange); }
.kpi-tile.none { box-shadow: inset 0 3px 0 var(--gray-dot); }
.kpi-tile.on.done, .kpi-tile.on.partial, .kpi-tile.on.not_done, .kpi-tile.on.late, .kpi-tile.on.none { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

/* frozen table headers */
.table-wrap.sticky { max-height: 70vh; overflow: auto; }
.table-wrap.sticky .tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
.tbl a.person { color: inherit; }
.tbl a.person:hover b { color: var(--accent-text); text-decoration: underline; }
.tbl .person .icon-btn { margin-left: auto; }

.qchips { margin: -4px 0 14px; }
.chip-opt .mono { font-size: 11px; opacity: .75; margin-left: 2px; }
.chip-opt:disabled { opacity: .38; cursor: not-allowed; }
a.chip-opt { display: inline-flex; align-items: center; gap: 4px; }

.person-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.person-head h1 { margin: 2px 0; font-size: 26px; }
.person-head p { margin: 0; }
.person-head .grow { flex: 1; min-width: 200px; }
.score-ring { width: 92px; height: 92px; border-radius: 50%; border: 6px solid var(--c, var(--line-2)); display: grid; place-items: center; text-align: center; align-content: center; }
.score-ring b { font-size: 22px; line-height: 1; }
.score-ring small { color: var(--muted); font-size: 11px; }

.priv-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); }
.priv-box .switch b { font-weight: 600; font-size: 13.5px; }

.nm a { color: inherit; } .nm a:hover { color: var(--accent-text); text-decoration: underline; }

/* mobile home: two big buttons in the middle of the screen */
.mobile-hub { display: none; }
@media (max-width: 860px) {
  .mobile-hub { display: grid; gap: 14px; min-height: calc(100vh - 230px); align-content: center; margin-bottom: 18px; }
  .hub-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 22px;
    border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; color: var(--text);
  }
  .hub-btn .ic { width: 34px; height: 34px; color: var(--gold-text); }
  .hub-btn b { font-size: 20px; }
  .hub-btn small { color: var(--muted); font-size: 13.5px; }
  .hub-btn.primary { background: var(--hero); color: #fff; border-color: transparent; }
  .hub-btn.primary .ic { color: var(--gold); }
  .hub-btn.primary small { color: rgba(255, 255, 255, .8); }
  .hub-red { color: #ffb4b4; font-weight: 600; }
  .shell .hero { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .person-head { gap: 12px; }
  .score-ring { width: 74px; height: 74px; }
  .table-wrap.sticky { max-height: 65vh; }
}
.my-page { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .my-page .my-list { order: 1; margin-top: 0 !important; }
  .my-page .my-stats { order: 2; margin-top: 16px; }
  .my-page > .row { order: 0; }
}
@media (max-width: 860px) {
  .tl-row { grid-template-columns: 18px minmax(0, 1fr); row-gap: 6px; padding: 11px 8px; border-bottom: 1px solid var(--line); }
  .tl-row .title { white-space: normal; font-weight: 500; line-height: 1.35; }
  .tl-row .meta { grid-column: 2; flex-wrap: wrap; }
}
