/* ── Reset ────────────────────────────────────────────────────────────────── */

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

/* ── Design tokens ────────────────────────────────────────────────────────── */

:root {
    /* Colors */
    --bg:            #212121;
    --bg-elevated:   #2a2a2a;
    --bg-input:      #1a1a1a;
    --border:        #3a3a3a;
    --border-strong: #555555;
    --accent:        #C78C06;
    --accent-hover:  #e0a020;
    --text-primary:  #f4f0e8;
    --text-muted:    #8a8a8a;
    --text-subtle:   #5a5a5a;
    --danger:        #c44e4e;
    --success:       #5a9a6a;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Radius */
    --radius-sm: 4px;
    --radius:    8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-focus: 0 0 0 3px rgba(199, 140, 6, 0.25);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; }

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Site nav ─────────────────────────────────────────────────────────────── */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-logo { line-height: 0; }

.nav-logo img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-strong);
    flex-shrink: 0;
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-username {
    font-size: 14px;
    color: var(--text-muted);
}

.logout-form { display: inline-flex; }

.btn-nav-logout {
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    min-height: 44px;
    transition: background 0.15s ease;
}
.btn-nav-logout:hover {
    background: rgba(199, 140, 6, 0.1);
    text-decoration: none;
}
.btn-nav-logout:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* ── Page content (authenticated pages) ──────────────────────────────────── */

.page-content {
    padding-top: calc(60px + var(--space-6));
    padding-bottom: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.page-heading {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

.page-sub {
    margin-top: var(--space-2);
    font-size: 16px;
    color: var(--text-muted);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

/* ── Auth layout (login / unauthenticated pages) ──────────────────────────── */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-7);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-6);
}

.auth-logo img {
    height: 120px;
    width: auto;
}

/* ── Auth footer (Powered by) ─────────────────────────────────────────────── */

.auth-footer {
    margin-top: var(--space-7);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.powered-by-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
}

.auth-footer a {
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}
.auth-footer a:hover {
    opacity: 1;
    text-decoration: none;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-5);
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(196, 78, 78, 0.15);
    border-left: 3px solid var(--danger);
    color: var(--text-primary);
}

.alert-success {
    background: rgba(90, 154, 106, 0.15);
    border-left: 3px solid var(--success);
    color: var(--text-primary);
}

.alert-info {
    background: rgba(199, 140, 6, 0.12);
    border-left: 3px solid var(--accent);
    color: var(--text-primary);
}

/* ── Flash (fixed top banner) ─────────────────────────────────────────────── */

.flash {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-card);
    z-index: 200;
    min-width: 280px;
    text-align: center;
}

.flash-info    { background: rgba(199,140,6,0.15);  color: var(--text-primary); border: 1px solid var(--accent); }
.flash-error   { background: rgba(196,78,78,0.15);  color: var(--text-primary); border: 1px solid var(--danger); }
.flash-success { background: rgba(90,154,106,0.15); color: var(--text-primary); border: 1px solid var(--success); }

/* ── Form fields ──────────────────────────────────────────────────────────── */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.field .label-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-subtle);
}

.field input[type="text"],
.field input[type="password"] {
    width: 100%;
    padding: var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 44px;
}

.field input::placeholder {
    color: var(--text-subtle);
}

.field input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-row {
    margin-top: var(--space-6);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: var(--space-4) var(--space-5);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn-full { width: 100%; }

/* ── TOTP card ────────────────────────────────────────────────────────────── */

.totp-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-7);
}

.totp-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.totp-qr {
    display: block;
    margin: var(--space-5) auto;
    max-width: 180px;
    border-radius: var(--radius);
    background: #fff;
    padding: var(--space-2);
}

.totp-secret {
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
    letter-spacing: 0.03em;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .auth-wrapper {
        align-items: flex-start;
        padding: var(--space-4);
    }
    .auth-card {
        padding: var(--space-6) var(--space-4);
    }
}

