/* ============================================================================
   Connections Center — admin console (plan 506)

   The shell is the partner portal's: navy sidebar, white sticky top bar, grouped navigation, a skip
   link, a #main target and one opaque focus ring. What stays the console's own is the density — a
   console is read as rows, so tables keep compact cells, tabular figures and horizontal scroll, and
   nothing here inflates a row to the portal's card spacing.

   Every class a page already writes still resolves. The old token names are kept as aliases of the
   portal's palette, at the end of the :root block, because the page groups are restyled in parallel
   against this file and a page written in either vocabulary has to render.
   ========================================================================== */

:root {
    /* Surfaces */
    --navy-900: #0b1b33;
    --navy-800: #10233f;
    --navy-700: #17304f;
    --paper: #f6f8fb;
    --card: #ffffff;
    --line: #e4e9f1;
    --line-strong: #cfd8e5;

    /* Text */
    --text: #16233a;
    --text-strong: #0b1b33;
    --muted: #5b6b80;
    /* The small-label gray. Darkened from #8592a5, which measured 3.16:1 on white. #626f88 cleared that,
       but not the tinted surfaces a row can be painted: 4.47:1 on --blue-50 (a table row on hover) and
       4.43:1 on --red-50, both below 4.5:1 for the 11–13 px text it is used on. #606d86 measures 5.21:1
       on white, 4.90:1 on --paper, 5.03:1 on --surface-tint, 4.64:1 on --slate-100, 4.60:1 on
       --blue-50 and 4.56:1 on --red-50 — the same gray within two steps, and clear on every surface it
       is drawn on (plan 537). */
    --muted-2: #606d86;
    --on-navy: #ffffff;
    --on-navy-muted: rgba(255, 255, 255, .66);
    /* The sidebar's group label. .46 measures 4.55:1 on --navy-900. */
    --on-navy-faint: rgba(255, 255, 255, .46);

    /* Accents */
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-100: #dbe6ff;
    --blue-50: #eaf1ff;
    --amber-600: #d98a0b;
    --amber-500: #f5a623;
    --amber-100: #fde7bd;
    --amber-50: #fff6e6;

    /* States */
    --green-700: #146c43;
    --green-50: #e7f6ec;
    --red-700: #b3261e;
    --red-50: #fdecec;
    --slate-100: #eef2f7;
    --slate-500: #98a2b3;

    /* Shape */
    --radius: 16px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(11, 27, 51, .05), 0 1px 3px rgba(11, 27, 51, .04);
    --shadow-md: 0 6px 18px rgba(11, 27, 51, .08), 0 2px 6px rgba(11, 27, 51, .04);
    --shadow-lg: 0 24px 60px rgba(11, 27, 51, .26);

    /* One opaque ring, used as an outline. It replaces the console's old 18 %-alpha amber shadow, which
       composited to about 1.16:1 on white, and its 2 px --amber button ring at 2.44:1 — both below WCAG
       1.4.11's 3:1. #2563eb measures 5.17:1 on white, 4.64:1 on the active nav pill and 3.33:1 on
       --navy-900. Opaque rather than translucent because no single alpha satisfies light and dark. */
    --focus-ring: #2563eb;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
    --sidebar-w: 248px;

    /* ---- the console's old names, kept as aliases ------------------------------------------------
       Pages written before the shell moved, and the page groups being restyled alongside it, use these
       names. They point at the portal's palette above rather than restating a color, so there is one
       value to change and no second vocabulary to drift. */
    --ink: var(--navy-900);
    --ink-soft: var(--navy-800);
    --slate: var(--muted);
    --slate-dim: var(--muted-2);
    --page: var(--paper);
    --surface: var(--card);
    --surface-tint: #fafbfd;
    --amber: var(--amber-500);
    --amber-ink: #3a2504;
    --amber-wash: var(--amber-50);
    --ok: var(--green-700);
    --ok-wash: var(--green-50);
    --warn: #8a5a00;
    --warn-wash: var(--amber-50);
    --bad: var(--red-700);
    --bad-wash: var(--red-50);
    --info: var(--blue-700);
    --info-wash: var(--blue-50);
    --shadow: var(--shadow-md);
}

/* ---------- reset and base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* The top bar is sticky. Scrolling to a fragment — the skip link's #main first of all — would put the
       target's top under the bar, so the scroll box reserves the bar's height. 76 px is the wide bar; the
       ≤ 960 px and ≤ 640 px rules below reserve their own. */
    scroll-padding-top: 76px;
}

