/* =====================================================================
   CPA Practice CRM — white & dark-green theme
   ===================================================================== */
:root {
  --g950: #072a1f;
  --g900: #0b3b2c;
  --g800: #0f4d3a;
  --g700: #146b4f;
  --g600: #1a8562;
  --g200: #bfe0d1;
  --g100: #e5f2ec;
  --g50:  #f2f8f5;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --border: #e2e8e5;
  --border-strong: #cfd8d4;
  --text: #15211d;
  --text-2: #3d4b46;
  --muted: #6b7a74;
  --good: #15803d;  --good-bg: #e7f6ec;
  --warn: #c2410c;  --warn-bg: #fff0e5;
  --bad:  #dc2626;  --bad-bg:  #fdecec;
  --info: #1d4ed8;  --info-bg: #eaf0fd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .05), 0 1px 3px rgba(16, 40, 30, .04);
  --shadow-lg: 0 10px 30px rgba(10, 40, 30, .14);
  --sidebar: 236px;
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--g700); text-decoration: none; }
a:hover { color: var(--g800); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.txt-good { color: var(--good); } .txt-warn { color: var(--warn); } .txt-bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0 } .mt8 { margin-top: 8px } .mt16 { margin-top: 16px } .mt24 { margin-top: 24px }
.mb8 { margin-bottom: 8px } .mb16 { margin-bottom: 16px }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------------- Shell ---------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--g900); color: #d8ebe3;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40;
  transition: transform .2s;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; color: var(--g800); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: #9cc5b4; }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px;
  color: #cfe5db; font-weight: 500; margin-bottom: 2px; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: #fff; color: var(--g900); font-weight: 600; }
.nav a.active .ic { color: var(--g700); }
.nav .sub a { padding: 6px 11px 6px 40px; font-size: 13px; font-weight: 450; }
.nav .sub a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav .count { margin-left: auto; background: rgba(255,255,255,.14); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.nav .count.c-bad { background: #e5484d; }
.nav .count.c-warn { background: #e8781a; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #7fae9a; padding: 14px 12px 6px; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #9cc5b4; }
.sidebar-foot strong { color: #fff; display: block; font-size: 13px; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input[type=search] { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; font: inherit; }
.search input:focus { outline: none; border-color: var(--g600); background: #fff; box-shadow: 0 0 0 3px var(--g100); }
.search .ic { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; z-index: 50; }
.search-results a { display: flex; gap: 10px; padding: 9px 14px; color: var(--text); border-bottom: 1px solid var(--g50); }
.search-results a:hover { background: var(--g50); text-decoration: none; }
.search-results .kind { font-size: 11px; color: var(--muted); margin-left: auto; text-transform: uppercase; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--g50); color: var(--g800); }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 8px; cursor: pointer; border: 0; background: none; font: inherit; color: inherit; }
.user-chip:hover { background: var(--g50); }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who small { color: var(--muted); font-size: 11.5px; }

.content { padding: 22px 26px 40px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 3px; font-size: 13px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.banner { background: var(--info-bg); color: var(--info); padding: 8px 24px; font-size: 13px; border-bottom: 1px solid #d5e1fb; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: #fbd7bd; }

/* ---------------- Dropdown ---------------- */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; }
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--g50); text-decoration: none; }
.dd-menu .sep { border-top: 1px solid var(--border); margin: 5px 0; }
.dd-menu .ic { color: var(--muted); }
.alerts-menu { width: 330px; }
.alerts-menu .al { display: flex; gap: 10px; padding: 9px 10px; }
.alerts-menu .al strong { display: block; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text); font: inherit; font-weight: 550;
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--g50); text-decoration: none; color: var(--text); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--g800); border-color: var(--g800); color: #fff; }
.btn-primary:hover { background: var(--g900); color: #fff; }
.btn-danger { color: var(--bad); border-color: #f3c4c4; }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-xs { padding: 3px 7px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--g700); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }

/* ---------------- Cards & grids ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.card-f { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.section { margin-bottom: 18px; }

/* KPI cards */
.kpi { display: flex; gap: 12px; padding: 15px 16px; align-items: flex-start; }
.kpi-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--g100); color: var(--g800); flex: none; }
.kpi-ic.t-warn { background: var(--warn-bg); color: var(--warn); }
.kpi-ic.t-bad { background: var(--bad-bg); color: var(--bad); }
.kpi-ic.t-info { background: var(--info-bg); color: var(--info); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-val { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 2px; line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-sub b { color: var(--text-2); }
a.kpi-link { color: inherit; text-decoration: none; display: block; }
.kpi-link .card, .grid > .kpi { height: 100%; }
a.kpi-link:hover .card { border-color: var(--g200); }

/* stat list (Today's tasks etc.) */
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--g50); }
.stat-list li:last-child { border-bottom: 0; }
.stat-list .v { margin-left: auto; font-weight: 700; font-size: 16px; }
.dot-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--g100); color: var(--g800); }
.dot-ic .ic { width: 16px; height: 16px; }
.dot-ic.t-warn { background: var(--warn-bg); color: var(--warn); }
.dot-ic.t-bad { background: var(--bad-bg); color: var(--bad); }
.dot-ic.t-info { background: var(--info-bg); color: var(--info); }

