/* ============ Astro Work — styles ============ */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #141b2d;
  --ink-2: #3a4560;
  --muted: #6b7690;
  --line: #e2e6ee;
  --primary: #14213d;
  --primary-2: #24365f;
  --accent: #f5a524;
  --accent-ink: #3b2600;
  --ok: #138a4a;
  --ok-bg: #e5f6ec;
  --warn: #b86e00;
  --warn-bg: #fff3dc;
  --bad: #c62a2a;
  --bad-bg: #fde8e8;
  --info: #2457c5;
  --info-bg: #e7eefc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 27, 45, .06), 0 4px 16px rgba(20, 27, 45, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Tamil", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --surface: #171c2c; --surface-2: #1d2336; --ink: #e9edf6; --ink-2: #c3cad9; --muted: #8d97ad;
    --line: #2a3147; --primary: #8fb0ff; --primary-2: #a9c2ff; --accent: #f5a524;
    --ok: #4ad387; --ok-bg: #12301f; --warn: #f2b14a; --warn-bg: #33270f; --bad: #ff7b7b; --bad-bg: #3a1717;
    --info: #8fb0ff; --info-bg: #1a2546; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1220; --surface: #171c2c; --surface-2: #1d2336; --ink: #e9edf6; --ink-2: #c3cad9; --muted: #8d97ad;
  --line: #2a3147; --primary: #8fb0ff; --primary-2: #a9c2ff; --accent: #f5a524;
  --ok: #4ad387; --ok-bg: #12301f; --warn: #f2b14a; --warn-bg: #33270f; --bad: #ff7b7b; --bad-bg: #3a1717;
  --info: #8fb0ff; --info-bg: #1a2546; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--info); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.side { display: none; }
