/* =========================================================
   SOCA Nhân sự — giao diện
   ========================================================= */
/* Font Be Vietnam Pro (SIL Open Font License, xem /fonts/OFL.txt) */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/be-vietnam-pro-Regular.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/be-vietnam-pro-Medium.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/be-vietnam-pro-SemiBold.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/be-vietnam-pro-Bold.woff") format("woff"); }
:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #f3f3f6;
  --surface-3: #ebebf0;
  --border: #e8e8ee;
  --border-strong: #d9d9e2;
  --text: #16161d;
  --text-2: #3f3f4a;
  --muted: #74748a;
  --primary: #5145e5;
  --primary-2: #4338ca;
  --primary-soft: #eeedfd;
  --primary-ink: #3b30b8;
  --hero-a: #5145e5;
  --hero-b: #7c4dff;
  --green: #0f7b55; --green-soft: #e4f6ee;
  --amber: #a15a00; --amber-soft: #fff2dc;
  --red: #c42e14; --red-soft: #fdece8;
  --blue: #1e5fc4; --blue-soft: #e7f0fd;
  --gray-soft: #f0f0f4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, .04);
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 4px 16px -6px rgba(20, 20, 40, .08);
  --shadow-lg: 0 24px 60px -12px rgba(20, 20, 40, .28);
  --font: "Be Vietnam Pro", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --sidebar-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1015; --surface: #17181f; --surface-2: #1e1f28; --surface-3: #272833;
    --border: #262733; --border-strong: #33344a;
    --text: #ececf3; --text-2: #c9c9d6; --muted: #9090a6;
    --primary: #8b83ff; --primary-2: #a29bff; --primary-soft: #25234a; --primary-ink: #b8b3ff;
    --hero-a: #3f36c9; --hero-b: #6a3fe0;
    --green: #4ad6a0; --green-soft: #13302a; --amber: #f5b454; --amber-soft: #33270f;
    --red: #ff8a6e; --red-soft: #3a1e19; --blue: #7fb2ff; --blue-soft: #17253b; --gray-soft: #23242f;
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
svg:not([width]) { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14.5px; line-height: 1.6; word-spacing: .05em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.005em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- khung ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app > div:last-child { min-width: 0; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 20px; font-weight: 700; font-size: 15px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em;
  box-shadow: 0 6px 14px -6px var(--hero-a);
}
.brand-logo svg { width: 18px; height: 18px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link svg:last-child:not(:first-child) { margin-left: auto; width: 14px; height: 14px; opacity: .5; }
.nav-sep { margin: 18px 12px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-foot.link-card { display: flex; color: var(--text); border-radius: 10px; }
.sidebar-foot.link-card:hover { background: var(--surface-2); text-decoration: none; }
.nav-scrim { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.main { padding: 32px 40px 72px; max-width: 1240px; margin: 0 auto; }
.topbar, .bottom-nav { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 5px; color: var(--muted); }
.page-head > .row { gap: 8px; }

/* ---------- khối ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .stack > .card + .card, .plan-cards > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); color: var(--text);
}
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .value small { font-size: 13.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat.link-card { transition: border-color .12s, box-shadow .12s, transform .12s; }
.stat.link-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.stat.attn { border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); background: linear-gradient(180deg, var(--amber-soft), var(--surface) 140%); }
.stat.attn .value { color: var(--amber); }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.3;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 14px -8px var(--primary); }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { filter: brightness(.95); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; padding: 7px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--text-2); line-height: 1.6;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--primary-soft); color: var(--primary-ink); }
.list-item > .badge:first-child::before { display: none; }
.list-item > .badge:first-child { min-width: 28px; justify-content: center; padding: 3px 8px; }

.callout { border-radius: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.callout.amber { background: var(--amber-soft); border-color: transparent; }
.callout.green { background: var(--green-soft); border-color: transparent; }
.callout.blue { background: var(--blue-soft); border-color: transparent; }
.callout.red { background: var(--red-soft); border-color: transparent; }
.callout strong { display: block; margin-bottom: 2px; color: var(--text); }

.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 11px; margin-bottom: 18px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 6px 14px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 8px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(20, 20, 40, .1); }
.tab .count { background: var(--red); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; line-height: 17px; }

/* ---------- form ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.field > span.hint, .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select, textarea {
  font: inherit; word-spacing: inherit; font-size: 14.5px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; font-weight: 400;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-strong)); }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[readonly] { background: var(--surface-2); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 2px 0 0; padding: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.days-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.days-pick label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 6px 11px; font-weight: 600; color: var(--text); cursor: pointer; }
.days-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.row > select { width: auto; min-width: 190px; max-width: 100%; }

/* ---------- bảng ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; padding-top: 11px; padding-bottom: 11px; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
tr.weekend td { background: var(--surface-2); color: var(--muted); }
.card .table-wrap { box-shadow: none; }

/* bảng công */
.ts-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 72vh; box-shadow: var(--shadow-sm); }
.ts { font-size: 12px; width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.ts th, .ts td { padding: 0; border: 0; border-bottom: 1px solid var(--border); text-align: center; }
.ts td { padding: 3px 1px; }
.ts thead th { position: sticky; top: 0; z-index: 2; padding: 8px 2px; background: var(--surface); font-weight: 600; line-height: 1.25; }
.ts thead th .muted { font-weight: 500; font-size: 11px; }
.ts thead th.off { color: var(--red); }
.ts .name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 8px 14px; min-width: 180px; max-width: 210px; border-right: 1px solid var(--border); }
.ts thead .name { z-index: 3; }
.ts .name b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .sum { padding: 8px 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; border-left: 1px solid var(--border); }
.ts .sum.hl { background: var(--primary-soft); color: var(--primary-ink); }
.cell {
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; color: var(--text); padding: 0; transition: transform .08s, box-shadow .08s;
}
.cell:hover { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.06); }
.cell.full { background: var(--green-soft); color: var(--green); }
.cell.half { background: var(--blue-soft); color: var(--blue); }
.cell.late { background: var(--amber-soft); color: var(--amber); }
.cell.leave { background: var(--primary-soft); color: var(--primary-ink); }
.cell.holiday { background: var(--red-soft); color: var(--red); }
.cell.absent { background: var(--red); color: #fff; }
.cell.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); color: var(--muted); }
.cell.future { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend i.full { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.legend i.half { background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.legend i.late { background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber); }
.legend i.leave { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.legend i.holiday { background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.legend i.absent { background: var(--red); }

/* ---------- thẻ chấm công ---------- */
.clock-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 26px 28px; border: 0; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, var(--hero-b) 0%, transparent 55%), linear-gradient(135deg, var(--hero-a), color-mix(in srgb, var(--hero-a) 70%, #1b1464));
  box-shadow: 0 18px 40px -20px var(--hero-a);
}
.clock-card::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.clock { font-size: 50px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 4px; }
.clock-date { color: rgba(255,255,255,.85); font-weight: 500; }
.clock-status { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.clock-card .badge { background: rgba(255,255,255,.16); color: #fff; }
.clock-card .badge::before { background: #fff; opacity: .8; }
.clock-card .badge.green::before { background: #5ff0b5; opacity: 1; }
.clock-card .badge.amber::before { background: #ffd07a; opacity: 1; }
.clock-card .badge.red::before { background: #ff9d8a; opacity: 1; }
.checkin-btn { position: relative; z-index: 1; min-width: 200px; border: 0 !important; box-shadow: 0 10px 24px -10px rgba(0,0,0,.45) !important; }
.clock-card .btn.primary.checkin-btn { background: #fff; color: var(--hero-a); }
.clock-card .btn.primary.checkin-btn:hover { background: #f1f0ff; }
.clock-card .btn.success.checkin-btn { background: #fff; color: var(--green); }
.clock-card .btn.checkin-btn:not(.primary):not(.success) { background: rgba(255,255,255,.14); color: #fff; }
.clock-card .btn.checkin-btn:not(.primary):not(.success):hover { background: rgba(255,255,255,.22); }

.month-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px; }
.month-nav input { width: 150px; border: 0; padding: 6px 8px; box-shadow: none !important; background: transparent; }

/* ---------- danh sách ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); margin-top: 3px; align-items: center; }
.link-card { display: block; color: inherit; }
.link-card:hover { text-decoration: none; }
.list-item.link-card { display: flex; color: inherit; border-radius: 10px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.list-item.link-card:first-child { padding-top: 10px; }
.list-item.link-card:last-child { padding-bottom: 10px; }
.list-item.link-card:hover { background: var(--surface-2); }
.list-item.link-card:hover .title { color: var(--primary-ink); }
.card.link-card { transition: border-color .12s, box-shadow .12s, transform .12s; }
.card.link-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; }
.plan-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.plan-card .title { font-weight: 600; font-size: 15px; line-height: 1.45; }
progress { width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-3); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 99px; }
.progress-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.progress-row progress { flex: 1; }

.todo { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--border); }
.todo:last-child { border-bottom: 0; padding-bottom: 0; }
.todo .txt { flex: 1; min-width: 0; }
.chk { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: inline-grid; place-items: center; flex: none; margin-top: 2px; }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; }
.chk svg { width: 13px; height: 13px; stroke-width: 3; }
.todo.done .txt > div:first-child { text-decoration: line-through; color: var(--muted); }
.todo .result { font-size: 13px; color: var(--green); margin-top: 4px; }
/* biểu mẫu kế hoạch */
.plan-form { max-width: 860px; }
.form-sec { padding: 20px 22px; }
.sec-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.sec-head p { margin-top: 2px; }
.sec-num { width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.sec-num svg { width: 15px; height: 15px; }
.form-grid.two { gap: 12px; }
.rows { counter-reset: row; }
.rows-head { display: grid; gap: 8px; padding: 0 2px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-head, .kpi-row { grid-template-columns: 1fr 200px 34px; }
.item-head, .item-row { grid-template-columns: 22px 1fr 150px 130px 34px; }
.kpi-row, .item-row { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row { counter-increment: row; }
.drag-num::before { content: counter(row); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.add-row { margin-top: 2px; color: var(--primary); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.tpl-pick { margin-bottom: 18px; }
.tpl-pick-label { margin-bottom: 8px; font-weight: 600; }
.tpl-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-width: 200px; flex: 1; max-width: 280px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); }
.tpl-card:hover { border-color: var(--primary); text-decoration: none; }
.tpl-card span { font-size: 12.5px; color: var(--muted); }
.tpl-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.tpl-card.blank { border-style: dashed; }
.tpl-preview { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.tpl-preview li::marker { color: var(--muted); }

/* chi tiết kế hoạch */
.grid-plan { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.progress-card { display: flex; gap: 20px; align-items: center; }
.pct { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 86px; height: 86px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--green) calc(var(--p, 0) * 1%), var(--surface-3) 0); position: relative; }
.pct::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.pct b, .pct span { position: relative; }
.pct b { font-size: 20px; line-height: 1.1; }
.pct span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pc-body progress { height: 8px; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pc-stats .bad { color: var(--red); }
.goals { margin-top: 10px; }
.kpi-table td, .kpi-table th { padding: 10px 14px; }
.checklist { display: flex; flex-direction: column; }
.ck-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ck-item:first-child { padding-top: 0; }
.ck-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ck-item input[type=checkbox] { width: 20px; height: 20px; margin-top: 1px; cursor: pointer; }
.ck-item .chk { width: 20px; height: 20px; }
.ck-body { flex: 1; min-width: 0; }
.ck-text { font-weight: 500; }
.ck-item.done .ck-text { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.ck-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ck-meta:empty { display: none; }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due svg { width: 13px; height: 13px; }
.due.bad { color: var(--red); font-weight: 600; }
.ck-result { margin-top: 6px; font-size: 13.5px; color: var(--green); background: var(--green-soft); border-radius: 8px; padding: 6px 10px; display: inline-block; }
.ck-result a { font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.card.blocker { border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); background: linear-gradient(180deg, var(--amber-soft), var(--surface) 120%); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 9px; font-weight: 600; color: var(--text-2); font-size: 14px; }
.seg input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment .bubble { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 10px 14px; flex: 1; min-width: 0; }
.comment .who { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comment .who time { font-weight: 400; color: var(--muted); font-size: 12px; }
.comment .who .icon-btn { margin-left: auto; padding: 3px; opacity: .35; }
.comment:hover .who .icon-btn { opacity: 1; }
.timeline { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; position: relative; }
.timeline div { display: flex; gap: 12px; position: relative; }
.timeline div::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); margin-top: 5px; flex: none; }
.timeline div:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: -14px; width: 1px; background: var(--border-strong); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.card .empty, td .empty { border: 0; padding: 32px 16px; background: transparent; }
.empty svg { width: 40px; height: 40px; opacity: .45; margin-bottom: 8px; }

/* ---------- modal, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 12, 24, .42); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .14s ease-out; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 6px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 12px 22px 22px; }
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1d1d27; color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 380px; animation: slide .2s ease-out; display: flex; align-items: center; gap: 10px; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ea0b5; flex: none; }
.toast.error::before { background: #ff7a5c; }
.toast.success::before { background: #4ee0a6; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
.copy-box { display: flex; gap: 8px; }
.copy-box input { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: .06em; }

/* ---------- đăng nhập ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(60% 50% at 15% 0%, color-mix(in srgb, var(--hero-b) 22%, transparent), transparent),
    radial-gradient(50% 50% at 100% 100%, color-mix(in srgb, var(--hero-a) 18%, transparent), transparent),
    var(--bg);
}
.auth .card { width: 100%; max-width: 410px; padding: 34px 32px 30px; border-radius: 20px; box-shadow: var(--shadow-lg); border-color: transparent; }
.auth .brand { justify-content: center; padding-bottom: 14px; }
.auth .brand-logo { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.auth h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.auth h1 + p { text-align: center; }
.auth form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth form > p.small { text-align: center; }
.loading { display: grid; place-items: center; align-content: center; min-height: 40vh; color: var(--muted); }
.loading::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin .7s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- thảo luận ---------- */
.feed { max-width: 720px; }
.composer { padding: 16px 18px; }
.composer-top { display: flex; gap: 12px; align-items: flex-start; }
.composer-top textarea { border: 0; background: var(--surface-2); min-height: 76px; resize: vertical; }
.composer-top textarea:focus { background: var(--surface); }
.composer-bar { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.cat-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
label.icon-btn { cursor: pointer; }
.img-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.img-thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.thumb-x svg { width: 12px; height: 12px; }
.loading-thumb { display: grid; place-items: center; font-size: 11.5px; color: var(--muted); border: 1px dashed var(--border-strong); }
.feed-tabs { margin: 20px 0 14px; }
.post { padding: 18px 20px 14px; }
.post.pinned { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.post-head { display: flex; gap: 12px; align-items: flex-start; }
.post-who { flex: 1; min-width: 0; }
.post-who .row { gap: 8px; }
.post-who .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-top: 1px; align-items: center; }
.cat-tag { font-weight: 600; }
.cat-tag.amber { color: var(--amber); } .cat-tag.blue { color: var(--blue); } .cat-tag.green { color: var(--green); } .cat-tag.red { color: var(--red); }
.pin-tag { color: var(--primary-ink); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.pin-tag svg { width: 13px; height: 13px; }
.post-actions { display: flex; gap: 0; opacity: .55; }
.post:hover .post-actions { opacity: 1; }
.post-text { margin-top: 12px; font-size: 15px; line-height: 1.6; }
.post-imgs { display: grid; gap: 4px; margin-top: 12px; border-radius: 12px; overflow: hidden; }
.post-imgs.n1 { grid-template-columns: 1fr; }
.post-imgs.n2 { grid-template-columns: 1fr 1fr; }
.post-imgs.n3, .post-imgs.n4 { grid-template-columns: 1fr 1fr; }
.post-imgs.n3 .post-img:first-child { grid-row: span 2; }
.post-img { border: 0; padding: 0; background: var(--surface-2); cursor: zoom-in; display: block; min-height: 120px; }
.post-img img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; display: block; }
.post-imgs.n1 .post-img img { max-height: 520px; object-fit: contain; background: var(--surface-2); }
.reactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.react-chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 99px; padding: 2px 10px; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.react-chip span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.react-chip.mine { border-color: var(--primary); background: var(--primary-soft); }
.react-chip.mine span { color: var(--primary-ink); }
.react-add { border: 1px dashed var(--border-strong); background: transparent; border-radius: 99px; padding: 3px 9px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; font: inherit; font-weight: 700; }
.react-add:hover { color: var(--primary); border-color: var(--primary); }
.react-bar { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; width: fit-content; box-shadow: var(--shadow); }
.react-bar button { border: 0; background: transparent; font-size: 21px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.react-bar button:hover { background: var(--surface-2); transform: scale(1.2); }
.link-btn { border: 0; background: none; padding: 0; margin-top: 12px; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--primary); }
.post-comments { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-comments .bubble { padding: 8px 12px; }
.comment-box { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.comment-box textarea { min-height: 38px; height: 38px; padding: 8px 12px; border-radius: 19px; resize: none; background: var(--surface-2); border-color: transparent; line-height: 1.4; }
.comment-box textarea:focus { background: var(--surface); }
.comment-box .avatar { margin-bottom: 5px; }
.comment-box .send { color: var(--primary); }
.emoji-pop { position: absolute; z-index: 70; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .12s ease-out; }
.emoji-pop button { border: 0; background: transparent; font-size: 20px; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.emoji-pop button:hover { background: var(--surface-2); }
.lightbox { display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.lightbox img { max-width: 100%; max-height: 70vh; display: block; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- ca làm & nhóm ---------- */
.shift-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.shift-list.inline { margin-top: 0; }
.shift-chip { font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; white-space: nowrap; }
.shift-list.inline .shift-chip { background: var(--surface-2); color: var(--text-2); }
.shift-chip.live { box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.shift-list.inline .shift-chip.live { background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.report-grid { display: flex; flex-direction: column; gap: 8px; }
.report-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; font-weight: 500; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; }
.report-row input { text-align: right; font-size: 17px; font-weight: 600; padding: 7px 10px; }
.report-total { text-align: right; }
.sess-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.sess-times { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 10px; align-items: end; }
.sess-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.sess-counts label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cell sup { font-size: 8.5px; margin-left: 1px; opacity: .8; }
.kpi-row.chan-row { grid-template-columns: 1fr 34px; }
.member-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row .badge::before { display: none; }
.sub-head { margin-bottom: 14px; }
.range-label { font-weight: 600; padding: 0 8px; font-size: 14px; white-space: nowrap; }
.video-table td, .video-table th { padding: 10px 12px; }
.video-table .total-row td { background: var(--surface-2); font-weight: 700; }
.bad-num { color: var(--red); font-weight: 600; }
td progress { height: 5px; margin-top: 4px; }
.chan-bars { display: flex; flex-direction: column; gap: 10px; }
.chan-bar { display: grid; grid-template-columns: 200px 1fr 60px; gap: 12px; align-items: center; font-size: 14px; }
.chan-bar b { text-align: right; }
@media (max-width: 760px) {
  .chan-bar { grid-template-columns: 1fr 50px; }
  .chan-bar progress { grid-column: 1 / -1; grid-row: 2; }
  .report-row { grid-template-columns: 1fr 90px; }
}

/* ---------- trang quản lý: giao diện tách biệt ---------- */
body.mode-admin { --primary: #0d8a7c; --primary-2: #0b7166; --primary-soft: #e2f5f2; --primary-ink: #0a6c61; --hero-a: #0d8a7c; --hero-b: #1fb89a; }
body.mode-admin .sidebar { background: #0f1b24; border-right-color: #0f1b24; color: #e6edf3; }
body.mode-admin .sidebar .brand small, body.mode-admin .sidebar .muted { color: #8ea0b2; }
body.mode-admin .sidebar .nav-link { color: #c3d0dc; }
body.mode-admin .sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
body.mode-admin .sidebar .nav-link.active { background: rgba(45,212,191,.14); color: #6ff0da; }
body.mode-admin .sidebar .nav-link.active::before { background: #2dd4bf; }
body.mode-admin .sidebar .nav-sep { color: #5f7488; }
body.mode-admin .sidebar-foot { border-top-color: rgba(255,255,255,.08); }
body.mode-admin .sidebar-foot.link-card { color: #e6edf3; }
body.mode-admin .sidebar-foot.link-card:hover { background: rgba(255,255,255,.06); }
body.mode-admin .sidebar .avatar { background: rgba(45,212,191,.16); color: #6ff0da; }
@media (prefers-color-scheme: dark) {
  body.mode-admin { --primary: #2dd4bf; --primary-2: #5eead4; --primary-soft: #11332f; --primary-ink: #6ff0da; --hero-a: #0b6f64; --hero-b: #139f86; }
  body.mode-admin .sidebar { background: #0b1419; border-color: #0b1419; }
}

/* ---------- máy tính bảng ---------- */
@media (max-width: 1100px) {
  .main { padding: 28px 28px 64px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3, .grid-2, .grid-plan { grid-template-columns: 1fr; }
}

/* ---------- điện thoại ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 39; }
  .topbar {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
  }
  .topbar .title { font-weight: 700; flex: 1; }
  .topbar a.avatar { width: 32px; height: 32px; font-size: 12px; text-decoration: none; }
  body.mode-admin .topbar { background: #0f1b24; color: #e6edf3; border-bottom-color: #0f1b24; }
  body.mode-admin .topbar .icon-btn { color: #c3d0dc; }
  .main { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-head > .btn.primary, .page-head > a.btn.primary { width: 100%; }
  .grid { gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 13px 14px; }
  .stat .value { font-size: 23px; }
  .card { padding: 16px; }
  .clock-card { grid-template-columns: 1fr; padding: 22px 20px; gap: 18px; }
  .clock { font-size: 46px; }
  .checkin-btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .rows-head { display: none; }
  .item-row { grid-template-columns: 22px 1fr 1fr 34px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .item-row input[name=item_text] { grid-column: 2 / -1; }
  .item-row input[name=item_due] { grid-column: 2; }
  .kpi-row { grid-template-columns: 1fr 34px; }
  .kpi-row input[name=kpi_target] { grid-column: 1; }
  .kpi-row .icon-btn { grid-row: 1; grid-column: 2; }
  .grid-plan { grid-template-columns: 1fr; }
  .form-sec { padding: 16px; }
  .tpl-card { max-width: none; min-width: 45%; }
  .progress-card { gap: 14px; }
  .hide-sm { display: none; }
  th, td { padding: 11px 12px; }
  .toast-wrap { left: 16px; right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; animation: sheet .2s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .month-nav input { width: 128px; }
  .tabs { display: flex; }
  .tab { flex: 1; justify-content: center; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px;
    color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; text-decoration: none; text-align: center; line-height: 1.2;
  }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a.active svg { stroke-width: 2.2; }
  .bottom-nav .nav-badge { position: absolute; top: 0; left: 55%; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; margin: 0; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .6; } }
