/* ---------------------------------------------------------------------------
   HMS Manager — "Deep Water" design system
   Dark-teal chrome (sidebar) over a light workspace, teal accent colour taken
   from the Hawk brand mark. Layered on Bootstrap 5.3 via CSS-variable
   overrides + component styles, so the bare `form.as_p` outputs used across
   the app render as polished controls without a widget-tweaks dependency.
   --------------------------------------------------------------------------- */

:root {
    /* Brand palette */
    --teal-800: #00768a;
    --teal-700: #008ba0;
    --teal-600: #009fb7;
    --teal-500: #1aa9bf;
    --teal-400: #40b7c9;
    --teal-300: #81cfdb;
    --teal-200: #c1e7ed;
    --teal-100: #e6f5f8;
    --chrome-900: #071a20;
    --chrome-800: #0b2229;
    --chrome-700: #0f3440;
    --ink: #241e1e;
    --ink-soft: #3d3636;
    --muted: #5f6b6e;
    --surface: #ffffff;
    --surface-2: #f3f7f8;
    --border: #e2eaec;
    --border-strong: #cfdbdf;

    /* Bootstrap mapping */
    --bs-primary: #008ba0;
    --bs-primary-rgb: 0, 139, 160;
    --bs-link-color: var(--teal-800);
    --bs-link-color-rgb: 0, 118, 138;
    --bs-link-hover-color: #00657a;
    --bs-body-bg: var(--surface-2);
    --bs-body-color: var(--ink);

    --app-card-shadow: 0 1px 2px rgba(11, 34, 41, 0.06);
    --app-focus-ring: 0 0 0 0.2rem rgba(0, 159, 183, 0.22);
}

body {
    padding-top: 0;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* ---- Base typography ----------------------------------------------------- */
h1, .h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
h2, .h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }

/* ---- Buttons ------------------------------------------------------------- */
.btn { border-radius: 8px; font-weight: 500; }

.btn-primary {
    --bs-btn-bg: #008ba0;
    --bs-btn-border-color: #008ba0;
    --bs-btn-hover-bg: #00768a;
    --bs-btn-hover-border-color: #00768a;
    --bs-btn-active-bg: #00657a;
    --bs-btn-active-border-color: #00657a;
    --bs-btn-disabled-bg: #008ba0;
    --bs-btn-disabled-border-color: #008ba0;
    --bs-btn-focus-shadow-rgb: 0, 139, 160;
}

.btn-outline-primary {
    --bs-btn-color: #008ba0;
    --bs-btn-border-color: #008ba0;
    --bs-btn-hover-bg: #008ba0;
    --bs-btn-hover-border-color: #008ba0;
    --bs-btn-active-bg: #008ba0;
    --bs-btn-active-border-color: #008ba0;
    --bs-btn-focus-shadow-rgb: 0, 139, 160;
}

.btn-link { --bs-btn-color: var(--teal-800); }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    line-height: 1;
}

