/* Station Car Oxted - Team Workboard */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e5ee;
  --border-strong: #d2d5e2;
  --ink: #1c1d2b;
  --ink-2: #4f5468;
  --muted: #868ba0;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef0ff;
  --sidebar: #1e1b4b;
  --sidebar-ink: #c7c9f2;
  --danger: #d03b3b;
  --danger-50: #fdeeee;
  --good: #16a05a;
  --good-50: #e8f7ef;
  --warn-50: #fff6e5;

  --st-not_started: #c3c6d4;
  --st-working: #f5a524;
  --st-stuck: #d03b3b;
  --st-review: #8e4ec6;
  --st-done: #16a05a;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 50, .06);
  --shadow: 0 6px 24px rgba(20, 22, 50, .08), 0 1px 3px rgba(20, 22, 50, .06);
  --shadow-lg: 0 24px 60px rgba(20, 22, 50, .22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: #c3c6d6; }
.btn:focus-visible, .input:focus-visible, .icon-btn:focus-visible { outline: 3px solid rgba(79, 70, 229, .3); outline-offset: 1px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, .28); }
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(28, 29, 43, .05); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 44px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: rgba(28, 29, 43, .06); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink-2);
}
.seg input:checked + span { background: var(--primary-50); border-color: var(--primary); color: var(--primary-600); }
.seg input:focus-visible + span { outline: 3px solid rgba(79, 70, 229, .3); }
.toggle-group { display: inline-flex; background: #ebedf3; border-radius: 9px; padding: 3px; }
.toggle-group button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.toggle-group button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--warn-50); border: 1px solid #f6dfae; color: #7a4f00; font-size: 13px; margin-bottom: 16px; }
.alert.info { background: var(--primary-50); border-color: #d9dcfb; color: #3730a3; }
.alert.bad { background: var(--danger-50); border-color: #f5caca; color: #9b1c1c; }
.alert.ok { background: var(--good-50); border-color: #bfe8d1; color: #0f6b3c; }
.alert .i { margin-top: 1px; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -10%, #6d63ff 0%, transparent 55%), linear-gradient(150deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
}
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #6d63ff, #4f46e5); box-shadow: 0 6px 16px rgba(79, 70, 229, .45); color: #fff; }
.brand-mark svg.i { width: 22px; height: 22px; }
.brand small { display: block; font-weight: 500; font-size: 12px; opacity: .7; letter-spacing: 0; }
.auth-hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 16px; font-weight: 800; max-width: 460px; }
.auth-hero p { font-size: 16px; opacity: .82; max-width: 420px; margin: 0 0 28px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-points .dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.auth-points .dot svg.i { width: 16px; height: 16px; }
.auth-foot { font-size: 12px; opacity: .55; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; }
.auth-card .links { margin-top: 18px; text-align: center; font-size: 13px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: #fff; padding: 4px 8px 22px; font-size: 15px; }
.sidebar .brand-mark { width: 34px; height: 34px; }
.nav { display: grid; gap: 3px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8b8dc4; padding: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--sidebar-ink); text-decoration: none; font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .13); color: #fff; }
.nav a .count { margin-left: auto; background: var(--st-review); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: #8b8dc4; }
.side-foot .icon-btn { color: var(--sidebar-ink); }
.side-foot .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(244, 245, 249, .9); backdrop-filter: blur(8px); padding: 18px 28px 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { padding: 6px 28px 40px; }

/* ---------- Avatars, pills ---------- */
.av { --c: var(--primary); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: 11px; flex: none; letter-spacing: .02em; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.xl { width: 48px; height: 48px; font-size: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.st-bg-not_started { background: var(--st-not_started); color: #2b2d3a; }
.st-bg-working { background: var(--st-working); color: #1c1d2b; }
.st-bg-stuck { background: var(--st-stuck); color: #fff; }
.st-bg-review { background: var(--st-review); color: #fff; }
.st-bg-done { background: var(--st-done); color: #fff; }
.prio { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-low { background: #eef1f6; color: #55607a; }
.p-medium { background: #e8efff; color: #2958c9; }
.p-high { background: #fff0e4; color: #c2410c; }
.p-urgent { background: #ffe9e9; color: #c4262c; }
.chip { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px; background: #eef0f6; color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.active { background: var(--good-50); color: #0f6b3c; }
.badge.invited { background: var(--warn-50); color: #8a5a00; }
.badge.disabled { background: #eef0f4; color: var(--muted); }
.badge.admin { background: var(--primary-50); color: var(--primary-600); }
.badge.late { background: var(--danger-50); color: var(--danger); }

.bar { position: relative; height: 8px; border-radius: 99px; background: #e9ebf2; overflow: hidden; flex: 1; min-width: 50px; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--primary); transition: width .3s; }
.bar.done > span { background: var(--st-done); }
.bar.late > span { background: var(--st-stuck); }
.progress { display: flex; align-items: center; gap: 9px; width: 100%; }
.progress b { font-size: 12px; min-width: 34px; text-align: right; color: var(--ink-2); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 10px 18px 18px; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .big { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--primary-50); color: var(--primary); }
.empty .big svg.i { width: 26px; height: 26px; }
.empty h4 { color: var(--ink); margin: 0 0 4px; font-size: 16px; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.kpi .k-ico svg.i { width: 16px; height: 16px; }
.kpi .k-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; color: var(--ink); }
.kpi .k-hint { font-size: 12px; color: var(--muted); }
.ico-blue { background: var(--primary-50); color: var(--primary); }
.ico-amber { background: var(--warn-50); color: #b26b00; }
.ico-red { background: var(--danger-50); color: var(--danger); }
.ico-purple { background: #f4ecfb; color: var(--st-review); }
.ico-green { background: var(--good-50); color: var(--good); }

.segbar { display: flex; gap: 2px; height: 28px; margin: 6px 0 12px; }
.segbar > div { border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 700; overflow: hidden; white-space: nowrap; min-width: 4px; cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { color: var(--ink); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-grid > div { display: grid; gap: 18px; min-width: 0; }
.team-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) 64px 76px minmax(110px, 1.2fr) 74px; align-items: center; gap: 12px; padding: 11px 6px; border-top: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.team-row:hover { background: var(--surface-2); }
.team-row.head { cursor: default; border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 2px; }
.team-row.head:hover { background: none; }
.team-row .person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team-row .person b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-row .person small { color: var(--muted); }
.num { font-weight: 700; font-size: 15px; }
.num.bad { color: var(--danger); }
.feed { display: grid; }
.feed-item { display: flex; gap: 11px; padding: 11px 0; border-top: 1px solid var(--border); cursor: pointer; }
.feed-item:first-child { border-top: 0; }
.feed-item .txt { min-width: 0; flex: 1; font-size: 13px; color: var(--ink-2); }
.feed-item .txt b { color: var(--ink); }
.feed-item .txt .task-ref { color: var(--primary-600); font-weight: 600; }
.feed-item .txt q { display: block; color: var(--ink); margin-top: 3px; quotes: "\201C" "\201D"; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-item time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.att-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.att-item:first-child { border-top: 0; }
.att-item .t { flex: 1; min-width: 0; }
.att-item .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-item .t small { color: var(--muted); }
.due-late { color: var(--danger); font-weight: 600; }
.due-soon { color: #b26b00; font-weight: 600; }
.due-ok { color: var(--ink-2); }
.due-done { color: var(--good); font-weight: 600; }

.my-task { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 14px; padding: 14px 16px 14px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; margin-bottom: 10px; overflow: hidden; transition: box-shadow .15s; }
.my-task:hover { box-shadow: var(--shadow); }
.my-task .stripe { border-radius: 0 4px 4px 0; }
.my-task h4 { margin: 0 0 6px; font-size: 15px; }
.my-task .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.my-task .right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }

/* ---------- Board toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.search { position: relative; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search .input { padding-left: 34px; width: 230px; height: 36px; }
.toolbar select.input { width: auto; height: 36px; padding-right: 28px; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip-toggle.on { background: var(--danger-50); color: var(--danger); border-color: #f1b9b9; }
.toolbar .spacer { flex: 1; }

/* ---------- Board table (grouped) ---------- */
.group { margin-bottom: 26px; --gc: var(--primary); }
.group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--gc); font-weight: 700; font-size: 15px; cursor: pointer; user-select: none; width: fit-content; }
.group-head .chev { transition: transform .15s; }
.group.collapsed .group-head .chev { transform: rotate(-90deg); }
.group-head .cnt { color: var(--muted); font-weight: 500; font-size: 13px; }
.group.collapsed .tbl { display: none; }
.tbl-wrap { overflow-x: auto; border-radius: 10px; }
.tbl { min-width: 960px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--gc); border-radius: 10px; overflow: hidden; }
.tr { display: grid; grid-template-columns: minmax(220px, 1fr) 128px 156px 100px 168px 150px 62px; min-height: 46px; border-top: 1px solid var(--border); cursor: pointer; }
.tr:first-child { border-top: 0; }
.tr:not(.th):hover { background: #f7f8fd; }
.tr.th { cursor: default; min-height: 36px; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface); }
.td { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-left: 1px solid var(--border); min-width: 0; }
.td:first-child { border-left: 0; }
.th .td { justify-content: center; }
.th .td:first-child { justify-content: flex-start; }
.td-title { gap: 10px; }
.td-title .t-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-owner span.nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 13px; }
.td-status { justify-content: center; font-weight: 600; font-size: 13px; padding: 0 8px; border-left-color: rgba(255, 255, 255, .6); text-align: center; transition: filter .15s; }
.td-status:hover { filter: brightness(.95); }
.td-center { justify-content: center; }
.td-due { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; font-size: 13px; line-height: 1.3; }
.td-due small { color: var(--muted); font-size: 11px; }
.td-upd { justify-content: center; color: var(--muted); font-size: 12px; gap: 4px; }
.td-upd svg.i { width: 16px; height: 16px; }
.add-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border-top: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: 13px; }
.add-row:hover { background: #f7f8fd; color: var(--primary); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: #eceef5; border-radius: 12px; padding: 10px; min-height: 160px; transition: background .15s, box-shadow .15s; }
.kcol.drop { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 700; font-size: 13px; }
.kcol-head i { width: 10px; height: 10px; border-radius: 3px; }
.kcol-head .cnt { color: var(--muted); font-weight: 500; }
.kcard { background: var(--surface); border-radius: 10px; padding: 12px; margin-bottom: 9px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); cursor: pointer; }
.kcard:hover { box-shadow: var(--shadow); }
.kcard.dragging { opacity: .5; }
.kcard h4 { margin: 0 0 8px; font-size: 14px; line-height: 1.35; }
.kcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; }

/* ---------- Team ---------- */
.member-list { display: grid; }
.member { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1.2fr) 110px 90px 130px 44px; align-items: center; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--border); }
.member.head { border-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 14px; padding-bottom: 8px; }
.member .person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member .person b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .person small { color: var(--muted); }
.member .email { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member.off { opacity: .6; }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 18px; max-width: 760px; }
.settings .card-body { padding-top: 14px; }
.settings p.lead { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; word-break: break-all; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(17, 18, 40, .45); display: grid; place-items: center; padding: 20px; animation: fade .15s; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; margin: auto; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 4px; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-head .icon-btn { margin-left: auto; margin-top: -4px; }
.modal-body { padding: 16px 22px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.steps-edit { display: grid; gap: 8px; margin-bottom: 8px; }
.steps-edit .s { display: flex; align-items: center; gap: 8px; }
.steps-edit .n { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.deadline-preview { margin-top: 8px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.recipients { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; display: grid; gap: 8px; }

/* ---------- Drawer ---------- */
.drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(17, 18, 40, .3); animation: fade .15s; }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.dr-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.dr-top { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.dr-top .spacer { flex: 1; }
.dr-head h2 { margin: 0; font-size: 21px; letter-spacing: -.015em; line-height: 1.3; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.dr-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 18px; }
.dr-meta .m label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.dr-meta .m .v { display: flex; align-items: center; gap: 8px; font-weight: 600; min-height: 28px; }
.dr-meta .m .v small { font-weight: 500; }
.status-btn { border: 0; cursor: pointer; }
.status-btn:hover { filter: brightness(.95); }
.dr-progress { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.dr-progress .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.dr-progress .top b { font-size: 22px; letter-spacing: -.02em; }
.dr-progress .bar { height: 10px; }
.dr-progress input[type=range] { width: 100%; accent-color: var(--primary); margin-top: 10px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 15px; border-radius: 12px; margin-bottom: 18px; font-size: 13px; }
.banner .t { flex: 1; min-width: 200px; }
.banner.review { background: #f6effc; border: 1px solid #e3d0f4; color: #5b2a86; }
.banner.stuck { background: var(--danger-50); border: 1px solid #f5caca; color: #8f1d1d; }
.banner.late { background: var(--danger-50); border: 1px solid #f5caca; color: #8f1d1d; }
.banner.done { background: var(--good-50); border: 1px solid #bfe8d1; color: #0f6b3c; }
.banner.start { background: var(--primary-50); border: 1px solid #d9dcfb; color: #3730a3; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; border-color: currentColor; border-right-color: transparent; opacity: .85; }
.status-btn[disabled] { cursor: default; filter: none; }
.chk[disabled] { cursor: default; }
.sec { margin-bottom: 24px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sec-head h3 { margin: 0; font-size: 15px; }
.sec-head .cnt { color: var(--muted); font-size: 13px; }
.desc { white-space: pre-wrap; color: var(--ink-2); line-height: 1.6; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--border); }
.steps { display: grid; gap: 8px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.step.done { background: #f6fbf8; border-color: #cdebd9; }
.chk { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; margin-top: 1px; }
.chk:hover { border-color: var(--primary); }
.chk svg.i { width: 15px; height: 15px; stroke-width: 3; }
.step.done .chk { background: var(--st-done); border-color: var(--st-done); color: #fff; }
.step .body { flex: 1; min-width: 0; }
.step .st-title { font-weight: 600; }
.step.done .st-title { color: var(--ink-2); }
.step .st-note { margin-top: 5px; font-size: 13px; color: var(--ink-2); background: var(--surface); border-left: 3px solid var(--st-done); padding: 4px 10px; border-radius: 0 6px 6px 0; white-space: pre-wrap; }
.step .st-by { font-size: 11px; color: var(--muted); margin-top: 4px; }
.step-add { display: flex; gap: 8px; margin-top: 8px; }
.step-add .input { height: 36px; }
.composer { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; margin-bottom: 16px; background: var(--surface); }
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.composer textarea { width: 100%; border: 0; resize: vertical; min-height: 80px; padding: 12px 14px; outline: none; line-height: 1.5; }
.composer .bar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.timeline { display: grid; }
.tl { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.tl:first-child { border-top: 0; }
.tl .c { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
.tl .c .who { color: var(--ink); font-weight: 600; }
.tl .c time { color: var(--muted); font-size: 12px; margin-left: 6px; }
.tl .c .msg { margin-top: 6px; color: var(--ink); white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); padding: 9px 12px; border-radius: 4px 12px 12px 12px; line-height: 1.55; }
.tl.mgr .c .msg { background: var(--primary-50); border-color: #dcdffb; }
.tl .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef0f6; color: var(--ink-2); flex: none; }
.tl .ico svg.i { width: 14px; height: 14px; }
.tl .pill { height: 22px; font-size: 11px; padding: 0 8px; }

/* ---------- Popover menu ---------- */
.pop { position: fixed; z-index: 80; min-width: 210px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 6px; animation: pop .12s ease-out; }
.pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-weight: 500; }
.pop button:hover { background: var(--surface-2); }
.pop button.danger { color: var(--danger); }
.pop .swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.pop hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.pop .cur { margin-left: auto; color: var(--primary); }

/* ---------- Toast ---------- */
#toasts { position: fixed; z-index: 100; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #1c1d2b; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; display: flex; align-items: center; gap: 9px; animation: pop .18s ease-out; max-width: min(520px, 92vw); }
.toast.bad { background: var(--danger); }
.toast.ok svg.i { color: #5be39a; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; min-height: auto; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero p, .auth-points, .auth-foot { display: none; }
  .auth-hero { margin-top: 18px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 45; background: rgba(17, 18, 40, .35); }
  .topbar { padding: 14px 16px 10px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 4px 16px 32px; }
  .search .input { width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  /* table rows become cards */
  .tbl { min-width: 0; }
  .tr.th { display: none; }
  .tr { grid-template-columns: 1fr auto; grid-template-areas: "title status" "owner due" "progress progress"; gap: 8px 10px; padding: 12px; min-height: 0; }
  .tr .td { border-left: 0; padding: 0; }
  .tr .td:nth-child(1) { grid-area: title; flex-wrap: wrap; }
  .tr .td:nth-child(1) .t-title { white-space: normal; }
  .tr .td:nth-child(2) { grid-area: owner; }
  .tr .td:nth-child(3) { grid-area: status; border-radius: 999px; height: 28px; padding: 0 12px; font-size: 12px; }
  .tr .td:nth-child(4) { display: none; }
  .tr .td:nth-child(5) { grid-area: due; align-items: flex-end; text-align: right; }
  .tr .td:nth-child(6) { grid-area: progress; }
  .tr .td:nth-child(7) { display: none; }
  .team-row { grid-template-columns: minmax(0, 1fr) 54px 64px; }
  .team-row > :nth-child(4), .team-row > :nth-child(5) { display: none; }
  .member { grid-template-columns: minmax(0, 1fr) auto 44px; }
  .member > :nth-child(2), .member > :nth-child(4), .member > :nth-child(5) { display: none; }
  .member.head { display: none; }
  .dr-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { flex-direction: column; gap: 0; }
  .modal-back { padding: 0; align-items: end; }
  .modal { border-radius: 18px 18px 0 0; max-width: none; margin: auto 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal.wide { max-width: none; }
}
@media (min-width: 901px) {
  .app { background: linear-gradient(90deg, var(--sidebar) 244px, transparent 244px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Clock in / out ---------- */
.clock-box { margin-top: auto; margin-bottom: 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); display: grid; gap: 10px; }
.clock-box:empty { display: none; }
.clock-box + .side-foot { margin-top: 0; }
.cb-row { display: flex; gap: 10px; align-items: center; }
.cb-row b { display: block; color: #fff; font-size: 13px; }
.cb-row small { color: #a9abd9; font-size: 12px; }
.live-dot, .off-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.live-dot { background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .2); }
.off-dot { background: #7c7fae; }
.cb-btn { width: 100%; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }
.cb-btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); }
.cb-btn.in { background: var(--good); border-color: var(--good); }
.cb-btn.in:hover { background: #128a4c; }

.clock-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.clock-card.on { background: var(--good-50); border-color: #bfe8d1; }
.cc-main { display: flex; gap: 14px; align-items: center; min-width: 0; flex: 1 1 260px; }
.cc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.clock-card.on .cc-ico { background: #d3f2e1; color: var(--good); }
.cc-ico svg.i { width: 24px; height: 24px; }
.cc-title { font-weight: 700; font-size: 17px; }
.cc-sub { color: var(--ink-2); font-size: 14px; }
.cc-today { color: var(--muted); font-size: 13px; margin-top: 3px; }
.cc-btn { height: 48px; padding: 0 26px; font-size: 16px; border-radius: 11px; }

.in-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--border); }
.in-row:first-child { border-top: 0; }
.in-row .t { flex: 1; min-width: 0; }
.in-row .t b { display: block; }
.in-row .t small { color: var(--muted); }

.day-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 80px; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.day-row:first-child { border-top: 0; }
.day-shifts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); }
.day-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.att-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tbl-scroll { overflow-x: auto; }
.att-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.att-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.att-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.att-table tbody tr:last-child td { border-bottom: 0; }
.att-table tfoot td { border-top: 2px solid var(--border-strong); font-weight: 700; padding-top: 12px; }
.att-table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.att-table .nowrap { white-space: nowrap; }
.att-table .note-col { color: var(--ink-2); min-width: 140px; }
.att-table .icon-btn { width: 30px; height: 30px; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell small { display: block; color: var(--muted); font-size: 12px; }
.print-only { display: none; }

@media (max-width: 1100px) { .att-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .day-row { grid-template-columns: 1fr auto; }
  .day-row .day-shifts { grid-column: 1 / -1; grid-row: 2; }
  .cc-btn { width: 100%; }
}

/* ---------- Printing (Attendance page) ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .toolbar, .no-print, #drawer-root, #modal-root, #toasts, #pop-root { display: none !important; }
  .app { display: block; background: none; }
  .content { padding: 0; }
  .print-only { display: block; }
  .print-head h2 { margin: 0 0 4px; font-size: 18px; }
  .print-head p { margin: 0 0 14px; color: #555; }
  .att-grid { display: block; }
  .card { box-shadow: none; border: 1px solid #ccc; margin-bottom: 14px; break-inside: avoid; }
  .att-table tr { break-inside: avoid; }
  .av { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
.cc-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: #8f1d1d; font-size: 13px; font-weight: 500; }
.cc-warn svg.i { width: 15px; height: 15px; margin-top: 2px; }

/* ---------- App install + updates ---------- */
.install-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.install-steps > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--ink-2); }
.install-steps > div.here { border-color: var(--primary); background: var(--primary-50); }
.install-steps ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.update-bar { position: fixed; z-index: 90; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: #1c1d2b; color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
@media (max-width: 900px) { .install-steps { grid-template-columns: 1fr; } }
@media (display-mode: standalone) { .topbar { padding-top: calc(14px + env(safe-area-inset-top, 0px)); } }
