[hidden] { display: none !important; }
:root {
  --bg: #090b10;
  --frame: #11141b;
  --card: #181c25;
  --card-2: #1f2430;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eef2fa;
  --muted: #8a93a6;
  --dim: #5a6378;
  --accent: #2f6bff;
  --accent-2: #5b8cff;
  --sky: #8fb4ff;
  --heat-mid: #9db8f2;
  --ice: #d6e4ff;
  --green: #5bd49a;
  --red: #ff5d5d;
  --radius: 20px;
  --radius-sm: 12px;
  font-family: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #28304a; border-radius: 8px; }

.app {
  max-width: 1440px; margin: 16px auto; padding: 18px 22px 28px;
  background: var(--frame); border: 1px solid var(--line); border-radius: 28px;
  min-height: calc(100vh - 32px);
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.logo-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--ice), var(--accent)); display: grid; place-items: center; color: #07142e; font-weight: 800; font-size: 14px; }
.nav { display: flex; gap: 4px; padding: 5px; background: #0c0f15; border: 1px solid var(--line); border-radius: 999px; margin-left: 16px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
#clock-btn { white-space: nowrap; }
.nav a { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-size: 13px; white-space: nowrap; transition: .15s; }
.nav a:hover { color: var(--text); }
.nav a.active { background: var(--card-2); color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; position: relative; color: var(--text); }
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #07142e; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -8px; border: 2px solid var(--card); }
.avatars .avatar:first-child { margin-left: 0; }

.page-head { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; font-weight: 600; letter-spacing: -0.02em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.page-head .spacer { flex: 1; }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.card {
  position: relative; background: linear-gradient(160deg, #1d2230 0%, var(--card) 55%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow: hidden; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }

.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inner .check-list { max-height: 330px; overflow-y: auto; padding-right: 4px; }

/* KPI cards */
.kpi { min-height: 150px; display: flex; flex-direction: column; }
.kpi .kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #fff; color: #111; }
.kpi .label { margin-top: auto; font-size: 15px; font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; display: flex; align-items: center; gap: 10px; }
.kpi .badge { position: absolute; top: 16px; right: 16px; }
.kpi.hero { background: radial-gradient(120% 90% at 85% 10%, #9cc0ff 0%, #2f6bff 38%, #0f2e86 75%, #0a1433 100%); border-color: rgba(120, 160, 255, .35); }
.kpi.hero .badge { background: rgba(0,0,0,.25); color: #fff; border-color: rgba(255,255,255,.2); }
.kpi .glow { position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.07), transparent 70%); }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; }
.badge.up { color: var(--green); } .badge.down { color: var(--red); }
.mini-bars { display: flex; gap: 4px; }
.mini-bars i { width: 14px; height: 4px; border-radius: 4px; background: var(--accent); }
.mini-bars i:nth-child(2) { background: var(--sky); } .mini-bars i:nth-child(3) { background: #2f3a52; }

/* select / buttons */
.select, .input, .textarea {
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 12px; font-size: 13px; outline: none;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--accent); }
.input.search { padding-left: 34px; min-width: 220px; background-position: 11px center; }
.btn { border: 1px solid var(--line-2); background: var(--card-2); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.seg button.on { background: #fff; color: #111; font-weight: 600; }

/* heatmap */
.heat { display: grid; gap: 6px; align-items: center; }
.heat .row-label { color: var(--muted); font-size: 12px; text-align: right; padding-right: 6px; }
.heat .cell { height: 30px; border-radius: 6px; background: #232a38; transition: transform .1s; }
.heat.dense .cell { height: 26px; border-radius: 5px; }
.heat .cell:hover { transform: scale(1.08); outline: 1px solid rgba(255,255,255,.3); }
.heat .col-label { color: var(--dim); font-size: 11px; text-align: center; }
.l0 { background: #1d2230 !important; } .l1 { background: #2f3a52 !important; } .l2 { background: var(--heat-mid) !important; }
.l3 { background: #4f86ff !important; } .l4 { background: var(--accent) !important; }
.legend { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* onboarding */
.ob-pct { font-size: 26px; font-weight: 700; margin-left: auto; }
.ob-bars { display: flex; gap: 6px; align-items: flex-end; margin: 6px 0 0; }
.ob-bar { display: flex; flex-direction: column; gap: 8px; min-width: 40px; }
.ob-bar .v { font-weight: 700; font-size: 15px; }
.ob-bar .b { height: 58px; border-radius: 10px; position: relative; overflow: hidden; }
.ob-bar .b span { position: absolute; inset: 0; opacity: .9; }
.ob-bar small { color: var(--muted); font-size: 11px; }
.ob-shadow { height: 26px; margin: 6px 12px 10px; background: linear-gradient(180deg, #2f3a52, transparent); clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%); border-radius: 4px; opacity: .6; }
.inner { background: #10131a; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }

/* checklist */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item .t { font-size: 13px; }
.check-item .meta { color: var(--dim); font-size: 11px; margin-top: 2px; }
.check-item .grow { flex: 1; min-width: 0; }
.check-item.done .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--dim); }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #34405a; background: transparent; display: grid; place-items: center; flex-shrink: 0; padding: 0; color: transparent; transition: .15s; }
.tick:hover { border-color: var(--accent); }
.tick.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* priority / status chips */
.chip { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.p-urgent { background: rgba(255,93,93,.15); color: #ff8080; }
.p-high { background: rgba(47,107,255,.16); color: var(--accent-2); }
.p-medium { background: rgba(143,180,255,.14); color: var(--sky); }
.p-low { background: rgba(255,255,255,.07); color: var(--muted); }
.s-active { color: var(--green); } .s-remote { color: var(--sky); } .s-on_leave { color: #c9a0ff; } .s-offline { color: var(--dim); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; text-transform: capitalize; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.overdue { color: var(--red) !important; }
.soon { color: var(--accent-2) !important; }

/* timeline */
.timeline { position: relative; }
.tl-days { display: grid; grid-template-columns: 56px repeat(7, 1fr); }
.tl-days div { text-align: center; color: var(--muted); font-size: 12px; padding: 6px 0; }
.tl-days div.today { color: #fff; }
.tl-days div.today span { background: #fff; color: #111; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.tl-body { position: relative; display: grid; grid-template-columns: 56px 1fr; height: 132px; }
.tl-hours { position: relative; }
.tl-hours span { position: absolute; right: 8px; font-size: 11px; color: var(--dim); transform: translateY(-50%); }
.tl-track { position: relative; border-left: 1px solid var(--line); }
.tl-track .grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.tl-track .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.tl-track .now::before { content: ''; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tl-event { position: absolute; transform: translateY(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 5px 6px 5px 11px; border-radius: 999px; display: flex; align-items: center; gap: 6px; white-space: nowrap; box-shadow: 0 4px 18px rgba(47,107,255,.35); cursor: default; max-width: 14%; }
.tl-event span { overflow: hidden; text-overflow: ellipsis; }
.tl-event.review { background: var(--sky); color: #0a1a3d; box-shadow: none; }
.tl-event.social { background: var(--ice); color: #0a1a3d; box-shadow: none; }
.tl-event.training { background: #2f3a52; box-shadow: none; }
.tl-event button { border: 0; background: rgba(0,0,0,.2); color: inherit; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: 10px; opacity: 0; }
.tl-event:hover button { opacity: 1; }

/* contributions calendar */
.contrib { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 16px); grid-auto-columns: 16px; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.contrib i { width: 16px; height: 16px; border-radius: 4px; background: #1d2230; display: block; }
.contrib-wrap { display: grid; grid-template-columns: 26px 1fr; gap: 6px; }
.contrib-days { display: grid; grid-template-rows: repeat(7, 16px); gap: 4px; font-size: 10px; color: var(--dim); }
.contrib-days span { display: flex; align-items: center; }

/* lists */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 600; font-size: 13px; }
.list-row .meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.rank { width: 22px; color: var(--dim); font-weight: 700; font-size: 12px; }
.rank.top { color: var(--accent-2); }
.progress { height: 6px; background: #232a38; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--sky)); border-radius: 999px; }
.date-box { width: 44px; text-align: center; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); padding: 5px 0; flex-shrink: 0; }
.date-box b { display: block; font-size: 16px; }
.date-box small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.big-number { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.empty { color: var(--dim); text-align: center; padding: 24px 0; font-size: 13px; }
.breakdown-row { display: grid; grid-template-columns: 70px 1fr 36px; gap: 10px; align-items: center; font-size: 12px; margin: 10px 0; text-transform: capitalize; color: var(--muted); }
.breakdown-row b { color: var(--text); text-align: right; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.table tr { cursor: pointer; }
.person { display: flex; align-items: center; gap: 10px; }
.person .meta { color: var(--muted); font-size: 11.5px; }
.table-wrap { overflow-x: auto; }

/* kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; }
.column { background: #0f1219; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 420px; transition: border-color .15s; }
.column.drag-over { border-color: var(--accent); }
.column-head { display: flex; align-items: center; gap: 8px; margin: 2px 4px 12px; font-weight: 600; }
.column-head .count { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--card-2); padding: 1px 8px; border-radius: 999px; }
.column-head .bar { width: 8px; height: 8px; border-radius: 50%; }
.task-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; cursor: grab; }
.task-card:hover { border-color: var(--line-2); }
.task-card.dragging { opacity: .4; }
.task-card .title { font-weight: 600; font-size: 13px; margin: 8px 0 4px; }
.task-card .proj { color: var(--muted); font-size: 11.5px; }
.task-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 11.5px; color: var(--muted); }

/* modal & drawer */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--frame); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.form label.full { grid-column: 1 / -1; }
.form .input, .form .select, .form .textarea { width: 100%; padding: 9px 12px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form-error { grid-column: 1 / -1; color: var(--red); font-size: 12px; min-height: 0; }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { width: min(460px, 100vw); height: 100vh; overflow: auto; background: var(--frame); border-left: 1px solid var(--line-2); padding: 24px; animation: slide .2s; }
.drawer h2 { margin: 0; font-size: 20px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.kv div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kv small { color: var(--muted); font-size: 11px; display: block; margin-bottom: 3px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 20px 0 8px; font-weight: 700; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--card-2); border: 1px solid var(--line-2); padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 60; animation: fade .2s; }
.toast.err { border-color: var(--red); color: #ffb3b3; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bar-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart .col span { width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); min-height: 3px; }
.bar-chart .col:nth-child(even) span { background: linear-gradient(180deg, var(--ice), var(--sky)); }
.bar-chart small { font-size: 10px; color: var(--dim); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; text-transform: capitalize; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend b { margin-left: auto; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; } .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8, .span-9 { grid-column: span 12; }
}
@media (max-width: 1180px) { .span-3.stack { grid-column: span 12; } }
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: 1fr; }
  .app { margin: 0; border-radius: 0; padding: 14px 14px 24px; border: 0; }
  .grid > * { grid-column: span 12 !important; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .topbar { flex-wrap: wrap; }
  .form { grid-template-columns: 1fr; }
  .input.search { min-width: 0; width: 100%; }
  .tl-event { font-size: 10px; max-width: 22%; }
}

/* ---------- BeforeNine additions ---------- */
.logo-mark { font-size: 11px; letter-spacing: -0.04em; width: 28px; height: 28px; }
.spacer { flex: 1; }
.of { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; border-color: rgba(47,107,255,.4); background: linear-gradient(160deg, rgba(47,107,255,.14), var(--card) 70%); color: var(--muted); line-height: 1.5; }
.notice b { color: var(--text); }
.notice a, .empty a, .hint a { color: var(--accent-2); text-decoration: underline; }
.hint { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; margin: -6px 0 14px; }
.progress.big { height: 10px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #34405a; display: inline-block; margin-right: 6px; flex-shrink: 0; }
.online-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(91,212,154,.18); }
.person-label { display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text) !important; font-weight: 500; }
.heat .cell.today { outline: 1.5px solid rgba(255,255,255,.55); outline-offset: 1px; }
.tl-empty { text-align: center; color: var(--dim); font-size: 12px; margin-top: -76px; height: 60px; pointer-events: none; }
.icon-btn.xs { width: 22px; height: 22px; background: transparent; border: 0; color: var(--dim); }
.icon-btn.xs:hover { color: var(--red); }
.struck { text-decoration: line-through; color: var(--muted); }
.clickable { cursor: pointer; border-radius: 10px; }
.clickable:hover { background: rgba(255,255,255,.03); }
.ok { color: var(--green); }
.dimmed { color: var(--dim); }
.chip.ok-chip { background: rgba(91,212,154,.14); color: var(--green); }
.tick.static { cursor: default; }
.tick.static:hover { border-color: #34405a; }
.tick.static.on:hover { border-color: var(--accent); }
.check-item.pending .t { color: var(--muted); }
.check-item .avatar { margin-right: -2px; }
.s-inactive { color: var(--dim); }
.full-w { width: 100%; font-size: 15px; font-weight: 600; padding: 10px 14px; }
.editor-bar, .editor-foot { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.editor-bar label.btn { cursor: pointer; }
.editor { width: 100%; min-height: 380px; resize: vertical; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.6; padding: 14px; }
.preview { min-height: 380px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 16px 20px; }
.report-list { max-height: 640px; overflow-y: auto; }
.modal.wide { width: min(760px, 100%); }
.md { line-height: 1.65; font-size: 14px; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { margin: 18px 0 8px; line-height: 1.3; }
.md h1 { font-size: 20px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.md > :first-child { margin-top: 0; }
.md p { margin: 8px 0; color: #d4dae8; }
.md ul, .md ol { padding-left: 22px; margin: 6px 0; color: #d4dae8; }
.md li { margin: 3px 0; }
.md li.task { list-style: none; margin-left: -20px; display: flex; gap: 8px; align-items: baseline; }
.md-check { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid #4a5775; display: inline-block; flex-shrink: 0; transform: translateY(2px); }
.md-check.on { background: var(--accent); border-color: var(--accent); }
.md code { background: #0c0f15; border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.md pre { background: #0c0f15; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.md pre code { border: 0; padding: 0; background: none; }
.md blockquote { margin: 8px 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
.md a { color: var(--accent-2); }
.donut { width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0; -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%); mask: radial-gradient(circle, transparent 52%, #000 53%); }
.gate { max-width: 460px; margin: 80px auto; text-align: center; color: var(--muted); padding: 36px; }
.gate h2 { color: var(--text); margin: 12px 0 6px; }
.empty b { color: var(--muted); font-weight: 600; }
.empty span { font-size: 12px; }

/* ---------- Pay + sign-up ---------- */
.nav-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; }
.nav-count[hidden] { display: none; }
.notice.warn { border-color: rgba(255,93,93,.45); background: linear-gradient(160deg, rgba(255,93,93,.12), var(--card) 70%); }
.notice.warn a { color: #ff9b9b; }
a.pay-card { display: block; color: inherit; transition: border-color .15s; }
a.pay-card:hover { border-color: rgba(47,107,255,.5); }
.pay-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.pay-meta b { color: var(--text); font-weight: 600; }
.chip.pay-scheduled { background: rgba(143,180,255,.14); color: var(--sky); }
.chip.pay-paid { background: rgba(91,212,154,.14); color: var(--green); }
.chip.pay-on_hold { background: rgba(201,160,255,.14); color: #c9a0ff; }
.chip.pay-late { background: rgba(255,93,93,.15); color: #ff8080; }
.gate.join { max-width: 480px; }
.gate.join p { line-height: 1.5; }
.gate.join .form { grid-template-columns: 1fr; margin-top: 18px; }
.logo-mark.big { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; margin: 0 auto; }
.notice-inline { display: flex; gap: 8px; align-items: center; justify-content: center; background: rgba(91,212,154,.1); color: var(--green); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
.notice-inline.err { background: rgba(255,93,93,.1); color: #ff9b9b; }
details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.copy-row { display: flex; gap: 8px; margin-top: 14px; }
.copy-row .input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.req-msg { font-style: italic; margin-top: 4px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.top-actions .btn { white-space: nowrap; }
@media (max-width: 900px) { #role-pill { display: none; } }
img.avatar { object-fit: cover; background: var(--card-2); display: block; }
.avatars img.avatar { border: 2px solid var(--card); }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; }
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-edit { display: flex; gap: 20px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.google-btn { margin-top: 20px; width: 100%; justify-content: center; gap: 10px; padding: 12px 16px; font-size: 14px; background: #fff; color: #1f1f1f; border-color: #fff; }
.google-btn:hover { background: #eef2fa; border-color: #eef2fa; }
.audit { max-height: 420px; overflow-y: auto; }
.warn-row td { color: #ff9b9b !important; }
.seg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); cursor: pointer; color: var(--text); }
.seg-choice label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.18); }
.seg-choice input { accent-color: var(--accent); margin-top: 3px; }
.seg-choice b { display: block; font-size: 13px; }
.seg-choice small { color: var(--muted); font-size: 11.5px; }
.sub-form { padding: 14px; border-radius: 12px; background: #10131a; border: 1px solid var(--line); }
@media (max-width: 720px) { .seg-choice { grid-template-columns: 1fr; } }
.form > .full { grid-column: 1 / -1; }
.sub-form { grid-template-columns: 1fr 1fr; }

/* ---------- Pay calendar ---------- */
.pay-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pay-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pay-pill.sent { color: #5bd49a; background: rgba(91,212,154,.13); }
.pay-pill.pending { color: #f5b544; background: rgba(245,181,68,.13); }
.pay-pill.invalid { color: #ff7a7a; background: rgba(255,93,93,.13); }
.pay-pill.upcoming { color: var(--sky); background: rgba(143,180,255,.12); }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h3 { margin: 0 6px; font-size: 16px; min-width: 150px; text-align: center; }
.cal-head .icon-btn { width: 32px; height: 32px; font-size: 18px; }
.cal-head .btn { margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 4px 0; }
.cal-cell { min-height: 74px; border-radius: 12px; background: #141822; border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.cal-cell.out { opacity: .38; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-cell.today .cal-num { color: #fff; }
.cal-pay { margin-top: auto; font-size: 10.5px; font-weight: 700; padding: 4px 6px; border-radius: 7px; text-align: center; }
.cal-cell.has-pay.sent { background: rgba(91,212,154,.10); border-color: rgba(91,212,154,.35); }
.cal-cell.has-pay.sent .cal-pay { background: #5bd49a; color: #062014; }
.cal-cell.has-pay.pending { background: rgba(245,181,68,.09); border-color: rgba(245,181,68,.35); }
.cal-cell.has-pay.pending .cal-pay { background: #f5b544; color: #2a1c02; }
.cal-cell.has-pay.invalid { background: rgba(255,93,93,.08); border-color: rgba(255,93,93,.35); }
.cal-cell.has-pay.invalid .cal-pay { background: #ff6b6b; color: #2a0606; text-decoration: line-through; }
.cal-cell.has-pay.upcoming { background: rgba(47,107,255,.10); border-color: rgba(47,107,255,.4); }
.cal-cell.has-pay.upcoming .cal-pay { background: var(--accent); color: #fff; }
.cal-cell[data-pay-date] { cursor: pointer; transition: transform .12s; }
.cal-cell[data-pay-date]:hover { transform: translateY(-2px); }
.cal-cell[data-pay-date]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cal-legend i.sent { background: #5bd49a; } .cal-legend i.pending { background: #f5b544; }
.cal-legend i.invalid { background: #ff6b6b; } .cal-legend i.upcoming { background: var(--accent); }
.member-pick.on { background: rgba(47,107,255,.12); box-shadow: inset 3px 0 0 var(--accent); }
.member-pick { padding-left: 8px; padding-right: 8px; }
.member-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.member-head h2 { margin: 0; font-size: 20px; }
.member-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.member-facts span { display: inline-flex; gap: 6px; align-items: center; }
.member-facts b { color: var(--text); }
.status-choices { display: grid; gap: 8px; }
.status-choice { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); }
.status-choice small { color: var(--muted); font-size: 12.5px; }
.status-choice:hover { border-color: var(--muted); }
.status-choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.2); }
.status-note { display: grid; gap: 6px; margin-top: 14px; font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .cal-cell { min-height: 54px; padding: 5px; } .cal-pay { font-size: 9px; padding: 3px 2px; } }

/* ---------- Notifications ---------- */
.icon-btn.bell { color: var(--text); }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--frame); }
.bell-count.urgent { background: #ff5d5d; }
.notif { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #141822; margin-bottom: 10px; }
.notif:last-child { margin-bottom: 0; }
.notif-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.notif.urgent { border-color: rgba(255,93,93,.35); } .notif.urgent .notif-ico { background: rgba(255,93,93,.14); color: #ff8080; }
.notif.warning { border-color: rgba(245,181,68,.3); } .notif.warning .notif-ico { background: rgba(245,181,68,.14); color: #f5b544; }
.notif.info .notif-ico { background: rgba(47,107,255,.16); color: var(--sky); }
.notif.success .notif-ico { background: rgba(91,212,154,.14); color: #5bd49a; }
.notif-title { font-weight: 700; font-size: 14px; }
.notif-body { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.notif-meta { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 11.5px; margin-top: 6px; }
.notif-meta:empty { display: none; }
.notif-tag { background: rgba(255,93,93,.16); color: #ff8080; font-weight: 700; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.notif-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.notif-help { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8; }
@media (max-width: 720px) { .notif { flex-wrap: wrap; } .notif-actions { width: 100%; justify-content: flex-end; } }
.cur-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.cur-switch .select { min-width: 200px; }
.status-remove { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* ===================== Brand logo ===================== */
.logo { gap: 10px; }
.logo-img { width: 34px; height: 34px; border-radius: 9px; display: block; box-shadow: 0 2px 10px rgba(0,0,0,.35); flex-shrink: 0; }
.auth-brand .logo-img, .legal .logo-img { width: 36px; height: 36px; }

/* ===================== Layout bug fixes ===================== */
/* 1. Daily Log names: first name, cut off on the right (full name on hover) */
.person-label { justify-content: flex-start !important; min-width: 0; }
.person-label .pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.heat .cell.leave, .legend i.leave { background: repeating-linear-gradient(135deg, #7c5cff 0 4px, #5b43c9 4px 8px) !important; }
.leave-txt { color: #b9a6ff; }
/* 4. Dashboard: columns line up (last card in a column fills the space) */
.grid { align-items: stretch; }
.stack > .card:last-child { flex: 1; }

/* ===================== Tasks (members can move their own) ===================== */
.task-card.movable { cursor: grab; }
.task-card:not(.movable) { cursor: pointer; }
.status-steps { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===================== Report feedback ===================== */
.comments { display: grid; gap: 10px; margin-bottom: 12px; }
.comment { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #141822; border: 1px solid var(--line); }
.comment.mine { background: rgba(47,107,255,.08); border-color: rgba(47,107,255,.25); }
.c-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.c-head span { color: var(--dim); font-size: 11.5px; }
.c-head .icon-btn { margin-left: auto; }
.c-body { margin-top: 3px; font-size: 13.5px; color: #d4dae8; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form .textarea { flex: 1; resize: vertical; min-height: 44px; }

/* ===================== Team calendar + time off ===================== */
.tc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tc-cell { min-height: 96px; border-radius: 12px; background: #141822; border: 1px solid var(--line); padding: 7px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tc-cell.out { opacity: .38; }
.tc-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tc-item { font-size: 10.5px; font-weight: 600; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-item.ev { background: rgba(47,107,255,.18); color: #b8ccff; }
.tc-item.dl { background: rgba(245,181,68,.16); color: #f5c76a; }
.tc-item.dl.done { text-decoration: line-through; opacity: .6; }
.tc-item.lv { background: rgba(124,92,255,.2); color: #c7b8ff; }
.tc-item.lv.pending { background: transparent; border: 1px dashed rgba(124,92,255,.6); }
.tc-item.py { background: rgba(91,212,154,.14); color: #7fe0b2; }
.tc-more { font-size: 10.5px; color: var(--muted); padding-left: 4px; }
.cal-legend i.ev { background: var(--accent); }
.cal-legend i.dl { background: #f5b544; }
.cal-legend i.lv { background: #7c5cff; }
.cal-legend i.py { background: #5bd49a; }
.leave-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.leave-tag.pending { background: rgba(245,181,68,.14); color: #f5b544; }
.leave-tag.approved { background: rgba(91,212,154,.14); color: #5bd49a; }
.leave-tag.declined { background: rgba(255,93,93,.14); color: #ff8080; }

/* ===================== Payslip ===================== */
.payslip { background: #f7f8fb; color: #10131a; border-radius: 16px; padding: 24px; }
.ps-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #dde1e8; }
.ps-head img { border-radius: 10px; }
.ps-head b { display: block; font-size: 17px; }
.ps-head small { color: #5f6779; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; }
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.ps-grid small, .ps-amount small { display: block; color: #5f6779; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ps-grid b { display: block; margin-top: 3px; font-size: 14.5px; }
.ps-grid span { color: #5f6779; font-size: 12.5px; }
.ps-amount { margin-top: 20px; padding: 18px; border-radius: 12px; background: #fff; border: 1px solid #dde1e8; }
.ps-amount b { display: block; font-size: 30px; letter-spacing: -.02em; margin-top: 4px; }
.ps-amount span { color: #5f6779; font-size: 12.5px; }
.ps-foot { color: #8a91a1; font-size: 11.5px; margin: 18px 0 0; }
@media print {
  body.printing-slip * { visibility: hidden !important; }
  body.printing-slip .payslip, body.printing-slip .payslip * { visibility: visible !important; }
  body.printing-slip .payslip { position: fixed; inset: 0; margin: 0; border-radius: 0; padding: 32px; }
  body.printing-slip .pay-pill.sent { color: #0b7a47 !important; background: #dff5ea !important; }
}

/* ===================== Search ===================== */
.search-overlay { place-items: start center; padding-top: 12vh; }
.search-box { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.search-box .input { flex: 1; font-size: 16px; padding: 12px 14px; }
.search-box kbd { font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; }
.search-results { margin-top: 14px; max-height: 55vh; overflow-y: auto; }
.sr-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; margin: 12px 4px 6px; }
.sr-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px; border-radius: 10px; border: 0; background: transparent; color: var(--text); }
.sr-item:hover, .sr-item:focus-visible { background: rgba(47,107,255,.12); outline: none; }
.sr-item b { display: block; font-size: 13.5px; }
.sr-item small { color: var(--muted); font-size: 12px; }

/* ===================== Phone: slim header + bottom tab bar ===================== */
.tabbar { display: none; }
.tab-dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: #ff5d5d; }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sheet-head b { display: block; }
.sheet-head small { color: var(--muted); font-size: 12px; }
.sheet-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-links a, .sheet-links button { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; text-align: left; }
.sheet-links .tab-dot { top: 10px; right: 10px; }
@media (max-width: 720px) {
  .app { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar { flex-wrap: nowrap; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--frame); margin: -14px -14px 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .topbar .nav, #role-pill, #write-report-btn, #signout-btn { display: none !important; }
  .top-actions { gap: 8px; }
  .logo span { font-size: 17px; }
  .logo-img { width: 30px; height: 30px; }
  .tabbar:not([hidden]) { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(13,16,24,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line-2); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  .tabbar .active { color: var(--accent-2); }
  .tabbar .active span svg { filter: drop-shadow(0 0 6px rgba(47,107,255,.6)); }
  .overlay.sheet { place-items: end stretch; padding: 0; }
  .overlay.sheet .modal { width: 100%; max-width: none; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .tc-cell { min-height: 64px; padding: 4px; }
  .tc-item { font-size: 9px; padding: 2px 3px; }
  .ps-grid { grid-template-columns: 1fr; }
  .search-overlay { padding-top: 4vh; }
}

/* ===================== Header never hides tabs ===================== */
/* Medium screens: drop the extras so the whole menu fits */
@media (max-width: 1320px) {
  #role-pill, #write-report-btn { display: none !important; }
}
/* Tablets and phones (or whenever the menu would not fit): slim header + bottom tab bar */
body.compact-nav .app { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.compact-nav .topbar { flex-wrap: nowrap; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--frame); border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
  body.compact-nav .topbar .nav, body.compact-nav #signout-btn { display: none !important; }
  body.compact-nav .top-actions { gap: 8px; margin-left: auto; }
  body.compact-nav .tabbar:not([hidden]) { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  body.compact-nav background: rgba(13, body.compact-nav 16, body.compact-nav 24, body.compact-nav .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line-2); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, body.compact-nav .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  body.compact-nav .tabbar .active { color: var(--accent-2); }
  body.compact-nav .tabbar .active span svg { filter: drop-shadow(0 0 6px rgba(47,107,255,.6)); }
  body.compact-nav .overlay.sheet { place-items: end center; padding: 0; }
  body.compact-nav .overlay.sheet .modal { width: min(560px, 100%); border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
@media (max-width: 720px) {
  .topbar { margin: -14px -14px 0; padding-left: 14px; padding-right: 14px; }
}
.sheet-head .grow { flex: 1; min-width: 0; }

/* ===================== Typography: Inter Tight, weight scale ===================== */
:root {
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-extrabold: 800; --fw-black: 900;
}
body { font-weight: var(--fw-regular); font-feature-settings: 'ss01' on, 'cv11' on; letter-spacing: -0.005em; text-rendering: optimizeLegibility; }
/* Display: poster-style, black weight, tight tracking */
.hero-copy h1 { font-weight: var(--fw-black); letter-spacing: -0.055em; line-height: .92; }
.page-head h1 { font-weight: var(--fw-extrabold); letter-spacing: -0.035em; }
.auth-body h2, .gate h2 { font-weight: var(--fw-extrabold); letter-spacing: -0.035em; }
.big-number, .kpi .value, .ob-pct, .ps-amount b { font-weight: var(--fw-black); letter-spacing: -0.04em; }
.member-head h2, .modal h2, .drawer h2 { font-weight: var(--fw-extrabold); letter-spacing: -0.025em; }
/* Section headings */
.card-head h3, .cal-head h3, .column-head { font-weight: var(--fw-bold); letter-spacing: -0.015em; }
.logo span, .auth-brand { font-weight: var(--fw-extrabold); letter-spacing: -0.03em; }
/* Labels, names, buttons */
.btn, .nav a, .auth-tabs button, .tabbar a, .tabbar button, .chip, .pay-pill, .leave-tag, .badge { font-weight: var(--fw-semibold); }
.name, .list-row .name, .person div[style*='font-weight'], .notif-title, .sr-item b, .t, .task-card .title { font-weight: var(--fw-semibold); }
.nav a.active { font-weight: var(--fw-bold); }
.section-title, .sr-group, .cal-dow, .table th, .ps-grid small, .ps-amount small { font-weight: var(--fw-bold); letter-spacing: .07em; }
/* Body & supporting text */
.meta, .sub, .lead, .hint, .notif-body, .card-head .sub { font-weight: var(--fw-regular); }
.md p, .md li, .c-body { font-weight: var(--fw-regular); letter-spacing: 0; }
.md h1, .md h2, .md h3 { font-weight: var(--fw-bold); letter-spacing: -0.02em; }
.md strong { font-weight: var(--fw-bold); }
.md em { font-style: italic; }

/* ===================== Site background (landscape blue pattern) ===================== */
html, body { background: #04060d; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 6, 13, .50) 0%, rgba(4, 6, 13, .72) 60%, rgba(4, 6, 13, .86) 100%),
    url('/brand/bg-landscape.jpg') center / cover no-repeat;
}
/* glass panels so the pattern shows through around the content */
.app { background: rgba(10, 13, 20, .76); border-color: rgba(143, 180, 255, .16); backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
body.compact-nav .topbar { background: rgba(10, 13, 20, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.logo-img { border-radius: 9px; box-shadow: 0 4px 16px rgba(0, 40, 160, .45); }

/* Sign-in / join: the pattern fills the brand side */
body.auth-mode { background: #04060d; }
body.auth-mode::before { background: linear-gradient(180deg, rgba(4, 6, 13, .30), rgba(4, 6, 13, .55)), url('/brand/bg-landscape.jpg') center / cover no-repeat; }
.auth-hero { background: linear-gradient(115deg, rgba(3, 6, 20, .25) 0%, rgba(3, 6, 20, .55) 70%, rgba(3, 6, 20, .75) 100%); border-right-color: rgba(143, 180, 255, .18); }
.auth-hero .orb { opacity: .14 !important; }
.auth-hero .grid-bg { opacity: .25; }
.auth-panel { background: rgba(5, 8, 15, .84); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.auth-brand .logo-img { width: 40px; height: 40px; border-radius: 11px; }

/* ===================== Motion: hover, press, transitions, feedback ===================== */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); --t-fast: .14s; --t: .22s; }

/* Buttons: lift + glow on hover, press down on click */
.btn, .icon-btn, .google-cta, .avatar-btn, .tick, .link, .auth-tabs button, .seg button, .status-choice, .sheet-links a, .sheet-links button, .sr-item {
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t) var(--ease-out), background-color var(--t) var(--ease-out),
    border-color var(--t) var(--ease-out), color var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
}
.btn:hover:not(:disabled):not(.is-loading) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.btn.primary:hover:not(:disabled):not(.is-loading) { box-shadow: 0 8px 24px rgba(47, 107, 255, .45); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 93, 93, .1); border-color: rgba(255, 93, 93, .5); }
.btn:active:not(:disabled), .icon-btn:active, .google-cta:active, .status-choice:active, .sheet-links a:active, .sheet-links button:active { transform: translateY(0) scale(.97); box-shadow: none; transition-duration: .06s; }
.icon-btn:hover { background: var(--card-2); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn:hover svg { transform: scale(1.08); }
.icon-btn svg, .btn svg { transition: transform var(--t) var(--ease-spring); }
.btn:hover svg { transform: translateX(1px) scale(1.06); }
#notif-btn:hover svg { animation: ring .6s var(--ease-out); }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } }
.avatar-btn:hover .avatar, .avatar-btn:hover img { transform: scale(1.07); box-shadow: 0 0 0 3px rgba(47, 107, 255, .45); }
.avatar, img.avatar { transition: transform var(--t) var(--ease-spring), box-shadow var(--t) var(--ease-out); }
.person:hover .avatar, .list-row:hover .avatar, .comment:hover .avatar { transform: scale(1.06); }
.link { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size var(--t) var(--ease-out); }
.link:hover { text-decoration: none; background-size: 100% 1px; }
.logo:hover .logo-img { transform: rotate(-6deg) scale(1.05); }
.logo-img { transition: transform .35s var(--ease-spring); }

/* Menu */
.nav a { transition: color var(--t) var(--ease-out), background-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out); }
.nav a:hover:not(.active) { background: rgba(255, 255, 255, .05); }
.tabbar a, .tabbar button { transition: color var(--t) var(--ease-out); }
.tabbar .active span { animation: tabPop .35s var(--ease-spring); }
@keyframes tabPop { 0% { transform: scale(.8); } 100% { transform: scale(1); } }

/* Cards, rows and tiles */
.card { transition: border-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out), transform var(--t) var(--ease-out); }
.card:hover { border-color: rgba(143, 180, 255, .18); }
a.card:hover, .kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.list-row.clickable, .member-pick, .notif { transition: background-color var(--t) var(--ease-out), transform var(--t) var(--ease-out), border-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out); }
.list-row.clickable:hover, .member-pick:hover { background: rgba(47, 107, 255, .08); transform: translateX(3px); }
.notif:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .3); }
.table tbody tr td { transition: background-color var(--t-fast) var(--ease-out); }
.table tbody tr[data-emp]:hover td, .table tbody tr[data-payout]:hover td, .table tbody tr[data-member-pay]:hover td { background: rgba(47, 107, 255, .07); }
.task-card { transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out), border-color var(--t) var(--ease-out), opacity var(--t); }
.task-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0, 0, 0, .35); border-color: rgba(143, 180, 255, .25); }
.task-card.dragging { transform: rotate(2deg) scale(1.02); opacity: .55; }
.column { transition: border-color var(--t) var(--ease-out), background-color var(--t) var(--ease-out); }
.column.drag-over { background: rgba(47, 107, 255, .06); }
.cal-cell, .tc-cell { transition: border-color var(--t) var(--ease-out), background-color var(--t) var(--ease-out), transform var(--t) var(--ease-out); }
.tc-cell:hover { border-color: rgba(143, 180, 255, .3); }
.cal-cell[data-pay-date]:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, .35); }
.heat .cell { transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast); }
.heat .cell:hover { filter: brightness(1.3); }
.chip, .pay-pill, .leave-tag { transition: transform var(--t) var(--ease-spring); }
.list-row:hover .pay-pill, .list-row:hover .chip { transform: scale(1.05); }
.sr-item:hover { transform: translateX(3px); }
.status-choice:hover { transform: translateX(3px); }
.input, .select, .textarea { transition: border-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out), background-color var(--t); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(143, 180, 255, .3); }
.input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 4px rgba(47, 107, 255, .18); }

/* Page and dialog transitions */
.page-in { animation: pageIn .28s var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.overlay { animation: fadeIn .18s var(--ease-out); }
.overlay .modal { animation: popIn .24s var(--ease-spring); }
.overlay .drawer { animation: slideIn .28s var(--ease-out); }
.overlay.closing { animation: fadeOut .17s var(--ease-out) forwards; pointer-events: none; }
.overlay.closing .modal { animation: popOut .17s var(--ease-out) forwards; }
.overlay.closing .drawer { animation: slideOut .17s var(--ease-out) forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes popOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }
.overlay.sheet .modal { animation: sheetUp .3s var(--ease-out); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }

/* Confirmation dialog */
.confirm-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(2, 4, 10, .6); backdrop-filter: blur(4px); animation: fadeIn .16s var(--ease-out); }
.confirm-layer.closing { animation: fadeOut .16s var(--ease-out) forwards; }
.confirm-box { width: min(400px, 100%); background: var(--frame); border: 1px solid var(--line-2); border-radius: 20px; padding: 24px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: popIn .26s var(--ease-spring); }
.confirm-layer.closing .confirm-box { animation: popOut .16s var(--ease-out) forwards; }
.confirm-ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: rgba(47, 107, 255, .16); color: var(--sky); }
.confirm-box.danger .confirm-ico { background: rgba(255, 93, 93, .14); color: #ff8080; animation: shake .5s var(--ease-out) .12s; }
@keyframes shake { 20% { transform: rotate(-8deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
.confirm-box h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.confirm-box p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; font-size: 14px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn { justify-content: center; padding: 11px; }
.btn.danger-solid { background: #e5484d; border-color: #e5484d; color: #fff; }
.btn.danger-solid:hover { background: #f05257; box-shadow: 0 8px 24px rgba(229, 72, 77, .45); }

/* Busy buttons: spinner, no double clicks */
.is-loading { position: relative; pointer-events: none; color: transparent !important; }
.is-loading > * { visibility: hidden; }
.is-loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.primary):not(.danger-solid).is-loading::after { border-color: rgba(143, 180, 255, .3); border-top-color: var(--sky); }
.tick.is-loading::after { width: 12px; height: 12px; }

/* Ticks pop when completed */
.tick.popping { animation: tickPop .4s var(--ease-spring); background: var(--accent); border-color: var(--accent); color: #fff; }
@keyframes tickPop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* Toasts */
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); animation: toastIn .32s var(--ease-spring); }
.toast.leaving { animation: toastOut .22s var(--ease-out) forwards; }
.toast-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 13px; }
.toast.ok .toast-ico { background: rgba(91, 212, 154, .18); color: #5bd49a; }
.toast.err .toast-ico { background: rgba(255, 93, 93, .18); color: #ff8080; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 10px); } }
body.compact-nav .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

/* Respect people who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
