:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #1d4ed8;
  --brand-2: #1f5fd6;
  --brand-soft: #e8f0fe;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --blue-soft: #eff6ff;
  --sidebar: #0b2350;
  --sidebar-text: #c7d6f2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --panel: #121826;
    --panel-2: #0f1522;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1f2937;
    --brand: #7aa7ff;
    --brand-2: #2f6fe4;
    --brand-soft: #0f2550;
    --green: #34d399;
    --green-soft: #052e22;
    --amber: #fbbf24;
    --amber-soft: #2a1f05;
    --red: #f87171;
    --red-soft: #2b0f0f;
    --blue-soft: #0c1a33;
    --sidebar: #071733;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.error { color: var(--red); min-height: 1em; margin: 0; font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- buttons & inputs ---------- */
.btn { border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--panel-2); }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand-2); padding: 0; flex: none; }
input[type=color] { padding: 2px; height: 38px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 35%, #2f6fe4, #163f96 55%, #0b2350); }
.login-card { background: var(--panel); width: 100%; max-width: 390px; padding: 28px; border-radius: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); }
.login-logo { width: 150px; height: 150px; border-radius: 22px; object-fit: cover; margin: 0 auto 4px; box-shadow: 0 10px 25px rgba(29, 78, 216, .35); }
.login-card h2 { font-size: 19px; }

