/* =====================================================================
   Design 3 ("Cobalt"): loaded after app.css, changes only the look.
   To go back to the old look, remove the <link> to design3.css in index.html.
   ===================================================================== */
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Bold.woff') format('woff'); font-weight: 700 900; font-display: swap; }
@font-face { font-family: 'Adventor'; src: url('/fonts/Adventor-Regular.woff') format('woff'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Adventor'; src: url('/fonts/Adventor-Bold.woff') format('woff'); font-weight: 600 900; font-display: swap; }

:root {
  --bg: #edf0f7; --surface: #ffffff; --surface-2: #f6f8fc; --border: #e4e8f1; --border-2: #dde2ec; --text: #101828; --muted: #667085; --faint: #98a2b3;
  --primary: #2346d8; --primary-2: #1b39bd; --primary-soft: #e8edfd; --primary-text: #fff;
  --green: #1a8a63; --green-2: #2fb88a; --green-soft: #e7f7f0; --orange: #c2560f; --orange-2: #ff8a3d; --orange-soft: #fff1e7;
  --red: #d92d33; --red-2: #e5484d; --red-soft: #fdecec; --blue: #2346d8; --blue-soft: #e8edfd; --purple: #6941c6; --purple-soft: #f1ecfd;
  --gray-soft: #f2f4f7; --teal: #0f7f80; --teal-soft: #e2f5f4; --cyan: #0b7fa3; --cyan-soft: #e1f3f9;
  --radius: 20px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, .12);
  --sidebar-w: 248px; --top-h: 72px;
  --head: 'Adventor', 'Inter', system-ui, sans-serif;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0b1020; --surface: #141a2b; --surface-2: #1a2236; --border: #252f47; --border-2: #2e3955; --text: #e8ecf5; --muted: #a3acc2; --faint: #6f7a94;
  --primary: #6584ff; --primary-2: #7b96ff; --primary-soft: #1d2a55; --green: #3cc796; --green-2: #3cc796; --green-soft: #13352b; --orange: #ffa25e; --orange-2: #ff8a3d; --orange-soft: #3a2614;
  --red: #ff6b6f; --red-2: #ff6b6f; --red-soft: #3d1c22; --blue: #6584ff; --blue-soft: #1d2a55; --purple: #a88bfa; --purple-soft: #2a2050; --gray-soft: #222a40; --teal-soft: #13353a; --cyan-soft: #12323f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 40px rgba(0, 0, 0, .4);
}
body { background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 13.5px; }
h1, h2, h3, .page-head h1, .modal-head h2, .mv, .num { font-family: var(--head); }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: 0; }
h3 { font-weight: 700; }
::selection { background: #c9d4fb; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.svgi { flex: none; display: block; }
span.ico { display: inline-grid; place-items: center; vertical-align: -3px; line-height: 0; }
span.ico .svgi { width: 1.15em; height: 1.15em; }

/* ---------- shell: sidebar + body ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: none; height: 100vh; transition: grid-template-columns .2s; }
.shell.slim { --sidebar-w: 84px; }
.shell > .body { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px 14px; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 11px; width: auto; padding: 2px 4px 20px; color: var(--text); text-decoration: none !important; }
.brand-logo { width: 42px; height: 42px; border-radius: 13px; background: var(--primary); color: #fff; display: grid; place-items: center; font: 700 19px var(--head); flex: none; box-shadow: none; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font: 700 15.5px var(--head); color: var(--text); }
.brand-txt span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; }
.nav a, .nav .nav-group > button { gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 2px; position: relative; }
.nav a:hover, .nav .nav-group > button:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.nav .ic { width: 22px; height: 22px; display: grid; place-items: center; opacity: 1; font-size: 0; }
.nav .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .chev { display: grid; place-items: center; font-size: 0; }
.nav-group.open > button { color: var(--text); }
.nav-sub { padding: 2px 0 6px 46px; position: relative; }
.nav-sub::before { content: ''; position: absolute; left: 22px; top: 4px; bottom: 8px; width: 1.5px; background: var(--border); }
.nav-sub a { padding: 7px 10px; font-size: 13px; font-weight: 500; }
.nav-sub a.active { background: none; color: var(--primary); font-weight: 700; }
.nav-sep { background: var(--border); margin: 10px 8px; }
.nav .count { background: var(--orange-2); color: #fff; font-size: 11px; }
.nav a.active .count { background: var(--primary); color: #fff; }
.nav-collapse { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 10px; border: 0; background: none; color: var(--faint); font-weight: 600; cursor: pointer; border-radius: 12px; }
.nav-collapse:hover { background: var(--surface-2); color: var(--text); }
.nav-collapse .svgi { margin: 0 2px; }
/* slim (icon rail) */
.shell.slim .sidebar { padding: 18px 12px 14px; align-items: center; }
.shell.slim .brand { padding: 2px 0 20px; } .shell.slim .brand-txt, .shell.slim .nav .lb, .shell.slim .nav .chev, .shell.slim .nav-collapse .lb { display: none; }
.shell.slim .nav { width: 100%; }
.shell.slim .nav a, .shell.slim .nav .nav-group > button { justify-content: center; padding: 13px 0; }
.shell.slim .nav-sub, .shell.slim .nav-group.open .nav-sub { display: none; }
.shell.slim .nav .count { position: absolute; top: 5px; right: 8px; min-width: 9px; height: 9px; padding: 0; font-size: 0; box-shadow: 0 0 0 2px var(--surface); }
.shell.slim .nav-collapse { justify-content: center; padding: 12px 0; width: 100%; }
.shell.slim .nav-collapse .svgi { transform: scaleX(-1); }
.nav-fly { position: fixed; z-index: 300; background: var(--text); color: var(--surface); font-weight: 600; font-size: 12.5px; padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow-lg); white-space: nowrap; pointer-events: auto; }
.nav-fly.grp { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 8px; min-width: 200px; display: flex; flex-direction: column; }
.nav-fly.grp b { font: 700 13px var(--head); padding: 6px 10px 8px; }
.nav-fly.grp a { padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; }
.nav-fly.grp a:hover, .nav-fly.grp a.active { background: var(--primary-soft); color: var(--primary); text-decoration: none; }