.main { min-width: 0; padding-bottom: calc(76px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: var(--primary); color: #fff;
}
:root[data-theme="dark"] .topbar { background: #141a2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: #141a2b; } }
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icon-btn { color: #fff; }
.page { max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .dot { position: absolute; top: 5px; left: calc(50% + 7px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }

@media (min-width: 900px) {
  .shell { grid-template-columns: 240px 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--primary); color: #dfe6f5; padding: 18px 12px; gap: 4px; overflow-y: auto; }
  :root[data-theme="dark"] .side { background: #121726; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side { background: #121726; } }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; font-size: 17px; }
  .side .brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9d3e8; font-weight: 500; }
  .side a svg { width: 20px; height: 20px; opacity: .9; }
  .side a:hover { background: rgba(255,255,255,.06); }
  .side a.active { background: rgba(255,255,255,.12); color: #fff; }
  .side .sec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8796b8; padding: 14px 12px 4px; }
  .side .badge { margin-left: auto; }
  .main { padding-bottom: 24px; }
  .bottom-nav { display: none; }
  .topbar { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); padding-top: 14px; padding-bottom: 14px; }
  .topbar .icon-btn { color: var(--ink); }
  .topbar .back-btn { display: none; }
  .page { padding: 22px 28px; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid3, .grid4 { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
a.stat { color: inherit; }
.hstack { display: flex; align-items: center; gap: 10px; }
.vstack { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.between { justify-content: space-between; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 11px; font-weight: 600; cursor: pointer; min-height: 42px; text-decoration: none; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0e1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0e1220; } }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.outline-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 16px; border-radius: 14px; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(127,127,127,.12); }
.fab { position: fixed; right: 18px; bottom: calc(88px + var(--safe-b)); z-index: 25; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(0,0,0,.2); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok, .badge.s-issued, .badge.s-received, .badge.s-approved, .badge.s-present, .badge.s-done, .badge.s-active, .badge.s-completed { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn, .badge.s-pending_join, .badge.s-submitted, .badge.s-pending, .badge.s-late, .badge.s-in_progress, .badge.s-onboarding, .badge.s-half_day, .badge.s-on_hold, .badge.s-planned { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad, .badge.s-rejected, .badge.s-absent, .badge.s-blocked, .badge.s-exited, .badge.s-cancelled, .badge.s-offboarding, .badge.p-critical { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.info, .badge.s-on_leave, .badge.s-self_review, .badge.s-manager_review, .badge.s-ordered, .badge.s-partially_issued, .badge.s-regularised, .badge.s-draft, .badge.p-high { background: var(--info-bg); color: var(--info); border-color: transparent; }
.side .badge { background: var(--bad); color: #fff; border: 0; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; min-width: 0; }
.item:last-child { border-bottom: 0; }
a.item:hover, .item.clickable:hover { background: var(--surface-2); cursor: pointer; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--info-bg); color: var(--info); display: grid; place-items: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 40px; height: 40px; opacity: .5; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 11px 12px; min-height: 44px; outline: none;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(36,54,95,.14); }
.field .hint { font-size: 12px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .row3 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tabs button.on { color: var(--primary); border-color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; }
.search { flex: 1; min-width: 160px; }

/* line editors (task details / materials / manpower) */
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; gap: 8px; align-items: center; grid-template-columns: 1fr 74px 74px 34px; }
.line.l4 { grid-template-columns: 1fr 70px 64px 58px 34px; }
.line.l3 { grid-template-columns: 1fr 74px 74px 34px; }
.line input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 10px; min-height: 40px; }
.line .icon-btn { padding: 6px; color: var(--bad); }
@media (max-width: 480px) {
  .line.l4 { grid-template-columns: 1fr 1fr 1fr 34px; }
  .line.l4 input:first-child { grid-column: 1 / -1; }
}

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #f7c35f); border-radius: 8px; }
.progress.ok > i { background: var(--ok); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 7px; background: var(--surface); border-radius: 50%; }
.ring span { position: relative; }

/* ---------- key-value ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }

/* ---------- media ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; border-radius: 5px; padding: 1px 5px; }
.selfie-box { width: 100%; aspect-ratio: 3/4; max-height: 300px; border-radius: 14px; border: 2px dashed var(--line); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); cursor: pointer; color: var(--muted); }
.selfie-box img { width: 100%; height: 100%; object-fit: cover; }
.file-pick { position: relative; overflow: hidden; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- attendance hero ---------- */
.punch { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: 0; }
:root[data-theme="dark"] .punch { background: linear-gradient(135deg, #1e2a4a, #2a3a64); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .punch { background: linear-gradient(135deg, #1e2a4a, #2a3a64); } }
.punch .clock { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.punch .muted { color: #b9c5e0; }
.punch .times { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.punch .times div { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px 10px; }
.punch .times b { display: block; font-size: 16px; }
.punch .times span { font-size: 11px; color: #b9c5e0; }

/* ---------- bar chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 34px; background: var(--info); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; }
.bars .b.today i { background: var(--accent); opacity: 1; }
.bars .b span { font-size: 11px; color: var(--muted); }
.bars .b em { font-style: normal; font-size: 11px; font-weight: 600; }

/* ---------- org chart ---------- */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 20px; border-left: 2px solid var(--line); padding-left: 10px; }
.tree li { margin: 6px 0; }
.node { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 220px; max-width: 100%; }
.node .tg { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; font-weight: 700; }

/* ---------- modal / sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(9, 13, 25, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 620px; max-height: 92vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; padding-bottom: var(--safe-b); }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { flex: 1; font-size: 17px; }
.sheet-b { padding: 16px; overflow-y: auto; }
.sheet-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img, .lightbox video { max-width: 96vw; max-height: 86vh; border-radius: 8px; }
.lightbox .close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; color: #fff; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(86px + var(--safe-b)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #1d2333; color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 500; max-width: 92vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: up .2s; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); background:
  radial-gradient(1200px 500px at 10% -10%, rgba(245,165,36,.18), transparent 60%), var(--bg); }
.login .box { width: 100%; max-width: 410px; display: flex; flex-direction: column; gap: 18px; }
.login .brand { display: flex; align-items: center; gap: 12px; }
.login .logo { width: 52px; height: 52px; border-radius: 15px; background: var(--primary); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 22px !important; font-weight: 700; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.loading { padding: 40px; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: var(--info-bg); color: var(--info); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.section-t { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center; position: relative; }
.quick a svg { width: 24px; height: 24px; color: var(--primary); }
.quick a .dot { position: absolute; top: 6px; right: 10px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; min-width: 18px; line-height: 18px; }
.perm-grid { display: grid; gap: 2px; }
.timeline { display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--line); padding-left: 14px; margin-left: 4px; }
.timeline div { position: relative; font-size: 13.5px; }
.timeline div::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ---------- Phase 2-4 additions ---------- */
.bell { position: relative; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; line-height: 17px; padding: 0 4px; font-weight: 700; text-align: center; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; }
.notif.unread { background: var(--info-bg); }
.notif .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); flex: none; }
.notif .ic svg { width: 18px; height: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal .d { min-height: 64px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; font-size: 11px; background: var(--surface); overflow: hidden; }
.cal .d.off { background: var(--surface-2); color: var(--muted); }
.cal .d.hol { background: var(--warn-bg); }
.cal .d.today { outline: 2px solid var(--accent); }
.cal .d .n { font-weight: 700; font-size: 12px; }
.cal .d .ev { display: block; margin-top: 2px; border-radius: 4px; padding: 1px 4px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.cal .d .hl { color: var(--warn); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .cal .d { min-height: 46px; } .cal .d .ev { font-size: 0; height: 5px; padding: 0; } .cal .d .hl { font-size: 9px; } }
.bal { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.bal .stat { border-top: 4px solid var(--c, var(--info)); }
.risk { display: inline-grid; place-items: center; min-width: 30px; height: 24px; border-radius: 6px; font-weight: 700; font-size: 12px; padding: 0 6px; color: #fff; }
.risk.low { background: #138a4a; } .risk.medium { background: #d38700; } .risk.high { background: #c62a2a; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 54px; gap: 8px; align-items: center; font-size: 13px; }
.hbar .tr { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--info); border-radius: 6px; }
.hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar b { text-align: right; font-size: 12px; }
.spark { width: 100%; height: 120px; display: block; }
.slip-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.slip-t td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.slip-t td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.net { display: flex; justify-content: space-between; align-items: center; background: var(--primary); color: #fff; border-radius: 12px; padding: 14px 16px; font-weight: 700; font-size: 18px; }
:root[data-theme="dark"] .net { color: #0e1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .net { color: #0e1220; } }
.stars { display: inline-flex; gap: 4px; }
.stars button { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--line); }
.stars button svg { width: 28px; height: 28px; }
.stars button.on { color: var(--accent); }
.stars button.on svg { fill: var(--accent); }
.chk-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chk-row .seg button { padding: 6px 10px; }
.big-num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.report-tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; cursor: pointer; }
.report-tile:hover { border-color: var(--primary-2); }
.login { overflow-x: hidden; }
.login .box { min-width: 0; }
.login .brand > div { min-width: 0; }
.login .brand .muted { overflow-wrap: anywhere; }