/* ---- Color helpers ------------------------------------------------------- */
.bg-primary { background-color: #008ba0 !important; }
.text-primary { color: #008ba0 !important; }
.border-primary { border-color: #008ba0 !important; }
.link-primary { color: #008ba0 !important; }
.text-muted { color: var(--muted) !important; }

/* ---- Focus rings --------------------------------------------------------- */
:focus-visible { outline: none; }
.btn:focus-visible,
a:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: var(--app-focus-ring);
}

/* ---- App shell ------------------------------------------------------------ */
@media (min-width: 992px) {
    body.app-shell {
        display: grid;
        grid-template-columns: 264px 1fr;
        min-height: 100vh;
    }
}
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ---- Sidebar -------------------------------------------------------------- */
.app-sidebar {
    background: linear-gradient(180deg, #0b2229 0%, #0f3440 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
}
@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
}
@media (max-width: 991.98px) {
    .app-sidebar {
        width: 280px;
        display: flex;
        flex-direction: column;
    }
}
.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
}
.app-sidebar-brand img { height: 30px; width: auto; }
.app-sidebar-brand .brand-name {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.15;
}
.app-sidebar-brand .brand-sub {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    line-height: 1.15;
}
.app-sidebar nav { padding: 0 0.75rem; flex: 1; }
.nav-section {
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin: 1.25rem 0.8rem 0.35rem;
    font-weight: 600;
}
.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}
.app-nav-link .bi { font-size: 1.05rem; opacity: 0.85; }
.app-nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.app-nav-link.active {
    background: rgba(64, 183, 201, 0.16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--teal-400);
}
.app-sidebar-footer {
    padding: 1rem 1.25rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}
.app-footer-version {
    display: inline-block;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
}
.app-footer-version:hover { color: var(--teal-400); }
.whats-new-footer-link {
    display: inline-block;
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}
.whats-new-footer-link:hover { color: var(--teal-400); }

/* ---- What's-new release modal ------------------------------------------------
   Brand-chrome header (same gradient as the home hero), roomy body for
   screenshots, and a dot-pager footer. modal-lg widens to 800px only on
   desktop (≥992px) — mobile keeps the default near-full-width dialog. */
.wn-modal {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(7, 26, 32, 0.35);
}
.wn-hero {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, var(--chrome-700) 0%, var(--teal-800) 100%);
    color: #fff;
}
.wn-hero-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 183, 201, 0.22);
    color: var(--teal-300);
    font-size: 1.35rem;
}
.wn-title { margin: 0; font-weight: 700; font-size: 1.1rem; }
.wn-version {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(64, 183, 201, 0.18);
    color: var(--teal-300);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.wn-body { padding: 1.5rem 1.75rem; }
.wn-step-intro { padding: 0.5rem 0.25rem; }
.wn-intro {
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1.6;
}
.wn-step { animation: wn-step-in 0.18s ease; }
@keyframes wn-step-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.wn-step-heading { font-weight: 600; margin-bottom: 0.5rem; }
.wn-step-body { color: var(--muted); margin-bottom: 0; }
.wn-step-img {
    display: block;
    margin: 0 auto 0.75rem;
    max-height: 50vh;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--app-card-shadow);
}
.wn-footer {
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    padding: 0.7rem 1.5rem;
    justify-content: space-between;
}
.wn-dots { display: inline-flex; align-items: center; gap: 0.4rem; }
.wn-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--border-strong);
    transition: width 0.15s ease, background 0.15s ease;
}
.wn-dot.active { width: 18px; background: var(--teal-600); }

/* ---- Release-notes timeline (core/release_notes.html) -------------------- */
.rl-timeline { display: flex; flex-direction: column; }
.rl-item { display: flex; gap: 1.1rem; align-items: stretch; }
.rl-rail { display: flex; flex-direction: column; align-items: center; }
.rl-node {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    color: var(--teal-700);
    font-size: 1rem;
    z-index: 1;
}
.rl-node-current {
    background: linear-gradient(135deg, var(--teal-700), var(--teal-800));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 139, 160, 0.35);
}
.rl-line {
    width: 2px;
    flex-grow: 1;
    min-height: 1.5rem;
    background: var(--border-strong);
}
.rl-card { flex-grow: 1; margin-bottom: 1.5rem; }
.rl-version {
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 139, 160, 0.1);
    color: var(--teal-800);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.rl-current {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--teal-100);
    color: var(--teal-800);
    font-size: 0.72rem;
    font-weight: 600;
}
.rl-date { color: var(--muted); font-size: 0.8rem; }
.rl-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0.5rem 0 0.3rem;
}
.rl-intro {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rl-steps { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 575.98px) {
    .rl-item { gap: 0.75rem; }
    .rl-node { width: 32px; height: 32px; font-size: 0.85rem; }
}

/* ---- Topbar --------------------------------------------------------------- */
.app-topbar {
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
}
.app-topbar .mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.app-topbar .mobile-brand img { height: 26px; width: auto; }
.app-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--teal-600);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.app-user-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: none;
    background: none;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.35rem 0.25rem;
    border-radius: 8px;
}
.app-user-btn:hover { background: var(--surface-2); }