/* top bar */
.topbar { grid-column: auto; height: var(--top-h); flex: none; gap: 12px; padding: 0 30px; background: transparent; border-bottom: 0; }
.search { max-width: 420px; }
.search .search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search::before { display: none; }
.search input { padding: 11px 14px 11px 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-results { border-radius: 16px; top: 50px; box-shadow: var(--shadow-lg); }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: #475467; }
:root[data-theme="dark"] .icon-btn { color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.badge-dot { top: -4px; right: -4px; background: var(--orange-2); box-shadow: 0 0 0 2px var(--bg); }
#quick-task { height: 42px; padding: 0 16px; border-radius: 12px; }
.me-btn { padding: 3px 10px 3px 3px; border-radius: 14px; }
.me-btn:hover { background: var(--surface); }
.me-btn .avatar { width: 38px; height: 38px; font-size: 13px; }
.me-btn .chev { display: grid; place-items: center; }

/* page */
.main { padding: 6px 30px 60px; flex: 1; overflow-y: auto; }
.main::before { display: none; }
.crumbs { font-size: 12.5px; font-weight: 500; color: var(--faint); margin-bottom: 4px; }
.page-head { margin-bottom: 20px; align-items: center; }
.page-head .sub { font-size: 13.5px; }

/* ---------- surfaces ---------- */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow); }
.card-head { padding: 18px 22px 14px; border-bottom: 0; }
.card-head h2, .card-head h3 { font-size: 16px; }
.card-pad { padding: 20px 22px; }
.card-head + .card-pad { padding-top: 4px; }
.metrics { gap: 16px; }
.metric { padding: 18px 20px; gap: 14px; transition: border-color .15s, box-shadow .15s; }
a.metric:hover { border-color: var(--border-2); box-shadow: 0 8px 24px rgba(16, 24, 40, .07); }
.metric .mi { width: 46px; height: 46px; border-radius: 14px; font-size: 18px; }
.metric .ml { font-size: 12.5px; color: var(--muted) !important; font-weight: 600; }
.metric .mv { font-size: 26px; font-weight: 700; color: var(--text) !important; line-height: 1.15; }

