/* CaseMerit design system — staff app, client portal and public pages share these tokens. */
:root {
  --brand: #1f5fbf;
  --brand-600: color-mix(in srgb, var(--brand) 88%, black);
  --brand-50: color-mix(in srgb, var(--brand) 8%, white);
  --brand-100: color-mix(in srgb, var(--brand) 16%, white);
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --green: #059669; --green-bg: #ecfdf5;
  --blue: #2563eb; --blue-bg: #eff6ff;
  --amber: #b45309; --amber-bg: #fffbeb;
  --red: #dc2626; --red-bg: #fef2f2;
  --gray-bg: #f1f5f9;
  --side: #0b1222;
  --side-2: #121b31;
  --side-text: #aab4c8;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px -8px rgba(15, 23, 42, .25);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.text-danger { color: var(--red); }
.text-warning { color: var(--amber); }
.text-success { color: var(--green); }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #26314d transparent; }
/* Long menus scroll under a pinned brand and footer; nothing in the column may shrink and overlap. */
.sidebar > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; position: sticky; top: 0; z-index: 2; background: var(--side); line-height: 1.25; }
.sidebar-foot { position: sticky; bottom: 0; z-index: 2; background: var(--side); }
.sidebar-close { display: none; position: fixed; top: 14px; left: 272px; z-index: 61; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .55); color: #fff; cursor: pointer; }
.brand-logo-mark { flex-shrink: 0; object-fit: contain; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #06b6d4)); display: grid; place-items: center; color: #fff; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--side-text); }
.nav { padding: 6px 10px 20px; flex: 1 0 auto; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #66728d; padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--side-text); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: color-mix(in srgb, var(--brand) 24%, var(--side)); color: #fff; }
.nav a.active .icon { color: color-mix(in srgb, var(--brand) 40%, white); }
.nav .count { margin-left: auto; font-size: 11px; background: #26314d; color: #cbd5e1; border-radius: 10px; padding: 0 7px; }
.sidebar-foot { padding: 12px 18px; font-size: 11.5px; color: #66728d; border-top: 1px solid #1a2440; }

.main { 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: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 30; }
.topbar .search { position: relative; flex: 1; max-width: 460px; }
.topbar .search input { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; font: inherit; }
.topbar .search input:focus { outline: 2px solid var(--brand-100); border-color: var(--brand); background: #fff; }
.topbar .search > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; display: none; }
.search-results.open { display: block; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 9px 14px; color: var(--text); border-bottom: 1px solid var(--surface-2); }
.search-results a:hover, .search-results a.focus { background: var(--brand-50); text-decoration: none; }
.search-results .group { padding: 8px 14px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.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(--gray-bg); color: var(--text); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.menu-toggle { display: none; }
.content { padding: 24px; flex: 1; }
.content-narrow { max-width: 980px; }

/* ------------------------------------------------------------------ page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: 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; font-size: 13.5px; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-bg); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn.active { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); z-index: 1; }

/* ------------------------------------------------------------------ cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.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)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 300px minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-sm { margin-bottom: 8px; }

/* stat tiles */
.stat { padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .delta { font-size: 12px; margin-top: 2px; color: var(--muted); }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); float: right; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table tr[data-href] { cursor: pointer; }
.table .cell-main { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12px; color: var(--muted); }
.table.compact td, .table.compact th { padding: 7px 12px; }
.table tfoot td { font-weight: 600; background: var(--surface-2); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 7px; color: var(--text-2); border: 1px solid var(--border); background: #fff; }
.pager-links span { border: 0; background: none; }
.pager-links a:hover { background: var(--gray-bg); text-decoration: none; }
.pager-links a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ------------------------------------------------------------------ badges, avatars, progress */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--text-2); }
.badge-brand { background: var(--brand-50); color: var(--brand); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 11.5px; background: var(--gray-bg); color: var(--text-2); margin: 1px 2px 1px 0; }
.avatar { --h: 230; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: hsl(var(--h) 55% 35%); background: hsl(var(--h) 70% 92%); flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.progress { height: 7px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.progress.green > span { background: var(--green); }
.dot-i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }

/* ------------------------------------------------------------------ forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field label, label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.req::after { content: ' *'; color: var(--red); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=tel], input[type=url], input[type=search], input[type=month], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; color: var(--text); background: #fff; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 15px; height: 15px; vertical-align: middle; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; cursor: pointer; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 6px; }
.inline-form { display: inline; }
.input-sm { padding: 5px 9px !important; font-size: 13px !important; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.filters input:not([type=checkbox]):not([type=radio]), .filters select { width: auto; min-width: 150px; padding: 6px 10px; font-size: 13px; }
.filters select { padding-right: 28px; }

/* ------------------------------------------------------------------ alerts */
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: #065f46; border-color: #a7f3d0; }
.alert-error { background: var(--red-bg); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--blue-bg); color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: var(--amber-bg); color: #92400e; border-color: #fde68a; }
.flash-stack { position: fixed; top: 70px; right: 20px; z-index: 100; width: 360px; max-width: calc(100vw - 40px); }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: slidein .25s ease; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 550; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; font: inherit; font-size: 13.5px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--gray-bg); color: var(--text-2); font-size: 11px; padding: 0 6px; border-radius: 8px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------------ definition lists */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ list items */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 18px; border-bottom: 1px solid #f0f2f5; display: flex; gap: 12px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: #cbd5e1; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ------------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 30px; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .t-icon { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.timeline .t-icon .icon { width: 12px; height: 12px; }
.timeline .t-head { font-size: 13.5px; }
.timeline .t-meta { font-size: 12px; color: var(--muted); }
.timeline .t-body { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: pre-line; }

/* ------------------------------------------------------------------ kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col { flex: 0 0 272px; background: #eef0f5; border-radius: 10px; padding: 10px; max-height: calc(100vh - 200px); display: flex; flex-direction: column; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-weight: 650; font-size: 13px; }
.kanban-items { overflow-y: auto; min-height: 60px; flex: 1; }
.kanban-items.drag-over { background: var(--brand-50); border-radius: 8px; outline: 2px dashed var(--brand-100); }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; display: block; color: var(--text); }
.kcard:hover { border-color: var(--brand-100); text-decoration: none; }
.kcard.dragging { opacity: .5; }
.kcard .k-title { font-weight: 600; font-size: 13.5px; }
.kcard .k-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ stage tracker */
.stages { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 6px; }
.stage { flex: 1 0 auto; min-width: 92px; text-align: center; font-size: 11.5px; font-weight: 600; padding: 8px 10px; background: var(--gray-bg); color: var(--muted); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); border: 0; cursor: pointer; font-family: inherit; }
.stage:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stage.done { background: var(--brand-100); color: var(--brand); }
.stage.current { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------ dropdown & modal */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; display: none; z-index: 50; }
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--text); font: inherit; font-size: 13.5px; border: 0; background: none; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--gray-bg); text-decoration: none; }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-menu .head { padding: 8px 10px; font-size: 12px; color: var(--muted); }
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: 560px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal.wide { width: 820px; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ------------------------------------------------------------------ notifications panel */
.notif-item { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.notif-item:hover { background: var(--gray-bg); text-decoration: none; }
.notif-item.unread { background: var(--brand-50); }
.notif-item .t { font-weight: 600; font-size: 13px; }
.notif-item .b { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ bar charts (CSS only) */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; min-width: 0; }
.bars .bar span.fill { width: 100%; max-width: 44px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 65%, white)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars .bar span.fill.alt { background: linear-gradient(180deg, #10b981, #6ee7b7); }
.bars .bar .bl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars .bar .bv { font-size: 11px; font-weight: 600; color: var(--text-2); }
.hbar { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 9px; }
.hbar .track { height: 9px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
/* Dashboard: KPI cards with the icon on the left, deadline table, task priorities, stage bars */
.stat.stat-lead { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; }
.stat-lead .stat-icon { float: none; width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.stat-lead .stat-icon .icon { width: 22px; height: 22px; }
.stat-lead .stat-body { min-width: 0; }
.stat-lead .value { font-size: 28px; margin-top: 2px; }
.stat-lead .delta { font-size: 12.5px; line-height: 1.55; margin-top: 4px; }
.dl-table th { font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.dl-table td { vertical-align: middle; }
.dl-table .cell-main, .dl-table .cell-sub { overflow-wrap: anywhere; }
.dl-table tr[data-href] { cursor: pointer; }
.dl-table .dl-narrow { display: none; }
@media (max-width: 700px) { .dl-table .dl-wide { display: none; } .dl-table .dl-narrow { display: inline; } }
@media (max-width: 600px) {
  .grid.g4:has(> .stat-lead) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat.stat-lead { padding: 14px; }
  .stat-lead .stat-icon { display: none; }
  .stat-lead .value { font-size: 22px; }
  .stat-lead .delta { font-size: 11.5px; }
}
.task-list > li { padding: 12px 18px; }
.task-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.task-title:hover { color: var(--brand); text-decoration: none; }
.badge.prio { min-width: 58px; justify-content: center; border-radius: 7px; }
input[type="file"] { font: inherit; font-size: 13px; color: var(--text-2); }
input[type="file"]::file-selector-button { font: 600 13px Inter, sans-serif; margin-right: 10px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; color: var(--text); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--gray-bg); }
/* Client portal */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 16px 16px; }
.quick-grid a { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600; transition: border-color .15s, background .15s; }
.quick-grid a .icon { width: 20px; height: 20px; color: var(--brand); }
.quick-grid a:hover { border-color: var(--brand); background: var(--brand-50); text-decoration: none; }
.date-chip { min-width: 50px; text-align: center; border-radius: 10px; padding: 6px 4px; background: var(--brand-50); color: var(--brand); line-height: 1.15; flex-shrink: 0; }
.date-chip span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.date-chip b { font-size: 19px; }
.date-chip.muted-chip { background: var(--gray-bg); color: var(--text-2); }
.stages.journey { scroll-behavior: smooth; scrollbar-width: thin; }
.chip-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filter button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font: 600 12.5px var(--font, Inter, sans-serif); color: var(--text-2); cursor: pointer; }
.chip-filter button span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip-filter button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-filter button.on span { color: rgba(255, 255, 255, .8); }
.ck-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--gray-bg); color: var(--muted); }
.ck-ic.ok { background: var(--green-bg); color: var(--green); }
.ck-ic.bad { background: var(--red-bg); color: var(--red); }
.checklist-item[hidden], [data-filter-list] [hidden] { display: none !important; }
.job-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.job-facts > div { background: var(--surface-2, #f8fafc); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.job-facts span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.job-facts b { font-size: 14px; }
.job-facts small { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
@media (max-width: 900px) { .job-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chat-day { text-align: center; margin: 6px 0; }
.chat-day span { font-size: 11.5px; color: var(--muted); background: var(--gray-bg); border-radius: 999px; padding: 3px 10px; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.mine { justify-content: flex-end; }
.msg-row .msg { margin: 0; }@media (max-width: 600px) { .ck-status { display: none; } }
.notif.unread { background: var(--brand-50); }
.notif-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-ic.tone-brand { background: var(--brand-50); color: var(--brand); }
.notif-ic.tone-amber { background: var(--amber-bg); color: var(--amber); }
.notif-ic.tone-green { background: var(--green-bg); color: var(--green); }
.notif-title { color: var(--text); }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }
.mini-progress { height: 7px; background: var(--gray-bg); border-radius: 6px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #22d3ee)); border-radius: 6px; }
.stagebar { display: flex; gap: 3px; height: 12px; border-radius: 6px; overflow: hidden; }
.stagebar span { min-width: 6px; }
.stage-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 12px; margin-top: 16px; }
.stage-legend b { display: block; font-size: 19px; line-height: 1.2; }
.stage-legend span { display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--muted); }
.stage-legend i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; transform: translateY(-1px); }
.stage-legend .zero { opacity: .5; }
.alert .alert-x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px 4px; align-self: flex-start; }
.alert .alert-x:hover { opacity: 1; }
.funnel-step { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.funnel-step .fbar { height: 30px; background: var(--brand); border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; padding: 0 10px; min-width: 40px; }

/* ------------------------------------------------------------------ calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal .dow { padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal .day { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; }
.cal .day.other { background: #fafbfc; color: #b6bdca; }
.cal .day.today .num { background: var(--brand); color: #fff; border-radius: 50%; }
.cal .num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; }
.cal .ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-top: 3px; background: var(--brand-50); color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--brand); }
.cal .ev.task { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.cal .ev.deadline { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* ------------------------------------------------------------------ chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 380px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 12px; background: #fff; border: 1px solid var(--border); font-size: 13.5px; white-space: pre-line; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-color: var(--brand); }
.msg .meta { font-size: 11px; opacity: .7; margin-top: 3px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: #fff; }
.chat-form textarea { min-height: 42px; height: 42px; }

/* ------------------------------------------------------------------ dropzone */
.dropzone { border: 2px dashed var(--border-strong); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.dropzone input[type=file] { display: none; }

/* ------------------------------------------------------------------ auth & public pages */
/* Sign-in / sign-up / password pages: photo panel + form on paper, matching the marketing site */
.auth2 { --paper: #f7f9fc; --ink: #0b1f4d; --accent: #d71920; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); color: var(--ink); }
.auth2 .serif { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; letter-spacing: -.01em; }
.auth2-photo { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #1b1d22; color: #fff; }
.auth2-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth2-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 14, 20, .45) 0%, rgba(12, 14, 20, 0) 28%, rgba(12, 14, 20, .15) 55%, rgba(12, 14, 20, .88) 100%); }
.auth2-photo .ph-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 44px 44px; }
.auth2-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: "Instrument Serif", Georgia, serif; font-size: 28px; line-height: 1; }
.auth2-brand:hover { text-decoration: none; }
.auth2-brand i { color: var(--accent); font-style: normal; }
.auth2-photo .auth2-brand i { color: #f87171; }
.auth2-brand.is-firm { font-family: Inter, sans-serif; font-size: 17px; font-weight: 700; line-height: 1.2; }
.auth2-firmname small { display: block; font-size: 12px; font-weight: 500; opacity: .8; margin-top: 2px; }
.auth2-firmlogo { height: 36px; width: auto; max-width: 140px; border-radius: 8px; background: #fff; padding: 3px; object-fit: contain; }
.auth2-foot .brand-logo-mark { vertical-align: -2px; }
.auth2 .lang-pick select { height: 36px; width: auto; padding: 4px 30px 4px 10px; font-size: 13px; background-color: #fff; border-color: #d6d2c8; border-radius: 8px; }
.auth2 .flash-stack:empty { display: none; }
.auth2-photo h2 { font-size: clamp(34px, 3.4vw, 50px); line-height: 1.02; max-width: 560px; margin: 0 0 18px; }
.auth2-photo h2 em { color: #fca5a5; }
.auth2-photo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; color: rgba(255, 255, 255, .86); font-size: 14.5px; max-width: 520px; }
.auth2-photo li { display: flex; gap: 10px; }
.auth2-photo li .icon { width: 17px; height: 17px; color: #86efac; margin-top: 2px; }
.auth2-main { display: flex; flex-direction: column; min-height: 100vh; padding: 28px 48px 28px; }
.auth2-top { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #5b5f69; }
.auth2-top .auth2-brand { display: none; font-size: 26px; color: var(--ink); }
.auth2-top .right { margin-left: auto; }
.auth2-top a { color: var(--ink); font-weight: 600; }
.auth2-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 36px 0; }
.auth2-card { width: 100%; max-width: 410px; }
.auth2-card.wide { max-width: 560px; }
.auth2-card h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: -.02em; margin: 0 0 10px; }
.auth2-card .lede { color: #5b5f69; font-size: 15.5px; margin: 0 0 26px; }
.auth2 .field label { font-size: 13px; font-weight: 600; color: #2b2e35; }
.auth2 .field input, .auth2 .field select { height: 46px; font-size: 15px; background: #fff; border-color: #d6d2c8; border-radius: 8px; }
.auth2 .field input:focus, .auth2 .field select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 23, 28, .08); }
.auth2 [aria-invalid="true"] { border-color: #dc2626 !important; }
.auth2 .hint { font-size: 12.5px; margin-top: 5px; }
.auth2 .label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth2 .label-row a { font-size: 13px; color: #5b5f69; }
.btn-ink { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; height: 48px; border: 0; border-radius: 8px; background: var(--ink, #15171c); color: #fff; font: 600 15px Inter, sans-serif; cursor: pointer; transition: background .15s; }
.btn-ink:hover { background: #000; }
.btn-ink[disabled] { opacity: .7; cursor: progress; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font: 600 12.5px Inter, sans-serif; color: #5b5f69; padding: 6px 8px; cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { background: #efece4; color: var(--ink); }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: #8a8d95; }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: #15803d; }
.pw-rules li.ok::before { content: "✓ "; }
.auth2-alt { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e2ded4; font-size: 14px; color: #5b5f69; display: grid; gap: 6px; }
.auth2-alt a { color: var(--ink); font-weight: 600; }
.auth2-foot { font-size: 13px; color: #6b6f78; border-top: 1px solid #e2ded4; padding-top: 16px; display: grid; gap: 10px; }
.auth2-foot a { color: #3a3e47; }
.auth2-foot a:hover { color: var(--ink); }
.af-help { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.af-help b { color: var(--ink); font-weight: 600; }
.af-help a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.af-help .icon { width: 14px; height: 14px; }
.af-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; color: #8a8d95; font-size: 12.5px; }
.af-bottom nav { display: flex; gap: 16px; }
/* Links on sign-in pages use ink, not the app's brand blue */
.auth2 a { color: var(--ink); }
.auth2 .label-row a, .auth2-alt span { color: #5b5f69; }
.auth2 a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.auth2 .auth2-photo .auth2-brand, .auth2 .auth2-photo .auth2-brand:hover { color: #fff; text-decoration: none; }
.auth2 .auth2-top .auth2-brand:hover { text-decoration: none; }
.auth2 .btn-ink, .auth2 .btn-ink:hover { color: #fff; text-decoration: none; }
.auth2 details.demo { margin-top: 20px; font-size: 13px; color: #5b5f69; background: #efece4; border-radius: 8px; padding: 10px 14px; }
.auth2 details.demo summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.auth2 .su-section { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8a8d95; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.auth2 .su-section::after { content: ""; flex: 1; border-top: 1px solid #e2ded4; }
.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan-cards label { position: relative; display: block; border: 1.5px solid #d6d2c8; border-radius: 10px; padding: 12px 14px; background: #fff; cursor: pointer; transition: border-color .15s; }
.plan-cards input { position: absolute; opacity: 0; pointer-events: none; }
.plan-cards label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan-cards label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.plan-cards .pn { font-weight: 600; font-size: 14px; }
.plan-cards .pp { font-family: "Instrument Serif", Georgia, serif; font-size: 30px; line-height: 1.1; margin-top: 2px; }
.plan-cards .pp small { font-family: Inter, sans-serif; font-size: 12px; color: #8a8d95; }
.plan-cards .pm { font-size: 12px; color: #6b6f78; margin-top: 2px; }
.slug-field { display: flex; align-items: stretch; border: 1px solid #d6d2c8; border-radius: 8px; overflow: hidden; background: #fff; }
.slug-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 23, 28, .08); }
.slug-field span { display: grid; place-items: center; padding: 0 10px; background: #efece4; color: #6b6f78; font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.slug-field input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; min-width: 0; }
.slug-status { font-size: 12.5px; margin-top: 5px; min-height: 18px; }
.slug-status.ok { color: #15803d; }
.slug-status.bad { color: #dc2626; }
@media (max-width: 920px) {
  .auth2 { grid-template-columns: minmax(0, 1fr); }
  .auth2-photo { position: relative; height: 230px; }
  .auth2-photo .ph-inner { padding: 20px 16px 18px; }
  .auth2-photo h2 { font-size: 30px; margin: 0; }
  .auth2-photo ul { display: none; }
  .auth2-main { min-height: 0; padding: 16px 16px 20px; }
  .auth2-top { justify-content: flex-end; }
  .auth2-body { padding: 20px 0 32px; }
  .auth2-card h1 { font-size: 38px; }
  .plan-cards { grid-template-columns: minmax(0, 1fr); }
}
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 0% 0%, color-mix(in srgb, var(--brand) 55%, #0b1222), #0b1222); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 34px; line-height: 1.15; margin: 18px 0 14px; }
.auth-side p { color: #c7cde0; font-size: 15px; max-width: 460px; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: center; color: #dfe4f2; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.public-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 60px; }
.public-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }

/* ------------------------------------------------------------------ portal */
.portal-top { background: #fff; border-bottom: 1px solid var(--border); }
.portal-top .inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 24px; }
.portal-nav { display: flex; gap: 4px; overflow-x: auto; }
.portal-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.portal-nav a.active, .portal-nav a:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 26px 20px 60px; }

/* ------------------------------------------------------------------ misc */
.score-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--gray-bg) 0); margin: 0 auto; }
.score-ring > div { width: 94px; height: 94px; background: #fff; border-radius: 50%; display: grid; place-items: center; text-align: center; }
.score-ring b { font-size: 28px; display: block; line-height: 1; }
.pill-tabs { display: inline-flex; background: var(--gray-bg); padding: 3px; border-radius: 9px; gap: 2px; }
.pill-tabs a { padding: 5px 12px; border-radius: 7px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.pill-tabs a.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.pill-tabs a:hover { text-decoration: none; }
.callout { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.ai-output { background: #fbfaff; border: 1px solid #e0e7ff; border-radius: 10px; padding: 16px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.65; }
.ai-label { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 700; color: #6d28d9; background: #f3e8ff; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.sig-pad { border: 1px dashed var(--border-strong); border-radius: 10px; background: #fff; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.doc-body { font-family: Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.7; }
.doc-body h1, .doc-body h2, .doc-body h3 { font-family: var(--font); margin: 18px 0 8px; }
.checklist-item { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f0f2f5; }
.checklist-item:last-child { border-bottom: 0; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.profile-head { display: flex; gap: 16px; align-items: center; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.repeat-group { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: var(--surface-2); position: relative; }

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .topbar, .no-print, .flash-stack, .page-head .actions { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border: 0; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55; }
  body.nav-open { overflow: hidden; }
  .sidebar-close.menu-toggle { display: none; }
  body.nav-open .sidebar-close.menu-toggle { display: grid; }
  .menu-toggle { display: grid; }
  .g3, .g-side { grid-template-columns: minmax(0, 1fr); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 680px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
  .g2, .g4, .form-grid, .form-grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .hbar { grid-template-columns: 90px 1fr 40px; }
  .topbar .search { max-width: none; }
  .hide-sm { display: none !important; }
}

/* Option cards (admin: account type) */
.opt-cards { display: grid; gap: 8px; }
.opt-cards label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; line-height: 1.35; }
.opt-cards label:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.opt-cards input { margin-top: 3px; }


/* CaseMerit wordmark */
.cm-word { font-family: Inter, system-ui, sans-serif; font-weight: 800; letter-spacing: -.025em; font-size: 22px; line-height: 1; white-space: nowrap; }
.cm-word b { font-weight: 800; }
.cm-dark b:first-child { color: #0b2a6e; }
.cm-dark b + b { color: #1f6fd6; }
.cm-light b:first-child { color: #ffffff; }
.cm-light b + b { color: #7fb2ff; }