body.console-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--paper);
    /* The "tables scroll, the page does not" rule: only a .table-wrap may scroll sideways. */
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; color: var(--text-strong); line-height: 1.22; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 1.02rem; font-weight: 650; margin: 26px 0 10px; }
h3 { font-size: .94rem; font-weight: 650; margin: 18px 0 8px; }
p { margin: 0; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }

img, svg { max-width: 100%; }
button { font: inherit; }

code, kbd, samp, pre { font-family: var(--mono); font-size: .92em; }

/* The keyboard indicator. One opaque ring for every control, at ≥ 3:1 on both the white card and the
   navy sidebar. The outline follows each element's own radius, so focusing never reshapes a target. */
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    background: var(--navy-900);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: #fff; text-decoration: none; }

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

/* ---------- shell -------------------------------------------------------- */

.console-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

.console-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    /* Only the nav scroller moves: the brand and the account foot stay where they are on a short
       viewport instead of scrolling away with the nineteen destinations. */
    overflow: hidden;
    background: var(--navy-900);
    color: var(--on-navy);
    padding: 18px 0 12px;
    z-index: 40;
}

.console-brand { padding: 0 20px 14px; flex: none; }

.console-brand-link {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    color: var(--on-navy);
    text-decoration: none;
}
.console-brand-link:hover { color: var(--on-navy); text-decoration: none; }

/* The real mark: the inverse file on the navy sidebar, because the navy "web" strokes would vanish
   there. The height is set here so the PNG's intrinsic size never dictates layout. */
.console-logo { display: block; height: 24px; width: auto; }

.console-brand-sub {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--on-navy-muted);
}

/* The one scroll box in the sidebar. flex: 1 + min-height: 0 lets a flex child shrink and scroll
   rather than overflow its parent; the brand and foot are flex: none, so they stay put. */
.console-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    scrollbar-color: rgba(255, 255, 255, .28) transparent;
    padding-bottom: 10px;
}
.console-nav::-webkit-scrollbar { width: 8px; }
.console-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 4px; }
.console-nav::-webkit-scrollbar-track { background: transparent; }

.console-nav-section {
    margin: 14px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--on-navy-faint);
}
.console-nav-section:first-child { margin-top: 4px; }

.console-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 8px;
    padding: 7px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .8);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.console-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

/* The pill you are on. Without it the nineteen destinations are nineteen identical links and every
   page looks like the same page. */
.console-nav-link.is-active { background: #eef3fb; color: var(--navy-900); font-weight: 650; }
.console-nav-link.is-active:hover { background: #eef3fb; color: var(--navy-900); text-decoration: none; }
.console-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 5px;
    bottom: 5px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--amber-500);
}

.console-sidebar-foot {
    flex: none;
    margin-top: auto;
    padding: 12px 18px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.console-user { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.console-user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.console-user-name { font-size: 13px; font-weight: 600; color: var(--on-navy); }
.console-user-org { font-size: 11.5px; color: var(--on-navy-muted); }

.console-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    background: var(--navy-700);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.console-signout { margin-top: 10px; }
.console-signout .btn { width: 100%; }

.console-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* ---------- top bar ------------------------------------------------------ */

.console-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 28px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.console-drawer-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text-strong);
    cursor: pointer;
}

/* The section the page belongs to, from the same table the nav draws from. It is context, not a
   control: nothing here is pressable. */
.console-topbar-context {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- the console's search (plan 550) ------------------------------ */

/* The mockup's one field above every console page. It takes the room the section label leaves, sits at
   the far end of the bar and stops at a reading measure, so it never turns the top bar into a second
   navigation row. It is a control, not a destination: no sidebar link points at it. */
.console-search {
    margin-left: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 420px;
}

.console-search-field { position: relative; display: flex; align-items: center; }

/* Decorative: the field's label is the accessible name, so the mark is hidden from assistive technology. */
.console-search-icon {
    position: absolute;
    left: 11px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

/* The global :focus-visible ring applies here like everywhere else; only the resting border is this
   field's own. */
.console-search input[type="search"] {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: .87rem;
    line-height: 1.3;
}

.console-search input[type="search"]::placeholder { color: var(--muted-2); }
.console-search input[type="search"]:focus { border-color: var(--blue-600); }

/* Off-canvas only, below 961 px. An anchor with no href is not in the tab order, so the backdrop can
   close the drawer by pointer without becoming one more stop in the keyboard walk. */
.console-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 27, 51, .52);
    z-index: 35;
}
.console-backdrop[hidden] { display: none; }

