@font-face {
    font-family: "Aptos";
    src: url("/static/fonts/Aptos.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Aptos";
    src: url("/static/fonts/Aptos-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f1f4f8;
    --panel: #ffffff;
    --border: #e3e7ee;
    --text: #1c2230;
    --text-muted: #5f6879;
    --primary: #1e4082;
    --primary-dark: #16305f;
    --accent: #2f6fed;
    --sidebar-bg: #483527;
    --sidebar-active-bg: #6d5d52;
    --sidebar-accent: #c7a97a;
    --success: #177a50;
    --success-bg: #e7f6ee;
    --warning: #955f09;
    --warning-bg: #fdf3e0;
    --danger: #b3261e;
    --danger-bg: #fdeceb;
    --radius: 14px;
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --series-5: #4a3aa7;
    /* the same design tokens FinanceIQ uses, so a tile or chart looks the same wherever it is shown */
    --ink: #1c2230;
    --muted: #5f6879;
    --line: #e3e7ee;
    --card: #ffffff;
    --soft: #f6f8fb;
    --brand: #483527;
    --brand-2: #6d5d52;
    --gold: #c7a97a;
    --good: #177a50;
    --bad: #b3261e;
    --warn: #955f09;
    --info: #1f6bc4;
    --gap: 16px;
    --nav-w: 236px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Aptos", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.shell { display: flex; min-height: 100vh; }

/* ───────────── navigation: a sticky menu with icons; icon-only on laptops, a drawer on phones ───────────── */
.sidebar {
    width: var(--nav-w);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.25) transparent;
    background: linear-gradient(180deg, #4d3a2b 0%, #3f2d20 100%);
    color: #d8cfc7;
    display: flex;
    flex-direction: column;
    padding: 18px 12px 14px;
    gap: 2px;
    z-index: 50;
}

.brand {
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    padding: 2px 10px 12px;
    letter-spacing: .2px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand span { color: var(--sidebar-accent); }

.sidebar a, .btn-sidebar-logout {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #d3c8bd;
    text-decoration: none;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}
.sidebar a:hover, .btn-sidebar-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar a:focus-visible, .btn-sidebar-logout:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--sidebar-accent) inset; }
.sidebar a.active { background: var(--sidebar-active-bg); color: #fff; box-shadow: inset 3px 0 0 var(--sidebar-accent); }
.sidebar a.active .qd-ico { color: var(--sidebar-accent); }
.btn-sidebar-logout {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}
.qd-ico { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group { padding: 14px 12px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.1px; color: #b0a090; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.12); margin: 12px 4px; }
.nav-spacer { flex: 1 1 auto; min-height: 12px; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 8px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; color: #b9ad9f; }
.nav-user strong { color: #fff; font-weight: 600; }
.nav-avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sidebar-accent); color: #3a2a1d; font-weight: 700; font-size: 14px; }
.nav-user-text { min-width: 0; line-height: 1.5; }
.nav-user-role { text-transform: capitalize; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.12); font-size: 11px; }

.qd-topbar { display: none; position: sticky; top: 0; z-index: 45; align-items: center; gap: 12px; padding: 9px 14px; background: var(--sidebar-bg); color: #fff; }
.qd-topbar button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 9px; padding: 8px; display: grid; place-items: center; cursor: pointer; }
.qd-topbar button:focus-visible { outline: 2px solid var(--sidebar-accent); }
.qd-topbar-brand { font-size: 17px; }
.qd-topbar-brand span { color: var(--sidebar-accent); }
.qd-scrim { position: fixed; inset: 0; background: rgba(15,18,26,.5); z-index: 48; }
.qd-scrim[hidden] { display: none; }

.content { flex: 1; min-width: 0; padding: 0; }
/* every QuoteDesk page uses the whole width of the screen (up to a very wide cap), instead of a narrow column in the middle of it */
.qd-page { width: 100%; max-width: 2400px; margin: 0 auto; padding: 22px 28px 56px; }

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.2px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.subtitle { color: var(--text-muted); margin: 0 0 20px; font-size: 14px; line-height: 1.5; max-width: 1200px; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    gap: 12px 24px;
}
.page-header .subtitle { margin-bottom: 0; }

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: var(--gap);
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
    overflow-x: auto;
}
.panel > :last-child { margin-bottom: 0; }
.panel.chart-panel { overflow: visible; }
body.qd .panel h2 { display: flex; align-items: center; gap: 8px; }
.panel-note { color: var(--text-muted); font-size: 13px; margin: -6px 0 12px; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: #f8fafd; }
table a { color: var(--accent); text-decoration: none; font-weight: 600; }
table a:hover { text-decoration: underline; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr[hidden] { display: none; }

.empty-state { padding: 30px; text-align: center; color: var(--text-muted); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
/* in QuoteDesk a status reads at a glance: a dot, a capital letter, and it never wraps */
body.qd .badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
body.qd .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-open, .badge-draft, .badge-paused { background: var(--warning-bg); color: var(--warning); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-closed, .badge-lost { background: var(--danger-bg); color: var(--danger); }
.badge-sent { background: #e6edfc; color: #1f55c0; }
.badge-won { background: var(--success-bg); color: var(--success); }
.badge-awarded { background: var(--success-bg); color: var(--success); }
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-overdue { background: var(--danger-bg); color: var(--danger); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }

/* "closes in 3 days", "12 days late": a short coloured note that says how urgent a date is */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eef1f6; color: #4a5568; }
.chip-bad { background: var(--danger-bg); color: var(--danger); }
.chip-warn { background: var(--warning-bg); color: var(--warning); }
.chip-good { background: var(--success-bg); color: var(--success); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16,24,40,.12);
    transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.btn:hover { background: #2159c9; box-shadow: 0 4px 12px rgba(47,111,237,.28); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid rgba(47,111,237,.35); outline-offset: 1px; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.btn-secondary:hover { background: #f6f8fb; box-shadow: 0 4px 12px rgba(16,24,40,.1); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f2c6c2; box-shadow: none; }
.btn-danger:hover { background: var(--danger-bg); box-shadow: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-gold { background: var(--gold); color: #33261b; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.btn-gold:hover { background: #d6ba8c; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.22); box-shadow: none; }

form.inline { display: inline; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=url], input[type=password], input[type=search], textarea, select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,111,237,.18); }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.flash-stack { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: 10px; font-size: 14px; border: 1px solid transparent; }
.flash-success { border-color: #bfe5d0; }
.flash-error { border-color: #f2c6c2; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--danger-bg); color: var(--danger); }

.line-items-table input { border: none; background: transparent; padding: 6px 4px; }
.line-items-table input:focus { background: #fff; outline: 1px solid var(--accent); border-radius: 4px; }
.line-items-table textarea {
    border: none; background: transparent; padding: 6px 4px; width: 100%;
    font: inherit; resize: vertical; overflow: hidden; display: block;
    min-height: 32px;
}
.line-items-table textarea:focus { background: #fff; outline: 1px solid var(--accent); border-radius: 4px; }
.line-items-table td { padding: 4px 6px; }
.line-items-table .col-desc { width: 45%; }
.line-items-table .col-num { width: 12%; }
.remove-row { color: var(--danger); cursor: pointer; background: none; border: none; font-size: 16px; }
.col-move { white-space: nowrap; width: 1%; }
.btn-move { color: var(--text-muted); cursor: pointer; background: none; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; padding: 3px 6px; }
.btn-move:hover { background: #f2f4f7; color: var(--text); }

.col-recurring { display: none; text-align: center; }
.line-items-table.show-recurring .col-recurring { display: table-cell; }

.col-sections { display: none; }
.line-items-table.show-sections .col-sections { display: table-cell; }

.yearly-breakdown { border: 1.5px dashed #483527; border-radius: 8px; padding: 12px 18px; margin: 16px 0; }
.yearly-breakdown-row { display: flex; align-items: center; gap: 32px; }
.yearly-label { margin-right: auto; font-weight: 600; }
.yearly-col { text-align: right; min-width: 100px; }
.yearly-year-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.yearly-col-extra { display: none; }
.yearly-breakdown.five-year .yearly-col-extra { display: block; }

.totals-box { margin-left: auto; width: 320px; max-width: 100%; }
.totals-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totals-box .row.grand { border-top: 2px solid var(--primary); font-weight: 700; font-size: 16px; margin-top: 6px; padding-top: 10px; }

.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-0 { margin-top: 0; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.source-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.source-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.pill { display: inline-block; background: #eef1f6; color: var(--text-muted); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; margin-right: 6px; }

.helptext { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text-muted); background: #fff; border: 1px solid var(--border); }
.tabs a:hover { color: var(--text); border-color: #cfd6e2; }
.tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a .n { margin-left: 6px; font-size: 11.5px; opacity: .8; }

/* FinanceIQ */
table th.num, table td.num { text-align: right; }
.amt-in { color: var(--success); }
details > summary { cursor: pointer; }

/* keyboard users: a way past the menu, and a visible focus on the page that opens when it is used */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: #fff; color: var(--text); padding: 10px 14px; border-radius: 8px; border: 2px solid var(--primary); font-weight: 600; }
.skip-link:focus { left: 8px; }
main:focus { outline: none; }

/* "Prices vary by year": a price input per year of the term in place of Cost / Unit Price / Recurring */
.col-years { display: none; }
.line-items-table.show-years .col-years { display: table-cell; }
.line-items-table.show-years .col-single, .line-items-table.show-years .col-recurring { display: none; }
.line-items-table.show-years:not(.five-year) .col-year-extra { display: none; }
.line-items-table.show-years .col-num { width: 9%; }

/* ═══════════════ QuoteDesk widescreen: hero, tiles, journey, chart cards ═══════════════ */

.qd-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 28px;
    margin-bottom: var(--gap);
    padding: 20px 26px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(115deg, #3f2d20 0%, #5d4a3a 52%, #7a6450 100%);
    box-shadow: 0 8px 24px rgba(63,45,32,.22);
}
.qd-hero::before, .qd-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.qd-hero::before { width: 360px; height: 360px; right: -90px; top: -190px; background: radial-gradient(circle, rgba(199,169,122,.55) 0%, rgba(199,169,122,0) 70%); }
.qd-hero::after { width: 260px; height: 260px; right: 220px; bottom: -170px; background: radial-gradient(circle, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 70%); }
.qd-hero > * { position: relative; z-index: 1; }
.qd-hero h1 { color: #fff; font-size: 26px; margin: 0 0 4px; }
.qd-hero p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.5; max-width: 900px; }
.qd-hero .qd-date { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.qd-hero .actions-row { gap: 10px; }

.qd-kpis { display: grid; gap: var(--gap); grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); margin-bottom: var(--gap); }
.qd-kpis .kpi { padding: 14px 16px 12px; overflow: hidden; }
.qd-kpis .kpi::after { content: ""; position: absolute; right: -28px; top: -28px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, var(--tint, rgba(31,107,196,.12)) 0%, rgba(255,255,255,0) 70%); pointer-events: none; }
.qd-kpis .kpi.good { --tint: rgba(23,122,80,.16); } .qd-kpis .kpi.bad { --tint: rgba(179,38,30,.15); } .qd-kpis .kpi.warn { --tint: rgba(224,162,27,.2); }
.kpi .k-ico { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #eaf1fb; color: var(--info); z-index: 1; }
.kpi.good .k-ico { background: var(--success-bg); color: var(--good); } .kpi.bad .k-ico { background: var(--danger-bg); color: var(--bad); } .kpi.warn .k-ico { background: var(--warning-bg); color: var(--warn); }
.kpi .k-ico .qd-ico { width: 17px; height: 17px; }
.qd-kpis .kpi .k-label { padding-right: 40px; }
.qd-kpis .kpi .k-sub { min-height: 16px; }
.qd-live-html { margin-bottom: 0; }
.qd-live-html > .qd-kpis { margin-bottom: var(--gap); }

/* the journey: tender → draft → sent → won → invoiced → paid, each step with a live count */
.qd-journey { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
.qd-step { position: relative; padding-right: 24px; --c: #7a8699; }
.qd-step:last-child { padding-right: 0; }
.qd-step:not(:last-child)::after { content: ""; position: absolute; right: 5px; top: 31px; width: 11px; height: 11px; border-top: 2.5px solid #b9c2d3; border-right: 2.5px solid #b9c2d3; transform: rotate(45deg); }
.step-tender { --c: #7a8699; } .step-draft { --c: #eda100; } .step-sent { --c: #2a78d6; } .step-won { --c: #1b8a5a; } .step-invoice { --c: #4a3aa7; } .step-paid { --c: #16a1b8; }
.qd-step > a { display: grid; gap: 1px; padding: 10px 14px 11px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); border-top: 4px solid var(--c); color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.qd-step > a:hover, .qd-step > a:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.12); outline: none; background: #fff; }
.qd-step-n { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--c); font-variant-numeric: tabular-nums; }
.qd-step-label { font-weight: 700; font-size: 14px; }
.qd-step-sub { font-size: 12px; color: var(--text-muted); min-height: 16px; }
.qd-step-hint { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.qd-journey-lost { margin: 12px 0 0; font-size: 13px; color: var(--text-muted); }

/* chart cards: a caption that says what the chart is, and a short lesson on how to read it */
.qd-chart-card { display: flex; flex-direction: column; }
.qd-chart-card .panel-head { margin-bottom: 2px; }
.qd-what { margin: 0 0 8px; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.qd-chart-card .fiq-chart { flex: 1 1 auto; min-height: 120px; }
.qd-learn { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.qd-learn summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--info); list-style: none; border-radius: 6px; padding: 2px 4px; }
.qd-learn summary::-webkit-details-marker { display: none; }
.qd-learn summary:hover { background: #eaf1fb; }
.qd-learn summary:focus-visible { outline: 2px solid var(--info); }
.qd-learn summary .qd-ico { width: 15px; height: 15px; }
.qd-learn[open] summary { margin-bottom: 8px; }
.qd-learn dl { margin: 0; display: grid; gap: 10px; }
.qd-learn dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: #7a8294; font-weight: 700; }
.qd-learn dd { margin: 1px 0 0; font-size: 13px; line-height: 1.5; }

.qd-attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qd-attn li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.qd-attn .dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--info); }
.qd-attn .tone-bad .dot { background: var(--bad); } .qd-attn .tone-warn .dot { background: #e0a21b; }
.qd-attn .tone-bad { border-left: 4px solid var(--bad); } .qd-attn .tone-warn { border-left: 4px solid #e0a21b; }
.qd-attn .txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.4; }
.qd-clear { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 12px; background: var(--success-bg); color: #0f5a39; font-size: 14px; line-height: 1.5; }
.qd-clear .qd-ico { width: 30px; height: 30px; flex: 0 0 30px; padding: 6px; border-radius: 50%; background: #fff; color: var(--good); stroke-width: 2.4; }

.qd-filter { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qd-filter .qd-ico { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.qd-filter input[type=search] { max-width: 420px; padding-left: 34px; }
.qd-filter-count { font-size: 12.5px; color: var(--text-muted); }

.qd-two { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: var(--gap); align-items: start; }
.qd-two > .panel { margin-bottom: 0; }
.qd-wide-form { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); align-items: start; }
.qd-form-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
.qd-form-layout > .panel { margin-bottom: 0; }
.qd-guide { background: linear-gradient(180deg, #fffdf8, #fff); border-color: #eadfcc; }
@media (max-width: 1199px) { .qd-form-layout { grid-template-columns: minmax(0, 1fr); } }
.qd-wide-form > .panel { margin-bottom: 0; }

/* ───────────── quote editor: the form, and a live summary that stays in view beside it ───────────── */
.qd-editor { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
.qd-editor-main { min-width: 0; }
.qd-editor-side { position: sticky; top: 14px; display: grid; gap: var(--gap); max-height: calc(100vh - 28px); overflow-y: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.qd-editor-side .panel { margin-bottom: 0; }
.qd-editor-side .panel[hidden] { display: none; }
.qd-total-card { background: linear-gradient(135deg, #3f2d20, #6d5d52); color: #fff; border: 0; }
.qd-total-card .k-label { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--gold); font-weight: 700; }
.qd-total-value { font-size: 32px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.qd-total-sub { font-size: 12.5px; color: rgba(255,255,255,.82); line-height: 1.5; }
.qd-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qd-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; padding: 6px 8px; border-radius: 9px; background: var(--soft); cursor: help; }
.qd-checks .mark { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.qd-checks .ok .mark { background: var(--success-bg); color: var(--good); }
.qd-checks .todo .mark { background: var(--warning-bg); color: var(--warn); }
.qd-checks .todo { background: #fffaf0; }
.qd-margin table { font-size: 13px; }
.qd-margin th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text); padding: 5px 4px; white-space: normal; }
.qd-margin td { padding: 5px 4px; }
.line-items-wrap { overflow-x: auto; }
.qd-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.qd-steps li::marker { color: var(--accent); font-weight: 700; }
@media (max-width: 1499px) {
    .qd-editor { grid-template-columns: minmax(0, 1fr); }
    .qd-editor-side { position: static; max-height: none; overflow: visible; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
}

/* ───────────── sign-in ───────────── */
.qd-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); background: var(--bg); }
.qd-login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 48px clamp(28px, 6vw, 96px); color: #fff; background: linear-gradient(135deg, #3b2a1d 0%, #5d4a3a 55%, #7a6450 100%); }
.qd-login-art::before { content: ""; position: absolute; width: 640px; height: 640px; right: -240px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(199,169,122,.5), rgba(199,169,122,0) 68%); }
.qd-login-art::after { content: ""; position: absolute; width: 520px; height: 520px; left: -200px; bottom: -280px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), rgba(255,255,255,0) 70%); }
.qd-login-art > * { position: relative; z-index: 1; }
.qd-login-art .brand { font-size: 34px; border: 0; padding: 0; margin: 0; }
.qd-login-art h2 { font-size: 22px; line-height: 1.35; margin: 0; max-width: 560px; font-weight: 600; color: #f6efe7; }
.qd-login-art ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 560px; }
.qd-login-art li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; color: rgba(255,255,255,.88); }
.qd-login-art li .qd-ico { margin-top: 2px; width: 22px; height: 22px; flex: 0 0 22px; padding: 4px; border-radius: 7px; background: rgba(199,169,122,.28); color: var(--gold); }
.qd-login-bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; max-width: 360px; }
.qd-login-bars i { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--gold), rgba(199,169,122,.25)); animation: qd-grow 1.1s ease-out both; transform-origin: bottom; }
.qd-login-form { display: grid; place-items: center; padding: 32px 20px; }
.qd-login-form .panel { width: 100%; max-width: 380px; padding: 26px 26px 22px; box-shadow: 0 12px 40px rgba(16,24,40,.12); }
.qd-login-form .brand-sm { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.qd-login-form .brand-sm span { color: #a98957; }
.qd-login-form .login-lede { margin: 0 0 18px; font-size: 13.5px; color: var(--text-muted); }

/* ───────────── motion: gentle, and off for anyone who asks for less ───────────── */
@keyframes qd-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes qd-grow { from { transform: scaleY(.05); } to { transform: scaleY(1); } }
.qd-page > .panel, .qd-page > .g > *, .qd-page .qd-kpis .kpi, .qd-page > .qd-hero { animation: qd-rise .35s ease-out both; }
.qd-page .qd-kpis .kpi:nth-child(2) { animation-delay: .04s; } .qd-page .qd-kpis .kpi:nth-child(3) { animation-delay: .08s; } .qd-page .qd-kpis .kpi:nth-child(4) { animation-delay: .12s; }
.qd-page .qd-kpis .kpi:nth-child(5) { animation-delay: .16s; } .qd-page .qd-kpis .kpi:nth-child(6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ───────────── responsive ───────────── */
@media (max-width: 1599px) { .qd-learn dl { grid-template-columns: 1fr; } }
@media (min-width: 1600px) { .qd-learn dl { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1399px) {
    .qd-kpis[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .qd-kpis[data-n="5"] { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
    .qd-two { grid-template-columns: minmax(0, 1fr); }
}
/* laptops: the menu shrinks to icons so the work gets the room */
@media (min-width: 900px) and (max-width: 1279px) {
    body.qd { --nav-w: 68px; }
    body.qd .sidebar { padding: 14px 8px; }
    body.qd .sidebar .nav-label, body.qd .sidebar .nav-user-text { display: none; }
    body.qd .sidebar a, body.qd .btn-sidebar-logout { justify-content: center; padding: 10px 0; }
    body.qd .sidebar .nav-group { height: 1px; padding: 0; margin: 8px 6px; background: rgba(255,255,255,.12); font-size: 0; overflow: hidden; }
    body.qd .brand { font-size: 0; padding: 4px 0 10px; text-align: center; }
    body.qd .brand::before { content: "QD"; font-size: 17px; color: var(--sidebar-accent); }
    body.qd .nav-user { justify-content: center; padding: 10px 0 6px; }
    .qd-page { padding: 18px 20px 48px; }
}
/* phones and small tablets: a top bar and a slide-in menu */
@media (max-width: 899px) {
    .qd-topbar { display: flex; }
    body.fiq .qd-topbar { display: none; }
    body.qd .shell { display: block; }
    body.qd .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; max-width: 86vw; height: auto; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    body.qd-nav-open .sidebar { transform: none; }
    .qd-page { padding: 14px 14px 40px; }
    .qd-hero { padding: 16px; border-radius: 14px; }
    .qd-hero h1 { font-size: 21px; }
    .qd-kpis[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qd-journey { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .qd-step { padding-right: 0; }
    .qd-step::after { display: none !important; }
    .qd-step-hint { display: none; }
    .qd-login { grid-template-columns: minmax(0, 1fr); }
    .qd-login-art { padding: 28px 22px; gap: 14px; }
    .qd-login-art h2 { font-size: 17px; }
    .qd-login-art ul, .qd-login-bars { display: none; }
    .page-header .actions-row { width: 100%; }
    .totals-box { width: 100%; }
    .qd-wide-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 479px) { .qd-journey { grid-template-columns: minmax(0, 1fr); } }
