:root {
    --navy: #0b2239;
    --navy-2: #123452;
    --teal: #08777d;
    --teal-dark: #075d63;
    --coral: #ff6b5f;
    --coral-dark: #e75349;
    --sky: #e9f7f6;
    --ink: #172b3d;
    --muted: #6d7d8b;
    --line: #dce5ea;
    --surface: #ffffff;
    --background: #f3f6f8;
    --success: #17815f;
    --warning: #ae6816;
    --danger: #c44343;
    --shadow: 0 12px 35px rgba(22, 48, 67, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand strong, .stat-card strong { font-family: "Aptos Display", "Segoe UI Variable", "Segoe UI", Arial, sans-serif; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.045em; margin-bottom: .65rem; }
h2 { letter-spacing: -.025em; line-height: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--navy); }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px 5px 12px 5px; background: var(--coral); color: white; font-family: "Aptos Display", "Segoe UI", sans-serif; font-size: .92rem; font-weight: 800; letter-spacing: -.04em; box-shadow: inset 0 -4px 10px rgba(86, 20, 16, .12); }
.brand > span:last-child { display: flex; align-items: baseline; gap: .24rem; font-size: 1.04rem; }
.brand strong { font-size: 1.1rem; letter-spacing: -.04em; }
.brand small { color: var(--teal); font-size: .62rem; font-weight: 800; letter-spacing: .15em; }
.eyebrow { display: block; margin-bottom: .45rem; color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow--light { color: #71dad4; }
.preline { white-space: pre-line; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 10px; padding: .65rem 1rem; cursor: pointer; font-weight: 700; line-height: 1; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--teal); color: white; box-shadow: 0 8px 18px rgba(8, 119, 125, .2); }
.button--primary:hover { background: var(--teal-dark); }
.button--coral { background: var(--coral); color: white; box-shadow: 0 10px 25px rgba(255, 107, 95, .28); }
.button--coral:hover { background: var(--coral-dark); }
.button--outline { border-color: var(--line); background: white; color: var(--navy); }
.button--light { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: white; backdrop-filter: blur(8px); }
.button--ghost { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.button--danger { border-color: #f3caca; background: #fff4f3; color: var(--danger); }
.button--large { min-height: 50px; padding-inline: 1.35rem; }
.button--small { min-height: 34px; padding: .5rem .7rem; font-size: .8rem; }
.button--full { width: 100%; }

.app-header { position: sticky; top: 0; z-index: 30; display: flex; height: 72px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(220,229,234,.85); background: rgba(255,255,255,.95); padding: 0 max(24px, calc((100vw - 1400px) / 2)); backdrop-filter: blur(14px); }
.app-nav { display: flex; height: 100%; align-items: center; gap: .2rem; }
.app-nav > a, .app-nav > form button { position: relative; display: flex; height: 100%; align-items: center; border: 0; background: transparent; padding: 0 .9rem; color: #526675; cursor: pointer; font-weight: 600; }
.app-nav > a:hover, .app-nav > form button:hover, .app-nav > a.is-active { color: var(--navy); }
.app-nav > a.is-active::after { position: absolute; right: .8rem; bottom: -1px; left: .8rem; height: 3px; border-radius: 4px 4px 0 0; background: var(--coral); content: ""; }
.app-nav > .nav-new { height: 38px; margin-inline: .6rem; border-radius: 9px; background: var(--teal); color: white; }
.app-nav > .nav-new:hover { color: white; background: var(--teal-dark); }
.nav-toggle { display: none; border: 0; background: transparent; padding: .5rem; }
.nav-toggle > span:not(.sr-only) { display: block; width: 22px; height: 2px; margin: 4px 0; background: var(--navy); }
.global-alert { position: fixed; z-index: 50; top: 84px; left: 50%; max-width: min(600px, calc(100vw - 32px)); transform: translateX(-50%); border: 1px solid; border-radius: 12px; padding: .8rem 1.2rem; box-shadow: var(--shadow); font-weight: 600; animation: slide-down .25s ease; }
.global-alert--success { border-color: #a4d6c4; background: #ecfbf5; color: #126646; }
.global-alert--warning { border-color: #f0d39e; background: #fff8e7; color: #81510e; }
@keyframes slide-down { from { opacity: 0; transform: translate(-50%, -8px); } }

.page-shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 46px 0 72px; }
.page-shell--narrow { width: min(860px, calc(100% - 40px)); }
.page-shell--form { width: min(1050px, calc(100% - 40px)); }
.page-heading, .record-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 28px; }
.page-heading p, .record-heading p { margin-bottom: 0; color: var(--muted); font-size: 1.02rem; }
.heading-actions, .table-actions { display: flex; align-items: center; gap: .65rem; }
.panel { border: 1px solid rgba(211,223,229,.95); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #edf1f3; padding: 22px 24px 18px; }
.panel-heading h2 { margin: 0; font-size: 1.15rem; }
.panel-heading .eyebrow { margin-bottom: .25rem; }
.panel-heading > a { color: var(--teal); font-size: .85rem; font-weight: 700; }
.panel-heading > span { color: var(--muted); font-size: .82rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; min-height: 176px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 23px; box-shadow: var(--shadow); }
.stat-card small { display: block; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; }
.stat-card strong { display: block; margin: .65rem 0 .7rem; color: var(--navy); font-size: clamp(1.65rem, 2.7vw, 2.35rem); letter-spacing: -.05em; white-space: nowrap; }
.stat-card a, .stat-card > span:last-child { color: var(--muted); font-size: .79rem; }
.stat-card a { color: var(--teal); font-weight: 700; }
.stat-icon { position: absolute; top: 18px; right: 18px; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--sky); color: var(--teal); font-weight: 800; }
.stat-card--navy { border-color: var(--navy); background: var(--navy); }
.stat-card--navy strong, .stat-card--navy small, .stat-card--navy a { color: white; }
.stat-card--navy small, .stat-card--navy a { opacity: .78; }
.stat-card--navy .stat-icon { background: rgba(255,255,255,.1); color: #73ddd7; }
.stat-card--alert { border-color: #f3d7d3; background: #fffafa; }
.stat-card--alert .stat-icon { background: #fff0ee; color: var(--coral-dark); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .8fr); gap: 20px; margin-bottom: 20px; }
.attention-row { display: grid; grid-template-columns: 12px minmax(180px, 1fr) minmax(180px, .85fr) 18px; align-items: center; gap: 14px; border-bottom: 1px solid #edf1f3; padding: 17px 24px; transition: background .16s ease; }
.attention-row:hover { background: #f8fbfc; }
.attention-row:last-child { border-bottom: 0; }
.attention-row strong, .attention-row small { display: block; }
.attention-row small { margin-top: .18rem; color: var(--muted); font-size: .77rem; }
.attention-row > span:last-child { color: var(--teal); font-size: 1.2rem; }
.attention-action { text-align: right; }
.priority-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #aebbc4; }
.priority-dot--high { background: #ef9a32; box-shadow: 0 0 0 4px #fff1df; }
.priority-dot--urgent { background: var(--coral); box-shadow: 0 0 0 4px #fff0ee; }
.pipeline-list { padding: 14px 24px 20px; }
.pipeline-list a { display: grid; grid-template-columns: 145px 1fr 26px; align-items: center; gap: 12px; padding: 8px 0; color: #536676; font-size: .78rem; }
.pipeline-list a div { height: 7px; overflow: hidden; border-radius: 9px; background: #edf1f3; }
.pipeline-list a i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--teal); }
.pipeline-list a strong { color: var(--navy); text-align: right; }
.recent-panel { overflow: hidden; }
.empty-state { display: grid; min-height: 260px; place-items: center; align-content: center; padding: 32px; text-align: center; }
.empty-state > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: var(--sky); color: var(--teal); font-weight: 800; }
.empty-state h3 { margin: .9rem 0 .3rem; }
.empty-state p { max-width: 460px; margin-bottom: 1rem; color: var(--muted); }
.empty-state--wide { min-height: 330px; }

.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { background: #f7f9fa; padding: 11px 16px; color: #71818e; font-size: .67rem; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.data-table td { border-top: 1px solid #edf1f3; padding: 15px 16px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfd; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: .18rem; color: var(--muted); font-size: .74rem; }
.data-table .row-overdue { background: #fffafa; }
.table-arrow { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--sky); color: var(--teal); font-weight: 800; }
.reference-cell { display: flex; align-items: center; gap: 10px; }
.is-overdue { color: var(--danger) !important; font-weight: 700; }
.legend { display: flex; align-items: center; gap: .5rem; }
.legend i:nth-of-type(2) { margin-left: .5rem; }
.pagination { border-top: 1px solid #edf1f3; padding: 18px 22px; }
.pagination nav > div:first-child { display: none; }
.pagination nav > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .82rem; }
.pagination nav span[aria-current] > span, .pagination nav a { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; padding: .4rem; }
.pagination nav span[aria-current] > span { border-color: var(--teal); background: var(--teal); color: white; }
.pagination svg { width: 18px; }

.filter-panel { margin-bottom: 18px; padding: 18px; }
.filters { display: grid; grid-template-columns: minmax(280px, 1fr) 190px 170px auto auto; align-items: end; gap: 12px; }
.filters label > span, .admin-filters label > span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .72rem; font-weight: 700; }
label { display: block; color: var(--navy); font-size: .82rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
.inline-action { float: right; border: 0; background: transparent; padding: 0; color: var(--teal); cursor: pointer; font-size: .7rem; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid #ccd8de; border-radius: 9px; outline: none; background: white; color: var(--ink); padding: .72rem .8rem; transition: border-color .16s, box-shadow .16s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,119,125,.11); }
textarea { resize: vertical; }
.filters input, .filters select { min-height: 43px; }
.checks-panel { overflow: hidden; }
.status { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; background: #edf2f4; color: #526572; padding: .32rem .6rem; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status--active, .status--completed { background: #e5f7ef; color: #107250; }
.status--trial, .status--funds_pending, .status--partial_disbursement { background: #e6f5fb; color: #176a83; }
.status--intake { background: #eef1f7; color: #4d6182; }
.status--documents_needed, .status--past_due { background: #fff1df; color: #98601c; }
.status--submitted, .status--endorsement_review { background: #e4f5f4; color: #08686d; }
.status--inspection_required { background: #f0eafa; color: #70549a; }
.status--on_hold, .status--expired { background: #f6eee5; color: #805d34; }
.status--cancelled, .status--blocked { background: #fbe9e8; color: #a63d3d; }

.record-form { overflow: hidden; }
.form-section { border-bottom: 1px solid var(--line); padding: 30px 34px; }
.form-section__heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.form-section__heading > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: var(--navy); color: white; font-size: .72rem; font-weight: 800; }
.form-section__heading h2 { margin: 0 0 .25rem; font-size: 1.2rem; }
.form-section__heading p { margin: 0; color: var(--muted); font-size: .84rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-grid label > input, .form-grid label > select, .form-grid label > textarea { margin-top: .42rem; }
.form-grid label > small { display: inline; }
.field-span-2 { grid-column: 1 / -1; }
.field-pair { display: grid; grid-template-columns: .55fr 1fr; gap: 12px; }
.money-input { position: relative; margin-top: .42rem; }
.money-input span { position: absolute; top: 50%; left: .8rem; transform: translateY(-50%); color: var(--muted); }
.money-input input { padding-left: 1.65rem; }
.checklist-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.checklist-grid label { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: 10px; padding: .72rem; cursor: pointer; font-weight: 600; }
.checklist-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.checklist-grid label > span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #b9c8d0; border-radius: 6px; color: transparent; }
.checklist-grid label:has(input:checked) { border-color: #93cdc9; background: #f0faf9; color: var(--teal-dark); }
.checklist-grid input:checked + span { border-color: var(--teal); background: var(--teal); color: white; }
.notes-field textarea { margin-top: .42rem; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; padding: 24px 34px; }
.form-panel { padding: 28px; }
.form-panel .form-actions { padding: 10px 0 0; }
.form-stack { display: grid; gap: 15px; }
.form-stack input, .form-stack select { margin-top: .4rem; }
.form-stack label > small { display: block; margin-top: .3rem; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; }
.checkbox-row input { width: auto; }
.alert { border: 1px solid; border-radius: 10px; padding: .8rem 1rem; font-size: .82rem; font-weight: 500; }
.alert--success { border-color: #a6d5c4; background: #ecf9f4; color: #126947; }
.alert--warning { border-color: #ecd39e; background: #fff8e7; color: #81510e; }
.alert--error { border-color: #ecc2c0; background: #fff4f3; color: #a23838; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }

.back-link { display: inline-block; margin-bottom: 1rem; color: var(--teal); font-size: .82rem; font-weight: 700; }
.record-heading { align-items: center; }
.record-title-line { display: flex; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.record-title-line .eyebrow { margin: 0; }
.record-heading h1 { margin-bottom: .25rem; }
.workflow-panel { overflow-x: auto; margin-bottom: 18px; padding: 21px 24px; }
.workflow-track { display: flex; min-width: 850px; align-items: flex-start; }
.workflow-track > div { position: relative; display: grid; flex: 1; justify-items: center; color: #8a9aa5; text-align: center; }
.workflow-track > div::before { position: absolute; z-index: 0; top: 16px; right: 50%; width: 100%; height: 2px; background: #dce5e9; content: ""; }
.workflow-track > div:first-child::before { display: none; }
.workflow-track span { position: relative; z-index: 1; display: grid; width: 32px; height: 32px; place-items: center; border: 2px solid #cfdae0; border-radius: 50%; background: white; font-size: .72rem; font-weight: 800; }
.workflow-track small { margin-top: .55rem; font-size: .66rem; font-weight: 700; }
.workflow-track .is-done, .workflow-track .is-current { color: var(--teal); }
.workflow-track .is-done::before, .workflow-track .is-current::before { background: var(--teal); }
.workflow-track .is-done span { border-color: var(--teal); background: var(--teal); color: white; }
.workflow-track .is-current span { border-color: var(--coral); box-shadow: 0 0 0 5px #fff0ee; color: var(--coral-dark); }
.record-summary-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.record-summary-grid article { min-height: 165px; padding: 22px; }
.record-summary-grid article > small { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; }
.record-summary-grid article > strong { display: block; margin: .5rem 0 .2rem; color: var(--navy); font-family: "Aptos Display", "Segoe UI", sans-serif; font-size: 1.65rem; letter-spacing: -.04em; }
.record-summary-grid article > span { color: var(--muted); font-size: .8rem; }
.record-summary-grid article > p { margin: .65rem 0 0; color: var(--muted); font-size: .8rem; }
.next-card.is-overdue { border-color: #efbeb9; background: #fff8f7; }
.money-progress { height: 8px; overflow: hidden; border-radius: 8px; background: #e9eff2; }
.money-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #26aba7); }
.money-card p { display: flex; justify-content: space-between; gap: 1rem; }
.record-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .72fr); align-items: start; gap: 18px; }
.record-main, .record-aside { display: grid; gap: 18px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; padding: 8px 24px 20px; }
.details-grid > div { min-height: 82px; border-bottom: 1px solid #edf1f3; padding: 18px 12px 14px 0; }
.details-grid > div:nth-child(even) { padding-left: 18px; }
.details-grid dt { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.details-grid dd { margin: .35rem 0 0; font-size: .92rem; font-weight: 600; }
.activity-form { display: grid; grid-template-columns: 1fr 1.25fr 1.2fr; gap: 10px; padding: 20px 24px; background: #f8fafb; }
.activity-form textarea { grid-column: 1 / 3; }
.activity-form button { align-self: stretch; }
.timeline-panel > .alert { margin: 0 24px 10px; }
.timeline { margin: 0; padding: 10px 24px 25px; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 13px; padding: 12px 0; }
.timeline li:not(:last-child)::before { position: absolute; top: 47px; bottom: -10px; left: 17px; width: 2px; background: #e0e7ea; content: ""; }
.timeline-icon { position: relative; z-index: 1; display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--teal); font-size: .8rem; font-weight: 800; }
.timeline li > div > div { display: flex; justify-content: space-between; gap: 1rem; }
.timeline time { color: var(--muted); font-size: .72rem; }
.timeline p { margin: .25rem 0 .5rem; color: #506472; font-size: .86rem; white-space: pre-line; }
.timeline-empty { display: block !important; color: var(--muted); text-align: center; }
.checklist-panel ul, .document-list { margin: 0; padding: 16px 20px; list-style: none; }
.checklist-panel li { display: flex; align-items: center; gap: .65rem; padding: .48rem 0; color: #657684; font-size: .82rem; }
.checklist-panel li > span { display: grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; border: 1px solid #c5d1d7; border-radius: 6px; font-size: .7rem; }
.checklist-panel li.is-complete { color: var(--teal-dark); font-weight: 700; }
.checklist-panel li.is-complete > span { border-color: var(--teal); background: var(--teal); color: white; }
.checklist-panel > p { border-top: 1px solid #edf1f3; margin: 0; padding: 12px 20px; color: var(--muted); font-size: .76rem; }
.upload-form { display: grid; gap: 10px; padding: 18px 20px; background: #f8fafb; }
.file-picker { position: relative; display: grid; min-height: 94px; place-items: center; align-content: center; border: 1px dashed #b6c7cf; border-radius: 10px; background: white; color: var(--teal); cursor: pointer; text-align: center; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker small { display: block; margin-top: .25rem; color: var(--muted); }
.document-list { padding-top: 8px; }
.document-list li { display: flex; align-items: center; gap: .65rem; border-bottom: 1px solid #edf1f3; padding: .75rem 0; }
.document-list li > span { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 8px; background: var(--sky); color: var(--teal); font-size: .62rem; font-weight: 800; }
.document-list li > div { min-width: 0; flex: 1; }
.document-list li a, .document-list li small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list li a { color: var(--navy); font-size: .8rem; font-weight: 700; }
.document-list li small { color: var(--muted); font-size: .68rem; }
.document-list li form button { border: 0; background: transparent; color: #9aabb4; cursor: pointer; font-size: 1.1rem; }
.document-empty { display: block !important; border: 0 !important; color: var(--muted); font-size: .8rem; text-align: center; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.admin-stat-grid article { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 15px; box-shadow: 0 5px 18px rgba(22,48,67,.04); }
.admin-stat-grid strong, .admin-stat-grid span { display: block; }
.admin-stat-grid strong { color: var(--navy); font-family: "Aptos Display", "Segoe UI", sans-serif; font-size: 1.45rem; }
.admin-stat-grid span { color: var(--muted); font-size: .7rem; }
.admin-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 18px; }
.admin-sidebar { display: grid; gap: 18px; }
.admin-create, .admin-password { padding: 24px; }
.admin-create h2, .admin-password h2 { margin-bottom: .4rem; }
.admin-create > p, .admin-password > p { color: var(--muted); font-size: .82rem; }
.admin-filters { display: grid; grid-template-columns: minmax(220px,1fr) 170px auto auto; align-items: end; gap: 10px; padding: 18px 20px; background: #f8fafb; }
.admin-customers { overflow: hidden; }
.account-summary { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 18px; color: var(--muted); font-size: .8rem; }

.marketing-page { background: var(--navy); }
.marketing-nav { position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: flex; width: min(1240px, calc(100% - 48px)); height: 86px; align-items: center; justify-content: space-between; margin: auto; }
.marketing-nav .brand { color: white; }
.marketing-nav .brand small { color: #71dad4; }
.hero { position: relative; display: grid; min-height: 720px; grid-template-columns: minmax(0,1fr) minmax(420px,.9fr); align-items: center; gap: 70px; overflow: hidden; background: radial-gradient(circle at 85% 25%, rgba(25,139,145,.35), transparent 30%), linear-gradient(128deg,#091f34 10%,#0e2e49 72%,#0d555d); padding: 130px max(48px, calc((100vw - 1240px) / 2)) 90px; color: white; }
.hero::after { position: absolute; right: -130px; bottom: -240px; width: 570px; height: 570px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.018); }
.hero__content { position: relative; z-index: 1; max-width: 660px; }
.hero h1 { max-width: 650px; font-size: clamp(3rem, 5.6vw, 5.1rem); letter-spacing: -.065em; }
.hero__content > p { max-width: 590px; margin-bottom: 2rem; color: #c9d8e1; font-size: 1.18rem; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 2rem; color: #a8becb; font-size: .76rem; font-weight: 600; }
.hero__trust span::before { margin-right: .4rem; color: #71dad4; content: "✓"; }
.hero__visual { position: relative; z-index: 1; perspective: 1200px; }
.preview-window { overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 20px; background: white; color: var(--ink); box-shadow: 0 40px 100px rgba(0,0,0,.32); transform: rotateY(-5deg) rotateX(2deg); }
.preview-window__top { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 14px 16px; }
.preview-window__top span { width: 8px; height: 8px; border-radius: 50%; background: #d6e0e5; }
.preview-window__top span:first-child { background: var(--coral); }
.preview-window__top em { margin-left: auto; color: var(--muted); font-size: .65rem; font-style: normal; font-weight: 700; }
.preview-summary { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 26px 18px; }
.preview-summary small, .preview-summary strong { display: block; }
.preview-summary small { color: var(--muted); font-size: .58rem; letter-spacing: .1em; }
.preview-summary strong { margin-top: .25rem; color: var(--navy); font-family: "Aptos Display", "Segoe UI", sans-serif; font-size: 1.65rem; }
.preview-client { border-block: 1px solid #edf1f3; padding: 17px 26px; }
.preview-client strong, .preview-client span { display: block; }
.preview-client span { margin-top: .25rem; color: var(--muted); font-size: .74rem; }
.preview-flow { margin: 0; padding: 12px 26px 26px; list-style: none; }
.preview-flow li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; }
.preview-flow li > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: .68rem; font-weight: 800; }
.preview-flow li strong, .preview-flow li small { display: block; }
.preview-flow li strong { font-size: .78rem; }
.preview-flow li small { color: var(--muted); font-size: .64rem; }
.preview-flow .is-done > span { border-color: var(--teal); background: var(--teal); color: white; }
.preview-flow .is-current > span { border-color: var(--coral); color: var(--coral-dark); box-shadow: 0 0 0 4px #fff0ee; }
.feature-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: rgba(255,255,255,.12); }
.feature-strip article { background: #f6f8f9; padding: 50px max(35px, calc((100vw - 1240px) / 6)); }
.feature-strip article > span { color: var(--coral); font-size: .72rem; font-weight: 800; letter-spacing: .1em; }
.feature-strip h2 { margin: .9rem 0 .5rem; color: var(--navy); }
.feature-strip p { margin: 0; color: var(--muted); }
.marketing-footer { display: flex; justify-content: space-between; padding: 28px max(24px, calc((100vw - 1240px) / 2)); color: #8ea5b3; font-size: .72rem; }

.auth-page { min-height: 100vh; background: radial-gradient(circle at 20% 10%, rgba(21,138,143,.4),transparent 28%), var(--navy); }
.auth-shell { display: grid; min-height: 100vh; place-items: center; align-content: center; padding: 42px 20px; }
.auth-brand { margin-bottom: 22px; color: white; }
.auth-brand .brand small { color: #71dad4; }
.auth-card { width: min(445px, 100%); border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: white; padding: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.auth-card h1 { font-size: 2.1rem; }
.auth-card > p { color: var(--muted); }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 18px; color: var(--teal); font-size: .78rem; font-weight: 700; }
.auth-footnote { border-top: 1px solid var(--line); margin: 22px 0 0 !important; padding-top: 17px; font-size: .72rem; text-align: center; }
.logout-form { margin-top: 16px; text-align: center; }
.link-button { border: 0; background: transparent; color: var(--teal); cursor: pointer; font-weight: 700; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .record-grid { grid-template-columns: 1fr; }
    .record-aside { grid-template-columns: 1fr 1fr; }
    .filters { grid-template-columns: minmax(260px,1fr) 1fr 1fr; }
    .filters .button { align-self: stretch; }
    .admin-stat-grid { grid-template-columns: repeat(3, 1fr); }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { grid-template-columns: 1fr 1fr; }
    .hero { grid-template-columns: 1fr 420px; gap: 30px; }
}

@media (max-width: 820px) {
    .app-header { height: 64px; padding: 0 18px; }
    .nav-toggle { display: block; }
    .app-nav { position: absolute; top: 64px; right: 12px; left: 12px; display: none; height: auto; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 8px; box-shadow: var(--shadow); }
    .app-nav.is-open { display: grid; }
    .app-nav > a, .app-nav > form button { width: 100%; height: 44px; border-radius: 8px; padding: 0 12px; }
    .app-nav > a.is-active::after { display: none; }
    .app-nav > a.is-active { background: var(--sky); }
    .app-nav > .nav-new { margin: 0; }
    .page-shell { width: min(100% - 28px, 1400px); padding-top: 30px; }
    .page-heading, .record-heading { align-items: flex-start; flex-direction: column; gap: 1.1rem; }
    .heading-actions { flex-wrap: wrap; }
    .filters { grid-template-columns: 1fr 1fr; }
    .filter-search { grid-column: 1/-1; }
    .record-summary-grid { grid-template-columns: 1fr; }
    .record-aside { grid-template-columns: 1fr; }
    .activity-form { grid-template-columns: 1fr 1fr; }
    .activity-form textarea { grid-column: 1/-1; }
    .activity-form button { grid-column: 1/-1; }
    .admin-sidebar { grid-template-columns: 1fr; }
    .admin-filters { grid-template-columns: 1fr 1fr; }
    .hero { min-height: auto; grid-template-columns: 1fr; padding: 130px 26px 70px; }
    .hero__visual { width: min(520px,100%); }
    .feature-strip { grid-template-columns: 1fr; }
    .feature-strip article { padding: 35px 26px; }
}

@media (max-width: 580px) {
    h1 { font-size: 2rem; }
    .brand strong { font-size: 1rem; }
    .brand__mark { width: 38px; height: 38px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 150px; padding: 18px; }
    .stat-card strong { font-size: 1.45rem; }
    .attention-row { grid-template-columns: 10px 1fr 18px; }
    .attention-action { grid-column: 2 / 3; text-align: left; }
    .pipeline-list a { grid-template-columns: 120px 1fr 24px; }
    .filters, .admin-filters { grid-template-columns: 1fr; }
    .filter-search { grid-column: auto; }
    .form-section { padding: 24px 18px; }
    .form-grid, .checklist-grid, .details-grid { grid-template-columns: 1fr; }
    .field-span-2 { grid-column: auto; }
    .details-grid > div, .details-grid > div:nth-child(even) { padding-left: 0; }
    .field-pair { grid-template-columns: 1fr 1fr; }
    .form-actions { padding: 20px 18px; }
    .activity-form { grid-template-columns: 1fr; padding: 18px; }
    .activity-form textarea, .activity-form button { grid-column: auto; }
    .timeline { padding-inline: 18px; }
    .admin-stat-grid { grid-template-columns: repeat(2,1fr); }
    .account-summary { align-items: flex-start; flex-direction: column; }
    .marketing-nav { width: calc(100% - 36px); }
    .marketing-nav .button { min-height: 38px; padding-inline: .75rem; font-size: .76rem; }
    .hero h1 { font-size: 3.05rem; }
    .preview-window { transform: none; }
    .marketing-footer { align-items: center; flex-direction: column; gap: .5rem; text-align: center; }
    .auth-card { padding: 28px 22px; }
}