.console-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 1340px;
    padding: 24px 28px 0;
}

/* A sibling of <main>, not a child of it, so it keeps the contentinfo landmark. It carries the bottom padding
   the content no longer does, and the same measure, so the border lines up with the page's own edges. */
.console-footer {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1340px;
    margin: 34px auto 0;
    padding: 16px 28px 40px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: .78rem;
}
.console-footer .dot { color: var(--line-strong); }

/* ---------- page frame --------------------------------------------------- */

.sub { color: var(--muted); margin: 0 0 18px; max-width: 78ch; }

/* The small uppercase label above an h1, the portal's .eyebrow under the console's own name. */
.page-eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-head .page-head-text { min-width: 0; }
.page-head .sub { margin-bottom: 0; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; flex-wrap: wrap; }

/* The right-hand slot for a badge or a pair of figures that belong to the heading. */
.page-head-meta { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; flex-wrap: wrap; }

/* ---------- panels ------------------------------------------------------- */

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 18px 0;
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.panel-head h2 { margin: 0; font-size: .98rem; }
.panel-head .actions { display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.panel-foot {
    padding: 11px 18px;
    border-top: 1px solid var(--line);
    background: var(--surface-tint);
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.panel-note { color: var(--muted); font-size: .82rem; }

/* ---------- stat tiles --------------------------------------------------- */

.cards, .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 14px;
    margin: 0 0 22px;
}
.card, .stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 15px 17px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.card-num, .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}
.card-num.small, .stat-value.small { font-size: 1rem; font-weight: 600; }
.card-label, .stat-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 700;
    order: -1;
}
.stat-hint { font-size: .78rem; color: var(--muted-2); }
.stat.accent { border-color: var(--amber-100); background: var(--amber-50); }

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

/* Only this element may scroll sideways. */
.table-wrap {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: auto;
    margin: 0 0 18px;
}
.table-wrap > table { margin: 0; border: 0; border-radius: 0; box-shadow: none; }

/* A table that lives inside a panel is flush with it: the panel already draws the border, the radius
   and the shadow, and a second set inside the first is the double-border look. */
.panel > .table-wrap { margin: 0; border: 0; border-radius: 0; box-shadow: none; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: .9rem;
}

th, td {
    text-align: left;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--slate-100);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}

tbody tr:nth-child(even) { background: var(--surface-tint); }
tbody tr:hover { background: var(--blue-50); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); font-size: .84rem; }
td.nowrap, .nowrap { white-space: nowrap; }

tfoot td, tr.total td {
    background: var(--slate-100);
    font-weight: 650;
    border-top: 1px solid var(--line-strong);
    border-bottom: 0;
}

