/* ── Design tokens — the mtl-expenses block verbatim (same names, same values), plus the
      certificate STATE palette below it, which is this app's own vocabulary (the POC's
      signed-off red/amber/green/grey for expired/expiring/valid/lapsed — expenses has no
      equivalent). New styles draw from these; page-specific rules live in sibling scoped
      Xxx.razor.css files. ── */

:root {
    /* Accent */
    --mtl-accent: #2563eb;
    --mtl-accent-strong: #1d4ed8;
    --mtl-accent-soft: #eff6ff;

    /* Surfaces */
    --mtl-bg: #f8fafc;
    --mtl-surface: #ffffff;

    /* Borders */
    --mtl-border: #dbe3ee;
    --mtl-border-strong: #cbd5e1;
    --mtl-border-soft: #e8eef7;

    /* Text */
    --mtl-text: #0f172a;
    --mtl-text-secondary: #475569;
    --mtl-text-muted: #64748b;
    --mtl-text-faint: #9ca3af;

    /* Status */
    --mtl-danger: #b42318;
    --mtl-danger-bg: #fef3f2;
    --mtl-danger-border: #fecdca;

    /* Widths — browse/detail screens cap at the page width. */
    --mtl-page-max: 1280px;
    --mtl-form-max: 1180px;

    /* Shape + elevation */
    --mtl-radius: 10px;
    --mtl-radius-lg: 12px;
    --mtl-shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
    --mtl-shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.12);
    --mtl-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.10);

    /* Certificate states (this app's own): expired / expiring soon / valid / lapsed. */
    --red: #dc2626;      --red-soft: #fdecec;
    --amber: #d97706;    --amber-soft: #fdf3e0;
    --green: #16a34a;    --green-soft: #e6f6ec;
    --blue: #0e7490;     --blue-soft: #e6f4f7;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    background-color: var(--mtl-bg);
    color: var(--mtl-text);
}

h1 { font-size: 1.65rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
h1:focus { outline: none; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
a { color: var(--mtl-accent); text-decoration: none; }

.icon { flex-shrink: 0; }

/* Icon tint classes stay global on purpose: they land on the Icon component's svg, which
   a parent page's scoped CSS cannot reach. */
.in-clip { color: var(--mtl-text-faint); }
.cc-clip { color: var(--mtl-text-muted); display: flex; align-items: center; }
.dz-ico { color: var(--mtl-accent); }
.dz-ico.ok { color: var(--green); }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Page head ---------- */
.viewing-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mtl-accent-soft);
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    border-radius: 9999px;
    padding: 4px 14px;
    font-size: 0.82rem;
    margin-bottom: 14px;
}
.viewing-pill b { color: var(--mtl-accent); }
/* impersonating: the identity pill goes amber so whose record this is can't be missed
   (My Certificates and My Bookings — moved from their scoped css when the second page took it) */
