/* Mortgage Solver Intranet — styles */
:root {
  --blue: #1d6fc2;
  --blue-600: #165aa0;
  --blue-700: #114780;
  --blue-50: #ebf3fc;
  --blue-100: #d6e7f8;
  --ink: #0e1726;
  --ink-2: #2c3a4f;
  --muted: #637289;
  --line: #e2e7ee;
  --line-2: #eef1f5;
  --bg: #f4f6f9;
  --card: #ffffff;
  --side: #0c1524;
  --side-2: #142036;
  --side-text: #b9c5d6;
  --warn: #9a5b06;
  --warn-bg: #fff5e6;
  --warn-line: #f5d9a8;
  --ok: #17703a;
  --ok-bg: #e9f7ee;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(14, 23, 38, .05), 0 1px 1px rgba(14, 23, 38, .03);
  --shadow-lg: 0 10px 30px rgba(14, 23, 38, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --topbar: 60px;
  --sidebar-w: 268px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-warn { color: var(--warn); }
.text-accent { color: var(--blue); font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-mark { color: var(--blue); width: 34px; height: 34px; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.brand-logo { height: 36px; width: auto; }
.brand-invert { color: #fff; }
.brand-invert .brand-mark { color: #fff; }
.brand-invert .brand-mark svg path { stroke: var(--blue); }
.brand-invert .brand-text span { color: rgba(255, 255, 255, .7); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; background: transparent; color: var(--ink); border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--line-2); }
.nav-toggle { display: none; }
.support-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); }
.support-btn:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }

.account-menu { position: relative; }
.account-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { background: var(--line-2); }
.account-name { font-weight: 600; font-size: 14px; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.account-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; display: flex; flex-direction: column; }
.account-head span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.account-dropdown a, .account-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 7px; font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--line-2); text-decoration: none; }
.account-dropdown form { margin: 0; }