/* key-value */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px 18px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.kv div strong { font-weight: 600; font-size: 14px; }
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; font-weight: 550; }

/* profit statement */
.pl { width: 100%; font-size: 14px; }
.pl td { padding: 7px 0; }
.pl td:last-child { text-align: right; font-weight: 600; }
.pl tr.total td { border-top: 2px solid var(--text); font-size: 16px; font-weight: 700; padding-top: 10px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; background: var(--g50); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 10px 14px; border-bottom: 1px solid #eef2f0; vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fafcfb; }
table.t tr.row-link { cursor: pointer; }
table.t tr.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 700; background: var(--g50); border-top: 1px solid var(--border); }
table.t .sub { font-size: 12px; color: var(--muted); }
table.t.compact td, table.t.compact th { padding: 7px 12px; }
a.sort { color: inherit; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--g200); display: block; margin: 0 auto 8px; }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; line-height: 1.5; }
.b-good { background: var(--good-bg); color: var(--good); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-muted { background: #eef1f0; color: #5b6863; }
.tier { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; border: 1px solid; }
.tier-a { color: var(--g800); border-color: var(--g600); background: var(--g100); }
.tier-b { color: #7c5e10; border-color: #e3cf8d; background: #fdf7e3; }
.tier-c { color: #5b6863; border-color: #d3dad7; background: #f4f6f5; }
.health { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.health i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.h-good i { background: var(--good); } .h-warn i { background: #ea7a1a; } .h-bad i { background: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; background: var(--g100); color: var(--g800); font-size: 12px; font-weight: 550; margin: 0 4px 4px 0; }

/* avatars */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.av0 { background: #0f4d3a; } .av1 { background: #1a8562; } .av2 { background: #4b6b5f; }
.av3 { background: #2f5d8a; } .av4 { background: #8a5a2f; } .av5 { background: #6b4f8a; }
.avatar-empty { background: #e6ebe9; color: var(--muted); }
.person { display: inline-flex; align-items: center; gap: 8px; }

/* utilisation bar */
.util { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.util-track { flex: 1; height: 6px; background: #edf1ef; border-radius: 3px; overflow: hidden; }
.util-fill { height: 100%; border-radius: 3px; }
.u-good { background: var(--g600); } .u-warn { background: #ea7a1a; } .u-bad { background: var(--bad); }
.util span { font-size: 12px; font-weight: 600; width: 38px; text-align: right; }
.progress { height: 6px; background: #edf1ef; border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--g600); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.c12 { grid-column: span 12 } .c10 { grid-column: span 10 } .c9 { grid-column: span 9 } .c8 { grid-column: span 8 } .c7 { grid-column: span 7 } .c6 { grid-column: span 6 } .c5 { grid-column: span 5 } .c4 { grid-column: span 4 } .c3 { grid-column: span 3 } .c2 { grid-column: span 2 } .c1 { grid-column: span 1 }
.field label, .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .req { color: var(--bad); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], input[type=search], input[type=month], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff;
  font: inherit; color: var(--text); min-height: 36px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g600); box-shadow: 0 0 0 3px var(--g100); }
input[readonly] { background: var(--g50); }
select[multiple] { min-height: 110px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; margin: 0 14px 8px 0; font-weight: 450; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--g700); }
.checks { display: flex; flex-wrap: wrap; }
.form-section { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--g800); margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; background: var(--g50); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; }
.seg input { display: none; }
.seg span { display: block; padding: 7px 14px; cursor: pointer; font-weight: 550; font-size: 13px; }
.seg input:checked + span { background: var(--g800); color: #fff; }

/* filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.filters .f { display: flex; flex-direction: column; gap: 3px; min-width: 130px; }
.filters .f label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.filters select, .filters input { min-height: 33px; padding: 5px 8px; font-size: 13px; }
.filters .f-search { flex: 1; min-width: 200px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 11px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--g800); border-color: var(--g800); }
.tabs .count { font-size: 11px; background: #eef1f0; padding: 1px 6px; border-radius: 9px; margin-left: 4px; }
.tabs.page-tabs { padding: 0; margin-bottom: 16px; }

/* alerts / flash */
.flash { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; display: flex; gap: 9px; align-items: center; font-weight: 500; }
.flash-success { background: var(--good-bg); color: var(--good); border: 1px solid #bfe5cb; }
.flash-error { background: var(--bad-bg); color: var(--bad); border: 1px solid #f5c2c2; }
.flash-info { background: var(--info-bg); color: var(--info); border: 1px solid #ccdaf9; }

/* alert tiles (dashboard row 6) */
.alert-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.alert-tile { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-right: 1px solid var(--border); color: var(--text); }
.alert-tile:last-child { border-right: 0; }
.alert-tile:hover { background: var(--g50); text-decoration: none; color: var(--text); }
.alert-tile strong { display: block; font-size: 17px; }
.alert-tile span { font-size: 12px; color: var(--muted); }

/* quick actions */
.qa-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px 8px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-weight: 600; font-size: 13px; text-align: center; background: #fff; }
.qa:hover { border-color: var(--g600); background: var(--g50); text-decoration: none; color: var(--g900); }
.qa .qa-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--g800); color: #fff; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--g100); }
.timeline li:last-child::before { display: none; }
.timeline li i { position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--g600); }
.timeline li i.t-warn { border-color: #ea7a1a; } .timeline li i.t-bad { border-color: var(--bad); } .timeline li i.t-info { border-color: var(--info); }
.timeline .when { font-size: 12px; color: var(--muted); }

/* folders */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.folder { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); }
.folder:hover, .folder.active { border-color: var(--g600); background: var(--g50); text-decoration: none; color: var(--text); }
.folder .ic { color: var(--g700); }
.folder small { display: block; color: var(--muted); font-size: 11.5px; }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--g50); }
.checklist li.done span { text-decoration: line-through; color: var(--muted); }

/* comments */
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--g50); }
.comment .body { flex: 1; }
.comment .meta { font-size: 12px; color: var(--muted); }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; }
.pager a, .pager span.cur { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border); color: var(--text); padding: 0 8px; }
.pager span.cur { background: var(--g800); color: #fff; border-color: var(--g800); }
.pager a:hover { background: var(--g50); text-decoration: none; }

/* modal (native dialog) */
dialog.modal { border: 0; border-radius: 12px; padding: 0; width: min(560px, 94vw); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(8, 30, 22, .45); }
dialog.modal .m-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
dialog.modal .m-b { padding: 18px; }
dialog.modal .m-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; background: var(--g50); border-top: 1px solid var(--border); }
dialog.modal.wide { width: min(820px, 96vw); }

/* pipeline (leads kanban) */
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.stage { background: #eef3f1; border-radius: 10px; padding: 10px; min-height: 200px; }
.stage-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; padding: 0 2px; }
.stage-h small { font-weight: 600; color: var(--muted); text-transform: none; }
.lead-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; color: var(--text); font-size: 13px; }
.lead-card:hover { border-color: var(--g600); text-decoration: none; color: var(--text); }
.lead-card strong { display: block; }

/* charts (minimal) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bars .bar .fill { width: 100%; max-width: 34px; background: var(--g700); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bar:hover .fill { background: var(--g900); }
.bars .bar .lbl { font-size: 10.5px; color: var(--muted); margin-top: 5px; white-space: nowrap; }
.bars .bar .tip { position: absolute; bottom: calc(100% - 4px); background: var(--g950); color: #fff; padding: 3px 7px; border-radius: 5px; font-size: 11.5px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .1s; }
.bars .bar:hover .tip { opacity: 1; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: #fff; }
.split > div:first-child { background: var(--g700); }
.split > div:last-child { background: #b9c6c1; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* calendar month view */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal > div { background: #fff; min-height: 74px; padding: 6px 8px; font-size: 12px; }
.cal .dow { min-height: 0; background: var(--g50); font-weight: 600; color: var(--muted); text-align: center; }
.cal .out { background: #fafbfa; color: #b9c2be; }
.cal .wk { background: #fafbfa; }
.cal .today { box-shadow: inset 0 0 0 2px var(--g600); }
.cal .h { font-size: 16px; font-weight: 700; color: var(--g800); margin-top: 6px; }
.cal .h.low { color: var(--warn); }

/* week view */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week .day { border: 1px solid var(--border); border-radius: 9px; padding: 10px; text-align: center; }
.week .day.today { border-color: var(--g600); background: var(--g50); }
.week .day .d { font-size: 12px; color: var(--muted); }
.week .day .h { font-size: 20px; font-weight: 700; margin: 4px 0; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--g900); color: #e3f1ea; padding: 50px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 32px; color: #fff; line-height: 1.2; margin: 20px 0 14px; }
.auth-side ul { padding-left: 18px; color: #b9d8ca; line-height: 1.9; }
.auth-form { display: grid; place-items: center; padding: 40px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }

/* print / invoice */
.inv-doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 40px 44px; border: 1px solid var(--border); border-radius: 10px; }
.inv-doc .inv-top { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--g800); padding-bottom: 18px; margin-bottom: 20px; }
.inv-doc h1 { font-size: 28px; color: var(--g800); letter-spacing: .04em; }
.inv-doc table.items { width: 100%; border-collapse: collapse; margin: 18px 0; }
.inv-doc table.items th { background: var(--g800); color: #fff; padding: 9px 10px; text-align: left; font-size: 12.5px; }
.inv-doc table.items td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.inv-doc .totals { margin-left: auto; width: 300px; }
.inv-doc .totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.inv-doc .totals .grand { border-top: 2px solid var(--g800); font-weight: 800; font-size: 17px; padding-top: 8px; }
.stamp { display: inline-block; padding: 4px 12px; border: 2px solid; border-radius: 6px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }

@media print {
  .sidebar, .topbar, .no-print, .page-head .btn-group { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .inv-doc { border: 0; padding: 0; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1200px) {
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .alert-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .alert-tile { border-bottom: 1px solid var(--border); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: grid; }
  .g4, .g3, .g-2-1, .g-1-2, .g-3-2 { grid-template-columns: minmax(0, 1fr); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .user-chip .who { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
  .g6, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alert-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid > * { grid-column: span 12 !important; }
  .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(4, 1fr); }
}
table.t td.name-col { min-width: 210px; }
table.t th, table.t td { padding-left: 12px; padding-right: 12px; }
.pill .ic { width: 13px; height: 13px; }
.alert-row.a4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .alert-row.a4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.g-7-3 { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
.g-inv { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
.bars { overflow: hidden; }
.bars .bar { min-width: 0; }
.bars .bar .lbl { max-width: 100%; overflow: hidden; text-overflow: clip; }
@media (max-width: 960px) {
  .g-7-3, .g-inv { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .card { overflow-x: auto; }
  .inv-doc { padding: 20px 16px; }
  .inv-doc .inv-top { flex-direction: column; }
  .inv-doc .totals { width: 100%; }
  .bars .bar .lbl { font-size: 9px; }
  .page-head .btn-group { width: 100%; }
}
.card-h { flex-wrap: wrap; }
