/* Alaidroos & Associates — Internal Operations Platform
   Light theme: teal accent (#2ba5a6) + brand blue (#1b5098) on white/grey surfaces.
   Top navbar with dropdowns. To rebrand: change ONLY the :root variables below. */
:root {
    /* Brand — teal accent + blue secondary (from alaidrooscpa.com) */
    --teal:           #2ba5a6;                 /* primary accent (teal) */
    --teal-hover:     #33bcbd;
    --teal-soft:      rgba(43,165,166,.12);
    --teal-line:      rgba(43,165,166,.45);    /* hairlines / accent rules */
    --brand-blue:     #1b5098;                 /* secondary brand blue */

    /* Surfaces — light */
    --bg-page:        #f7f7f7;   /* page body */
    --bg-page-deep:   #eef1f4;   /* hero base / deepest surface */
    --bg-card:        #ffffff;   /* default card / panel */
    --bg-card-2:      #f0f3f6;   /* card header, table header band */
    --bg-raised:      #eef2f6;   /* hovered rows / raised surfaces */
    --bg-header:      #ffffff;   /* page header band (white; accent used for active) */
    --bg-nav:         #ffffff;   /* nav bar band */
    --bg-input:       #ffffff;   /* form inputs */

    /* Text — dark on light */
    --text:           #222222;
    --text-secondary: #444444;
    --text-muted:     #666666;
    --text-on-input:  #222222;

    /* Lines / elevation — light-theme shadows */
    --border:         #e4e4e4;
    --border-strong:  #d0d4da;
    --shadow:         0 1px 3px rgba(0,0,0,.08);
    --shadow-lg:      0 10px 25px rgba(0,0,0,.12);
    --shadow-soft:    0 1px 2px rgba(0,0,0,.06), 0 8px 20px rgba(0,0,0,.06);
    --shadow-hover:   0 4px 10px rgba(0,0,0,.08), 0 16px 34px rgba(0,0,0,.12);

    /* Semantic — status meaning only; teal stays the single brand accent */
    --primary:        var(--teal);
    --info:           var(--brand-blue);       /* brand blue */
    --info-bg:        rgba(27,80,152,.12);
    --info-soft:      #e7eefb;
    --success:        #2fa47f;   /* green — paid / sent */
    --warning:        #d99a2b;   /* amber — attention */
    --danger:         #e5546a;   /* coral — failed / error */

    /* Radius */
    --radius:         8px;
    --radius-lg:      12px;
    --radius-pill:    999px;

    /* Motion */
    --t-fast:         .15s;
    --t-med:          .18s;

    /* Type — Lato body, Source Sans Pro headings (both Google Fonts).
       Update the Google Fonts <link> in base.html to load Lato + Source Sans Pro. */
    --font:           'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-heading:   'Source Sans Pro', var(--font);
    --font-display:   'Source Sans Pro', var(--font);
    --font-mono:      'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

    /* --- Phase-1 design-system scale: NAMES + assignments for the EXISTING
       palette (no new hues). One color = one meaning. --- */
    --teal-700: #1f8586;  --teal-600: #2ba5a6;  --teal-500: #33bcbd;
    --teal-100: rgba(43,165,166,.12);  --teal-050: rgba(43,165,166,.05);
    --navy-700: #164081;  --navy-600: #1b5098;  --navy-100: rgba(27,80,152,.12);
    --red-600:  #e5546a;  --red-100:  rgba(229,84,106,.12);
    --amber-600:#b17f22;  --amber-100:rgba(217,154,43,.16);
    --ink-900:  #10201f;  --ink-700:  #33474a;  --ink-500:  #6b7f82;  --ink-300: #a3b2b4;
    --surface:  #ffffff;  --surface-sunken: var(--bg-page);
    --surface-rule: #e4eaea;  --surface-header: #eff3f3;
    /* meaning: teal=brand/primary/approved/income · navy=secondary/system/expense
       · amber=needs-attention · red=destructive/failed · gray=neutral/none */
    --status-pending: var(--amber-600);  --status-approved: var(--teal-600);
    --status-rejected: var(--red-600);    --status-neutral: var(--ink-500);
    --money-income: var(--teal-600);      --money-expense: var(--navy-600);
    --env-dev: var(--amber-600);

    --header-h:       64px;
    --nav-h:          48px;
}

/* Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg-page); }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.55;
    min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); text-decoration: underline; }

/* Header (top bar) -------------------------------------------------- */
header {
    background: var(--bg-header);
    color: var(--text);
    padding: .75rem 1.5rem;
    border-bottom: 2px solid var(--teal);
    position: relative;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header-left { display: flex; align-items: center; gap: .75rem; }
/* Tagline row: 'Internal Operations' + the env badge sit together on one line */
.brand-sub { display: flex; align-items: center; gap: .45rem; }
.brand {
    color: var(--text);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.brand:hover { text-decoration: none; }
.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    margin: 0;
}
.brand small {
    font-size: .7rem;
    letter-spacing: .12em;
    color: var(--teal);
    text-transform: uppercase;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .85rem;
    color: var(--text-secondary);
}
.user-link {
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    text-decoration: none;
    padding: .3rem .7rem;
    border-radius: var(--radius);
    /* a light pill on the white header so the profile is discoverable at rest */
    border: 1px solid var(--border-strong);
    background: transparent;
    transition: background .15s, border-color .15s;
}
.user-link:hover { background: var(--teal-soft); border-color: var(--teal-line); }
.user-link .fa-circle-user { color: var(--teal); }
.user-caret { font-size: .7rem; opacity: .75; }
.env-badge {
    background: var(--teal-soft);
    color: var(--teal);
    border: 1px solid var(--teal-line);
    font-weight: 700;
    font-size: .58rem;
    letter-spacing: .05em;
    line-height: 1;
    padding: .16rem .38rem;
    border-radius: var(--radius);
}

/* Top nav bar with dropdowns --------------------------------------- */
.topnav {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: relative;
    z-index: 40;
}
.topnav-inner {
    display: flex;
    gap: .25rem;
    align-items: stretch;
    min-height: var(--nav-h);
}
.topnav-item, .topnav-toggle {
    color: var(--text);
    text-decoration: none;
    padding: 0 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1;
    height: var(--nav-h);
    box-sizing: border-box;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
}
.topnav-item:hover, .topnav-toggle:hover {
    color: var(--teal);
    background: rgba(255,255,255,.03);
    text-decoration: none;
}
.topnav-item.active, .topnav-toggle.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}
.topnav-toggle .caret { font-size: .65em; opacity: .8; }

.topnav-group { position: relative; }
.topnav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-card-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .4rem 0;
    z-index: 100;
    display: none;
}
.topnav-group.open .topnav-menu { display: block; }
.topnav-menu a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    color: var(--text);
    font-size: .88rem;
    text-decoration: none;
}
.topnav-menu a:hover { background: var(--teal-soft); color: var(--teal); }

