/* RetireGov — shared application stylesheet.
   System fonts only, no CDN dependencies. Print-friendly. */

:root {
    --accent: #1f4e79;
    --accent-dark: #163a5c;
    --ink: #1c2126;
    --muted: #5e6a75;
    --line: #dde3ea;
    --bg: #f0f3f7;
    --card: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 34, 53, 0.05), 0 4px 14px rgba(16, 34, 53, 0.05);
    --danger: #a4262c;
    --danger-bg: #fbeae9;
    --warn-bg: #fff4ce;
    --warn-ink: #6d5a10;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1 { font-size: 25px; font-weight: 650; letter-spacing: -0.015em; margin: 26px 0 12px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 30px 0 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.muted { color: var(--muted); }

/* ---- header / nav ---- */

.site-header {
    background: linear-gradient(180deg, #235684 0%, var(--accent) 60%, #1b4569 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 2px 10px rgba(16, 34, 53, 0.22);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    min-height: 52px;
    padding-top: 6px;
    padding-bottom: 6px;
    padding-left: 16px;
    padding-right: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.brand {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-decoration: none;
}
.brand:hover { color: #fff; }

nav.nav { display: flex; gap: 18px; flex: 1 1 auto; }

nav.nav a {
    color: #d9e5f1;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.12s ease, color 0.12s ease;
}
nav.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.user-box {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #cddced;
}
.user-box strong { color: #fff; font-weight: 600; }
.user-box a { color: #fff; }

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    padding: 14px 0 24px;
    margin-top: 32px;
}

/* ---- centered card (login / reset) ---- */

.card-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 32px 26px;
    width: 100%;
    max-width: 400px;
}

.card-title {
    margin: 0 0 2px;
    font-size: 24px;
    color: var(--accent);
    text-align: center;
}

.card-sub {
    margin: 0 0 18px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ---- forms ---- */

form { margin: 0; }

.field { margin-bottom: 14px; }

.field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="tel"],
.field select {
    width: 100%;
    padding: 7px 9px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.18);
}

.help { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 4px 18px;
}

.form-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }

/* ---- buttons ---- */

.btn {
    display: inline-block;
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    padding: 7px 14px;
    border: 1px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
    transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}
.btn:hover { background: #eef3f8; box-shadow: 0 1px 4px rgba(16, 34, 53, 0.12); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(180deg, #26598a, var(--accent));
    color: #fff;
    box-shadow: 0 1px 3px rgba(16, 34, 53, 0.25);
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-small { padding: 3px 10px; font-size: 13px; }

.btn-block { width: 100%; }

.btn-link { border-color: transparent; background: transparent; }

/* ---- alerts / badges ---- */

.alert {
    padding: 9px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 14px;
}
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #e5b6b4;
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 9px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    white-space: nowrap;
}
.badge-off {
    background: #e8eaec;
    color: #5a6068;
    border: 1px solid #c9ced4;
}

/* disabled-agent rows read as inactive */
table.data tbody tr.row-disabled td { color: #969ca3; }
table.data tbody tr.row-disabled td a { color: inherit; }

.inline-form { display: inline-block; margin-left: 6px; }

/* ---- issue tracker ---- */

.status-pill {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 10px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.st-new         { background: #e8f0fa; color: #1f4e79; border-color: #b9d0e8; }
.st-triaged     { background: #f3ecfa; color: #5b3a8e; border-color: #d5c4ec; }
.st-in-progress { background: #fdf3e0; color: #8a5a00; border-color: #ecd4a2; }
.st-on-hold     { background: #eeeff1; color: #5b636b; border-color: #cfd4d9; }
.st-resolved    { background: #e9f4ee; color: #1e6b40; border-color: #b8dcc7; }
.st-closed      { background: #e5e7e9; color: #4c5257; border-color: #c6cacd; }

.issue-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px 18px;
    margin-bottom: 14px;
}
.issue-meta b {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 3px;
}

.comment { border-top: 1px solid var(--line); padding: 10px 0; }
.comment:first-of-type { border-top: none; }
.comment-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 2px; }
.comment p { margin: 4px 0 0; }

.history { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.history li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.history li:last-child { border-bottom: none; }

/* ---- client portal (client-facing chrome) ---- */

body.portal { background: #f2f5f7; }
.portal-head { background: #1f4e79; }
.portal-head-inner { max-width: 860px; margin: 0 auto; padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: baseline; }
.portal-brand { color: #fff; font-size: 19px; font-weight: 700; }
.portal-sub { font-weight: 400; font-size: 13px; opacity: 0.85; margin-left: 8px; }
.portal-signout { color: #cfe0f0; font-size: 14px; text-decoration: none; }
.portal-signout:hover { color: #fff; }
.portal-signout-btn { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.portal-wrap { max-width: 860px; margin: 0 auto; padding: 26px 20px 40px; }
.portal-card { background: #fff; border: 1px solid var(--line); border-radius: 8px;
    padding: 26px 30px; max-width: 460px; margin: 30px auto; }
.portal-card.portal-wide { max-width: 860px; margin: 0 auto; }
.portal-card h1 { margin: 0 0 8px; font-size: 24px; }
.portal-card h2 { font-size: 17px; margin: 26px 0 10px; color: #1f4e79;
    border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.portal-card .field { margin-bottom: 14px; }
.portal-card label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.portal-card input, .portal-card select { width: 100%; font: inherit; padding: 9px 10px;
    border: 1px solid var(--line); border-radius: 5px; }
.portal-foot { max-width: 860px; margin: 0 auto; padding: 10px 20px 30px;
    color: var(--muted); font-size: 12.5px; text-align: center; }
.portal-invite-flash { background: #e9f4ee; border: 1px solid #9ec4ad; border-radius: 5px;
    padding: 10px 14px; margin: 8px 0; font-size: 13.5px; flex-basis: 100%; }
.portal-invite-link { width: 100%; font: 12px Consolas, monospace; margin-top: 6px;
    padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; }

/* unsaved-changes modal */
.ug-overlay { position: fixed; inset: 0; background: rgba(20, 26, 32, 0.55);
    display: flex; align-items: center; justify-content: center; z-index: 1000; }
/* display:flex above would defeat the hidden attribute without this */
.ug-overlay[hidden] { display: none !important; }
.ug-modal { background: #fff; border-radius: 8px; padding: 22px 26px; max-width: 440px;
    width: calc(100% - 40px); box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.ug-modal h3 { margin: 0 0 6px; font-size: 18px; }
.ug-msg { margin: 0 0 14px; color: var(--muted); }
.ug-err { background: var(--danger-bg, #fbeeec); color: var(--danger, #8f2318);
    border: 1px solid #e5b6b4; border-radius: 5px; padding: 9px 12px; font-size: 13.5px; }
.ug-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* journey stepper (client) + agent portal panel */
.journey { list-style: none; display: flex; gap: 4px; padding: 0; margin: 18px 0 10px; flex-wrap: wrap; }
.journey li { flex: 1; min-width: 96px; text-align: center; position: relative; }
.journey li:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: 50%;
    width: 100%; height: 2px; background: var(--line); z-index: 0; }
.journey li.done:not(:last-child)::after { background: #1e6b40; }
.journey-dot { position: relative; z-index: 1; display: inline-flex; width: 28px; height: 28px;
    border-radius: 50%; align-items: center; justify-content: center; font-weight: 700;
    font-size: 13px; background: #e8eaec; color: #5b636b; border: 2px solid var(--line); }
.journey li.done .journey-dot { background: #1e6b40; color: #fff; border-color: #1e6b40; }
.journey li.now .journey-dot { background: #1f4e79; color: #fff; border-color: #1f4e79; }
.journey-label { display: block; font-size: 11.5px; margin-top: 6px; color: var(--muted); }
.journey li.now .journey-label { color: #1f4e79; font-weight: 700; }
.journey-guide { font-size: 15px; background: #eaf1f8; border-left: 4px solid #1f4e79;
    padding: 10px 14px; margin: 14px 0 18px; }
.portal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
table.portal-docs td { white-space: normal; width: auto; }
.portal-panel summary { cursor: pointer; font-size: 15px; }
.portal-panel-body { margin-top: 12px; }
.portal-panel-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.portal-upload input[type="file"] { font-size: 13px; }
.portal-upload input[type="text"] { font: inherit; padding: 5px 8px; border: 1px solid var(--line);
    border-radius: 4px; width: 180px; }

/* ---- client worksheets ---- */

.ws-panel h3 { margin: 4px 0 8px; }
.ws-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 22px; }
table.ws { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.ws th, table.ws td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
table.ws th { background: #e9eef3; }
table.ws td:last-child { white-space: nowrap; width: 150px; }
table.ws tr.ws-total td { font-weight: 700; background: #f2f4f6; border-top: 2px solid var(--rule-strong, #aab2ba); }
table.ws tr.ws-surplus td { background: #e9f4ee; }
table.ws tr.ws-negative td { background: #fbeeec; color: #8f2318; }
.ws-cell { display: inline-flex; align-items: center; gap: 4px; }
input.ws-money { width: 96px; font: inherit; padding: 4px 6px; border: 1px solid var(--line);
                 border-radius: 3px; text-align: right; }
.ws-chip { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: #1e6b40;
           background: #e9f4ee; border: 1px solid #9ec4ad; border-radius: 8px; padding: 1px 6px; }
.ws-panel textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; }
.ws-panel .field { margin: 10px 0 0; }
.ws-panel .field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }

/* ---- tables ---- */

.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

table.data {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

table.data th,
table.data td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    white-space: nowrap;
}

table.data th {
    background: #f6f8fa;
    color: #55616d;
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    border-bottom: 2px solid var(--line);
}

/* click-to-sort affordances (table-sort.js) */
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--accent); background: #eef3f8; }
table.data th.sortable::after { content: ""; margin-left: 5px; font-size: 9px; }
table.data th.sorted-asc::after { content: "B2"; color: var(--accent); }
table.data th.sorted-desc::after { content: "BC"; color: var(--accent); }

table.data tbody tr { transition: background 0.08s ease; }
table.data tbody tr:nth-child(even) { background: #fafbfc; }
table.data tbody tr:hover { background: #eef4fa; }
table.data tbody tr:last-child td { border-bottom: none; }

.variants { font-size: 12px; color: var(--muted); }
.variants a { margin-left: 4px; }

/* ---- page furniture ---- */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 8px; }

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0 14px;
    flex-wrap: wrap;
}
.search-form input[type="text"] {
    font: inherit;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    width: 320px;
    max-width: 100%;
}
.search-form input[type="date"],
.search-form select {
    font: inherit;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
}
.search-form .filter-label { font-size: 13px; color: var(--muted); }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px 14px;
    margin: 14px 0 22px;
}
.panel h2 { margin-top: 0; }

/* ---- change management (ECP) ---- */

/* change-request state pills, one per state-machine state */
.cs-draft          { background: #eeeff1; color: #5b636b; border-color: #cfd4d9; }
.cs-proposed       { background: #e8f0fa; color: #1f4e79; border-color: #b9d0e8; }
.cs-approved       { background: #e9f4ee; color: #1e6b40; border-color: #b8dcc7; }
.cs-rejected       { background: #fbeae9; color: #a4262c; border-color: #e5b6b4; }
.cs-deferred       { background: #eeeff1; color: #5b636b; border-color: #cfd4d9; }
.cs-in-development { background: #fdf3e0; color: #8a5a00; border-color: #ecd4a2; }
.cs-verifying      { background: #f3ecfa; color: #5b3a8e; border-color: #d5c4ec; }
.cs-packet-review  { background: #fdf3e0; color: #8a5a00; border-color: #ecd4a2; }
.cs-deployed       { background: #e9f4ee; color: #1e6b40; border-color: #b8dcc7; }
.cs-rolled-back    { background: #fbeae9; color: #a4262c; border-color: #e5b6b4; }
.cs-closed         { background: #e5e7e9; color: #4c5257; border-color: #c6cacd; }

/* ---- app shell: sidebar + topbar (2026-09; Alpine-driven) ---- */
[x-cloak] { display: none !important; }
.app-body { margin: 0; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.shell.nav-mini { grid-template-columns: 64px minmax(0, 1fr); }

.ico { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.7;
       fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.sidebar {
    background: linear-gradient(180deg, #235684 0%, var(--accent) 55%, #17395c 100%);
    color: #d7e3f0; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 70;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px; }
.side-brand a { display: flex; align-items: center; gap: 10px; color: #fff;
    text-decoration: none; min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--accent);
    font-weight: 800; font-size: 15px; letter-spacing: .5px; flex: 0 0 auto; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.mini-toggle { margin-left: auto; background: transparent; border: 0; color: #9fbbd6;
    cursor: pointer; padding: 6px; border-radius: 6px; display: flex; }
.mini-toggle:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.mini-toggle .ico { transition: transform .15s ease; }

.side-nav { flex: 1; padding: 6px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-section { margin: 14px 6px 4px; font-size: 10.5px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: #8fadcb; white-space: nowrap; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px;
    border-radius: 8px; color: #d7e3f0; text-decoration: none; font-size: 14px;
    border-left: 3px solid transparent; white-space: nowrap; }
.side-link:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.side-link.is-active { background: rgba(255, 255, 255, .16); color: #fff;
    border-left-color: #8fc0ea; font-weight: 600; }
.side-foot { padding: 10px 14px 14px; font-size: 11px; color: #7c9cbd; white-space: nowrap; }

.nav-mini .brand-name, .nav-mini .side-link .lbl, .nav-mini .side-foot .lbl,
.nav-mini .side-section span { display: none; }
.nav-mini .side-section { height: 1px; background: rgba(255, 255, 255, .16); margin: 12px 10px; }
.nav-mini .side-link { justify-content: center; padding: 10px 0; }
.nav-mini .side-brand { justify-content: center; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
.nav-mini .mini-toggle { margin: 6px 0 0; }

.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
    gap: 12px; background: var(--card); border-bottom: 1px solid var(--line);
    padding: 8px 18px; min-height: 54px; }
.top-title { font-size: 14px; font-weight: 600; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; background: transparent; border: 0; cursor: pointer;
    color: var(--ink); padding: 8px; border-radius: 8px; }
.burger:hover { background: var(--bg); }

.user-wrap { margin-left: auto; position: relative; }
.avatar-btn { display: flex; align-items: center; gap: 9px; background: transparent;
    border: 0; cursor: pointer; padding: 5px 8px; border-radius: 999px; color: var(--ink); }
.avatar-btn:hover { background: var(--bg); }
.avatar { display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #2a5d8c, var(--accent)); color: #fff;
    font-size: 12.5px; font-weight: 700; letter-spacing: .5px; }
.user-name { font-size: 13.5px; font-weight: 600; }
.chev-down { width: 14px; height: 14px; transform: rotate(90deg); color: var(--muted); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(16, 34, 53, .16); padding: 6px; z-index: 50; }
.menu-head { padding: 9px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.menu-head strong { display: block; font-size: 14px; }
.menu-head span { font-size: 12px; color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.menu-item:hover { background: var(--bg); }
.menu-item .ico { color: var(--muted); }

.main-col .wrap { width: 100%; padding-top: 20px; }
.main-col .site-footer { margin-top: auto; padding: 14px 18px 20px; }
.scrim { display: none; }

/* phones + narrow: the sidebar becomes a drawer */
@media (max-width: 900px) {
    .shell, .shell.nav-mini { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; height: 100dvh;
        transform: translateX(-102%); transition: transform .18s ease; box-shadow: none; }
    .nav-open .sidebar { transform: translateX(0);
        box-shadow: 0 0 40px rgba(10, 25, 40, .45); }
    /* the drawer always shows labels, whatever the desktop collapse state */
    .nav-mini .brand-name, .nav-mini .side-link .lbl, .nav-mini .side-foot .lbl,
    .nav-mini .side-section span { display: revert; }
    .nav-mini .side-section { height: auto; background: transparent; margin: 14px 6px 4px; }
    .nav-mini .side-link { justify-content: flex-start; padding: 9px 10px; }
    .mini-toggle { display: none; }
    .burger { display: flex; }
    .user-name { display: none; }
    .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 25, 40, .45); z-index: 60; }
    .page-head, .search-form { flex-wrap: wrap; gap: 8px; }
    .search-form input[type="text"], .search-form select { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .mini-toggle .ico { transition: none; }
}

/* login card polish */
.login-brand { text-align: center; margin-bottom: 16px; }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 13px; font-size: 22px;
    background: linear-gradient(135deg, #2a5d8c, var(--accent)); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.login-card .btn-block { display: flex; align-items: center; justify-content: center; gap: 9px; }
.ico-btn { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7;
    fill: none; stroke-linecap: round; stroke-linejoin: round; }
.login-foot { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ---- engine models registry (release-note cards) ---- */
.model-card { margin-bottom: 18px; }
.model-head { display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; }
.model-head h2 { margin: 0 0 2px; }
.model-meta { font-size: 13px; color: var(--muted); }
.model-meta code { font-size: 12.5px; }
.model-desc { max-width: 78ch; font-size: 13.5px; margin: 8px 0 4px; }
.model-none { color: #1e6b40; font-size: 13.5px; margin: 10px 0 2px; }
.corr-h { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); }
.corr-list { list-style: none; margin: 0; padding: 0; }
.corr-list li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 8px 2px; border-top: 1px solid var(--line); }
.corr-code { font-weight: 700; font-size: 13.5px; white-space: nowrap;
    min-width: 4.6em; text-decoration: none; }
.corr-title { flex: 1 1 0; min-width: 0; font-size: 13.5px; }
/* narrow: side row (state + issue chips) drops under the title cleanly */
@media (max-width: 560px) {
    .corr-list li { display: block; }
    .corr-list li .corr-side { margin-top: 5px; }
    .corr-list li .corr-code { margin-right: 6px; }
}
.corr-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rg-link { display: inline-block; font-size: 11.5px; font-weight: 700;
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
    padding: 1px 9px; text-decoration: none; white-space: nowrap; }
.rg-link:hover { border-color: var(--accent); }
.rg-done { background: #e9f4ee; border-color: #b8dcc7; color: #1e6b40; }

/* ---- analytics dashboard (Chart.js) ---- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card h2 { margin-bottom: 2px; }
.chart-head { display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; }
.chart-sub { margin: 0 0 10px; font-size: 12.5px; }
.chart-box { position: relative; height: 300px; }
.chart-toggle { display: flex; gap: 6px; }

/* ---- organization profile + vendor console ---- */
.stat-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.stat-card { flex: 1 1 110px; background: var(--panel-bg, #fff); border: 1px solid #d7dde3;
             border-radius: var(--radius, 8px); padding: 10px 14px; text-align: center; }
.stat-card b { display: block; font-size: 22px; line-height: 1.2; }
.stat-card span { color: #5b6672; font-size: 12.5px; }
.org-logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.org-logo { max-height: 64px; max-width: 240px; border: 1px solid #d7dde3;
            border-radius: 6px; padding: 4px; background: #fff; }
.chart-row { display: flex; gap: 28px; flex-wrap: wrap; }
.chart-row > div { flex: 1 1 300px; }
.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 90px; padding: 4px 0; }
.bar-chart .bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.bar-chart .bar span { display: block; width: 100%; background: #1f4e79;
                       border-radius: 2px 2px 0 0; min-height: 2px; }
.spark-cell { color: #1f4e79; }
.spark { display: block; }
.renewal-due { color: #a4262c; font-weight: 600; }
.alert-ok { background: #e9f4ee; color: #1e6b40; border: 1px solid #b8dcc7;
            border-radius: 5px; padding: 8px 12px; }
/* organization status pills (issue st-* classes cover other vocabularies) */
.st-active    { background: #e9f4ee; color: #1e6b40; border-color: #b8dcc7; }
.st-trial     { background: #e8f0fa; color: #1f4e79; border-color: #b9d0e8; }
.st-suspended { background: #fbeae9; color: #a4262c; border-color: #e5b6b4; }

/* issue <-> change-request links: chips on the issue page, inline
   link/unlink forms in the vendor manage panel, and the resolve nudge */
.ecr-chip { text-decoration: none; margin-right: 4px; }
.ecr-links form { display: inline-flex; gap: 6px; align-items: center; margin: 0 10px 6px 0; }
.nudge-resolve { border-left: 4px solid #1e6b40; }

/* sign-off decision pills */
.de-pending  { background: var(--warn-bg); color: var(--warn-ink); border-color: #e6d493; }
.de-approved { background: #e9f4ee; color: #1e6b40; border-color: #b8dcc7; }
.de-rejected { background: #fbeae9; color: #a4262c; border-color: #e5b6b4; }

.signoff-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.signoff-form input[type="text"] {
    font: inherit; font-size: 13px; padding: 4px 7px; width: 180px;
    border: 1px solid var(--line); border-radius: 4px;
}
.btn-reject { color: var(--danger); border-color: #e5b6b4; }
.btn-reject:hover { background: var(--danger-bg); }

.transition-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.transition-form strong, .transition-form .muted, .transition-form .alert { flex-basis: 100%; margin: 0; }
.transition-form .muted { font-size: 13px; }
.transition-form input[type="text"] {
    font: inherit; font-size: 13px; padding: 5px 8px; min-width: 280px; flex: 1;
    border: 1px solid var(--line); border-radius: 4px;
}
.transition-form button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- environment banner (staging etc.) ---- */
.env-banner { background: repeating-linear-gradient(45deg, #b3450e, #b3450e 14px, #8f3407 14px, #8f3407 28px);
    color: #fff; text-align: center; font-size: 13px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; }

/* ---- engine model picker ---- */

.model-pick { margin: 10px 0 0; font-size: 13px; }
.model-pick label { font-weight: 600; margin-right: 8px; }
.model-pick select { font: inherit; font-size: 13px; padding: 4px 8px;
    border: 1px solid var(--line); border-radius: 6px; }

/* ---- lead funnel ---- */

.pill-hot { background: #fdebe0; color: #b3450e; border-color: #f0c4a8; }

.qr-panel { display: flex; gap: 22px; align-items: flex-start; }
.qr-panel .qr-box { flex: 0 0 auto; background: #fff; border: 1px solid var(--line);
    border-radius: 6px; padding: 10px; }
.qr-panel h2 { margin: 0 0 8px; }
@media print {
    /* the printed page is the QR handout: everything else hides */
    .qr-panel { border: none; }
    .qr-panel .qr-box img { width: 320px; height: 320px; }
    .qr-panel .btn { display: none; }
}

/* ---- print ---- */

@media print {
    body { background: #fff; font-size: 12px; }
    .site-header, .site-footer, .search-form, .btn, .no-print { display: none !important; }
    .wrap { max-width: none; padding: 0; }
    .table-scroll { border: none; overflow: visible; }
    table.data th { background: #fff; border-bottom: 2px solid #000; }
    a { color: #000; text-decoration: none; }
}

/* ---- modest screens ---- */

@media (max-width: 640px) {
    .header-inner { gap: 10px; }
    .user-box { width: 100%; justify-content: flex-start; }
    .card { padding: 22px 18px; }
}

/* ==== desktop-style client editor (matches the WinForms FormMain look) ==== */

.sheet {
    background: #fff;
    border: 1px solid #b8bfc6;
    max-width: 1060px;
    margin: 8px auto 40px;
    padding: 26px 34px 30px;
    box-shadow: 0 2px 14px rgba(20, 40, 60, 0.10);
}

.fgroup { margin: 0 0 26px; }
.fgroup > h2 {
    color: #c00000;               /* the desktop's red group headings */
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    border-bottom: 1px solid #e4e7ea;
    padding-bottom: 3px;
}

/* label right-aligned in a fixed column, control(s) to the right */
.frow {
    display: grid;
    grid-template-columns: 220px auto;
    align-items: center;
    gap: 6px 12px;
    margin-bottom: 9px;
}
.frow > label {
    text-align: right;
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
}
.frow.pair { grid-template-columns: 220px minmax(0, 1fr) 130px minmax(0, 1fr); }
.frow.pair input { width: 100%; min-width: 0; }
.frow.calc { grid-template-columns: 220px auto auto auto auto; justify-content: start; }
.frow .unit { font-weight: 600; font-size: 13px; }
.frow label.inline { text-align: left; font-weight: 600; }
.frow label.inline.first { grid-column: 2; }

.sheet input[type="text"],
.sheet input[type="tel"],
.sheet input[type="email"],
.sheet input[type="date"],
.sheet input[type="number"],
.sheet select {
    font: inherit;
    font-size: 13.5px;
    padding: 4px 7px;
    border: 1px solid #8d949c;
    border-radius: 2px;
    background: #fff;
    color: var(--ink);
}
.sheet input:focus, .sheet select:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}
.sheet input[readonly] { background: #f2f2f2; }

.w-name  { width: 220px; }
.w-wide  { width: 260px; }
.w-date  { width: 160px; }
.w-num   { width: 90px; }

/* Employee Data: form column + children box side by side */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.split .col { min-width: 0; }
.children-box .child-add { display: flex; gap: 8px; margin: 4px 0 8px; }
.children-box .child-add input { width: 70px; }
.chips { list-style: none; margin: 0; padding: 0; min-height: 90px; border: 1px solid #b8bfc6; background: #fff; }
.chips li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 3px 8px; border-bottom: 1px solid #eceff1; font-size: 13.5px;
}
.chips li button {
    border: none; background: none; color: var(--danger);
    font-weight: 700; cursor: pointer; font-size: 13px; padding: 0 3px;
}

/* mini group boxes (FERS/CSRS, Type of Retirement, FEGLI elections) */
.minibox {
    display: inline-flex; align-items: center; gap: 16px;
    border: 1px solid #b8bfc6; border-radius: 3px;
    padding: 12px 16px 10px; position: relative; margin-top: 8px;
    background: #fff;
}
.minibox-title {
    position: absolute; top: -9px; left: 10px;
    background: #fff; padding: 0 6px;
    font-size: 12px; font-weight: 700; color: #444;
}
.minibox label.inline { font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.children-box { display: block; }
.children-box.minibox { padding-top: 14px; }

.band { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.band .frow { margin-bottom: 0; grid-template-columns: auto auto; }
.band .frow > label { text-align: left; }

/* Time In Service table */
.tis-table { display: grid; grid-template-columns: 130px 170px 170px auto; gap: 7px 14px; align-items: center; }
.tis-head { display: contents; }
.tis-head > span, .tis-head > label { font-weight: 700; font-size: 13px; }
.tis-head > label.inline { justify-self: end; font-weight: 600; }
.tis-row { display: contents; }
.tis-row > label { text-align: right; font-weight: 600; font-size: 13.5px; }

.hint { font-size: 12px; color: var(--muted); margin: 8px 0 10px; }
.fear-title { font-weight: 700; font-size: 12.5px; letter-spacing: 0.4px; margin: 16px 0 4px; color: #333; }

.sheet-actions { justify-content: center; margin-top: 6px; }

.report-menu { position: relative; }
.report-menu summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.report-links { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 0; }

@media (max-width: 760px) {
    .sheet { padding: 18px 14px; }
    .split { grid-template-columns: 1fr; }
    .frow, .frow.pair, .frow.calc { grid-template-columns: 1fr; }
    .frow > label, .tis-row > label { text-align: left; }
    .tis-table { grid-template-columns: 1fr 1fr; }
    .tis-head > span:first-child { display: none; }
}

/* ==== sticky filter panel above the clients/issues grids ====
   z-scale contract (see the shell block): page stickies stay at z-10,
   BELOW the topbar (50), the drawer scrim (60), and the drawer (70) —
   so the user menu and the mobile drawer always paint on top. */

.list-tools {
    position: sticky;
    top: 54px;                 /* just below the topbar */
    z-index: 10;
    background: var(--bg);
    padding: 10px 0 2px;
    margin: 0 0 6px;
    border-bottom: 1px solid var(--line);
}
.list-tools .page-head h1 { margin: 4px 0 8px; }
.list-tools .search-form { margin: 0 0 8px; }
.list-tools .muted { margin: 0 0 8px; font-size: 13px; }

/* phones: the panel is half a screen tall — it must scroll away, not float */
@media (max-width: 900px) {
    .list-tools { position: static; top: auto; }
}

@media print {
    .list-tools { position: static; box-shadow: none; }
}

/* ==== Scenario Studio ====
   The one wide page: .wrap-wide lifts the shell cap for the studio grid.
   Lever panel left (sticky on tall screens), results right; stacks <=1100px.
   Sticky rule: the aside has no z-index, so it stays under the topbar (50)
   per the z-scale contract. */
.wrap-wide { max-width: 1560px; }
.scn-sub { color: var(--muted); font-size: 14px; margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scn-model-chip { font-size: 11.5px; background: #eef3f9; color: var(--accent); border: 1px solid #d3e0ee; border-radius: 999px; padding: 1px 9px; font-weight: 600; }
.scn-layout { display: grid; grid-template-columns: 352px minmax(0, 1fr); gap: 18px; align-items: start; }
.scn-side { position: sticky; top: 62px; max-height: calc(100vh - 76px); overflow-y: auto; padding-right: 2px; }
.scn-side .panel { margin: 0 0 12px; }
.scn-group h2 { font-size: 14px; }
.scn-lab { display: block; font-weight: 600; font-size: 12.5px; margin: 8px 0 3px; }
.scn-manage select, .scn-manage input[type=text], .scn-lever select,
.scn-lever input[type=number], .scn-manual-grid input, .scn-spouse-search input,
.scn-compare select {
    width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px;
    font-size: 13.5px; background: #fff; color: var(--ink); box-sizing: border-box;
}
.scn-manage select:focus, .scn-manage input:focus, .scn-lever select:focus,
.scn-lever input[type=number]:focus, .scn-manual-grid input:focus, .scn-spouse-search input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.14);
}
.scn-manage-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.scn-export { margin-top: 10px; }
.scn-lever { margin: 10px 0 12px; }
.scn-lever-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; gap: 8px; }
.scn-lever-head label { font-weight: 600; }
.scn-lever-head b { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scn-lever input[type=range] { width: 100%; accent-color: var(--accent); margin: 6px 0 2px; }
.scn-lever-note { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.scn-lever-note b { color: var(--ink); font-variant-numeric: tabular-nums; }
.scn-check { display: flex; gap: 7px; align-items: center; font-size: 13px; font-weight: 600; margin: 10px 0 4px; flex-wrap: wrap; }
.scn-check input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.scn-check .scn-lever-note { font-weight: 400; margin: 0; }
.scn-hintchip { font-size: 10.5px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 999px; padding: 1px 8px; font-weight: 600; cursor: help; }
.scn-spouse-linked { font-size: 13px; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.scn-spouse-search { display: flex; gap: 6px; margin: 8px 0; }
.scn-spouse-search input { flex: 1 1 0; min-width: 0; width: auto; }
.scn-matches { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; }
.scn-matches a { display: block; padding: 4px 8px; border-radius: 6px; text-decoration: none; }
.scn-matches a:hover { background: #eef3f9; }
.scn-manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0; font-size: 12.5px; }
.scn-manual-grid label { font-weight: 600; }
.scn-manual-grid input { margin-top: 2px; }
.scn-check-cell { display: flex; gap: 6px; align-items: center; align-self: end; padding-bottom: 6px; }
.scn-check-cell input { width: 15px; height: 15px; accent-color: var(--accent); }
.scn-stats { margin-bottom: 12px; }
.scn-stats .stat-card b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-card.scn-good b { color: #1e6b40; }
.stat-card.scn-warn b { color: #6d5a10; }
.stat-card.scn-bad b { color: var(--danger); }
.scn-compare { display: flex; gap: 10px; align-items: center; margin: 2px 0 12px; font-size: 13px; flex-wrap: wrap; }
.scn-compare label { font-weight: 600; }
.scn-compare select { width: auto; min-width: 180px; }
.scn-cmp-note { color: var(--muted); }
.scn-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scn-span2 { grid-column: 1 / -1; }
.chart-box.scn-tall { height: 380px; }
@media (max-width: 1100px) {
    .scn-layout { grid-template-columns: 1fr; }
    .scn-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 900px) {
    .scn-charts { grid-template-columns: 1fr; }
    .chart-box.scn-tall { height: 300px; }
}