@media (max-width: 600px) {
    .nav-title,
    .nav-divider { display: none; }

    .page-content {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* ── Nav center links ─────────────────────────────────────────────────────── */

.nav-center {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    text-decoration: none;
    position: relative;
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); text-decoration: none; }
.nav-link--active { color: var(--accent); }
.nav-link--muted  { color: var(--text-subtle); }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Mobile nav (hamburger + slide-in drawer) ─────────────────────────────── */
/* Hidden on desktop; the <=960px media query below flips them on. Keeping the
   desktop default as display:none means the >=960px bar is byte-for-byte unchanged. */
.nav-hamburger,
.nav-backdrop,
.mobile-drawer { display: none; }

/* Hamburger: three bars, on-theme (uses --text-muted like nav-link). */
.nav-hamburger {
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.05); }
.nav-hamburger:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.nav-hamburger-bar {
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: background 0.15s ease;
}
.nav-hamburger:hover .nav-hamburger-bar { background: var(--text-primary); }

/* Backdrop: fades in under the drawer; visibility (not display) so it can transition
   and so taps pass through when closed. */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nav-backdrop.open { opacity: 1; visibility: visible; }

/* Drawer: slides in from the right, above the nav (z 200 > nav's 100). */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    max-width: 80vw;
    z-index: 200;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    flex-direction: column;
    padding: var(--space-4);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.nav-drawer-close {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-drawer-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-drawer-close:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* Drawer links: full-width, >=44px tap targets, same color treatment as .nav-link. */
.drawer-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}
.drawer-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); text-decoration: none; }

.drawer-logout-form { display: block; margin-top: auto; padding-top: var(--space-3); }
.drawer-logout {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.drawer-logout:hover { background: rgba(199, 140, 6, 0.1); }
.drawer-logout:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Prevent the page behind the drawer from scrolling while it's open. */
body.nav-drawer-open { overflow: hidden; }

@media (max-width: 960px) {
    /* Replaces the old `.nav-center { display: none }` rule: still hide the inline
       links, but now also hide the desktop username/logout cluster and reveal the
       hamburger + drawer machinery so the links remain reachable. */
    .nav-center { display: none; }
    .nav-right .nav-username,
    .nav-right .logout-form,
    .nav-right .nav-divider { display: none; }
    .nav-hamburger { display: flex; }
    .nav-backdrop { display: block; }
    .mobile-drawer { display: flex; }
}

/* ── Dashboard stats grid ─────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}
@media (max-width: 800px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-decoration: none;
    transition: border-color 0.15s ease;
}
.stat-card:hover { border-color: var(--border-strong); text-decoration: none; }
.stat-card--alert { border-color: var(--danger); }

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

/* ── Card headings ────────────────────────────────────────────────────────── */

.card-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Data tables ──────────────────────────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.row--returned td { opacity: 0.55; }
.row--dnc td { color: var(--danger); }

/* ── Badges ───────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.badge--category   { background: rgba(199,140,6,0.15); color: var(--accent); }
.badge--success    { background: rgba(90,154,106,0.15); color: var(--success); }
.badge--danger     { background: rgba(196,78,78,0.15);  color: var(--danger); }
.badge--warning    { background: rgba(199,140,6,0.12);  color: var(--accent); }
.badge--info       { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.badge--historical { background: rgba(255,255,255,0.06); color: var(--text-subtle); }
.badge--scan       { background: rgba(90,154,106,0.10); color: var(--success); }

/* ── Confidence pills ─────────────────────────────────────────────────────── */

.conf-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
}
.conf-pill--lg   { font-size: 14px; padding: 4px 12px; }
.conf-pill--high { background: rgba(90,154,106,0.2);  color: var(--success); }
.conf-pill--mid  { background: rgba(199,140,6,0.15);  color: var(--accent); }
.conf-pill--low  { background: rgba(196,78,78,0.15);  color: var(--danger); }

.conf-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}
.conf-dot--high { background: var(--success); }
.conf-dot--mid  { background: var(--accent); }
.conf-dot--low  { background: var(--danger); }

/* ── Upload drop zone ─────────────────────────────────────────────────────── */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.drop-zone:hover { border-color: var(--accent); background: rgba(199,140,6,0.04); }
/* Active drag-over state: stronger gold wash + solid border for clear feedback. */
.drop-zone--over { border-color: var(--accent); border-style: solid; background: rgba(199,140,6,0.12); }
.drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-7) var(--space-5);
    color: var(--text-muted);
    pointer-events: none;
}
.drop-zone-text { font-size: 16px; font-weight: 500; color: var(--text-primary); }
.drop-zone-hint { font-size: 13px; }
.drop-zone-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.file-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
.file-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.file-name { flex: 1; font-size: 14px; }
.file-size { font-size: 12px; color: var(--text-muted); }
.file-remove {
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 0.1s ease;
}
.file-remove:hover { color: var(--danger); }