/* ---------- layout ---------- */
.app { display: flex; height: 100%; }
.sidebar { width: 236px; flex: none; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 16px 12px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; color: inherit; }
.brand strong { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.brand small { color: #8fb0e8; font-size: 12px; }
.logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
#nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--sidebar-text); font-weight: 500; font-size: 14.5px; }
#nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
#nav a.active { background: #1f5fd6; color: #fff; box-shadow: 0 4px 12px rgba(31, 95, 214, .35); }
#nav .ico { opacity: .9; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: #6f8fc7; padding: 14px 12px 4px; font-weight: 600; }
.count { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.count.warn { background: #f59e0b; }
.count:empty { display: none; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.me .who { flex: 1; min-width: 0; }
.me .who strong { color: #fff; display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who a { color: #8fb0e8; font-size: 12px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--panel); }
.title-wrap { flex: 1; min-width: 0; }
.topbar h1 { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-hint { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-hint:empty { display: none; }
.menu-btn { display: none; }
.quick { position: relative; }
.quick-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); padding: 6px; min-width: 240px; z-index: 45; }
.quick-menu button { display: flex; width: 100%; align-items: center; gap: 12px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.quick-menu button:hover { background: var(--brand-soft); }
.quick-menu button .qi { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.quick-menu button b { display: block; font-weight: 600; }
.quick-menu button small { color: var(--muted); font-size: 12px; }
.bottom-nav { display: none; }

/* tabs & data tables (clients & leads) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
table.data td:first-child { min-width: 150px; }
.tab { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tab span { background: var(--panel-2); border: 1px solid var(--border); border-radius: 99px; padding: 0 7px; font-size: 11px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand-2); }
.tab.on span { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
table.data th { background: var(--panel-2); position: sticky; top: 0; white-space: nowrap; padding: 10px; }
table.data td { padding: 9px 10px; vertical-align: middle; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tr.unreached td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.cname { font-weight: 600; color: var(--text); }
.cname:hover { color: var(--brand); }
.nowrap { white-space: nowrap; }
.mini-link { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--brand-soft); }
.reach { font-size: 12px; font-weight: 700; white-space: nowrap; }
.reach.yes { color: var(--green); }
.reach.no { color: var(--red); }
.pill-select, .cell-select, .cell-date { width: auto; padding: 4px 8px; font-size: 12.5px; border-radius: 8px; }
.cell-select { max-width: 150px; }
.cell-date { max-width: 140px; }
.cell-date.late { border-color: var(--amber); color: var(--amber); font-weight: 600; }
.pill-select { font-weight: 600; border-radius: 99px; }
.pill-select.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill-select.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill-select.blue { background: var(--blue-soft); color: #2563eb; border-color: transparent; }
.pill-select.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill-select.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.quick-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr .9fr .9fr auto; gap: 8px; margin-bottom: 12px; background: var(--panel); border: 1px dashed var(--brand-2); border-radius: 12px; padding: 10px; }
.lead-card.unreached { border-left: 4px solid var(--red); }
.stage-bar button:disabled { cursor: default; opacity: .7; }
.perm-table th, .perm-table td { padding: 9px 10px; }
.perm-table tr.group td { background: var(--panel-2); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); font-weight: 700; }
.tick.on { background: var(--green-soft); color: var(--green); }
.badge.role-admin { background: #0b2350; color: #fff; border-color: transparent; }
.badge.role-manager { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.role-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; background: rgba(255, 255, 255, .14); color: #fff; padding: 1px 6px; border-radius: 5px; }

/* HR */
.warn-count { background: #f59e0b !important; color: #fff !important; border: 0 !important; }
.att-card .big-status { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.big { padding: 12px 20px; font-size: 15px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 16px; background: var(--panel-2); border-radius: 12px; padding: 10px; text-align: center; }
.mini-stats b { display: block; font-size: 20px; color: var(--brand); }
.mini-stats span { font-size: 11.5px; color: var(--muted); }
b.bad, td.bad, .mini-stats b.bad { color: var(--red); }
b.warnc, .mini-stats b.warnc { color: var(--amber); }
.mini-stats b.goodc { color: var(--green); }
.att-pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.att-pill.p { background: var(--green-soft); color: var(--green); }
.att-pill.h { background: var(--amber-soft); color: var(--amber); }
.att-pill.a { background: var(--red-soft); color: var(--red); }
.att-pill.l { background: var(--blue-soft); color: #2563eb; }
.att-pill.hol { background: #f3e8ff; color: #7c3aed; }
.att-pill.pend { background: var(--panel-2); color: var(--muted); border: 1px dashed var(--border); }
.mark-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; }
.mark-btn:hover { border-color: var(--brand-2); color: var(--text); }
.mark-btn.on.p { background: var(--green); border-color: var(--green); color: #fff; }
.mark-btn.on.h { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.mark-btn.on.a { background: var(--red); border-color: var(--red); color: #fff; }
.date-chip { width: 42px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); text-align: center; padding: 4px 0; flex: none; }
.date-chip b { display: block; font-size: 16px; line-height: 1.1; }
.date-chip span { font-size: 10.5px; text-transform: uppercase; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin-bottom: 10px; align-items: center; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.legend i.dc { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-style: normal; font-weight: 700; font-size: 11px; }
table.register { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.register th, table.register td { padding: 0; border-bottom: 1px solid var(--border); text-align: center; }
table.register th { font-size: 11px; padding: 6px 0; min-width: 26px; color: var(--muted); background: var(--panel-2); }
table.register th small { display: block; font-size: 9.5px; font-weight: 500; }
table.register th.we { color: var(--red); }
table.register th.today { background: var(--brand-2); color: #fff; }
table.register .sticky { position: sticky; left: 0; background: var(--panel); z-index: 1; text-align: left; padding: 6px 10px; min-width: 150px; border-right: 1px solid var(--border); }
table.register th.sticky { background: var(--panel-2); }
table.register .sum { min-width: 38px; padding: 6px 4px; background: var(--panel-2); font-size: 12px; }
td.dc { height: 32px; font-weight: 700; font-size: 11.5px; }
.dc.p { background: var(--green-soft); color: var(--green); }
.dc.h { background: var(--amber-soft); color: var(--amber); }
.dc.a { background: var(--red-soft); color: var(--red); }
.dc.l { background: var(--blue-soft); color: #2563eb; }
.dc.hol { background: #f3e8ff; color: #7c3aed; }
.dc.off { color: var(--border); }
.dc.pend { color: var(--muted); }
td.dc.late { box-shadow: inset 0 -3px 0 #f59e0b; }
td.dc[data-act] { cursor: pointer; }
td.dc[data-act]:hover { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.bal { background: var(--panel); border: 1px solid var(--border); border-top: 4px solid var(--c); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.bal-num { font-size: 30px; font-weight: 800; color: var(--c); line-height: 1; }
.bal-num small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.dot-c { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.lv-info { background: var(--brand-soft); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.lv-info.bad { background: var(--red-soft); color: var(--red); }
.hol-row { grid-template-columns: 160px 1fr 160px auto; }
tr.past td { opacity: .55; }
.lt-row { display: grid; grid-template-columns: 80px 1fr 110px 110px 46px auto; gap: 8px; align-items: end; }
.lt-row label { font-size: 11px; }
.wd { display: flex; gap: 4px; }
.wd label { flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .att-pill.hol, .dc.hol { background: #2a1748; color: #c4b5fd; }
}

/* chat attachments */
.chat-main { position: relative; }
.msg-body { min-width: 0; max-width: 100%; }
.att-imgs { display: grid; gap: 4px; margin-top: 6px; max-width: 420px; }
.att-imgs.n1 { grid-template-columns: 1fr; }
.att-imgs.n2, .att-imgs.n4 { grid-template-columns: 1fr 1fr; }
.att-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.att-imgs a { display: block; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--border); }
.att-imgs img { display: block; width: 100%; height: 100%; max-height: 320px; object-fit: cover; transition: transform .15s; }
.att-imgs.n1 img { object-fit: contain; height: auto; max-height: 340px; background: var(--panel-2); }
.att-imgs:not(.n1) img { aspect-ratio: 1; }
.att-imgs a:hover img { transform: scale(1.03); }
.file-card { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 12px 8px 8px; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; max-width: 360px; color: var(--text); text-decoration: none; }
.file-card:hover { border-color: var(--brand-2); }
.file-card .dl { margin-left: auto; color: var(--brand); font-weight: 700; }
.file-ico { width: 40px; height: 40px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; flex: none; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: var(--muted); font-size: 11.5px; }
.file-meta .progress { margin-top: 4px; height: 4px; }
.composer form { align-items: flex-end; }
.attach-btn { width: 42px; height: 42px; flex: none; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.attach-btn:hover { color: var(--brand); border-color: var(--brand-2); background: var(--brand-soft); }
.pending-files { display: flex; gap: 8px; overflow-x: auto; }
.pending-files:not(:empty) { margin-bottom: 8px; padding-bottom: 2px; }
.pending { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 4px 6px 6px; background: var(--panel-2); width: 230px; flex: none; }
.pending img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.pending.err { border-color: var(--red); }
.pending.err small { color: var(--red); }
.pending .icon-btn { font-size: 13px; padding: 4px 6px; }
#send-btn:disabled { opacity: .55; }
.drop-hint { display: none; position: absolute; inset: 60px 12px 90px; border: 3px dashed var(--brand-2); border-radius: 16px; background: color-mix(in srgb, var(--brand-soft) 85%, transparent); color: var(--brand); font-weight: 700; font-size: 16px; place-items: center; z-index: 5; pointer-events: none; text-align: center; padding: 16px; }
.chat-main.dropping .drop-hint { display: grid; }
.lightbox { background: #0b1220; border-radius: 12px; display: grid; place-items: center; min-height: 200px; }
.lightbox img { max-width: 100%; max-height: 70vh; display: block; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.img-grid a { border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.img-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.chat-head .btn .lbl { display: inline; }

/* admin console & notifications */
.bell-wrap { position: relative; }
.bell-btn { position: relative; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.bell-btn:hover { color: var(--brand); border-color: var(--brand-2); }
.bell-btn .count { position: absolute; top: -6px; right: -6px; margin: 0; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 370px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 45px rgba(15, 23, 42, .2); z-index: 46; overflow: hidden; }
.bell-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-list { max-height: 65vh; overflow-y: auto; }
.notif { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; padding: 11px 14px; cursor: pointer; align-items: flex-start; }
.notif:hover { background: var(--panel-2); }
.notif.unread { background: var(--brand-soft); }
.notif.unread.pr-urgent { background: var(--red-soft); }
.notif.unread.pr-important { background: var(--amber-soft); }
.notif .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif b { font-size: 13px; font-weight: 600; }
.notif small { font-size: 11.5px; }
.notif .nb { color: var(--text); opacity: .8; }
.udot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-2); flex: none; margin-top: 5px; }
.n-ico { font-size: 18px; line-height: 1.2; flex: none; }
.toast.warn { background: #b45309; }
.sent-item .title { white-space: normal; }
.urgent-box { border-left: 4px solid var(--red); background: var(--red-soft); padding: 12px 14px; border-radius: 8px; color: var(--text); }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.req-card { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid #f59e0b; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.cards .req-card { box-shadow: none; margin-bottom: 10px; }
.req-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.req-reason { font-style: italic; color: var(--text); margin-bottom: 4px; }
.cell-input { padding: 5px 8px; font-size: 13px; min-width: 200px; }
.seg-radio { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg-radio label { flex-direction: row; align-items: center; gap: 6px; padding: 8px 14px; cursor: pointer; font-weight: 500; border-right: 1px solid var(--border); }
.seg-radio label:last-child { border-right: 0; }
.seg-radio input { width: auto; accent-color: var(--brand-2); }
.seg-radio label:has(input:checked) { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.seg-radio label.pr-urgent:has(input:checked) { background: var(--red-soft); color: var(--red); }
.seg-radio label.pr-important:has(input:checked) { background: var(--amber-soft); color: var(--amber); }
.notify-people { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel-2); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.person-pick { flex-direction: row; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 500; }
.person-pick:has(input:checked) { border-color: var(--brand-2); background: var(--brand-soft); }
.person-pick span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.person-pick small { color: var(--muted); font-size: 11px; font-weight: 400; }
.bal-chip { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-weight: 600; }
.bal-chip b { font-size: 14px; }

/* layout without the left menu (everyone except admins) */
.top-brand, .me-wrap { display: none; }
.app.no-sidebar .sidebar, .app.no-sidebar .scrim, .app.no-sidebar .menu-btn { display: none !important; }
.app.no-sidebar .top-brand { display: block; flex: none; }
.app.no-sidebar .top-brand img { width: 40px; height: 40px; border-radius: 10px; display: block; object-fit: cover; }
.app.no-sidebar .me-wrap { display: block; position: relative; }
.home-btn { font-size: 14px; }
.me-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 99px; padding: 4px 12px 4px 4px; font: inherit; font-weight: 600; cursor: pointer; }
.me-btn:hover { border-color: var(--brand-2); }
.me-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 270px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 45px rgba(15, 23, 42, .2); z-index: 46; padding: 6px; display: flex; flex-direction: column; }
.me-menu.hidden { display: none; }
.me-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.me-head b { display: block; }
.me-head small { display: block; font-size: 12px; }
.role-pill { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 5px; margin: 2px 0; }
.me-menu a, .me-menu button { display: block; text-align: left; padding: 10px 12px; border-radius: 9px; color: var(--text); font: inherit; border: 0; background: transparent; cursor: pointer; }
.me-menu a:hover, .me-menu button:hover { background: var(--brand-soft); }
.me-menu .danger { color: var(--red); }
@media (max-width: 760px) {
  .app.no-sidebar .me-wrap { display: none; } /* phones use "Me" in the bottom bar */
  .app.no-sidebar .me-wrap:has(.me-menu:not(.hidden)) { display: block; }
  .me-btn .me-name, .home-btn .lbl { display: none; }
  .app.no-sidebar .top-brand img { width: 34px; height: 34px; }
  .me-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 74px; width: auto; }
}

/* home launchpad tiles */
.hero-home .clock { text-align: right; }
.hero-home .clock b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1; color: #fff; }
.hero-home .clock span { color: #c7d6f2; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { --c: #1f5fd6; --bg: #e8f0fe; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 118px; padding: 16px; border: 1px solid transparent; border-radius: 16px; background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15, 23, 42, .14); border-color: var(--c); }
.tile:active { transform: translateY(0) scale(.97); }
.tile-ico { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.tile-label { font-weight: 700; font-size: 16px; color: var(--c); }
.tile-sub { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tile-count { position: absolute; top: 12px; right: 12px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 99px; background: var(--c); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.tile.alert .tile-count { background: #ef4444; animation: pulse 1.6s ease-in-out infinite; }
.tile.alert .tile-sub { color: #dc2626; font-weight: 600; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); } 50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } }
.tile-blue { --c: #1d4ed8; --bg: #e8f0fe; }
.tile-green { --c: #047857; --bg: #e7f8f0; }
.tile-purple { --c: #7c3aed; --bg: #f3ecff; }
.tile-indigo { --c: #4338ca; --bg: #eceefe; }
.tile-amber { --c: #b45309; --bg: #fff5e1; }
.tile-teal { --c: #0f766e; --bg: #e3f7f5; }
.tile-pink { --c: #be185d; --bg: #fdeaf3; }
.tile-slate { --c: #334155; --bg: #eef1f5; }
.tile-orange { --c: #c2410c; --bg: #fff0e6; }
.tile-sky { --c: #0369a1; --bg: #e4f4fd; }
.tile-red { --c: #b91c1c; --bg: #fdecec; }
.tile-att { grid-column: span 2; flex-direction: row; align-items: center; gap: 16px; color: #fff; border: 0; }
.tile-att .tile-ico.big { font-size: 46px; margin: 0; }
.tile-att .tile-text { display: flex; flex-direction: column; gap: 4px; }
.tile-att .tile-label { color: #fff; font-size: 24px; font-weight: 800; }
.tile-att .tile-sub { color: rgba(255, 255, 255, .88); font-size: 13.5px; }
.tile-att.att-go { background: linear-gradient(120deg, #059669, #10b981); }
.tile-att.att-in { background: linear-gradient(120deg, #b91c1c, #ef4444); }
.tile-att.att-done { background: linear-gradient(120deg, #334155, #64748b); }
.tile-att.att-leave, .tile-att.att-off { background: linear-gradient(120deg, #0369a1, #38bdf8); }
.tile-att.att-holiday { background: linear-gradient(120deg, #7c3aed, #a78bfa); }
.tile-att.att-go:hover, .tile-att.att-in:hover { border-color: transparent; box-shadow: 0 14px 30px rgba(5, 150, 105, .35); }
@media (prefers-color-scheme: dark) {
  .tile { --bg: #16213a; }
  .tile-label { filter: brightness(1.6); }
  .tile-att .tile-label { filter: none; }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 104px; padding: 13px; }
  .tile-label { font-size: 15px; }
  .tile-att .tile-label { font-size: 20px; }
  .hero-home .clock { text-align: left; }
  .hero-home .clock b { font-size: 26px; }
}

/* birthdays */
.li.bday.today { background: linear-gradient(90deg, #fff7ed, transparent); border-radius: 10px; }
@media (prefers-color-scheme: dark) { .li.bday.today { background: linear-gradient(90deg, #3a2410, transparent); } }

/* payroll */
.pay-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.pay-line.total { border-bottom: 0; border-top: 2px solid var(--border); margin-top: 2px; font-size: 14.5px; }
.pay-line.total b { color: var(--brand); }
.pay-row { display: grid; grid-template-columns: 1fr 130px auto; gap: 6px; }
.pay-row input { padding: 6px 9px; }
.pay-summary { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.net-big { font-weight: 800; color: var(--brand); font-size: 16px; }
.slip-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.warn-card { border-left: 4px solid #f59e0b; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.slip-list { display: flex; flex-direction: column; gap: 8px; }
.slip-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.slip-row:hover { border-color: var(--brand-2); }
.slip-row .grow { flex: 1; min-width: 0; }
.slip-row .title { font-weight: 600; }
.slip-row .sub { color: var(--muted); font-size: 12px; }
.slip-month { width: 48px; text-align: center; background: var(--brand-soft); color: var(--brand); border-radius: 10px; padding: 6px 0; flex: none; }
.slip-month b { display: block; font-size: 14px; text-transform: uppercase; }
.slip-month span { font-size: 11px; font-weight: 600; }
.slip-net { text-align: right; font-weight: 800; font-size: 17px; color: var(--green); white-space: nowrap; }
.slip-net small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* search */
.search-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; min-width: 230px; }
.search-btn:hover { border-color: var(--brand-2); color: var(--text); }
.search-btn .lbl { flex: 1; text-align: left; }
kbd { font: 600 11px Inter, sans-serif; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--panel); color: var(--muted); }
.search-results { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow-y: auto; }
.sr { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.sr .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr:hover, .sr.on { background: var(--brand-soft); }

/* interactive dashboard */
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stat { transition: transform .12s, box-shadow .12s, border-color .12s; }
.stat:hover { transform: translateY(-2px); border-color: var(--brand-2); box-shadow: 0 8px 20px rgba(31, 95, 214, .15); }
.stat.on { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-soft), 0 8px 20px rgba(31, 95, 214, .15); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--muted); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip span { background: var(--panel-2); border-radius: 99px; padding: 0 6px; font-size: 11px; }
.chip:hover { border-color: var(--brand-2); color: var(--text); }
.chip.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.chip.on span { background: rgba(255, 255, 255, .22); }
.quick-add { margin-bottom: 6px; }
.quick-add input { border-style: dashed; background: var(--panel-2); padding: 10px 12px; }
.quick-add input:focus { border-style: solid; background: var(--panel); }
.li .title .badge { margin-left: 4px; vertical-align: 1px; }
.fu { align-items: flex-start; }
.fu-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.next-btn.ghost { border-color: var(--border); background: transparent; color: var(--muted); }
.next-btn.ghost:hover { background: var(--panel-2); color: var(--text); }
a.next-btn { display: inline-block; }
.workload { display: flex; flex-direction: column; gap: 4px; }
.wl { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; cursor: pointer; }
.wl:hover { background: var(--panel-2); }
.wl .grow { flex: 1; min-width: 0; }
.bar { display: flex; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand-2); transition: width .4s; }
.bar i.late { background: var(--red); }
.card.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--brand-2); } 100% { box-shadow: var(--shadow); } }
.li { transition: background .12s; }
.kcard { transition: transform .12s, border-color .12s; }
.kcard:hover { transform: translateY(-1px); }
.confetti { position: fixed; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; z-index: 70; animation: confetti .85s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* welcome / quick start */
.hero { background: linear-gradient(120deg, #0b2350, #1f5fd6); color: #fff; border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: 0 10px 30px rgba(31, 95, 214, .25); }
.hero h2 { font-size: 21px; }
.hero p { margin: 4px 0 0; color: #c7d6f2; }
.hero .grow { flex: 1; min-width: 220px; }
.hero .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, .24); }
.hero .btn.white { background: #fff; color: #0b2350; border-color: #fff; }
.setup { border: 2px dashed var(--brand-2); background: var(--brand-soft); }
.setup ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.setup li { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 10px; padding: 10px 12px; }
.setup li .n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.setup li.ok .n { background: var(--green); }
.setup li.ok span { text-decoration: line-through; color: var(--muted); }
.next-btn { border: 1px solid var(--brand-2); background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.next-btn:hover { background: var(--brand-2); color: #fff; }
.next-btn.done { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.next-btn.done:hover { background: var(--green); color: #fff; }
.view { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }
.scrim { display: none; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card > h2, .card-head { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { flex: 1; }
.cards { display: grid; gap: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols > *, .cards > * { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { font-size: 26px; display: block; letter-spacing: -.5px; color: var(--brand); }
.stat span { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat.warn b { color: var(--amber); }
.stat.bad b { color: var(--red); }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.li:last-child { border-bottom: 0; }
.li:hover { background: var(--panel-2); }
.li .grow { flex: 1; min-width: 0; }
.li .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li.done .title { text-decoration: line-through; color: var(--muted); }

/* ---------- badges / avatars ---------- */
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: #2563eb; border-color: transparent; }
.pri-urgent { color: var(--red); }
.pri-high { color: var(--amber); }
.av { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; flex: none; position: relative; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av.sm { width: 22px; height: 22px; font-size: 9px; }
.av.empty { background: var(--border); color: var(--muted); }
.av .dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; border: 2px solid var(--panel); }
.progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), #0891b2); border-radius: 99px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input { width: auto; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand-soft); color: var(--brand); }

/* ---------- kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 140px; display: flex; flex-direction: column; gap: 8px; }
.kcol.over { outline: 2px dashed var(--brand-2); }
.kcol h3 { font-size: 13px; display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.kcol h3 .badge { margin-left: auto; }
.kcard { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 7px; }
.kcard:hover { border-color: var(--brand-2); }
.kcard.dragging { opacity: .45; }
.kcard .t { font-weight: 600; font-size: 13px; }
.kcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.kcard .meta .av { margin-left: auto; }
.kadd { border: 1px dashed var(--border); background: transparent; color: var(--muted); border-radius: 9px; padding: 7px; cursor: pointer; font: inherit; }
.kadd:hover { color: var(--brand); border-color: var(--brand-2); }

/* ---------- SOPs ---------- */
.sop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 22px; }
.sop-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.sop-card:hover { border-color: var(--brand-2); }
.sop-card p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 6px 0 10px; font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); counter-increment: s; }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.steps p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.step-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.step-row textarea { grid-column: 1 / -1; min-height: 44px; }

/* ---------- checklist ---------- */
.checklist { display: flex; flex-direction: column; }
.checklist label { flex-direction: row; align-items: flex-start; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-weight: 400; cursor: pointer; }
.checklist label:last-child { border-bottom: 0; }
.checklist label.done span { text-decoration: line-through; color: var(--muted); }
.checklist input { margin-top: 2px; }

/* ---------- client / detail ---------- */
.stage-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-bar button { border: 1px solid var(--border); background: var(--panel); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.stage-bar button.on { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.tp { display: flex; gap: 10px; }
.tp .body { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.tp .body p { margin: 4px 0 0; white-space: pre-wrap; }

/* ---------- team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member { display: flex; flex-direction: column; gap: 10px; }
.member.inactive { opacity: .55; }
.member .top { display: flex; gap: 12px; align-items: center; }
.member .nums { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 6px; background: var(--panel-2); border-radius: 10px; padding: 8px; }
.member .nums b { display: block; font-size: 17px; }
.member .nums span { font-size: 11px; color: var(--muted); }
.skills { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; }

/* ---------- chat ---------- */
.view.chat-view { padding: 0; overflow: hidden; display: flex; }
.chat { display: flex; flex: 1; min-height: 0; }
.chat-side { width: 250px; flex: none; border-right: 1px solid var(--border); background: var(--panel); overflow-y: auto; padding: 14px 10px; }
.chat-side h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 8px 6px; display: flex; align-items: center; }
.chat-side h4 button { margin-left: auto; font-size: 15px; padding: 0 6px; }
.chat-link { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--text); cursor: pointer; }
.chat-link:hover { background: var(--panel-2); }
.chat-link.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chat-link.unread { font-weight: 700; }
.chat-link .count { margin-left: auto; background: var(--brand-2); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--panel); display: flex; align-items: center; gap: 10px; }
.chat-head .back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 3px 0; }
.msg .av { margin-top: 2px; }
.msg.cont { padding-left: 38px; }
.msg .who { font-weight: 600; font-size: 13px; }
.msg .who time { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 6px; }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.msg.mine .who { color: var(--brand); }
.day-sep { text-align: center; color: var(--muted); font-size: 11px; margin: 12px 0 6px; font-weight: 600; }
.composer { padding: 12px 18px 16px; background: var(--panel); border-top: 1px solid var(--border); }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 160px; resize: none; }
.typing { font-size: 12px; color: var(--muted); height: 16px; margin-bottom: 4px; }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); border-radius: 14px; display: flex; flex-direction: column; box-shadow: 0 25px 60px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 760px; }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal header h3 { flex: 1; font-size: 16px; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal footer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0, 0, 0, .25); font-size: 13px; max-width: 360px; cursor: pointer; animation: pop .2s ease-out; }
.toast.error { background: #b91c1c; }
.toast.ok { background: #047857; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 30; }
  .menu-btn { display: none; }
  .topbar { padding: 10px 16px; }
  .quick .btn .lbl { display: none; }
  .search-btn { min-width: 0; width: 42px; height: 42px; justify-content: center; border-radius: 50%; padding: 0; }
  .search-btn .lbl, .search-btn kbd { display: none; }
  .quick-row, .hol-row { grid-template-columns: 1fr 1fr; }
  .bell-btn { border-radius: 50%; }
  .slip-row { flex-wrap: wrap; }
  .slip-row .grow { flex-basis: calc(100% - 70px); }
  .pay-row { grid-template-columns: 1fr 100px auto; }
  .req-grid { grid-template-columns: 1fr; }
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .lt-row { grid-template-columns: 70px 1fr 40px auto; }
  .lt-row label { grid-row: 2; }
  .quick-row input[name=name], .quick-row button { grid-column: 1 / -1; }
  .quick .btn { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; }
  .page-hint { display: none; }
  .view { padding: 16px 16px 90px; }
  .view.chat-view { padding-bottom: 64px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--panel); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; position: relative; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav .count { position: absolute; top: 0; left: 55%; margin: 0; }
  .hero { padding: 16px; }
  .hero h2 { font-size: 18px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .chat-side { width: 100%; border-right: 0; }
  .chat.has-active .chat-side { display: none; }
  .chat:not(.has-active) .chat-main { display: none; }
  .chat-head .back { display: inline-block; }
  .msgs, .composer, .chat-head { padding-left: 16px; padding-right: 16px; }
  .toolbar select, .toolbar input { min-width: 0; flex: 1; }
}