/* ---- Project badges (Phase 3 — logo or monogram tile) --------------------- */
.project-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    line-height: 1;
    overflow: hidden;
    vertical-align: middle;
}
img.project-badge { object-fit: cover; }
.project-badge-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.project-badge-md { width: 40px; height: 40px; font-size: 0.9rem; }
.project-badge-lg { width: 64px; height: 64px; font-size: 1.35rem; }
/* Deterministic monogram hues — muted, brand-compatible, white-text safe.
   The project_badge tag picks one by project pk; keep in sync with
   _BADGE_PALETTE_SIZE in apps/core/templatetags/ui.py. */
.badge-c0 { background: #00768a; }
.badge-c1 { background: #0f766e; }
.badge-c2 { background: #075985; }
.badge-c3 { background: #92400e; }
.badge-c4 { background: #6d28d9; }
.badge-c5 { background: #334155; }

/* Logo crop area on the project-settings Branding tab (vendored Cropper.js
   v2 custom elements — styles live in shadow DOM, so only the canvas needs
   sizing here). */
.logo-crop-area {
    height: 320px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.logo-crop-area img { display: block; max-width: 100%; max-height: 100%; margin: auto; }
.logo-crop-area cropper-canvas { display: block; width: 100%; height: 100%; }
/* "Remove logo" toggle is on — the stored image is the one going away. */
.logo-crop-removing { opacity: .35; }

/* Report-branding slots while the enabled switch is off. */
fieldset.report-slot:disabled { opacity: .55; }

/* ---- Client report selection — report options (§8.5) -------------------- */

.option-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.option-section + .option-section { margin-top: 1.25rem; }
.option-section-bordered {
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

/* Priority pills — flat and neutral when off, so the row reads calm;
   selected pills fill with that level's badge colour, so "what's
   included" pops at a glance without six competing pastels fighting
   for attention all the time. The checkbox stays keyboard-accessible
   via .btn-check. */
.pill-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.4em 0.8em;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pill:hover { border-color: var(--border-strong); }
.pill-tick-off { font-size: 0.5rem; opacity: 0.6; }
.pill-tick { display: none; font-size: 0.9rem; }
.priority-check:checked + .pill .pill-tick,
.column-check:checked + .pill .pill-tick { display: inline; }
.priority-check:checked + .pill .pill-tick-off,
.column-check:checked + .pill .pill-tick-off { display: none; }
.pill-count {
    font-weight: 500;
    font-size: 0.72rem;
    opacity: 0.75;
}
.priority-check:focus-visible + .pill,
.column-check:focus-visible + .pill {
    outline: 2px solid var(--teal-700);
    outline-offset: 2px;
}
/* Column pills fill with the teal accent — neutral metadata, unlike the
   priority pills which carry their severity colour. */
.column-check:checked + .pill {
    background: var(--teal-700);
    color: #fff;
    border-color: var(--teal-700);
}
/* Selected fill — the same PRIORITY_COLORS scale used for the priority
   cells inside the generated PDF (apps/reports/pdf.py), not the
   fault-list badge palette — this panel picks levels for *that* report,
   so it should read as the report's own colour language. */
.priority-check:checked + .pill-p0 { background: #8b0000; color: #fff; border-color: #8b0000; }
.priority-check:checked + .pill-p1 { background: #d7301f; color: #fff; border-color: #d7301f; }
.priority-check:checked + .pill-p2 { background: #fc8d59; color: #fff; border-color: #fc8d59; }
.priority-check:checked + .pill-p3 { background: #fdcc8a; color: #111827; border-color: #fdcc8a; }
.priority-check:checked + .pill-p4 { background: #fef0d9; color: #111827; border-color: #fbe4bf; }
.priority-check:checked + .pill-p5 { background: #66c2a4; color: #111827; border-color: #66c2a4; }

/* Conveyor pick-and-order list — a flat row list (not a table: no
   double borders, no header). Grip + chevrons stay ghost-quiet until
   hovered so the row reads as name-first. */
.conveyor-list { counter-reset: conveyor; }
.conveyor-row {
    counter-increment: conveyor;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.25rem;
    border-bottom: 1px solid var(--border);
}
.conveyor-row:last-child { border-bottom: 0; }
.conveyor-row.is-unchecked { opacity: 0.55; }
.conveyor-row.dragging { opacity: 0.3; }
.conveyor-grip {
    display: inline-flex;
    cursor: grab;
    color: var(--border-strong);
    transition: color 0.15s ease;
}
.conveyor-row:hover .conveyor-grip { color: var(--muted); }
.conveyor-grip:active { cursor: grabbing; }
.conveyor-pos {
    width: 1.4rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 999px;
    line-height: 1.5;
}
.conveyor-pos::before { content: counter(conveyor); }
.conveyor-move {
    border: 0;
    background: none;
    color: var(--muted);
    padding: 0.15rem 0.3rem;
    line-height: 1;
    border-radius: 4px;
}
.conveyor-move:hover:not(:disabled) { background: var(--surface-2); color: var(--teal-700); }
.conveyor-move:disabled { color: var(--border); cursor: default; }
/* btn-check remove toggles inside a disabled fieldset keep their danger
   outline but lose the click affordance. */
fieldset:disabled input.btn-check + label.btn {
    opacity: .65;
    pointer-events: none;
}

/* Report tab (Phase 4): scaled-down A4 mock showing the header band,
   content area and footer band. Band positions are set inline by the
   view (and live-updated by report_branding.js) as percentages of the
   210x297mm page. */
.report-slot-thumb {
    max-height: 48px;
    max-width: 160px;
    object-fit: contain;
}
.a4-mock {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 210 / 297;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: var(--app-card-shadow);
    overflow: hidden;
}
.a4-mock-band {
    position: absolute;
    background: var(--surface-2);
    outline: 1px dashed rgba(11, 34, 41, 0.25);
    overflow: hidden;
}
.a4-mock-band img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}
.a4-mock-content {
    position: absolute;
    left: 7.14%; /* 15mm side margins */
    right: 7.14%;
    top: 22%;
    bottom: 8%;
    display: flex;
    flex-direction: column;
    gap: 6%;
    padding-top: 2%;
}
.a4-mock-line {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: rgba(11, 34, 41, 0.12);
}
.a4-mock-line-short { width: 62%; }

/* ---- Content -------------------------------------------------------------- */
.app-content {
    padding: 1.25rem;
    max-width: 1400px;
    width: 100%;
    flex: 1;
    min-width: 0;
}
@media (min-width: 992px) {
    .app-content { padding: 2rem; }
}
.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.page-header h1,
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0;
}
.page-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 0; }
.page-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    align-items: center;
    flex-wrap: wrap;
}
@media (max-width: 575.98px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .page-actions { margin-left: 0; }
}
.app-breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.app-breadcrumb a { color: var(--muted); }
.app-breadcrumb a:hover { color: var(--teal-700); }

/* ---- Cards / surfaces ----------------------------------------------------- */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--app-card-shadow);
}
.app-card .app-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0; }
.app-card .app-card-body { padding: 1.25rem; }

/* ---- Tables --------------------------------------------------------------- */
.table {
    --bs-table-bg: #fff;
    margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: 0.75rem 1rem; }
.table thead th {
    background-color: #f7fafb;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #f8fafc;
}
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #f0f8fa;
}
.table td a { color: var(--teal-800); font-weight: 600; }
.table td a.btn { color: var(--bs-btn-color); font-weight: 500; }
.table td a.dropdown-item { color: var(--bs-dropdown-link-color); font-weight: 400; }
.table td a.dropdown-item:hover,
.table td a.dropdown-item:focus { color: var(--bs-dropdown-link-hover-color); }
th.sortable a {
    color: inherit;
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}
th.sortable a i { opacity: 0.75; }
th.is-sorted a { color: var(--teal-800); }
th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-sort] .js-sort-icon { opacity: 0.75; margin-left: 0.2rem; }
tr.row-link { cursor: pointer; }

/* ---- List cards ----------------------------------------------------------- */
.list-card {
    padding: 1rem;
}
.list-card + .list-card { margin-top: 0.75rem; }
.list-card-title { font-weight: 600; }
.list-card-meta {
    color: var(--muted);
    font-size: 0.85rem;
}
.list-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

/* ---- Stats ---------------------------------------------------------------- */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .stat-strip { grid-template-columns: repeat(4, 1fr); }
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
}
.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}
.stat-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

/* ---- Timeline -------------------------------------------------------------- */
.timeline { position: relative; }
.timeline-item {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding-left: 1.5rem;
    padding-bottom: 1.25rem;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 18px;
    bottom: -4px;
    width: 2px;
    background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal-600);
    border: 2px solid var(--surface);
}
.timeline-dot.muted { background: var(--muted); }
.timeline-time {
    flex: 0 0 3.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    line-height: 1.2;
    padding-top: 0.15rem;
}
.timeline-time span {
    display: block;
    font-weight: 500;
    color: var(--muted);
    font-size: 0.72rem;
}
.timeline-card { flex: 1; min-width: 0; }
.timeline-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.timeline-toggle .bi-chevron-down { transition: transform 0.15s ease; }
.timeline-toggle[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }

/* ---- Definition lists ----------------------------------------------------- */
dl.row dt { font-weight: 600; font-size: 0.8rem; color: var(--muted); }
dl.row dd { font-size: 0.95rem; }

/* ---- Forms ---------------------------------------------------------------- */
form label,
form .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--ink-soft);
    display: inline-block;
}
form .form-text,
form .helptext {
    color: var(--muted);
    font-size: 0.8125rem;
    margin-top: 0.35rem;
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="search"],
form input[type="url"],
form input[type="tel"],
form input[type="date"],
form input[type="time"],
form input[type="datetime-local"],
form select,
form textarea,
.form-control,
.form-select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--bs-body-color);
    background-color: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input::placeholder,