/* ── Review layout (scan left, form right) ───────────────────────────────── */

.review-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: var(--space-6);
    align-items: start;
}
@media (max-width: 1000px) {
    .review-layout { grid-template-columns: 1fr; }
}

.review-scan { position: sticky; top: 76px; }
.scan-preview-img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* ── Form groups (collapsible sections) ──────────────────────────────────── */

.form-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
}
.form-group-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    cursor: pointer;
    user-select: none;
}
.form-group[open] .form-group-title { border-bottom: 1px solid var(--border); }
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
}
@media (max-width: 700px) { .field-grid { grid-template-columns: 1fr; } }

/* ── Secondary button ─────────────────────────────────────────────────────── */

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.04); }
.btn-danger {
    background: rgba(196,78,78,0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(196,78,78,0.25); }
.btn-sm {
    min-height: 32px;
    padding: var(--space-1) var(--space-3);
    font-size: 13px;
}

/* ── Search bar ───────────────────────────────────────────────────────────── */

.search-bar { display: flex; gap: var(--space-3); max-width: 480px; }
.search-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* ── Two-column layout ────────────────────────────────────────────────────── */

.two-col-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: var(--space-5);
    align-items: start;
}
@media (max-width: 900px) { .two-col-layout { grid-template-columns: 1fr; } }

/* ── Detail list (key/value pairs) ───────────────────────────────────────── */

.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); font-size: 14px; margin-top: var(--space-4); }
.detail-list dt { color: var(--text-muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.detail-list dd { color: var(--text-primary); }

/* ── Merge row ────────────────────────────────────────────────────────────── */

.merge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    gap: var(--space-3);
}
.merge-row:last-child { border-bottom: none; }

/* ── Batch / checkbox styles ──────────────────────────────────────────────── */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-2) 0;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.field-row { display: flex; gap: var(--space-4); }
.field-row .field { flex: 1; }

/* ── Activity feed event type ─────────────────────────────────────────────── */

.event-type {
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
    margin-right: var(--space-2);
}

/* ── Utility ──────────────────────────────────────────────────────────────── */

.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.file-list-static { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }

/* ── Modal ────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-card);
}
.modal-title { font-size: 18px; font-weight: 700; }

/* ── Address-validation review warning ─────────────────────────────────────── */
.address-warning {
    background: rgba(196,78,78,0.10);
    border: 1px solid var(--danger);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}
.address-warning-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}
.address-warning-list {
    margin: 0 0 var(--space-3) 0;
    padding-left: var(--space-5);
    color: var(--text-primary);
}
.address-warning-list li { margin: 2px 0; }
.address-warning-note {
    margin: var(--space-2) 0 0 0;
    color: var(--text-muted);
    font-size: 13px;
}
/* Highlight an input whose value was just filled from a suggestion. */
.field-suggested {
    border-color: var(--accent) !important;
    box-shadow: var(--shadow-focus);
}

/* ── Upload progress bar ───────────────────────────────────────────────────── */
.progress { margin-top: var(--space-5); }
.progress[hidden] { display: none; }
.progress-track {
    height: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}
/* PHASE 1 — determinate fill, width set inline by upload.js. */
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.15s ease;
}
/* PHASE 2 — indeterminate "processing" barber-pole; ignores width (pinned 100%). */
.progress-fill--indeterminate {
    width: 100% !important;
    background-color: var(--accent);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.18) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent
    );
    background-size: 1rem 1rem;
    animation: progress-stripes 0.8s linear infinite;
    transition: none;
}
@keyframes progress-stripes {
    from { background-position: 1rem 0; }
    to   { background-position: 0 0; }
}
.progress-status {
    margin-top: var(--space-3);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}
/* Lock the queue UI while uploading. */
.drop-zone--disabled { opacity: 0.5; pointer-events: none; }
.is-uploading .file-remove { display: none; }
@media (prefers-reduced-motion: reduce) {
    .progress-fill--indeterminate { animation: none; }
    .mobile-drawer,
    .nav-backdrop { transition: none; }
}