/* buttons */
.btn { border-radius: 12px; padding: 9px 15px; font-weight: 600; border-color: var(--border-2); transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #c8cfdd; }
.btn .svgi { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-green { background: var(--green-2); border-color: var(--green-2); }
:root:not([data-theme="dark"]) .btn-green { background: #1fa77a; border-color: #1fa77a; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #dbe3fc; }
.btn-sm { border-radius: 10px; padding: 6px 11px; font-size: 12.5px; }
.seg { border-radius: 12px; background: var(--surface); border-color: var(--border); padding: 4px; }
.seg button { border-radius: 9px; padding: 6px 13px; }
.seg button.active { background: var(--primary); color: #fff; }
.chip { border-radius: 10px; border-color: var(--border); }
.chip.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); background: var(--primary-soft); }

/* tabs */
.tabs { gap: 22px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.tabs button { padding: 16px 0 13px; border-bottom-width: 2.5px; color: var(--muted); }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-color: var(--primary); }

/* forms */
.input, select.input, textarea.input { border-radius: 12px; border-color: var(--border-2); padding: 10px 13px; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
label.lbl { font-size: 12.5px; }
.ms-box { border-radius: 12px; border-color: var(--border-2); }
.ms-pop, .menu { border-radius: 14px; box-shadow: var(--shadow-lg); }
.ms-tag { border-radius: 8px; }
.rte { border-radius: 12px; border-color: var(--border-2); }
.drop { border-radius: 14px; }

/* pills */
.pill { padding: 3px 10px; font-size: 11.5px; font-weight: 700; }
.pill::before { width: 6px; height: 6px; }
.s-pending { background: var(--gray-soft); color: #475467; }
:root[data-theme="dark"] .s-pending { color: var(--muted); }
.s-in_progress { background: var(--primary-soft); color: var(--primary); }
.s-submitted { background: var(--orange-soft); color: var(--orange); }
.s-completed { background: var(--green-soft); color: var(--green); }
.s-paused { background: var(--purple-soft); color: var(--purple); }
.p-low { background: var(--gray-soft); color: #475467; } :root[data-theme="dark"] .p-low { color: var(--muted); }
.p-medium { background: var(--orange-soft); color: var(--orange); }
.p-high { background: var(--red-soft); color: var(--red); }
.p-urgent { background: var(--red-2); color: #fff; }
.code { font-family: Inter, sans-serif; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--gray-soft); border-radius: 7px; padding: 2px 7px; letter-spacing: .01em; }
.avatar { box-shadow: 0 0 0 2px var(--surface); font-weight: 600; }
.progress { height: 8px; background: var(--gray-soft); border-radius: 8px; }
.progress > div { background: var(--primary); border-radius: 8px; }
.progress.green > div { background: var(--green-2); }

/* tables */
.tbl th { background: transparent; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 13px 14px; border-bottom-color: #eef1f6; }
:root[data-theme="dark"] .tbl td { border-bottom-color: var(--border); }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.pager { border-top-color: var(--border); }

/* project cards */
.pcards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard { padding: 20px; border-radius: var(--radius); }
.pcard:hover { transform: none; border-color: var(--border-2); box-shadow: 0 10px 28px rgba(16, 24, 40, .08); }

/* modals, toasts */
.modal-bg { background: rgba(10, 16, 40, .45); backdrop-filter: blur(3px); }
.modal { border-radius: 22px; box-shadow: 0 40px 90px rgba(10, 16, 40, .3); }
.modal-head { border-radius: 22px 22px 0 0; padding: 20px 24px; border-bottom-color: var(--border); }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; background: var(--surface-2); border-radius: 0 0 22px 22px; border-top-color: var(--border); }
.toast { border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); }
.toast.ok { background: #1fa77a; }

/* lists, empty states */
.list-item { padding: 12px 0; border-bottom-color: #eef1f6; }
:root[data-theme="dark"] .list-item { border-bottom-color: var(--border); }
.empty .big, .dash-empty > span { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; opacity: 1; font-size: 26px; }
.dash-empty > span { width: 46px; height: 46px; border-radius: 14px; margin: 0; }
.empty .big, .dash-empty > span { font-size: 19px; }
.kv > div > .k { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.comment .bubble { background: var(--surface-2); border-color: transparent; border-radius: 4px 14px 14px 14px; }
.tl-item::before { background: var(--primary); }
.act-icon, .ncard-icon { font-size: 15px; }
.act-badge { font-size: 10px; }
.ev-date { background: var(--primary-soft); border-radius: 12px; }
.count-pill { background: var(--primary-soft); color: var(--primary); }
.act-btn { border-radius: 10px; font-size: 14px; color: #475467; }
:root[data-theme="dark"] .act-btn { color: var(--muted); }
.emp-eye { font-size: 14px; color: #475467; }
.dlv-ic, .emp-doc-ic { font-size: 16px; color: var(--primary); }

/* calendar */
.cal-grid { border-color: var(--border); }
.cal-grid .dh { background: transparent; color: var(--muted); }
.cal-cell { min-height: 118px; padding: 8px; }
.cal-cell.other { background: var(--surface-2); opacity: .7; }
.cal-cell .dn { border-radius: 9px; min-width: 28px; height: 28px; font-size: 12.5px; }
.cal-cell.today .dn { background: var(--primary); }
.cal-ev { border-radius: 6px; font-weight: 600; padding: 4px 7px; border-left: 3px solid transparent; }
.cal-ev.task { background: var(--primary-soft); border-left-color: var(--primary); color: var(--primary); }
.cal-ev.task.done { background: var(--green-soft); border-left-color: var(--green-2); color: var(--green); }
.cal-ev.task.overdue { background: var(--red-soft); border-left-color: var(--red-2); color: var(--red); }
.cal-ev.event { background: var(--purple-soft); border-left-color: var(--purple); color: var(--purple); }
.cal-ev.holiday, .cal-ev.announcement { background: var(--orange-soft); border-left-color: var(--orange-2); color: var(--orange); }

/* chat */
.chat-fab { background: var(--primary); box-shadow: 0 12px 28px rgba(35, 70, 216, .35); font-size: 19px; display: grid; place-items: center; }
.chat-panel { border-radius: 20px; }
.msg.me { background: var(--primary); }

/* notifications */
.notif-pop { border-radius: 20px; }
.ncard.unread { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }

/* attendance chip, gate */
.att-chip { height: 42px; border-radius: 12px; font-weight: 600; }
.att-side { background: var(--primary) !important; }
.att-card { border-radius: 26px; }
.att-gate { background: rgba(12, 20, 60, .72) !important; }
.att-pop { border-radius: 20px; }

/* ---------- login / setup ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-hero { background: var(--primary); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; right: -160px; bottom: -200px; width: 560px; height: 560px; border-radius: 50%; border: 90px solid rgba(255, 255, 255, .06); pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: 12px; font: 700 19px var(--head); }
.auth-brand .brand-logo { background: #fff; color: var(--primary); }
.auth-copy { margin-top: auto; position: relative; z-index: 1; max-width: 500px; }
.auth-copy h2 { font-size: 38px; line-height: 1.15; font-weight: 700; }
.auth-copy p { color: #c9d3fa; font-size: 15.5px; line-height: 1.6; margin: 14px 0 26px; }
.auth-feats { display: grid; gap: 12px; }
.auth-feats div { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-feats .svgi { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 0; background: none; border: 0; box-shadow: none; }
.auth-card h1 { font-size: 28px; margin: 0 0 6px; }
.auth-card .muted { margin: 0 0 26px; }
.auth-card .input { padding: 12px 14px; }
@media (max-width: 900px) { .auth-split { grid-template-columns: 1fr; } .auth-hero { padding: 28px 24px; } .auth-copy h2 { font-size: 26px; } .auth-copy { margin-top: 28px; } .auth-feats { display: none; } .auth-hero::after { display: none; } }

/* ============== dashboard (bento) ============== */
.db { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.db > * { min-width: 0; }
.db-hero { grid-column: span 6; background: var(--primary); color: #fff; border: 0; border-radius: 22px; padding: 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; position: relative; overflow: hidden; }
.db-hero::after { content: ''; position: absolute; right: -90px; bottom: -150px; width: 360px; height: 360px; border-radius: 50%; border: 56px solid rgba(255, 255, 255, .06); pointer-events: none; }
.db-hero > * { position: relative; z-index: 1; }
.db-hero h1 { color: #fff; font-size: 29px; line-height: 1.15; }
.db-hero p { color: #c9d3fa; margin: 10px 0 20px; font-size: 14px; line-height: 1.55; max-width: 380px; }
.db-hero p a { color: #fff; text-decoration: underline; }
.db-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.db-chips a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 30px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; font-size: 12.5px; }
.db-chips a:hover { background: rgba(255, 255, 255, .22); text-decoration: none; }
.db-ring { align-self: center; }
.db-ring .rv { font: 700 40px var(--head); line-height: 1; }
.db-ring .rv small { font-size: 18px; opacity: .7; margin-left: 2px; }
.db-ring .rl { font-size: 12.5px; color: #c9d3fa; margin-top: 6px; }
.db-kpi { grid-column: span 3; display: flex; flex-direction: column; padding: 20px 22px; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.db-kpi:hover { border-color: var(--border-2); box-shadow: 0 8px 24px rgba(16, 24, 40, .07); }
.db-kpi .top { display: flex; justify-content: space-between; align-items: flex-start; }
.db-kpi .ki { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.db-kpi .num { font-size: 36px; font-weight: 700; letter-spacing: -.01em; line-height: 1; margin-top: 18px; }
.db-kpi .kl { color: var(--muted); margin-top: 6px; font-weight: 500; }
.db-kpi .spark { margin-top: auto; padding-top: 12px; }
.db-delta { font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.db-delta.up { background: var(--green-soft); color: var(--green); } .db-delta.down { background: var(--red-soft); color: var(--red); } .db-delta.flat { background: var(--gray-soft); color: var(--muted); }
.db-card { padding: 22px; }
.db-card .ch { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.db-card .ch h2 { font-size: 16px; }
.db-card .ch .s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.db-card .ch a.more { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.db-lg { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.db-lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.db-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.db-chart text { font-family: Inter, sans-serif; }
.db-stages { display: grid; gap: 13px; }
.db-stages .r { display: grid; grid-template-columns: 120px minmax(0, 1fr) 34px; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; font-weight: 500; }
.db-stages .bar { height: 13px; border-radius: 8px; background: var(--gray-soft); overflow: hidden; }
.db-stages .bar i { display: block; height: 100%; border-radius: 8px; min-width: 4px; }
.db-stages b { text-align: right; font-family: var(--head); }
.db-prj { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.db-prj a { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; color: var(--text); font-weight: 600; font-size: 12.5px; min-width: 0; }
.db-prj a span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.db-prj a:hover { background: var(--primary-soft); text-decoration: none; }
.ring { position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring > div { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring b { font: 700 12px var(--head); color: var(--text); }
.db-top .r { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #eef1f6; color: inherit; text-decoration: none !important; }
:root[data-theme="dark"] .db-top .r { border-top-color: var(--border); }
.db-top .r:first-child { border-top: 0; }
.db-top .rk { width: 20px; font: 700 14px var(--head); color: var(--faint); }
.db-top .who { min-width: 0; flex: 1; } .db-top .who b { display: block; font-weight: 600; } .db-top .who span { font-size: 12px; color: var(--muted); }
.db-top .sc { text-align: right; } .db-top .sc b { font-family: var(--head); display: block; } .db-top .sc span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.db-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.db-cal .dn { font-size: 11.5px; color: var(--faint); font-weight: 600; padding-bottom: 4px; }
.db-cal .d { height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 13px; position: relative; }
.db-cal .d.we { color: #c0c6d2; } :root[data-theme="dark"] .db-cal .d.we { color: var(--faint); }
.db-cal .d.today { background: var(--primary); color: #fff; }
.db-cal .d .dots { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.db-cal .d .dots i { width: 5px; height: 5px; border-radius: 50%; }
.db-task { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid #eef1f6; color: inherit; text-decoration: none !important; }
:root[data-theme="dark"] .db-task { border-top-color: var(--border); }
.db-task:first-child { border-top: 0; }
.db-task .t { min-width: 0; flex: 1; } .db-task .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .db-task .t span { font-size: 12px; color: var(--muted); }
.db-task .box { width: 20px; height: 20px; border-radius: 7px; border: 2px solid #d0d5dd; flex: none; }
.db-task:hover .t b { color: var(--primary); }
.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-12 { grid-column: span 12; }
.db-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.db-head h1 { font-size: 24px; } .db-head .sub { color: var(--muted); margin-top: 2px; }
@media (max-width: 1280px) { .db-hero { grid-column: span 12; } .db-kpi { grid-column: span 6; } .span-7, .span-5 { grid-column: span 12; } .span-4 { grid-column: span 6; } }
@media (max-width: 1000px) { .span-4, .span-6, .span-8, .span-3 { grid-column: span 12; } }
@media (max-width: 640px) { .db-kpi { grid-column: span 12; } .db-hero { grid-template-columns: 1fr; padding: 22px; } .db-ring { justify-self: center; } .db-prj { grid-template-columns: 1fr; } .db-stages .r { grid-template-columns: 96px minmax(0, 1fr) 30px; } }

/* ============== projects page ============== */
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.pc-code { min-width: 46px; height: 46px; padding: 0 8px; border-radius: 14px; display: grid; place-items: center; font: 700 12px var(--head); }
.pc-title { font-size: 17px; margin: 14px 0 3px; line-height: 1.3; }
.pc-sub { color: var(--muted); font-size: 12.5px; }
.pc-stack { display: flex; gap: 5px; margin: 16px 0; height: 8px; }
.pc-stack i { height: 8px; border-radius: 5px; min-width: 6px; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #eef1f6; padding-top: 14px; margin-top: auto; gap: 8px; }
:root[data-theme="dark"] .pc-foot { border-top-color: var(--border); }
.pc-meta { display: flex; gap: 14px; color: #475467; font-size: 12.5px; font-weight: 600; } :root[data-theme="dark"] .pc-meta { color: var(--muted); }
.pc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.av-stack { display: flex; } .av-stack .avatar + .avatar { margin-left: -7px; }

/* ============== task board ============== */
.bd { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.bd-col { background: #e4e8f1; border-radius: 20px; padding: 12px; min-height: 360px; }
:root[data-theme="dark"] .bd-col { background: var(--surface-2); }
.bd-col.over { box-shadow: inset 0 0 0 2px var(--primary); }
.bd-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 700; }
.bd-h i { width: 10px; height: 10px; border-radius: 3px; }
.bd-h .n { background: var(--surface); color: #475467; border-radius: 20px; padding: 1px 9px; font-size: 11.5px; }
.bd-card { display: block; background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); color: var(--text); text-decoration: none !important; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.bd-card:hover { border-color: var(--border-2); box-shadow: 0 6px 18px rgba(16, 24, 40, .08); }
.bd-card[draggable="true"] { cursor: grab; }
.bd-card.dragging { opacity: .5; }
.bd-card .tp { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bd-card .tp .k { font-size: 11.5px; color: var(--faint); font-weight: 700; }
.bd-card b.tt { display: block; margin: 10px 0; font-weight: 600; line-height: 1.4; }
.bd-card .ft { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.bd-card .ft span { display: inline-flex; align-items: center; gap: 4px; }
.bd-card .ft .late { color: var(--red); font-weight: 600; }
.bd-card .ft .avatar { margin-left: auto; }
.bd-empty { text-align: center; color: var(--faint); font-size: 12.5px; padding: 18px 6px; border: 1.5px dashed #cfd5e1; border-radius: 14px; }
:root[data-theme="dark"] .bd-empty { border-color: var(--border-2); }
.pri-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; color: var(--text); }
.pri-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pri-dot.high::before, .pri-dot.urgent::before { background: var(--red-2); } .pri-dot.medium::before { background: var(--orange-2); }
.view-toggle { margin-left: auto; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .shell, .shell.slim { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s, box-shadow .2s; box-shadow: none; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 10px 0 30px rgba(0, 0, 0, .15); }
  .shell.slim .sidebar { align-items: stretch; padding: 18px 14px; }
  .shell.slim .brand-txt, .shell.slim .nav .lb, .shell.slim .nav .chev { display: flex; }
  .shell.slim .nav a, .shell.slim .nav .nav-group > button { justify-content: flex-start; padding: 10px 12px; }
  .shell.slim .nav-group.open .nav-sub { display: block; }
  .shell.slim .nav .count { position: static; min-width: 0; height: auto; padding: 0 7px; font-size: 11px; box-shadow: none; }
  .nav-collapse { display: none; }
  .topbar { padding: 0 14px; gap: 8px; height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar .icon-btn { width: 38px; height: 38px; }
  #quick-task { height: 38px; padding: 0 11px; } #quick-task span { display: none; }
  .search { flex: 0 1 auto; max-width: none; }
  .search input { width: 40px; padding: 9px 0 9px 36px; height: 38px; cursor: pointer; }
  .search input:focus { width: calc(100vw - 120px); position: relative; z-index: 5; }
  .search .search-ic { left: 11px; z-index: 6; }
  .me-btn > div, .me-btn .chev { display: none; } .me-btn { padding: 0; }
  .main { padding: 18px 14px 80px; background: var(--bg); }
  body, .shell { background: var(--bg); }
  h1 { font-size: 22px; }
  .db-hero h1 { font-size: 24px; }
  .bd { grid-auto-columns: 82%; }
}
@media (max-width: 820px) { .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(10, 16, 40, .35); z-index: 40; } }

/* project header strip */
.prj-strip { display: flex; align-items: center; gap: 22px; padding: 18px 22px; margin-bottom: 16px; flex-wrap: wrap; }
.prj-strip .sep { width: 1px; height: 44px; background: var(--border); }
@media (max-width: 700px) { .prj-strip .sep { display: none; } .prj-strip { gap: 14px 20px; } }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.pager:empty { display: none; }
.av-stack .avatar + .avatar { margin-left: -5px; }
.bd { grid-auto-columns: minmax(200px, 1fr); }
.bd-card .tp .act { margin-left: auto; padding: 2px 4px; color: var(--faint); border-radius: 8px; }
.bd-card .tp .act:hover { background: var(--gray-soft); color: var(--text); }

/* page titles: no icons, the menu already shows them */
h1 > span.ico, .page-head h1 > span.ico { display: none; }
.empty .big span.ico .svgi, .dash-empty > span span.ico .svgi { width: 1.2em; height: 1.2em; }
.bd-card .tp .k { white-space: nowrap; }
.db .wl-tbl th, .db .wl-tbl td { padding: 11px 8px; } .db .wl-tbl .act-btn { width: 30px; height: 30px; }
.db .wl-tbl { min-width: 0; } .db .wl-tbl .wl-act .act-cell { gap: 4px; } .db .wl-tbl .act-btn { width: 30px; height: 30px; font-size: 13px; }
/* board columns keep their own height and scroll inside */
.bd-col { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 230px); }
.bd-list { overflow-y: auto; min-height: 60px; margin: 0 -4px; padding: 0 4px 2px; scrollbar-width: thin; }
.bd-more { margin-top: 4px; border: 1.5px dashed #c3cad8; background: transparent; color: var(--primary); font-weight: 600; font-size: 12.5px; padding: 9px; border-radius: 12px; cursor: pointer; flex: none; }
.bd-more:hover { background: var(--surface); border-color: var(--primary); }
:root[data-theme="dark"] .bd-more { border-color: var(--border-2); }
@media (max-width: 820px) { .bd-col { max-height: 70vh; } }
.bd-card .ft { flex-wrap: nowrap; } .bd-card .ft .pill { flex: none; }

/* ---------- team chat: media ---------- */
.chat-panel { width: 380px; height: 560px; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-compose .icon-btn { width: 38px; height: 38px; flex: none; color: var(--muted); }
.chat-compose .icon-btn:hover { color: var(--primary); }
.chat-compose .btn-primary { height: 38px; padding: 0 12px; flex: none; }
.chat-body.drop-on .chat-msgs { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
.chat-pending { display: flex; gap: 8px; overflow-x: auto; padding: 10px 10px 0; background: var(--surface); border-top: 1px solid var(--border); scrollbar-width: thin; }
.cp-item { position: relative; flex: none; width: 150px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.cp-item img, .cp-ic { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.cp-ic { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.cp-n { min-width: 0; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; flex-direction: column; }
.cp-n small { font-weight: 500; color: var(--muted); }
.cp-item button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--text); color: var(--surface); font-size: 10px; cursor: pointer; line-height: 1; }
.msg { white-space: normal; }
.msg .mt { white-space: pre-wrap; }
.msg.has-media { padding: 4px; max-width: 82%; }
.msg.has-media .mt { padding: 6px 7px 0; }
.msg.has-media .t { padding: 0 7px 3px; }
.msg-img { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.msg-img img { display: block; max-width: 100%; max-height: 240px; min-width: 120px; object-fit: cover; }
.msg-video { display: block; width: 260px; max-width: 100%; max-height: 260px; border-radius: 10px; background: #000; }
.msg-audio { display: block; width: 250px; max-width: 100%; height: 40px; }
.msg-dl { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; margin: 6px 6px 0; color: inherit; opacity: .85; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .16); color: inherit; text-decoration: none !important; min-width: 210px; }
.msg.them .msg-file { background: var(--surface-2); color: var(--text); }
.msg-file .fi { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: none; }
.msg.them .msg-file .fi { background: var(--primary-soft); color: var(--primary); }
.msg-file .fn { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.msg-file .fn b { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file .fn small { font-size: 11px; opacity: .75; }
.msg-file.gone { opacity: .7; }
.chat-zoom { position: fixed; inset: 0; z-index: 400; background: rgba(8, 12, 30, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 14px; }
.chat-zoom img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.chat-zoom .bar { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; max-width: 100%; }
.chat-zoom .bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
@media (max-width: 820px) { .chat-panel { height: calc(100vh - 110px); } }