.imp-pill { background: var(--amber-soft); border-color: #f3ddb0; color: #7c4a03; }
.imp-pill b { color: #b45309; }
.pill-note { opacity: 0.75; }

/* The "Show archived" / "Show leavers" toggle (Administration, Certificates by person) —
   archived people are hidden by default; this reveals them. Moved from Administration.razor.css
   when the people list took the same control. */
.archived-toggle {
    border: 1px solid var(--mtl-border-strong);
    background: var(--mtl-surface);
    color: var(--mtl-text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}
.archived-toggle:hover { border-color: #94a3b8; color: #334155; }
.archived-toggle.on { background: #f1f5f9; border-color: #94a3b8; color: #334155; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-sub { color: var(--mtl-text-muted); font-size: 0.9rem; margin: 4px 0 0; }

.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 600; margin-bottom: 14px; }
/* a back-link that is a real button (BackLink, keyboard-operable) reads exactly like the anchor one */
button.back-link { background: none; border: none; padding: 0; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--mtl-accent); cursor: pointer; }
button.back-link:hover { text-decoration: underline; }

/* the initials disc (the people list, a person's page) */
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--mtl-accent-soft);
    color: var(--mtl-accent);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* ---------- Loading / errors ---------- */
.page-loading { padding: 44px 0; color: var(--mtl-text-muted); font-size: 0.92rem; }

.guard, .page-error {
    background: var(--mtl-danger-bg);
    border: 1px solid var(--mtl-danger-border);
    color: var(--mtl-danger);
    border-radius: var(--mtl-radius-lg);
    padding: 16px 20px;
    font-size: 0.92rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--mtl-radius);
    border: 1px solid var(--mtl-border);
    background: var(--mtl-surface);
    color: var(--mtl-text);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 16px;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { background: #f3f4f6; }

.btn-primary { background: var(--mtl-accent); border-color: var(--mtl-accent); color: #fff; }
.btn-primary:hover { background: var(--mtl-accent-strong); border-color: var(--mtl-accent-strong); }
.btn-primary:disabled { background: #a7bff0; border-color: #a7bff0; cursor: default; }

.btn-sm { padding: 5px 11px; font-size: 0.82rem; font-weight: 600; border-radius: 8px; }

/* pressed/toggled state (Never expires, the quick-add "+ New" toggles) */
.btn.on { background: var(--mtl-accent-soft); border-color: var(--mtl-accent); color: var(--mtl-accent); }

/* destructive actions (Course library's retire confirms) — solid for the confirming
   button inside a popup, quiet for the entry point that merely opens one */
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-quiet-danger { color: var(--red); border-color: #f0caca; }
.btn-quiet-danger:hover { background: var(--red-soft); }

/* ---------- Filter chips (My Certificates' spy bar, the course chooser's sorts) ---------- */
.fchip {
    border: 1px solid var(--mtl-border); border-radius: 999px;
    background: var(--mtl-surface); color: var(--mtl-text-muted);
    font: inherit; font-size: 0.82rem; font-weight: 600;
    padding: 5px 13px; cursor: pointer;
}
.fchip:hover { border-color: #c4cad2; color: var(--mtl-text); }
.fchip.cur { background: var(--mtl-accent-soft); border-color: var(--mtl-accent); color: var(--mtl-accent); }

/* ---------- Chips ---------- */
.chip {
    display: inline-block;
    border-radius: 9999px;
    padding: 2px 10px;
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
}
.chip-red   { background: var(--red-soft);   color: var(--red); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-blue  { background: var(--blue-soft);  color: var(--blue); }
.chip-grey  { background: #f3f4f6;           color: var(--mtl-text-muted); }
/* badge + its quiet "what happens next" note (StateChip, 2026-09-08) */
.chip-wrap { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.chip-note { font-size: 0.76rem; color: var(--mtl-text-muted); }
/* a chip that is a button (the library's "Merged into X →" link-chip) */
button.chip { border: none; font: inherit; font-size: inherit; cursor: pointer; }
button.chip:hover { text-decoration: underline; }

.type-chip, .tchip {
    display: inline-block;
    background: #f3f4f6;
    color: var(--mtl-text-secondary);
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 7px;
}

/* neutral colour hues hashed from the real category code (no invented taxonomy) */
.tc-0 { background: #fdf3e0; color: #b45309; }
.tc-1 { background: #fde8ef; color: #be185d; }
.tc-2 { background: #efe9fe; color: #6d28d9; }
.tc-3 { background: #dcf3f1; color: #0f766e; }
.tc-4 { background: #e4e9fb; color: #4338ca; }
.tc-5 { background: #e8efff; color: #1d4ed8; }
.tc-6 { background: #e6f6ec; color: #15803d; }
.tc-7 { background: #f4ede1; color: #92600a; }

/* ---------- Cards ---------- */
.card {
    background: var(--mtl-surface);
    border: 1px solid var(--mtl-border);
    border-radius: var(--mtl-radius-lg);
    box-shadow: var(--mtl-shadow-card);
    padding: 18px 20px;
}
.card + .card, .detail-grid + .card { margin-top: 16px; }
.card-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mtl-text-faint); margin-bottom: 12px; }
/* the smaller card label — moved here from CertificateDetail.razor.css when the person page's
   Vantage card became its second user (2026-09-09); its hard-coded #9aa1ac became the token */
.card-kicker { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--mtl-text-faint); }

/* ---------- Inputs ---------- */
.input, .select {
    border: 1px solid var(--mtl-border-strong);
    border-radius: var(--mtl-radius);
    padding: 9px 12px;
    font: inherit;
    font-size: 0.9rem;
    background: var(--mtl-surface);
    color: var(--mtl-text);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .select:focus { outline: none; border-color: var(--mtl-accent); box-shadow: var(--mtl-focus-ring); }
.input:disabled { background: #f3f4f6; color: var(--mtl-text-muted); }
.select { width: 100%; }

/* ---------- Forms (the upload flow and its popups) ---------- */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 5px; color: #374151; }
.form-field .input { width: 100%; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* grid items default to min-width:auto — a select with long options would blow the column out */
.form-row2 > * { min-width: 0; }
.form-hint { font-size: 0.78rem; color: var(--mtl-text-muted); margin-top: 4px; }
.form-hint .btn { padding: 2px 8px; font-size: 0.74rem; margin-left: 4px; }
.form-error {
    background: var(--red-soft); border: 1px solid #f5c8c8; color: var(--red);
    border-radius: 6px; padding: 6px 9px; font-size: 0.78rem;
}

/* ---------- Summary tiles (My Certificates' headline strip, the Team hub) ----------
   Moved from MyCertificates.razor.css when the Team hub took the same tiles. */
.sum-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 720px) { .sum-cards { grid-template-columns: repeat(2, 1fr); } }
.stat {
    background: var(--mtl-surface); border: 1px solid var(--mtl-border); border-left-width: 4px;
    border-radius: var(--mtl-radius-lg); box-shadow: var(--mtl-shadow-card);
    padding: 12px 16px; cursor: pointer; text-align: left; font: inherit; color: var(--mtl-text);
}
.stat b { display: block; font-size: 1.5rem; line-height: 1.15; }
.stat span { font-size: 0.8rem; color: var(--mtl-text-muted); }
.stat:hover { box-shadow: var(--mtl-shadow-hover); }
.st-red { border-left-color: var(--red); }
.st-amber { border-left-color: var(--amber); }
.st-green { border-left-color: var(--green); }
.st-grey { border-left-color: #94a3b8; }
.st-blue { border-left-color: var(--mtl-accent); }
.st-violet { border-left-color: #7c3aed; }

/* ---------- Admin list pages (Course library, Bookings, Training to be renewed) ----------
   The toolbar inside the table's card, the status pills, the management table and its
   scroll container. Moved from CourseLibrary.razor.css when the second and third list
   pages arrived. */
.lib-card { padding: 16px 20px 10px; }
.lib-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.lib-search { position: relative; flex: 1; min-width: 0; }
.lib-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mtl-text-muted); pointer-events: none; }
.lib-search .input { width: 100%; border-radius: 10px; padding: 9px 12px 9px 36px; font-size: 0.9rem; }
.lib-sel { width: auto; border-radius: 10px; padding: 9px 12px; font-size: 0.86rem; }
.lib-status { display: inline-flex; background: #f1f3f6; border-radius: 10px; padding: 3px; flex: none; }
.fpill {
    border: none; border-radius: 8px; background: none; color: var(--mtl-text-muted);
    font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 14px; cursor: pointer; white-space: nowrap;
}
.fpill.on { background: #fff; color: var(--mtl-accent); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10); }

/* the state tabs carry their state's colour (Jamie 2026-09-08: "make them all different") —
   a dot on every tab, the active one tinted to match its chips */
.fpill-red::before, .fpill-amber::before, .fpill-green::before, .fpill-blue::before, .fpill-grey::before {
    content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px;
}
.fpill-red::before   { background: var(--red); }
.fpill-amber::before { background: var(--amber); }
.fpill-green::before { background: var(--green); }
.fpill-blue::before  { background: var(--blue); }
.fpill-grey::before  { background: #9ca3af; }
.fpill-red.on   { background: var(--red-soft);   color: var(--red); }
.fpill-amber.on { background: var(--amber-soft); color: var(--amber); }
.fpill-green.on { background: var(--green-soft); color: var(--green); }
.fpill-blue.on  { background: var(--blue-soft);  color: var(--blue); }
.fpill-grey.on  { background: #fff;              color: #374151; }

/* the management tables: uppercase muted headers, roomy rows */
.lib-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lib-table th {
    text-align: left; color: var(--mtl-text-muted); font-weight: 600; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 10px 10px 10px 0; border-bottom: 1px solid var(--mtl-border-soft);
}
.lib-table td { padding: 15px 10px 15px 0; border-bottom: 1px solid var(--mtl-border-soft); }
.lib-table tr:last-child td { border-bottom: none; }
.row-click { cursor: pointer; }
.row-click:hover td { background: #f6f8fb; }
.lib-foot { color: var(--mtl-text-muted); font-size: 0.85rem; padding: 12px 0 6px; }
.mg-name { font-weight: 600; }
.mg-use { color: var(--mtl-text-muted); font-size: 0.85rem; white-space: nowrap; }
.mini-note { color: var(--mtl-text-muted); font-size: 0.88rem; margin: 0; }
/* retired / lapsed / leaver rows dimmed (moved from CourseLibrary.razor.css when the
   chase list and the people list took it) */
tr.mg-off td:not(.act-cell) { opacity: 0.55; }
/* a booking's note under its kind, wrapped (Bookings, the person page) */
.bk-note { white-space: normal; max-width: 320px; font-size: 0.78rem; margin-top: 2px; }

/* the key actions are visible buttons at the row's side */
.act-cell { text-align: right; white-space: nowrap; }
.act-cell .btn { white-space: nowrap; margin-left: 6px; }
/* bookings list: one Actions button per row (2026-09-08) — the outcome lives in its menu */
.act-cell.act-menu { width: 112px; }
.btn-menu { gap: 5px; padding-right: 8px; }
.btn-menu .icon { color: var(--mtl-text-muted); }
.btn-menu.on { background: #f6f7f9; border-color: #c9d0da; }

/* ---------- Row actions menu: fixed-position, anchored to its Actions button by
   certsMenu.anchor (index.html); the backdrop closes it on any outside click ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 90; }
.menu {
    position: fixed; z-index: 95;
    min-width: 264px;
    background: var(--mtl-surface);
    border: 1px solid var(--mtl-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    padding: 6px;
    outline: none;
}
.menu-head {
    color: var(--mtl-text-muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 6px 10px 5px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    border: none; background: none; border-radius: 8px;
    font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--mtl-text); text-align: left;
    padding: 8px 10px; cursor: pointer; white-space: nowrap;
}
.menu-item .icon { color: var(--mtl-text-muted); flex: none; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: #f6f7f9; outline: none; }
.menu-item:disabled { color: var(--mtl-text-muted); cursor: default; opacity: 0.65; }
.menu-item.menu-danger, .menu-item.menu-danger .icon { color: var(--red); }
.menu-item.menu-danger:hover { background: var(--red-soft); }
.menu-hint { margin-left: auto; padding-left: 14px; font-size: 0.74rem; font-weight: 500; color: var(--mtl-text-muted); }
.menu-sep { height: 1px; background: var(--mtl-border-soft); margin: 5px 4px; }

/* ---------- Inventory sections: the date-first certificate rows (My Certificates, My
   Bookings, a person's page) ---------- Moved from MyCertificates.razor.css when the
   second and third pages took the same vocabulary (2026-09-08). Sticky offsets are
   relative to .content — the app's one scroll container; pages without the spy bar
   set their section heads static in their own css. */
.inv-section { margin-bottom: 18px; }
.inv-head {
    font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    position: sticky; top: 52px; z-index: 10; background: var(--mtl-bg); padding: 5px 2px 6px; margin: 0;
}
.ih-red { color: var(--red); }
.ih-amber { color: var(--amber); }
.ih-green { color: var(--green); }
.ih-blue { color: var(--blue); }
.ih-grey { color: #8a93a0; }
.inv-count { color: #b3b9c4; font-weight: 600; margin-left: 4px; }
.inv-hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: #b3b9c4; }

.inv-card { padding: 2px 16px; }
.inv-row {
    display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; gap: 14px; align-items: center;
    padding: 7px 2px; border-bottom: 1px solid var(--mtl-border-soft); cursor: pointer;
}
.inv-card .inv-row:last-child { border-bottom: none; }
.inv-row:hover .in-title { color: var(--mtl-accent); }
.inv-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.in-title { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-empty { color: #b3b9c4; font-size: 0.86rem; padding: 14px 2px; }
.inv-empty-card { color: var(--mtl-text-muted); font-size: 0.92rem; }
@media (max-width: 860px) { .inv-row { grid-template-columns: 96px 1fr auto; } }

.exp-date {
    font-weight: 650; font-size: 0.86rem; font-variant-numeric: tabular-nums;
    color: var(--mtl-text); white-space: nowrap;
}
.exp-date.exp-red { color: var(--red); }
.exp-date.exp-amber { color: var(--amber); }
.exp-date.exp-muted { color: #9aa3ae; font-weight: 500; }

.never-row .in-title, .lapsed-row .in-title { font-weight: 500; }
.lapsed-row .in-title { color: var(--mtl-text-muted); }
.nx-div { display: flex; align-items: center; gap: 10px; color: #b3b9c4; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; padding: 10px 0 4px; }
.nx-div::before, .nx-div::after { content: ""; flex: 1; height: 1px; background: var(--mtl-border-soft); }

/* tables stay on screen: cap + scroll, header pinned while it scrolls. The main list's
   cap is viewport-derived so the toolbar never leaves view; detail tables get a simpler
   viewport share. */
.scroll-box { max-height: 60vh; overflow-y: auto; }
.lib-scroll { max-height: calc(100vh - 340px); min-height: 240px; overflow-y: auto; }
.scroll-box .lib-table thead th,
.lib-scroll .lib-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--mtl-surface);
    border-bottom: none; box-shadow: inset 0 -1px 0 var(--mtl-border-soft);
}

/* ---------- Popup bands: the blue what-happens note, the amber consequence band ---------- */
.nc-info {
    background: var(--mtl-accent-soft); border: 1px solid #d5e4fb; color: #1e3a8a;
    border-radius: var(--mtl-radius); padding: 10px 14px; font-size: 0.88rem; margin: 2px 0 4px;
}
.mg-warn {
    background: var(--amber-soft); border: 1px solid #f3d9a4; color: #92400e;
    border-radius: var(--mtl-radius); padding: 10px 14px; font-size: 0.88rem; margin: 2px 0 14px;
}
.mg-warn.mg-red { background: var(--red-soft); border-color: #f5c8c8; color: var(--red); }
.mg-warn ul { margin: 0; padding-left: 18px; }
.mg-warn li { margin-top: 3px; }
.label-soft { font-weight: 400; color: var(--mtl-text-muted); }
textarea.input { resize: vertical; font-family: inherit; }

/* ---------- Modals ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(17, 24, 39, 0.45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 7vh 16px;
    z-index: 100;
}
.modal-box {
    background: var(--mtl-surface);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
    width: 100%;
    max-width: 680px;
    max-height: 86vh;
    overflow-y: auto;
    padding: 24px 28px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-close { border: none; background: none; color: var(--mtl-text-muted); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--mtl-text); }
.modal-sub { color: var(--mtl-text-muted); font-size: 0.85rem; margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Inline quick-add (new provider / new category) ----------
   Dropdown + "+ New" toggle; the panel floats under the field, spanning the half-column. */
.qa-row { display: flex; align-items: center; gap: 8px; }
.qa-row .select, .qa-row .input { flex: 1; min-width: 0; }
.qa-row .btn { white-space: nowrap; flex: none; }
.qa-anchor { position: relative; }
.qa-pop {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
    background: var(--mtl-surface); border: 1px solid var(--mtl-border); border-radius: var(--mtl-radius);
    box-shadow: 0 14px 32px rgba(16, 24, 40, 0.20);
    padding: 12px 14px;
}
.qa-pop .input { width: 100%; }
.ap-title { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mtl-text-muted); margin-bottom: 8px; }
.ap-code { text-transform: uppercase; max-width: 10rem; }
.ap-hint {
    background: var(--amber-soft); border: 1px solid #f3d9a4; color: #92400e;
    border-radius: 6px; padding: 6px 9px; font-size: 0.78rem; margin-top: 8px;
}
.ap-hint.ap-block { background: var(--red-soft); border-color: #f5c8c8; color: var(--red); }
.ap-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- Auth pages (MSAL handshake) ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--mtl-bg);
    padding: 24px;
}
.auth-card {
    background: var(--mtl-surface);
    border: 1px solid var(--mtl-border);
    border-radius: var(--mtl-radius-lg);
    box-shadow: var(--mtl-shadow-card);
    max-width: 440px; width: 100%;
    padding: 28px 32px;
}
/* The mark sits beside the name rather than over it — the card's copy is left-aligned, and
   a centred crest above left-aligned headings reads as two different cards. */
.auth-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; color: var(--mtl-accent); margin-bottom: 16px;
}
.auth-logo { flex: none; width: 34px; height: 54px; display: block; }
.auth-card h1 { font-size: 1.2rem; }
.auth-status p, .auth-result p { color: var(--mtl-text-muted); font-size: 0.9rem; }
.auth-error-detail { font-size: 0.78rem; color: var(--mtl-text-faint); word-break: break-word; }
.auth-action {
    display: inline-flex; align-items: center;
    border-radius: var(--mtl-radius);
    background: var(--mtl-accent); border: 1px solid var(--mtl-accent); color: #fff;
    font: inherit; font-weight: 600; font-size: 0.9rem;
    padding: 9px 16px; cursor: pointer; margin-top: 6px;
}
.auth-action:hover { background: var(--mtl-accent-strong); color: #fff; }

/* ---------- Boot splash ---------- */
/* The markup is in index.html, inside #app, and the Blazor runtime replaces the lot on boot
   — so none of this can reach the app shell afterwards. The mark animates itself and settles
   to its still pose under prefers-reduced-motion, so there is no spinner to keep in step. */
.app-splash {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px;
}
.splash-logo { width: 76px; height: 120px; }
.splash-name { font-weight: 700; font-size: 1.15rem; color: var(--mtl-text); }
.splash-status { font-size: 0.9rem; color: var(--mtl-text-muted); }

/* ---------- Framework error bar ---------- */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff3cd; padding: 0.8rem 1.2rem; z-index: 999; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; border: none; background: none; font: inherit; }