form textarea::placeholder { color: #9aa8ad; }

form input:focus,
form select:focus,
form textarea:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--teal-600);
    box-shadow: var(--app-focus-ring);
    outline: none;
}
form input[type="checkbox"],
form input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    margin-top: 0.25rem;
    accent-color: var(--teal-600);
    box-shadow: none;
}
.form-check-input:checked {
    background-color: var(--teal-600);
    border-color: var(--teal-600);
}
/* as_p wraps each field in <p> */
form p { margin-bottom: 1.1rem; }
form p:last-child { margin-bottom: 0; }
form .errorlist {
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
    color: #b91c1c;
    font-size: 0.8125rem;
}
/* CheckboxSelectMultiple renders a <ul> of checkboxes */
form ul#id_groups,
form ul#id_activities,
form ul[id$="_groups"] {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.35rem 1rem;
}
form ul#id_groups li,
form ul#id_activities li,
form ul[id$="_groups"] li { margin: 0; }
form ul#id_groups label,
form ul#id_activities label,
form ul[id$="_groups"] label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 400;
    color: var(--bs-body-color);
}

/* ---- Badges / status ------------------------------------------------------ */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.35em 0.6em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}
.badge.font-monospace { font-size: 0.78rem; }

.badge-p0 { background: #8b0000; color: #fff; }
.badge-p1 { background: #fee2e2; color: #991b1b; }
.badge-p2 { background: #fef3c7; color: #92400e; }
.badge-p3 { background: #e2e8f0; color: #334155; }
.badge-p4 { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-p5 { background: #d1fae5; color: #065f46; }

.badge-open { background: var(--teal-100); color: var(--teal-800); }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-closed { background: #e2e8f0; color: #334155; }
.badge-replaced { background: #e0f2fe; color: #075985; }
.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* ---- Alerts / messages ---------------------------------------------------- */
.alert {
    border-radius: 8px;
    border: none;
    border-left: 3px solid transparent;
    font-size: 0.92rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-left-color: #10b981; }
.alert-danger { background: #fee2e2; color: #991b1b; border-left-color: #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-left-color: #f59e0b; }
.alert-info { background: var(--teal-100); color: var(--teal-800); border-left-color: var(--teal-500); }
.alert-primary {
    background: var(--teal-100);
    color: var(--teal-800);
    border-left-color: var(--teal-600);
}
.alert .btn-close { font-size: 0.8rem; }

/* ---- Offline banner -------------------------------------------------------- */
#offline-banner {
    position: sticky;
    top: 60px;
    z-index: 1010;
    border-radius: 0;
    margin-bottom: 0;
}

/* ---- Empty states ---------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}
.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--teal-100);
    color: var(--teal-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}
.empty-state .empty-title { font-size: 0.95rem; font-weight: 600; color: var(--ink-soft); }
.empty-state p { font-size: 0.875rem; }

/* ---- Pagination ------------------------------------------------------------ */
.pagination { --bs-pagination-border-radius: 8px; }
.page-item .page-link {
    color: var(--teal-800);
    border-color: var(--border);
    border-radius: 8px;
    margin: 0 0.15rem;
}
.page-item.active .page-link {
    background: var(--teal-600);
    border-color: var(--teal-600);
}
.page-item.disabled .page-link { color: var(--muted); }

/* ---- Home hero / module tiles --------------------------------------------- */
.hero {
    background: linear-gradient(160deg, #071a20 0%, #0b2229 45%, #0f3440 100%);
    border-radius: 12px;
    color: #fff;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.hero img.hero-mark {
    position: absolute;
    right: -1.5rem;
    bottom: -2.5rem;
    height: 180%;
    width: auto;
    opacity: 0.08;
    pointer-events: none;
}
.hero h1 { color: #fff; font-size: 1.5rem; margin-bottom: 0.35rem; }
.hero p { color: rgba(255, 255, 255, 0.65); margin-bottom: 0; font-size: 0.95rem; }

.module-tile {
    display: block;
    height: 100%;
    text-decoration: none;
    color: var(--ink);
}
.module-tile:hover,
.module-tile:focus-visible { color: var(--ink); }
.module-tile .app-card {
    height: 100%;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.module-tile:hover .app-card {
    transform: translateY(-2px);
    border-color: var(--teal-400);
    box-shadow: 0 6px 16px rgba(11, 34, 41, 0.1);
}
.module-tile .tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--teal-100);
    color: var(--teal-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}
.module-tile h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.module-tile .tile-desc { color: var(--muted); font-size: 0.85rem; }
.module-tile .tile-open { color: var(--muted); font-size: 0.8rem; }
.module-tile:hover .tile-open { color: var(--teal-700); }

/* ---- Project workspace (Phase 6 Stage B) -------------------------------- */

/* Sidebar: project identity header above the section links. */
.workspace-project {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0.35rem;
    min-width: 0;
}
.workspace-project-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Home dashboard project cards — the workspace index. The card is a
   .module-tile link; the pin dropdown sits outside the anchor (nested
   interactive elements are invalid) in the card's top corner. */
.project-card-wrap { position: relative; height: 100%; }
.project-card-text { min-width: 0; flex-grow: 1; }
.project-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
.pinned-marker { color: var(--teal-700); font-size: 0.8rem; }
.project-pin-menu { position: absolute; top: 0.4rem; right: 0.4rem; z-index: 3; }
.project-pin-btn {
    width: 44px; /* touch target */
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    padding: 0;
}
.project-pin-btn:hover,
.project-pin-btn:focus-visible,
.project-pin-menu:has(.dropdown-menu.show) .project-pin-btn {
    color: var(--teal-800);
    background: var(--teal-100);
}

/* Page-level section label between card grids (micro-label convention). */
.section-heading {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 1.5rem 0 0.75rem;
}

/* ---- Auth pages (Deep Water) ---------------------------------------------- */
body.auth-layout {
    background: linear-gradient(160deg, #071a20 0%, #0b2229 45%, #0f3440 100%);
    min-height: 100vh;
    overflow-x: hidden;
}
.auth-watermark {
    position: fixed;
    right: -10vw;
    bottom: -15vh;
    height: 110vh;
    width: auto;
    opacity: 0.06;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}
.auth-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(600px 400px at 20% 10%, rgba(64, 183, 201, 0.18), transparent 70%);
}
.auth-brand-strip {
    position: fixed;
    top: 1.25rem;
    left: 1.5rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}
.auth-brand-strip img { height: 28px; width: auto; }
@media (max-width: 991.98px) {
    .auth-brand-strip { display: none; }
}
.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 3rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.auth-card .auth-card-body { padding: 2rem; }
.auth-card .auth-logo { display: block; height: 84px; width: auto; margin: 0 auto 1rem; }
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-align: center;
    margin-bottom: 0.25rem;
}
.auth-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-layout form input[type="text"],
.auth-layout form input[type="email"],
.auth-layout form input[type="password"],
.auth-layout .form-control {
    background-color: #f4f8f9;
    border: 1px solid transparent;
}
.auth-layout form input:focus,
.auth-layout .form-control:focus {
    background-color: #f4f8f9;
    border-color: var(--teal-600);
    box-shadow: 0 0 0 0.2rem rgba(0, 159, 183, 0.18);
}
.btn-auth-primary {
    height: 46px;
    width: 100%;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    background: linear-gradient(90deg, #009fb7, #40b7c9);
}
.btn-auth-primary:hover { filter: brightness(1.06); color: #fff; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.8rem;
    margin: 1.25rem 0;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e8ea;
}
.btn-ms {
    height: 46px;
    width: 100%;
    background: #fff;
    border: 1px solid #d5dfe2;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.btn-ms:hover { background: #f6f9fa; color: var(--ink); }
.auth-caption {
    margin-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
}
.auth-card .auth-links { font-size: 0.85rem; }
.auth-card .auth-links a { color: var(--teal-800); }
.auth-card .auth-links a:hover { color: var(--teal-700); }

/* ---- Footer ---------------------------------------------------------------- */
.app-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    padding: 1rem 1.25rem;
}

.assign-user-field { min-width: 220px; }

/* ---- Misc ------------------------------------------------------------------ */
code { color: var(--teal-800); }
a { text-decoration: none; transition: color 0.15s ease; }
a:hover,
a:focus-visible { text-decoration: none; color: var(--bs-link-hover-color); }
.btn:hover { text-decoration: none; }

/* ---- Media lightbox / thumbs ------------------------------------------------ */
.media-lightbox {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    background: rgba(10, 14, 22, 0.92);
    align-items: center;
    justify-content: center;
}
.media-lightbox-open { display: flex; }

.media-lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 4px;
    object-fit: contain;
}
.media-lightbox-video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 4px;
}
.media-lightbox-pdf {
    width: 80vw;
    height: 85vh;
    border: none;
    border-radius: 4px;
    background: #fff;
}

.media-lightbox-download {
    position: absolute;
    top: 14px;
    right: 60px;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
    z-index: 2001;
}
.media-lightbox-download:hover { opacity: 1; color: #fff; }

.media-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
    z-index: 2001;
}
.media-lightbox-close:hover { opacity: 1; }

.media-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
    z-index: 2001;
    padding: 0 12px;
}
.media-lightbox-nav:hover { opacity: 1; }
.media-lightbox-prev { left: 8px; }
.media-lightbox-next { right: 8px; }

.media-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.media-thumb { cursor: pointer; transition: box-shadow 0.15s; }
.drop-target { outline: 2px dashed var(--teal-400); outline-offset: -2px; }
.media-thumb:hover { box-shadow: 0 0 0 2px var(--teal-400); }
.media-thumb-img {
    height: 120px;
    object-fit: cover;
    width: 100%;
    border-radius: 8px;
}
.media-thumb-video,
.media-thumb-icon {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chrome-800);
    color: var(--teal-300);
    font-size: 2rem;
    border-radius: 8px;
}

/* ---- Print ------------------------------------------------------------------ */
@media print {
    .app-sidebar,
    .app-topbar,
    .app-footer { display: none !important; }
    body.app-shell { display: block; }
}

/* Phase 5 Resources — folder tiles */
.resource-folder-icon { font-size: 2rem; color: #f59e0b; }

/* ---- Sync widget (topbar) ---------------------------------------------------
   Icon cluster rendered by offline-core/chip.js: device glyph + status dot +
   count badge, plus a warning button when rejections need attention. */
.sync-widget { display: flex; align-items: center; gap: 0.35rem; }
.sync-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 1.15rem;
    line-height: 1;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sync-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.sync-btn:focus-visible { box-shadow: var(--app-focus-ring); outline: none; }
.sync-device-mobile { display: none; }
@media (max-width: 991.98px) {
    .sync-device-desktop { display: none; }
    .sync-device-mobile { display: inline; }
}

/* Status dot — bottom-right of the device glyph. */
.sync-dot {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--surface);
}
.sync-btn.is-ok .sync-dot { background: #16a34a; }
.sync-btn.is-pending .sync-dot { background: #f59e0b; }
.sync-btn.is-error .sync-dot { background: #dc2626; }
.sync-btn.is-syncing .sync-dot {
    background: var(--teal-600);
    animation: sync-pulse 1.1s ease-in-out infinite;
}
.sync-btn.is-offline .sync-offline-mark {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 0.6rem;
    color: #64748b;
    background: var(--surface);
    border-radius: 50%;
    padding: 1px;
}
.sync-btn.is-offline { color: #64748b; }
@keyframes sync-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.55; }
}

/* Count badge — queued ops / rejections, top-right corner. */
.sync-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}
.sync-btn-rejected {
    color: #b45309;
    border-color: #fcd34d;
    background: #fffbeb;
}
.sync-btn-rejected:hover { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.sync-btn-rejected .sync-badge { background: #dc2626; }

/* ---- Rejections modal ------------------------------------------------------
   Shares the wn-modal shell language — borderless card, chrome-gradient hero
   with a translucent icon tile — adapted for an information list: tinted
   body, white item cards, one calm action pair per item. */
.rej-modal {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(7, 26, 32, 0.35);
}
.rej-hero {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.4rem;
    background: linear-gradient(135deg, var(--chrome-700) 0%, var(--teal-800) 100%);
    color: #fff;
}
.rej-hero-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.22);
    color: #fcd34d;
    font-size: 1.35rem;
}
.rej-title { margin: 0; font-weight: 700; font-size: 1.1rem; }
.rej-count {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.rej-body { background: var(--surface-2); padding: 1rem 1.25rem; }
.rej-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 0.7rem 1.25rem;
    align-items: center;
}
.rej-footer-note { font-size: 0.78rem; color: var(--muted); margin: 0 auto 0 0; }
.rej-footer-note .bi { color: var(--teal-700); margin-right: 0.15rem; }

.rejection-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--app-card-shadow);
}
.rejection-item + .rejection-item { margin-top: 0.75rem; }
.rejection-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.rejection-icon.is-create { background: var(--teal-100); color: var(--teal-800); }
.rejection-icon.is-update { background: #e0e7ff; color: #4338ca; }
.rejection-icon.is-delete { background: #fee2e2; color: #b91c1c; }
.rejection-icon.is-intent { background: #fef3c7; color: #b45309; }
.rejection-body { flex: 1; min-width: 0; }
.rejection-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.rejection-op {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rejection-time { color: var(--muted); font-size: 0.78rem; margin-left: auto; }
.rejection-reason {
    margin-top: 0.55rem;
    padding: 0.5rem 0.7rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #78350f;
}
.rejection-reason .bi { color: #d97706; margin-right: 0.2rem; }
.rejection-errors {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: #b91c1c;
}
.rejection-payload { margin-top: 0.55rem; font-size: 0.8rem; }
.rejection-payload summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.78rem;
    list-style: none;
}
.rejection-payload summary::before {
    font-family: "bootstrap-icons";
    content: "\F282";
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}
.rejection-payload[open] summary::before { transform: rotate(90deg); }
.rejection-payload dl {
    display: grid;
    grid-template-columns: minmax(90px, 35%) 1fr;
    gap: 0.15rem 0.6rem;
    margin: 0.45rem 0 0;
    padding: 0.55rem 0.7rem;
    background: var(--surface-2);
    border-radius: 8px;
}
.rejection-payload dt { color: var(--muted); font-weight: 500; }
.rejection-payload dd { margin: 0; word-break: break-word; }
.rejection-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0.55rem 0 0;
    padding: 0.5rem 0.7rem;
    background: var(--teal-100);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--teal-800);
}
.rejection-hint .bi { flex-shrink: 0; margin-top: 0.1em; }
.rejection-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}
.rejection-empty { text-align: center; padding: 2.25rem 1rem; }
.rejection-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dcfce7;
    color: #16a34a;
    font-size: 1.6rem;
}
.rejection-empty-title { font-weight: 600; color: var(--ink); margin-bottom: 0.15rem; }
.rejection-empty-sub { color: var(--muted); font-size: 0.85rem; margin: 0; }