.detail-table th { width: 220px; background: var(--surface-tint); font-size: .82rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.detail-table td { background: var(--card); }
.detail-table tr:hover td { background: var(--card); }
/* A rounded table does not round its cells, so a cell background paints a square notch into the corner
   the border curve leaves empty. The four corner cells carry the radius instead. */
.detail-table tbody tr:first-child > :first-child { border-top-left-radius: var(--radius-md); }
.detail-table tbody tr:first-child > :last-child { border-top-right-radius: var(--radius-md); }
.detail-table tbody tr:last-child > :first-child { border-bottom-left-radius: var(--radius-md); }
.detail-table tbody tr:last-child > :last-child { border-bottom-right-radius: var(--radius-md); }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + * { margin-left: 6px; }

.scope-grid { width: auto; min-width: 340px; margin-bottom: 16px; }
.scope-grid th, .scope-grid td { text-align: center; }
.scope-grid td:first-child, .scope-grid th:first-child { text-align: left; }

/* A coverage bar: 25 and 75 should tell themselves apart without reading the number. */
.coverage { display: flex; align-items: center; gap: 8px; }
.coverage .meter { flex: 1; min-width: 56px; }
.coverage > span { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.meter {
    height: 7px;
    border-radius: var(--radius-pill);
    background: var(--slate-100);
    border: 1px solid var(--line);
    overflow: hidden;
}
.meter > span {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--amber-600), var(--amber-500));
}
.meter.is-full > span { background: linear-gradient(90deg, var(--green-700), #34a266); }

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: .74rem;
    font-weight: 650;
    letter-spacing: .01em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-ok { background: var(--green-50); color: var(--green-700); border-color: #bfe3cf; }
.badge-warn { background: var(--amber-50); color: var(--warn); border-color: var(--amber-100); }
.badge-bad { background: var(--red-50); color: var(--red-700); border-color: #f3c3bd; }
.badge-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.badge-muted { background: var(--slate-100); color: var(--muted); border-color: var(--line); }
/* A badge that appears on every row stops being a badge: "Expired" on forty-one rows is a column of gray
   pills, not information. The quiet variant keeps the word and drops the chrome. */
.badge-quiet { background: transparent; border-color: transparent; color: var(--muted-2); font-weight: 600; padding-left: 0; padding-right: 0; }
.badge-accent { background: var(--amber-50); color: var(--amber-ink); border-color: var(--amber-100); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

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

/* Blue is the thing to press, as it is in the portal; amber is the state worth noticing and the pill
   you are on. The console's one accent moved from the buttons to the marker. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--blue-600);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 15px;
    font: inherit;
    font-size: .87rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--blue-700); color: #fff; text-decoration: none; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--blue-600); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--blue-700); color: #fff; }

.btn-secondary { background: #fff; color: var(--text-strong); border-color: var(--line-strong); }
.btn-secondary:hover { background: #f8fafc; color: var(--text-strong); border-color: var(--muted-2); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--blue-600); padding: 5px 8px; }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); }
.btn-ghost-danger { background: transparent; border-color: transparent; color: var(--red-700); padding: 5px 8px; }
.btn-ghost-danger:hover { background: var(--red-50); color: var(--red-700); }

.btn-danger { background: #fff; border-color: #f0c2bc; color: var(--red-700); }
.btn-danger:hover { background: var(--red-50); color: var(--red-700); }

.btn-small { padding: 4px 10px; font-size: .8rem; border-radius: 8px; }

.inline-form { display: inline; }

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

.field { margin-bottom: 15px; }
.field label { display: block; font-size: .8rem; font-weight: 650; color: var(--text-strong); margin-bottom: 5px; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .9rem;
    background: #fff;
    color: var(--text);
}
/* The field gets the ring too — an outline and a tinted border, not a 1.16:1 shadow instead of one. */
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100);
}
.field .check { display: flex; align-items: center; gap: 9px; font-weight: 400; }
.field .check input { width: auto; }
/* The tick is the console's accent: on the application form it is seventeen of them in a grid, and the
   browser's own blue was the only hue on the page that is not a token. */
input[type=checkbox], input[type=radio] { accent-color: var(--blue-600); }
.field-error { color: var(--red-700); font-size: .8rem; margin-top: 4px; }
.hint { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 5px; line-height: 1.45; max-width: 78ch; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.field-wide { grid-column: 1 / -1; }

.toolbar, .filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 16px;
    flex-wrap: wrap;
}
.toolbar input[type=text], .filter-form input[type=text],
.toolbar input[type=number], .filter-form input[type=number],
.toolbar input[type=date], .filter-form input[type=date],
.toolbar input[type=datetime-local], .filter-form input[type=datetime-local],
.toolbar select, .filter-form select {
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .88rem;
    background: #fff;
    color: var(--text);
}
.toolbar input[type=text], .filter-form input[type=text] { min-width: 260px; }
/* A filter is a row, not a form: an id box sized for a paragraph and a date box twice the widest date it
   can hold push a four-filter strip onto a second line with the button stranded on it. */
.filter-form input[type=number] { max-width: 130px; }
.filter-form input[type=datetime-local] { max-width: 210px; }
.toolbar input:focus, .filter-form input:focus, .filter-form select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100);
}
/* A filter label wraps its own control ("From <input>"), so the two are laid out as one unit with air
   between them. */
.filter-form label { font-size: .8rem; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ---------- log tabs ----------------------------------------------------- */

.log-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 5px;
    background: var(--slate-100);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}
.log-nav a { color: var(--muted); text-decoration: none; padding: 6px 13px; border-radius: var(--radius-pill); font-size: .86rem; }
.log-nav a:hover { background: #fff; color: var(--text-strong); text-decoration: none; }
/* The tab you are on. Without it the eight log tables are eight identical links and every page looks like
   the web-service log. */
.log-nav a.is-active { background: var(--card); color: var(--text-strong); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- approval queue (mockup 05, plan 441) ------------------------- */

/* The queue is a master/detail surface: the scan on the left, the selected request on the right. The rail
   keeps its place while the list scrolls, but collapses under it before the table gets too narrow to read. */
.approval-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(330px, 1fr);
    gap: 18px;
    align-items: start;
}
.approval-layout > * { min-width: 0; }
.approval-layout > .approval-list > .panel,
.approval-layout > .approval-list > .empty { margin: 0; }
.approval-detail { margin: 0; position: sticky; top: 78px; }
.approval-detail .panel-body { padding-top: 14px; }
.approval-detail-head h3 { margin: 0 0 2px; font-size: 1.05rem; }
.approval-detail-head .hint { margin-top: 2px; }
.approval-detail-table { border: 0; box-shadow: none; font-size: .85rem; }
.approval-detail-table th { width: 128px; padding-left: 0; }
.approval-detail-table td { padding-right: 0; }
.approval-detail-table th, .approval-detail-table td { border-bottom: 1px solid var(--line); }
.approval-detail-table tr:last-child th, .approval-detail-table tr:last-child td { border-bottom: 0; }
.approval-detail-table tbody tr:hover td { background: var(--card); }

/* Density: the queue is a scan. A two-line cell still fits in one glance, and the selected row is marked
   once, with the same amber the console uses for the pill you are on. */
.approval-table th, .approval-table td { padding-top: 10px; padding-bottom: 10px; }
.approval-table tbody tr.is-selected { background: var(--amber-50); }
.approval-table tbody tr.is-selected td { border-bottom-color: var(--amber-100); }
.approval-table tbody tr.is-selected > td:first-child { box-shadow: inset 3px 0 0 var(--amber-500); }
.approval-table .row-actions { width: 1%; text-align: right; }

.approval-history-block { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.approval-history-block h3 { margin-top: 0; }
.approval-history { list-style: none; margin: 0; padding: 0; }
.approval-history li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.approval-history li:last-child { border-bottom: 0; padding-bottom: 0; }
.approval-history .hint { margin-top: 1px; }

.approval-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.approval-decision { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.panel-foot-note { margin: 14px 0 0; font-size: .84rem; }

/* ---------- notices ------------------------------------------------------ */

.alert {
    background: var(--green-50);
    border: 1px solid #bfe3cf;
    color: var(--green-700);
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    margin: 0 0 16px;
    font-size: .9rem;
}
.alert-error { background: var(--red-50); border-color: #f3c3bd; color: var(--red-700); }
.alert-key { background: var(--amber-50); border-color: var(--amber-100); color: var(--warn); }
.alert-key code { display: block; margin: 8px 0; font-family: var(--mono); font-size: .95rem; word-break: break-all; user-select: all; }

.empty {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--card);
    padding: 34px 20px;
    text-align: center;
    color: var(--muted);
}
.empty strong { display: block; color: var(--text-strong); font-size: 1rem; margin-bottom: 4px; }

/* ---------- auth --------------------------------------------------------- */

/* Sign-in, access denied and the error page: the brand strip is the layout's, the card is the page's.
   No sidebar, no navigation, no session to navigate with. */
.console-auth-topbar {
    /* Centered to match the portal's auth strip and the card underneath it (owner's call, 2026-11-23).
       Nothing else sits in this row, so this is one property rather than a grid. */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 24px 4px;
}
/* The same brand block on a light surface: the sidebar's white wordmark colors would vanish here, so the
   auth strip draws the light palette instead. */
.console-auth-topbar .console-brand-link { color: var(--text-strong); }
.console-auth-topbar .console-brand-sub { color: var(--muted-2); }
.console-auth-topbar .console-logo { height: 26px; }

.console-auth-main {
    display: grid;
    place-items: start center;
    padding: 18px 16px 48px;
    min-height: 70vh;
}

.console-auth-foot {
    padding: 18px 24px 28px;
    color: var(--muted-2);
    font-size: .78rem;
    border-top: 1px solid var(--line);
}

.auth-shell { display: grid; place-items: center; width: 100%; padding: 32px 0; }
.auth-card {
    width: min(460px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 28px 26px 24px;
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-card p { color: var(--muted); margin: 0 0 20px; font-size: .88rem; }
.auth-card .sub { margin-bottom: 20px; font-size: .86rem; }
.auth-card .btn { margin-top: 4px; }
.auth-card form .btn { width: 100%; }
.auth-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--muted); font-weight: 700; margin-bottom: 18px;
}
.auth-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber-500); }

/* ---------- misc --------------------------------------------------------- */

.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }
.dim { color: var(--muted-2); }
.small { font-size: .8rem; }
.stack > * + * { margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* ---------- narrow widths ------------------------------------------------ */

@media (max-width: 960px) {
    .console-shell { grid-template-columns: minmax(0, 1fr); }

    /* The bar is taller here (44 px controls), so a fragment target needs more room above it. */
    html { scroll-padding-top: 84px; }

    /* With the script off — no .console-drawer-ready on <html> — the sidebar is simply a visible block
       above the page, so every destination is reachable without a control that cannot open anything.
       console.js adds the class as its first act, and only then does the same sidebar become a drawer. */
    .console-sidebar { position: static; height: auto; max-height: none; }
    .console-nav { overflow-y: visible; }

    /* The drawer. Moved off-screen is not hidden: a transformed element still takes focus and is still in
       the accessibility tree, so visibility removes it from both, and the script adds inert/aria-hidden for
       assistive technology. The delay lets the slide finish first. */
    html.console-drawer-ready .console-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 300px);
        height: 100vh;
        height: 100dvh;
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
        box-shadow: var(--shadow-lg);
        overflow: hidden;
    }
    html.console-drawer-ready .console-nav { overflow-y: auto; }
    html.console-drawer-ready body.console-drawer-open .console-sidebar {
        transform: none;
        visibility: visible;
        transition: transform .2s ease, visibility 0s;
    }
    /* The page must not scroll behind the drawer; console.js toggles this class with the open state. */
    html.console-drawer-locked, html.console-drawer-locked body { overflow: hidden; }

    /* 44 × 44 (WCAG 2.5.5) for the shell's own control. Above 960 px, and with the script off, the toggle is
       not displayed at all: it would be a button that does nothing. */
    html.console-drawer-ready .console-drawer-toggle { display: inline-flex; width: 44px; height: 44px; }

    .console-topbar { padding: 8px 16px; }
    .console-content { max-width: none; padding: 20px 18px 48px; }
    .approval-layout { grid-template-columns: minmax(0, 1fr); }
    .approval-detail { position: static; }
    .grid { grid-template-columns: minmax(0, 1fr); }
    .field-wide { grid-column: auto; }
    .detail-table th { width: 150px; }
}