/* ---------- Avatars ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--blue-100); color: var(--blue-700); font-weight: 700; object-fit: cover; flex: none; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.avatar-xl { width: 96px; height: 96px; font-size: 28px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); background: linear-gradient(to right, var(--side) var(--sidebar-w), transparent var(--sidebar-w)); }
.sidebar { background: var(--side); color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; }
.me-card { background: var(--side-2); border-radius: var(--radius); padding: 14px; }
.me-top { display: flex; gap: 12px; align-items: center; }
.me-card .avatar { background: var(--blue); color: #fff; }
.me-id { display: flex; flex-direction: column; min-width: 0; }
.me-id strong { color: #fff; font-size: 15px; }
.me-id span { font-size: 12.5px; }
.me-office { color: #8fa2bc; }
.me-score { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; margin-top: 14px; color: var(--side-text); }
.me-score:hover { text-decoration: none; color: #fff; }
.me-score-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.me-score-value { color: #fff; font-weight: 700; font-size: 14px; }
.me-score .bar { grid-column: 1 / -1; height: 6px; background: rgba(255, 255, 255, .1); border-radius: 99px; overflow: hidden; }
.me-score .bar span { display: block; height: 100%; background: linear-gradient(90deg, #3b8ae0, #6fb0f5); border-radius: 99px; }
.me-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 12px 0 0; color: #8fa2bc; }
.me-meta .icon { width: 14px; height: 14px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--side-text); font-size: 14px; font-weight: 500; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--blue); color: #fff; }
.side-heading { margin: 16px 11px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: #6d7f99; }
.side-foot { margin-top: auto; font-size: 11.5px; color: #5d6f88; padding: 0 11px; }
.scrim { display: none; }

.main { padding: 28px 32px 24px; min-width: 0; outline: none; display: flex; flex-direction: column; }
.page-foot { margin-top: auto; padding-top: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { margin: 6px 0 0; max-width: 64ch; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--blue); margin: 0 0 6px; }
.back-link { display: inline-block; font-size: 14px; margin-bottom: 12px; font-weight: 500; }
.score-pill { display: inline-flex; align-items: baseline; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.score-pill span { font-weight: 700; font-size: 16px; color: var(--blue); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; }
.card-link .icon { width: 15px; height: 15px; }
.card-accent { border-top: 3px solid var(--blue); }
.stack { display: flex; flex-direction: column; min-width: 0; }
.empty { color: var(--muted); margin: 0; padding: 6px 0; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h1 { margin-bottom: 10px; }
.empty-state .btn { margin-top: 12px; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--blue-50); border-radius: var(--radius-sm); padding: 10px 12px; margin: 14px 0 0; }
.note .icon { color: var(--blue); width: 16px; height: 16px; margin-top: 2px; }

/* ---------- Quick-launch tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 20px; }
.tile { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tile .icon { color: var(--blue); width: 20px; height: 20px; }
.tile:hover { border-color: var(--blue); text-decoration: none; color: var(--ink); transform: translateY(-1px); }
.tile span { overflow: hidden; text-overflow: ellipsis; }
.tiles-empty { grid-template-columns: 1fr; }
.tile-add { border-style: dashed; color: var(--muted); font-weight: 500; box-shadow: none; }
.tile-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--blue-50); color: var(--blue); flex: none; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); }
a.stat:hover { border-color: var(--blue); text-decoration: none; color: var(--ink); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.stat-warn .stat-value { color: var(--warn); }

/* ---------- Dashboard grid ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.dash-side { display: flex; flex-direction: column; min-width: 0; }

/* Feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: block; padding: 14px 12px; margin: 0 -12px; border-radius: var(--radius-sm); color: var(--ink); border-top: 1px solid var(--line-2); }
.feed-item:first-child { border-top: 0; }
.feed-item:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.feed-item h3 { font-size: 15.5px; font-weight: 650; margin: 6px 0 4px; }
.feed-item p { color: var(--ink-2); font-size: 14px; margin: 0; }
.feed-item.is-pinned { background: var(--blue-50); border-top-color: transparent; margin-bottom: 4px; }
.feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag .icon { width: 12px; height: 12px; }
.tag-pin { background: var(--blue); color: #fff; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-muted { background: var(--line-2); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.list-row:first-child { border-top: 0; padding-top: 2px; }
.list-row > div:first-child { min-width: 0; }
.list-row small { display: block; color: var(--muted); }
.list-compact .list-row { padding: 8px 0; font-size: 14px; }
.list-row.is-past { opacity: .6; }
.row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.row-actions form { margin: 0; }
.event-row { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Checklist */
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checklist .icon { width: 18px; height: 18px; color: #b3bdcb; margin-top: 1px; }
.checklist li.done { color: var(--muted); }
.checklist li.done span { text-decoration: line-through; text-decoration-color: #c6cfdb; }
.checklist li.done .icon { color: var(--ok); }

/* Events */
.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.events li { display: flex; gap: 12px; align-items: flex-start; }
.events li > div:not(.date-chip) { display: flex; flex-direction: column; min-width: 0; }
.events small { color: var(--muted); }
.events a strong { color: var(--ink); }
.events a:hover strong { color: var(--blue); }
.date-chip { flex: none; width: 46px; text-align: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.date-chip span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--blue); color: #fff; padding: 2px 0; }
.date-chip strong { display: block; font-size: 18px; padding: 3px 0 4px; }
.events-lg li { padding-bottom: 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
.events-lg li:last-child { border-bottom: 0; padding-bottom: 0; }
.event-body { flex: 1; }
.event-body small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.event-body small .icon { width: 14px; height: 14px; }
.event-body p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }

/* Contacts */
.contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.contacts li { display: flex; gap: 12px; align-items: flex-start; }
.contacts li > div { display: flex; flex-direction: column; min-width: 0; }
.contacts small { color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.contact-links a { display: inline-flex; align-items: center; gap: 4px; }
.contact-links .icon { width: 14px; height: 14px; }

/* People */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person > span { display: flex; flex-direction: column; min-width: 0; }
.person small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.person-lg h1 { font-size: 26px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person-card { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.person-card-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.person-card h3 { font-size: 15.5px; }
.person-card p { margin: 0; }
.person-office, .person-card .small { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.person-card .icon { width: 14px; height: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table .cell-actions { text-align: right; padding-right: 0; }
.table tr.is-disabled td { opacity: .55; }
.table tr.row-warn td { background: var(--warn-bg); }
.mini-bar { display: inline-block; width: 60px; height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.mini-bar span { display: block; height: 100%; background: var(--blue); }
.role-tag { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.role-admin { background: #0e1726; color: #fff; }
.role-compliance { background: #efe9fd; color: #5b3cb3; }
.role-owner { background: var(--blue-100); color: var(--blue-700); }
.role-agent { background: var(--blue-50); color: var(--blue-600); }
.role-investor { background: #e7f6ef; color: #17703a; }

/* Pills / filters */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.pill:hover { border-color: var(--blue); text-decoration: none; }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; }
.field-grow { flex: 1 1 240px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

/* Article */
.article { max-width: 760px; padding: 28px 32px; }
.article h1 { margin: 10px 0 6px; }
.byline { margin-bottom: 20px; }
.prose { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.prose p { margin: 0 0 1em; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; border: 0; padding: 0; }
.field > span, .field legend { font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 0; }
.field small { color: var(--muted); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row a { font-weight: 500; font-size: 13px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #cfd7e2; border-radius: var(--radius-sm); padding: 9px 11px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 111, 194, .16); }
input:disabled { background: var(--line-2); color: var(--muted); }
input[type="file"] { padding: 7px; font-size: 14px; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; }
.check-inline { align-self: end; padding-bottom: 10px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.form-section { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 10px 0 -2px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.inline-form { margin-top: 10px; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 5px 11px; border: 1px solid #cfd7e2; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff; transition: all .12s; }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip-group-label { font-size: 12px; color: var(--muted); margin: 4px 0 2px; font-weight: 600; }

.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 6px; }
.icon-choice { position: relative; cursor: pointer; }
.icon-choice input { position: absolute; opacity: 0; inset: 0; }
.icon-choice span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #cfd7e2; border-radius: 8px; color: var(--ink-2); }
.icon-choice input:checked + span { border-color: var(--blue); background: var(--blue-50); color: var(--blue); box-shadow: 0 0 0 2px var(--blue-100); }

.role-help { font-size: 14px; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.role-help summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.role-help dl { margin: 10px 0 0; display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; }
.role-help dt { font-weight: 600; }
.role-help dd { margin: 0; color: var(--ink-2); }

.photo-row { display: flex; gap: 18px; align-items: flex-start; }
.photo-row .form { flex: 1; min-width: 0; }

.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.copy-row input { font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-sm); background: var(--blue); color: #fff; border: 1px solid var(--blue); cursor: pointer; white-space: nowrap; transition: background .15s; }
.btn:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; text-decoration: none; }
.btn .icon { width: 17px; height: 17px; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cfd7e2; }
.btn-secondary:hover { background: var(--line-2); border-color: #b8c3d1; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 12px 18px; font-size: 15px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.link-btn .icon { width: 15px; height: 15px; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert p { margin: 0; }
.alert-success { background: var(--ok-bg); color: #11552c; border-color: #c4e8d1; }
.alert-error { background: var(--danger-bg); color: #8a1c13; border-color: #f6c9c3; }
.alert-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }

/* Admin grids */
.grid-profile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-admin-wide { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); }

/* ---------- Auth pages ---------- */
body.auth { background: #fff; }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { background: radial-gradient(circle at 20% 110%, rgba(29, 111, 194, .55), transparent 55%), linear-gradient(160deg, #0c1524 0%, #13233d 100%); color: #fff; display: flex; align-items: center; padding: 48px; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255, 255, 255, .02), 0 0 0 120px rgba(255, 255, 255, .015); }
.auth-brand-inner { max-width: 440px; position: relative; z-index: 1; }
.auth-brand h2 { font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.15; margin: 48px 0 16px; letter-spacing: -.01em; }
.auth-brand p { color: rgba(255, 255, 255, .75); font-size: 16px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, .8); }
.auth-points li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5aa2ee; margin-right: 10px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-card .form { margin-top: 20px; }
.auth-note { font-size: 13.5px; color: var(--muted); margin-top: 20px; }
.auth-foot { font-size: 12px; color: var(--muted); margin-top: 40px; }

.install-wrap { max-width: 640px; margin: 0 auto; padding: 40px 20px; }
.install-wrap > .brand { margin-bottom: 24px; }
.install-wrap .card { padding: 28px; }
.install-wrap h1 { margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 20px; }
  .grid-admin, .grid-admin-wide, .grid-profile { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); bottom: 0; height: auto; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(14, 23, 38, .45); z-index: 35; }
  .main { padding: 22px 16px 20px; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .support-btn span, .account-name { display: none; }
  .support-btn { padding: 8px; border: 0; }
  .brand-text span { display: none; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 24px; }
  .dash-side { grid-template-columns: minmax(0, 1fr); }
  .photo-row { flex-direction: column; }
  .list-row { flex-wrap: wrap; }
  .article { padding: 20px 16px; }
  .role-help dl { grid-template-columns: 1fr; }
  .events-lg li { flex-wrap: wrap; }
}