/* Page heading row (gold icon + title) ------------------------------ */
.page-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 0 .75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}
.page-head h2 {
    color: var(--teal);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
.page-head .icon, .page-head h2 i {
    color: var(--teal);
    font-size: 1.15rem;
}
.page-head .head-right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* Main + container -------------------------------------------------- */
main {
    padding: 24px 32px 48px;
    background: var(--bg-page);
    min-height: calc(100vh - var(--header-h) - var(--nav-h));
    max-width: 1504px;   /* §3.4: 1440 content + 2x32 gutter, centered */
    margin: 0 auto;
}
.container, .container-narrow {
    margin: 0 auto;
}

/* Typography -------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    margin-bottom: .75rem;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; color: var(--teal); }
h3 { font-size: 1.15rem; color: var(--teal); }
h4 { font-size: 1rem; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--info); }
.text-info { color: var(--info); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-dark { color: var(--text); }
.muted { color: var(--text-muted); }
.bg-light {
    background: rgba(255,255,255,.04);
    color: var(--text);
    border: 1px solid var(--border);
    padding: .5rem .75rem;
    border-radius: var(--radius);
}
pre.bg-light { font-family: var(--font-mono); font-size: .82rem; }
.list-unstyled { list-style: none; padding-left: 0; }
.rounded { border-radius: var(--radius); }
.p-2 { padding: .5rem; }
.w-100 { width: 100%; }
.d-grid { display: grid; }
.col-lg-4 { flex: 1 1 calc(33.33% - .833rem); min-width: 280px; }
.col-lg-8 { flex: 1 1 calc(66.66% - .417rem); min-width: 320px; }
.col-md-2 { flex: 1 1 calc(16.66% - 1.04rem); min-width: 130px; }
.col-md-4 { flex: 1 1 calc(33.33% - .833rem); min-width: 200px; }
.text-center { text-align: center; }

/* Alerts (info / success / danger / warning) ------------------------ */
.alert {
    padding: .85rem 1.1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .9rem;
}
.alert-info {
    background: var(--info-soft);
    border-color: #1e3a72;
    color: #143d75;
}
.alert-info::before { content: "ⓘ"; font-size: 1rem; color: #1b5098; }
.alert-success { background: rgba(47,164,127,.14); border-color: rgba(47,164,127,.45); color: #0f5a3c; }
.alert-warning { background: rgba(217,154,43,.16); border-color: rgba(217,154,43,.5); color: #6b4a06; }
.alert-danger  { background: rgba(229,84,106,.14); border-color: rgba(229,84,106,.45); color: #8a1b2b; }
.alert .alert-close {
    margin-left: auto;
    background: none; border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: .7;
}
.alert .alert-close:hover { opacity: 1; }

/* Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 32px;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    font-family: var(--font);
    white-space: nowrap;
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, opacity .22s ease;
}
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; min-height: 28px; }

/* Button-like anchors never underline on hover (only inline text links do) */
.btn:hover, .btn:focus,
.user-link:hover,
.stat-card:hover, .instrument:hover,
.topnav-item:hover, .topnav-toggle:hover, .topnav-menu a:hover { text-decoration: none; }

/* Smooth, DTR-style hover/focus feedback across ALL interactive surfaces */
a,
.topnav-item, .topnav-toggle, .topnav-menu a,
.count-badge, .rp-role, .rp-cap,
.data-table tbody tr, table tbody tr,
input, select, textarea, .form-control, .form-select,
.alert-close, .mc-modal-x, .pill {
    transition: background-color .22s ease, color .22s ease,
                border-color .22s ease, box-shadow .22s ease;
}

.btn-primary,
.btn-warning {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}
.btn-primary:hover, .btn-warning:hover { background: var(--teal-hover); color: #fff; }

/* §3.3: system/secondary actions are OUTLINE navy, so a solid navy can never be
   mistaken for a second primary. Exactly one SOLID (teal) button per region. */
.btn-info {
    background: #fff;
    color: var(--navy-600);
    border-color: var(--navy-600);
}
.btn-info:hover { background: var(--navy-100); color: var(--navy-700); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #bb2d3b; color: #fff; }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #146c43; color: #fff; }

.btn-secondary {
    background: #fff;
    color: var(--navy-600);
    border-color: var(--navy-600);
}
.btn-secondary:hover { background: var(--navy-100); color: var(--navy-700); }
/* Ghost — in-row table actions (Edit / Password / View) */
.btn-ghost { background: transparent; color: var(--navy-600); border-color: transparent; }
.btn-ghost:hover { background: var(--navy-100); color: var(--navy-700); }
.btn-ghost-danger { background: transparent; color: var(--red-600); border-color: transparent; }
.btn-ghost-danger:hover { background: var(--red-100); }

.btn-outline-primary {
    background: transparent;
    color: var(--teal);
    border-color: var(--teal);
}
.btn-outline-primary:hover { background: var(--teal); color: #fff; }

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-outline-secondary:hover { background: rgba(255,255,255,.04); color: var(--text); }

.btn-logout {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-logout:hover { background: rgba(255,255,255,.05); }

/* Cards ------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
.card-header {
    background: var(--bg-card-2);
    margin: -1.1rem -1.25rem 1rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}
.card-header h6, .card-header h5, .card-header h4, .card-header h3 { margin: 0; }
.card-body { padding: 0; }

/* Dashboard cards --------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
.card-grid .card { display: flex; flex-direction: column; gap: .75rem; }
.card-grid .card h3 {
    color: var(--teal);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
}
.card-grid .card p {
    color: var(--text-secondary);
    font-size: .88rem;
    margin: 0;
    flex-grow: 1;
}
.card-grid .card .btn { align-self: flex-start; }

/* Tables ------------------------------------------------------------ */
.table-wrap, .table-responsive {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
    background: var(--bg-card);
}
table thead tr { background: var(--bg-card-2); }
table th {
    color: var(--teal);
    text-align: left;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .03em;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}
table td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
    vertical-align: middle;
}
table tbody tr:hover { background: var(--bg-raised); }
table tbody tr:last-child td { border-bottom: 0; }
table .actions { display: flex; gap: .35rem; align-items: center; }

/* Status pills / type badges --------------------------------------- */
.badge {
    display: inline-block;
    padding: .25em .6em;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius);
    color: #fff;
    vertical-align: middle;
}
.badge-customer, .bg-primary { background: var(--info); }
.badge-broker,   .bg-success { background: var(--success); }
.badge-trader,   .bg-warning { background: var(--warning); color: #1a1a2e; }
.bg-secondary { background: #495057; }
.bg-info      { background: var(--info); color: #fff; }
.bg-danger    { background: var(--danger); }
.bg-dark      { background: #212529; }

/* Forms ------------------------------------------------------------- */
.form-label {
    display: block;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: .35rem;
}
.form-text {
    display: block;
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: .25rem;
}
.form-control, .form-select, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"], textarea, select {
    width: 100%;
    padding: .5rem .7rem;
    background: var(--bg-input);
    color: var(--text-on-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .9rem;
}
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
    outline: 0;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(43,165,166,.2);
}
textarea { font-family: var(--font-mono); }
/* §3.5: custom-styled select — never the raw OS widget */
select, .form-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 2.1rem; cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7f82' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center; background-size: 12px 8px;
}
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.ms-2 { margin-left: .5rem; }
.me-2 { margin-right: .5rem; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.col-md-6 { flex: 1 1 calc(50% - .625rem); min-width: 320px; }
.col-6 { flex: 0 0 50%; }
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.btn-group .btn:last-child  { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.btn-group .btn + .btn { margin-left: -1px; }

/* Form check (custom checkbox) ------------------------------------- */
.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.form-check-input {
    width: auto;
    margin: 0;
    width: 16px; height: 16px;
}
.form-check-label { color: var(--text); }

/* Misc utilities --------------------------------------------------- */
.small { font-size: .8rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }

/* Login -------------------------------------------------------------- */
.login-container {
    min-height: calc(100vh - var(--header-h) - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.25rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.login-card .login-logo {
    width: 90px;
    background: #fff;
    padding: 6px 10px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.login-card h2 { color: var(--teal); margin-bottom: .25rem; }
.login-card .muted { color: var(--text-muted); font-size: .85rem; margin-bottom: 1.25rem; }
.login-card label {
    display: block;
    text-align: left;
    color: var(--text-secondary);
    font-size: .8rem;
    margin: .75rem 0 .25rem;
}
.login-card .btn { width: 100%; justify-content: center; margin-top: 1rem; }

/* Footer ----------------------------------------------------------- */
footer {
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: .8rem;
}

/* Flash message slide-in ------------------------------------------- */
@keyframes slideIn { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.alert { animation: slideIn .25s ease; }

/* Responsive small fix -------------------------------------------- */
@media (max-width: 720px) {
    .topnav-inner { flex-wrap: wrap; }
    .header-inner { flex-wrap: wrap; gap: .5rem; }
}

/* ===== Role admin components (MCA-30) ============================== */

/* count pill used on the roles list + matrix role list */
.count-badge {
    display: inline-block; min-width: 1.7rem; padding: .12rem .5rem;
    border-radius: 999px; background: var(--bg-card-2); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: .78rem; font-weight: 700; text-align: center;
}
a.count-badge { text-decoration: none; }
a.count-badge:hover { border-color: var(--teal); color: var(--teal); }
.row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: nowrap; }
.btn-icon { padding: .4rem .55rem; line-height: 1; }
.btn-icon i { font-size: .85rem; }

/* lightweight modal (roles + capabilities add/edit) */
.mc-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.62);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 7vh 1rem 1rem; z-index: 1000;
}
.mc-modal-overlay[hidden] { display: none; }
.mc-modal {
    background: var(--bg-card); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 500px; animation: slideIn .18s ease;
}
.mc-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1.2rem; border-bottom: 1px solid var(--border);
}
.mc-modal-head h3 { margin: 0; font-size: 1.05rem; }
.mc-modal-x {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.mc-modal-x:hover { color: var(--text); }
.mc-modal form { padding: 1.2rem; }
.mc-field { margin-bottom: 1rem; }
.mc-field:last-of-type { margin-bottom: 0; }
.mc-field label { display: block; margin-bottom: .35rem; font-size: .82rem; color: var(--text-secondary); }
.mc-field input, .mc-field textarea, .mc-field select { width: 100%; }
/* modal textareas default to the mono font globally (line ~503); use the app
   font so the description reads the same as the role-name input, not pixelated */
.mc-field textarea { font-family: var(--font); }
.mc-modal-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.3rem; }

/* two-panel role -> capability matrix */
.rp-grid { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.rp-h { margin: 0 0 .75rem; font-size: 1rem; }
.rp-role-list { list-style: none; margin: 0; padding: 0; }
.rp-role-list li { margin-bottom: .3rem; }
.rp-role {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .7rem; border-radius: var(--radius); text-decoration: none;
    color: var(--text); border: 1px solid var(--border); background: var(--bg-card-2);
}
.rp-role:hover { border-color: var(--teal); }
.rp-role.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.rp-role.active .count-badge { background: rgba(255,255,255,.25); color: #fff; border-color: rgba(255,255,255,.35); }
.rp-caps-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.rp-tools { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0 .75rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.rp-selectall { font-size: .85rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.rp-cat {
    text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; font-weight: 700;
    color: var(--teal); margin: .9rem 0 .35rem; padding-bottom: .2rem; border-bottom: 1px solid var(--border);
}
.rp-cap { display: flex; align-items: flex-start; gap: .6rem; padding: .4rem .3rem; border-radius: var(--radius); cursor: pointer; }
.rp-cap:hover { background: var(--bg-card-2); }
.rp-cap input { margin-top: .2rem; }
.rp-cap-body { display: flex; flex-direction: column; }
.rp-cap-name { font-weight: 600; font-size: .9rem; }
.rp-cap-desc { font-size: .78rem; color: var(--text-muted); }
.rp-foot { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.rp-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.rp-empty i { font-size: 2rem; display: block; margin-bottom: .75rem; opacity: .6; }
@media (max-width: 768px) { .rp-grid { grid-template-columns: 1fr; } }

/* ==================================================================
   Dashboard + ledger design system: tabular-mono figures, hairline rules,
   restrained motion, a single teal rule as the signature.
   ================================================================== */

/* Base type treatment ---------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.01em; }
/* Money & data always read as a ledger/telegraph readout */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
    display: block; font-size: .68rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--teal);
}

/* Motion + accessibility floor ------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; animation: rise .5s cubic-bezier(.22,.61,.36,1) forwards; }
.d1 { animation-delay: .04s; } .d2 { animation-delay: .10s; }
.d3 { animation-delay: .16s; } .d4 { animation-delay: .22s; } .d5 { animation-delay: .28s; }
@keyframes tidePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229,84,106,0); }
    50%      { box-shadow: 0 0 0 6px rgba(229,84,106,.16); }
}
:where(a, button, input, select, textarea, .btn):focus-visible {
    outline: 2px solid var(--teal); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    /* Disable keyframe ANIMATIONS and translate "lifts" (the vestibular motion),
       but KEEP gentle color/background/opacity fades so hover feedback still
       reads smoothly. */
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .rise { opacity: 1 !important; transform: none !important; }
    .stat-card:hover, .instrument:hover, .btn:hover { transform: none !important; }
}

/* Modest global elevation refresh (rounder cards, softer shadow) ---- */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }

/* Header profile pill — light pill on the white header */
.user-link {
    gap: .5rem; padding: .32rem .8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: transparent;
    transition: background-color .22s ease, border-color .22s ease, color .22s ease;
}
.user-link:hover { background: var(--teal-100); border-color: var(--teal-line); }
.user-link .fa-circle-user { color: var(--teal); font-size: 1.05rem; }
.user-caret { font-size: .7rem; opacity: .6; }

/* Consistent page header (eyebrow + title + action) ---------------- */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding: .25rem 0 1rem; margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 1.55rem; font-weight: 700; margin: .2rem 0 0; color: var(--text); }
.page-header-actions { display: flex; gap: .5rem; align-items: center; }

/* ---- Dashboard: the Bridge instrument band ----------------------- */
.bridge {
    position: relative; overflow: hidden; text-align: center;
    padding: 1.6rem 1.75rem 1.4rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 150% at 94% -20%, rgba(43,165,166,.08), transparent 58%),
        linear-gradient(180deg, var(--bg-card-2), var(--bg-card));
    box-shadow: var(--shadow-soft);
}
.bridge-head { margin-bottom: 1.35rem; }
.bridge-eyebrow { color: var(--teal); }
.bridge-greeting { display: block; margin-top: .15rem; font-size: .85rem; color: var(--text-secondary); }
.bridge-greeting strong { color: var(--text); font-weight: 600; }
.bridge-clock {
    position: absolute; top: 1.15rem; right: 1.4rem;
    font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 640px) { .bridge-clock { display: none; } }
.bridge-instruments {
    display: flex; flex-wrap: wrap; gap: 1.4rem 3.25rem;
}
.instrument {
    position: relative; display: flex; flex-direction: column; gap: .18rem;
    min-width: 150px; flex: 0 1 auto;
    padding: .15rem .3rem .15rem 1rem;
    border-left: 2px solid var(--border-strong);
    text-decoration: none; color: var(--text);
    transition: border-color var(--t-fast), transform var(--t-fast);
}
.instrument:hover { border-left-color: var(--teal); transform: translateX(1px); }
.instrument-label {
    font-size: .66rem; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--text-muted);
}
.instrument-value {
    font-family: var(--font-mono); font-weight: 600;
    font-size: 1.9rem; line-height: 1.12; color: var(--teal);
    font-variant-numeric: tabular-nums;
}
.instrument-note { font-size: .73rem; color: var(--text-secondary); }
.instrument.is-primary { border-left-color: var(--teal); }
.instrument.is-primary .instrument-value { color: var(--teal); }
.instrument.is-danger { border-left-color: var(--danger); border-radius: 2px; animation: tidePulse 2.6s ease-in-out infinite; }
.instrument.is-danger .instrument-value { color: #a81f33; }

/* The signature: a luminous gold horizon (tideline) ---------------- */
.tideline {
    position: relative; height: 2px; margin-top: 1.35rem;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--teal-line) 16%, var(--teal) 50%, var(--teal-line) 84%, transparent);
    box-shadow: 0 0 18px 1px rgba(43,165,166,.24);
}
.tideline::after {
    content: ""; position: absolute; left: 10%; right: 10%; top: 5px; height: 22px;
    background: radial-gradient(60% 100% at 50% 0, rgba(43,165,166,.12), transparent 72%);
    pointer-events: none;
}
.bridge-title {
    font-family: var(--font-display); font-size: 1.9rem; font-weight: 700;
    letter-spacing: -.01em; line-height: 1.1; margin: 0 0 .2rem; color: var(--text);
}

/* ---- Metric cards: the 6-up overview grid ------------------------- */
.stat-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
    position: relative; display: flex; flex-direction: column; gap: .18rem;
    padding: 1.15rem 1.3rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
    text-decoration: none; overflow: hidden;
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.stat-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--teal); opacity: .8;
}
.stat-card:hover {
    transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-hover);
}
.stat-card-icon {
    position: absolute; top: 1rem; right: 1.1rem;
    font-size: 1.3rem; color: var(--teal); opacity: .28;
}
.stat-card-value {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
    font-size: 1.85rem; font-weight: 600; line-height: 1.1; color: var(--teal);
}
.stat-card-label { font-size: .8rem; font-weight: 600; color: var(--text); margin-top: .1rem; }
.stat-card-sub { font-size: .73rem; color: var(--text-muted); }
.stat-card.is-danger::before { background: var(--danger); opacity: 1; }
.stat-card.is-danger .stat-card-value { color: #a81f33; }
.stat-card.is-danger .stat-card-icon { color: var(--danger); opacity: .5; }
/* Destination label — names the page each card links to */
.stat-card-link {
    margin-top: .6rem; padding-top: .55rem;
    border-top: 1px solid var(--border);
    font-size: .72rem; font-weight: 600; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: .35rem;
    transition: color .22s ease;
}
.stat-card-link i { font-size: .62rem; transition: transform .22s ease; }
.stat-card:hover .stat-card-link { color: var(--teal); }
.stat-card:hover .stat-card-link i { transform: translateX(2px); }

/* §5.2 semantic stat-card accents — one hue per meaning ------------- */
.stat-card.is-attention::before { background: var(--amber-600); opacity: 1; }
.stat-card.is-attention .stat-card-value { color: var(--amber-600); }
.stat-card.is-attention .stat-card-icon { color: var(--amber-600); opacity: .38; }
.stat-card.is-approved::before { background: var(--teal-600); opacity: 1; }
.stat-card.is-approved .stat-card-value { color: var(--teal-600); }
.stat-card.is-neutral::before { background: var(--ink-300); opacity: 1; }
.stat-card.is-neutral .stat-card-value { color: var(--ink-700); }
.stat-card.is-neutral .stat-card-icon { color: var(--ink-500); opacity: .32; }

/* §5.2 Home greeting strip ----------------------------------------- */
.dash-greet {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.25rem;
}
.dash-greet-title {
    font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
    letter-spacing: -.01em; line-height: 1.15; margin: 0; color: var(--text);
}
.dash-greet-sub { margin: .25rem 0 0; font-size: .92rem; color: var(--text-secondary); }
.dash-greet-sub strong { color: var(--text); font-weight: 700; }
.dash-greet-sub .txt-danger { color: var(--red-600); }
.dash-greet-clock {
    flex-shrink: 0; padding-top: .5rem;
    font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 640px) { .dash-greet-clock { display: none; } }

/* §5.2 Needs-your-attention panel ---------------------------------- */
.attention-panel {
    display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem;
    padding: .75rem 1rem; border-radius: var(--radius-lg);
    background: var(--amber-100); border: 1px solid rgba(177,127,34,.4);
    text-decoration: none; transition: border-color var(--t-fast);
}
.attention-panel:hover { border-color: var(--amber-600); }
.attention-icon { flex-shrink: 0; color: var(--amber-600); font-size: 1.05rem; }
.attention-text { color: var(--text); font-size: .92rem; }
.attention-text strong { color: var(--amber-600); font-weight: 700; }
.attention-go {
    margin-left: auto; flex-shrink: 0; white-space: nowrap;
    color: var(--amber-600); font-weight: 600; font-size: .85rem;
}
.attention-go i { margin-left: .3rem; font-size: .72rem; }

/* §5.2 Manage tiles — whole tile is the target, no separate button - */
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (max-width: 560px) { .tile-grid { grid-template-columns: 1fr; } }
.manage-tile {
    display: flex; align-items: center; gap: .8rem; padding: .85rem .95rem;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg-card); text-decoration: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.manage-tile:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-1px); }
.manage-tile-icon {
    display: grid; place-items: center; flex-shrink: 0;
    width: 36px; height: 36px; border-radius: var(--radius);
    background: var(--teal-100); color: var(--teal-700); font-size: .95rem;
}
.manage-tile-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.manage-tile-title { color: var(--text); font-weight: 600; font-size: .92rem; }
.manage-tile-desc { color: var(--text-muted); font-size: .8rem; line-height: 1.3; }
.manage-tile-go { margin-left: auto; flex-shrink: 0; color: var(--text-muted); font-size: .8rem; transition: transform var(--t-fast), color var(--t-fast); }
.manage-tile:hover .manage-tile-go { color: var(--teal); transform: translateX(2px); }

/* ---- Quick actions bar ------------------------------------------- */
.quick-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
    padding: .8rem 1.1rem; margin-bottom: 1.5rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.quick-actions-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted); margin-right: .2rem;
}
.quick-actions-label i { color: var(--teal); margin-right: .3rem; }
.quick-actions-roster {
    margin-left: auto; font-family: var(--font-mono); font-size: .76rem;
    color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.quick-actions-roster strong { color: var(--text-secondary); font-weight: 600; }

/* ---- Two-column body: activity + manage -------------------------- */
.dash-cols {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 1.5rem; align-items: start;
}
.dash-panel { min-width: 0; }
.dash-panel-title {
    font-family: var(--font-display); font-size: 1rem; color: var(--text);
    display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .9rem;
}
.dash-panel-title i { color: var(--teal); }
.dash-panel .card-grid { margin-top: 0; grid-template-columns: 1fr; }
.dash-panel-empty {
    color: var(--text-muted); font-size: .88rem; padding: 1.5rem; text-align: center;
    background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.dash-panel-empty i { margin-right: .4rem; opacity: .7; }

/* Recent activity list */
.activity-list {
    list-style: none; margin: 0; padding: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.activity-item {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .7rem .95rem; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-level {
    flex: none; font-size: .6rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; padding: .2rem .45rem; border-radius: var(--radius-pill);
    margin-top: .05rem; background: var(--info-bg); color: var(--info);
    border: 1px solid rgba(79,157,212,.3);
}
.activity-warning, .activity-warn { background: rgba(217,154,43,.16); color: #6b4a06; border-color: rgba(217,154,43,.3); }
.activity-error, .activity-critical { background: rgba(229,84,106,.16); color: #8a1b2b; border-color: rgba(229,84,106,.3); }
.activity-info { background: var(--info-bg); color: #143d75; border-color: rgba(79,157,212,.3); }
.activity-body { display: flex; flex-direction: column; min-width: 0; }
.activity-msg {
    font-size: .85rem; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-meta { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }
.activity-meta .src { font-family: var(--font-mono); }
.dash-panel-more {
    display: inline-block; margin-top: .7rem; font-size: .8rem;
    color: var(--teal); text-decoration: none;
}
.dash-panel-more:hover { text-decoration: underline; }
.dash-panel-more i { font-size: .7rem; margin-left: .2rem; }

/* ==================================================================
   Reusable status pills (tables, lists, detail views)
   ================================================================== */
.pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .2rem .55rem; border-radius: var(--radius-pill);
    font-size: .72rem; font-weight: 600; line-height: 1.4;
    border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { background: rgba(47,164,127,.14);  color: #0f5a3c; border-color: rgba(47,164,127,.32); }
.pill-warning { background: rgba(217,154,43,.14);  color: #6b4a06; border-color: rgba(217,154,43,.32); }
.pill-danger  { background: rgba(229,84,106,.14);  color: #8a1b2b; border-color: rgba(229,84,106,.32); }
.pill-info    { background: rgba(79,157,212,.14);  color: #143d75; border-color: rgba(79,157,212,.32); }
.pill-muted   { background: rgba(124,129,148,.14); color: #454b5a; border-color: rgba(124,129,148,.32); }

/* ==================================================================
   Table system — the surface AR staff live in
   ================================================================== */
.table-toolbar {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
    justify-content: space-between; margin-bottom: 1rem;
}
.toolbar-group { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.data-table-wrap {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.data-table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    position: sticky; top: 0; z-index: 2; background: var(--bg-card-2);
    color: var(--text-secondary); font-size: .7rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; text-align: left;
    padding: .7rem .9rem; border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}
.data-table tbody td {
    padding: .7rem .9rem; border-bottom: 1px solid var(--border);
    font-size: .86rem; vertical-align: middle; color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--bg-raised); }
.data-table .num-cell, .data-table th.num-cell {
    font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}
.data-table td.num-cell { font-family: var(--font-mono); }
.data-table .col-actions, .data-table th.col-actions { text-align: right; white-space: nowrap; }
.row-actions { display: inline-flex; gap: .3rem; justify-content: flex-end; align-items: center; }
.table-empty { padding: 3rem 1rem; text-align: center; color: var(--text-muted); }
.table-empty i { font-size: 2rem; display: block; margin-bottom: .75rem; opacity: .6; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { font-size: .76rem; color: var(--text-muted); }

/* §5.16: one empty-state pattern — icon > headline > explanation > optional action.
   Centered inside the content panel, never a bare sentence on the background. */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: .3rem; padding: 3rem 1.5rem; min-height: 220px;
    background: var(--surface); border: 1px dashed var(--surface-rule); border-radius: var(--radius-lg);
}
.empty-state .empty-icon { font-size: 2.3rem; color: var(--ink-300); margin-bottom: .4rem; }
.empty-state .empty-title { font-size: 1.02rem; font-weight: 600; color: var(--ink-700); }
.empty-state .empty-desc { font-size: .88rem; color: var(--ink-500); max-width: 46ch; line-height: 1.5; }
.empty-state .btn { margin-top: .7rem; }

/* §3.5: file dropzone — the app's core action, styled as the page anchor */
.back-link { color: var(--ink-500); text-decoration: none; font-size: .88rem; }
.back-link:hover { color: var(--teal-600); }
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .5rem; text-align: center; cursor: pointer; position: relative;
    padding: 2.1rem 1.25rem; border: 2px dashed var(--surface-rule);
    border-radius: var(--radius-lg); background: var(--surface-sunken); color: var(--ink-500);
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--teal-600); background: var(--teal-050); }
.dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone-icon { font-size: 1.9rem; color: var(--teal-600); }
.dropzone-text { font-size: .92rem; color: var(--ink-700); }
.dropzone-browse { color: var(--teal-600); font-weight: 600; text-decoration: underline; }
.dropzone-hint { font-size: .78rem; color: var(--ink-500); }
.dropzone-chip {
    display: flex; align-items: center; gap: .6rem; margin-top: .6rem;
    padding: .6rem .8rem; border: 1px solid var(--surface-rule);
    border-radius: var(--radius); background: var(--surface); font-size: .88rem;
}
.dropzone-chip i { color: var(--teal-600); }
.dropzone-chip .chip-name { font-weight: 600; color: var(--ink-700); }
.dropzone-chip .chip-size { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-500); }
.dropzone-chip .chip-remove { margin-left: auto; background: none; border: 0; color: var(--ink-500); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.dropzone-chip .chip-remove:hover { color: var(--red-600); }

/* §5.1: header account dropdown (demotes standalone Logout into it) */
.user-menu { position: relative; }
.user-menu-toggle { cursor: pointer; font: inherit; }
.user-menu-toggle .caret { font-size: 1.15em; opacity: .7; margin-left: .15rem; }
.user-menu-panel { left: auto; right: 0; min-width: 200px; }
.user-menu-panel .menu-divider { height: 1px; background: var(--surface-rule); margin: .3rem 0; }
.user-menu-panel form { margin: 0; }
.user-menu-panel .menu-logout {
    display: flex; align-items: center; gap: .5rem; width: 100%;
    padding: .55rem 1rem; background: none; border: 0; cursor: pointer;
    color: var(--text); font-size: .88rem; font-family: inherit; text-align: left;
}
.user-menu-panel .menu-logout:hover { background: var(--red-100); color: var(--red-600); }
/* §5.1: slim footer build/env line */
.footer-meta { opacity: .85; }
.footer-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
    .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .bridge-instruments { gap: 1.2rem 2rem; }
}

/* ==================================================================
   Site-wide form + detail utilities (design-system rollout)
   ================================================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem 1.25rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.15rem 1.25rem; }
.form-actions {
    display: flex; flex-wrap: wrap; gap: .75rem;
    margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
}
@media (max-width: 640px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }

/* Profile / detail list */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.profile-dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.4rem; margin: 0; }
.profile-dl dt { color: var(--text-secondary); font-size: .85rem; }
.profile-dl dd { margin: 0; word-break: break-word; }
.profile-subh {
    margin: 1.4rem 0 .55rem; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--teal);
}
.profile-caps { display: flex; flex-wrap: wrap; gap: .35rem; }
.status-on { color: var(--success); font-weight: 600; }
.req { color: var(--danger); }
@media (max-width: 768px) { .profile-grid { grid-template-columns: 1fr; } }