@media (max-width: 640px) {
    html { scroll-padding-top: 72px; }

    /* Two rows when the search field needs the width: the drawer toggle and the section name first, then
       the field across the bar. The label stays — it is the page's context, not decoration to drop. */
    .console-topbar { min-height: 52px; padding: 6px 12px; gap: 10px; flex-wrap: wrap; }
    .console-topbar-context { font-size: 11px; }
    .console-search { order: 3; flex: 1 1 100%; margin-left: 0; max-width: none; }

    .console-content { padding: 16px 12px 40px; }

    /* Page header actions stack under the heading and share the width, so a two-button head does not
       leave one button stranded at the right of a wrapped row. */
    .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-head-actions { justify-content: flex-start; width: 100%; }
    .page-head-actions .btn { flex: 1 1 auto; justify-content: center; }
    .page-head-meta { width: 100%; }

    .panel-head { flex-wrap: wrap; gap: 8px; }
    .filter-form label { white-space: normal; }
    .toolbar input[type=text], .filter-form input[type=text] { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---- plan 496: the toolbox-account and approval pages' own controls -------------------------------
   Two surfaces were audited with a keyboard and at 512 px: the toolbox-account list and record form,
   and the approval queue, its rail and a request's own page. The shell's ring is now the 3 px
   --focus-ring these rules were reaching for; they stay scoped to the two pages' hooks, and the 44 px
   floor stays where plan 496 put it, because the shell's own controls are the layout's.

   Page hooks: `.toolbox-account-search`, `.toolbox-account-table`, `.toolbox-account-form`,
   `.approval-filter`, `.approval-list`, `.approval-decision-form`. No other page carries one. */

.toolbox-account-search input:focus-visible,
.toolbox-account-form input:focus-visible,
.approval-filter select:focus-visible,
.approval-decision-form textarea:focus-visible {
    outline: 3px solid var(--info);
    outline-offset: 2px;
    box-shadow: none;
}

.toolbox-account-form .btn:focus-visible,
.toolbox-account-table .btn:focus-visible,
.approval-filter .btn:focus-visible,
.approval-list .btn:focus-visible,
.approval-decision-form .btn:focus-visible {
    outline: 3px solid var(--info);
    outline-offset: 2px;
}

@media (max-width: 860px) {
    .toolbox-account-search input,
    .toolbox-account-search .btn,
    .toolbox-account-table .btn,
    .toolbox-account-form input,
    .toolbox-account-form .btn,
    .approval-filter select,
    .approval-filter .btn,
    .approval-list .btn,
    .approval-decision-form textarea,
    .approval-decision-form .btn {
        min-height: 44px;
    }
}
