/* ==========================================================================
   AI-Tax Invoice Verifier Theme Stylesheet (Modern Light Professional Navy & Gold Theme)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand (Navy & Gold) */
    --color-navy-deep: #071527;
    --color-navy: #0B1F3A;
    --color-navy-2: #122E55;
    --color-gold: #C9A227;
    --color-gold-strong: #A8871D;
    --color-gold-soft: #F6EFD3;
    
    /* Surface & ink */
    --color-page-bg: #F5F6F8;
    --color-surface: #FFFFFF;
    --color-surface-soft: #F8FAFC;
    --color-border: #E5E7EB;
    --color-ink: #0F172A;
    --color-ink-muted: #475569;
    
    /* Status */
    --color-success: #15803D;
    --color-warning: #92590A;
    --color-danger: #B42318;
    --color-info: #1D4ED8;
    --color-waiting: #6F4DAA;
    --color-teal: #0F766E;

    /* Legacy CSS Variable mappings for backward compatibility --bg-primary: #060913 */
    --bg-primary: var(--color-page-bg);
    --bg-secondary: var(--color-surface-soft);
    --bg-glass: var(--color-surface);
    --bg-glass-active: rgba(229, 231, 235, 0.85);
    
    --accent-cyan: var(--color-gold);
    --accent-violet: var(--color-navy);
    --accent-glow: rgba(201, 162, 39, 0.1);
    --accent-gradient: linear-gradient(135deg, var(--color-navy), var(--color-navy-2));
    
    --text-primary: var(--color-ink);
    --text-secondary: var(--color-ink-muted);
    --text-muted: #64748b;
    
    --border-color: var(--color-border);
    --border-glow: rgba(201, 162, 39, 0.25);
    
    --status-pass: var(--color-success);
    --status-pass-glow: rgba(21, 128, 61, 0.08);
    --status-warning: var(--color-warning);
    --status-warning-glow: rgba(146, 89, 10, 0.08);
    --status-fail: var(--color-danger);
    --status-fail-glow: rgba(180, 35, 24, 0.08);
    --status-review: var(--color-info);
    --status-review-glow: rgba(29, 78, 216, 0.08);
    
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-premium: 0 12px 20px -8px rgba(0,0,0,0.08), 0 4px 12px -2px rgba(0,0,0,0.03);
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-page-bg);
    color: var(--color-ink);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand {
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #22d3ee;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* App Header & Navigation */
header.app-header {
    background: rgba(6, 9, 19, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #22d3ee, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 1.15rem;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.45);
    transition: transform 0.3s ease;
}

.brand:hover .brand-icon {
    transform: rotate(10deg) scale(1.05);
}

nav.main-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.nav-link.active {
    border-bottom: 2px solid var(--accent-cyan);
    border-radius: 8px 8px 0 0;
    background: rgba(6, 182, 212, 0.05);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.user-role-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    width: fit-content;
}

/* PIN Login Card styling */
.login-brand-icon {
    margin: 0 auto 1.5rem;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 580px;
    padding: 3.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
}

.login-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, var(--text-primary), #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 3rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.profile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.profile-card:hover, .profile-card.selected {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 20px rgba(201, 162, 39, 0.15);
}

.profile-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #151d30;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-card:hover .profile-icon, .profile-card.selected .profile-icon {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.35);
}

.profile-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.profile-role {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pin-entry-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 1.15rem;
    margin: 2rem 0;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    transform: scale(1.25);
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.8);
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 280px;
    margin: 0 auto 2rem;
}

.pin-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 1.15rem;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.pin-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.pin-btn:active {
    transform: scale(0.93);
}

.pin-btn.action {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
}

.pin-btn.action:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Premium Quick Stats Card Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(255,255,255,0.15);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.stat-pending::after { background: var(--status-review); }
.stat-card.stat-passed::after { background: var(--status-pass); }
.stat-card.stat-failed::after { background: var(--status-fail); }

.stat-title {
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 0.25rem;
    font-family: var(--font-heading);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    opacity: 0.7;
    transform: scale(1.1) rotate(5deg);
}

/* Main Dashboard Layout */
.main-content {
    max-width: 1440px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
}

/* Drag & Drop Upload Zone */
.upload-panel {
    padding: 2.25rem 2rem;
    height: fit-content;
}

.dropzone-container {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

.dropzone-container:hover, .dropzone-container.dragover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.04);
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.06);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropzone-container:hover .upload-icon {
    transform: translateY(-6px) scale(1.08);
    color: var(--accent-cyan);
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.dropzone-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.dropzone-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Dashboard Document Queue Panel */
.queue-panel {
    padding: 2.25rem 2rem;
}

.data-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    text-align: left;
    font-size: 0.88rem;
}

table.data-table th {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

table.data-table tbody tr {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

table.data-table tbody tr td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

table.data-table tbody tr td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

table.data-table tbody tr td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

table.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
    transform: scale(1.002);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 30px;
    letter-spacing: 0.03em;
}

.badge.status-pass {
    background: var(--status-pass-glow);
    color: var(--status-pass);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge.status-warning {
    background: var(--status-warning-glow);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge.status-fail {
    background: var(--status-fail-glow);
    color: var(--status-fail);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge.status-review {
    background: var(--status-review-glow);
    color: var(--status-review);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge.status-processing {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    animation: pulse 1.6s infinite;
}

/* Premium Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--status-fail-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 0.38rem 0.8rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* Dual Panel Verify Workspace */
.verify-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1600px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
    min-height: calc(100vh - 140px);
}

.verify-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.65rem;
    border-radius: 10px;
}

.preview-container {
    flex: 1;
    background: #05070d;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    min-height: 520px;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
}

#preview-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.25s ease-out;
}

/* Form Review Fields Editor */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 0.95rem;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    border-color: var(--accent-cyan);
    outline: none;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.form-input.field-low-conf {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.form-input.field-low-conf:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

/* ==========================================================================
   Design tokens — utility classes (T12)
   ========================================================================== */

/* Text truncation */
.td-truncate {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Monospace code / document code cells */
.td-code {
    font-family: var(--font-mono, monospace);
    font-weight: 600;
}

/* Status colour helpers — use CSS vars so single token controls all usages */
.text-status-pass    { color: var(--status-pass); }
.text-status-warning { color: var(--status-warning); }
.text-status-fail    { color: var(--status-fail); }
.text-status-review  { color: var(--status-review); }
.text-accent-cyan    { color: var(--accent-cyan); }
.text-muted          { color: var(--text-muted); }

/* Common flex helpers */
.flex-row-center   { display: flex; align-items: center; }
.flex-row-between  { display: flex; align-items: center; justify-content: space-between; }
.gap-xs  { gap: 0.3rem; }
.gap-sm  { gap: 0.5rem; }
.gap-md  { gap: 0.75rem; }

/* Small label above inline content (e.g. queue card labels) */
.label-xs {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Table empty state */
.td-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

.form-section-title {
    grid-column: span 2;
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-cyan);
    margin: 1.5rem 0 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.35rem;
    font-family: var(--font-heading);
}

/* Recalculate component row design */
.recalc-row-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.recalc-row-container input {
    flex: 1;
}

.recalc-row-container button {
    padding: 0.72rem 0.95rem;
}

/* Interactive Verification Checklist Styling */
.rule-banner {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.50rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    animation: fadeIn 0.4s ease;
}

.rule-banner.pass {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.rule-banner.warning {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.rule-banner.fail {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.banner-title {
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-heading);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(6, 182, 212, 0.35);
    transform: translateX(4px);
}

.checklist-item input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    margin-top: 0.15rem;
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.checklist-item input[type="checkbox"]:checked + span {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.65;
}

/* Alert Notification Panel */
.alert {
    padding: 1.15rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    font-size: 0.92rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Processing AI spinner modal */
.spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 9, 19, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    z-index: 10;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 3.5px solid rgba(6, 182, 212, 0.15);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { opacity: 0.55; }
    50% { opacity: 1; }
    100% { opacity: 0.55; }
}

/* App Footer */
.app-footer {
    background: rgba(6, 9, 19, 0.6);
    border-top: 1px solid var(--border-color);
    padding: 1.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

/* ==========================================================================
   Dashboard Filter Controls
   ========================================================================== */

.dashboard-filters {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.55rem 0.95rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 180px;
}

.filter-select:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.55rem 0.95rem 0.55rem 2.35rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-cyan);
    outline: none;
    background: rgba(0, 0, 0, 0.45);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   Mobile Responsive Layout
   ========================================================================== */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-panel {
        order: 2;
    }
    
    .queue-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    header.app-header {
        padding: 0.5rem 1rem;
    }
    
    .brand {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .brand-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .brand span {
        display: none;
    }
    
    nav.main-nav {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .nav-link span,
    .nav-link i.fa-solid:not(.fa-right-from-bracket) {
        display: none;
    }
    
    .user-profile-widget {
        padding-left: 0.75rem;
        gap: 0.5rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .user-role-badge {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem 1.25rem;
    }
    
    .stat-value {
        font-size: 1.65rem;
    }
    
    .stat-icon {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .dashboard-grid {
        gap: 1rem;
    }
    
    .upload-panel,
    .queue-panel {
        padding: 1.25rem;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: unset;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
        min-width: unset;
    }
    
    table.data-table {
        font-size: 0.78rem;
    }
    
    table.data-table th,
    table.data-table td {
        padding: 0.65rem 0.5rem;
    }
    
    /* Hide less important columns on small screens */
    table.data-table th:nth-child(3),
    table.data-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .brand {
        font-size: 1.05rem;
    }
    
    .brand-icon {
        width: 28px;
        height: 28px;
        font-size: 0.95rem;
    }
    
    header.app-header {
        padding: 0.65rem 1rem;
    }
    
    /* Hide AI confidence column on very small screens */
    table.data-table th:nth-child(6),
    table.data-table td:nth-child(6) {
        display: none;
    }
}

/* ==========================================================================
   VERIFY PAGE — RESPONSIVE LAYOUT
   ========================================================================== */
@media (max-width: 1200px) {
    .verify-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .verify-panel {
        max-width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .line-items-table {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .verify-layout {
        padding: 0 1rem;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .panel-body {
        padding: 1rem;
    }
    
    .preview-actions {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .preview-actions .btn-sm {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .form-section-title {
        grid-column: span 1;
    }
    
    .line-items-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .line-items-table th,
    .line-items-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .line-items-table input {
        padding: 0.3rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .verify-form-buttons {
        flex-direction: column;
    }
    
    .verify-form-buttons > div {
        width: 100%;
    }
    
    .verify-form-buttons button,
    .verify-form-buttons a {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .preview-container {
        min-height: 300px;
    }
    
    .panel-header {
        padding: 0.75rem 1rem;
    }
    
    .panel-body {
        padding: 0.75rem;
    }
    
    .preview-actions {
        justify-content: center;
    }
    
    .form-input {
        padding: 0.6rem 0.7rem;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   LINE ITEMS TABLE
   ========================================================================== */
.line-items-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.line-items-table {
    width: 100%;
    border-collapse: collapse;
}

.line-items-table thead th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.line-items-table tbody td {
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.line-items-table tbody tr:last-child td {
    border-bottom: none;
}

.line-items-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.03);
}

.line-items-table input:focus {
    border-color: var(--accent-cyan);
    outline: none;
    background: rgba(0, 0, 0, 0.45) !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.line-items-table input[readonly] {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==========================================================================
   REJECT SECTION
   ========================================================================== */
#reject-section textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==========================================================================
   STATUS SELECT
   ========================================================================== */
#status-select option {
    padding: 0.5rem;
}

/* ==========================================================================
   FULLSCREEN STYLES
   ========================================================================== */
.verify-panel:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    margin: 0;
    max-width: 100vw;
    height: 100vh;
    overflow: auto;
}

.verify-panel:-webkit-full-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    margin: 0;
    max-width: 100vw;
    height: 100vh;
    overflow: auto;
}

.verify-panel:fullscreen .panel-body {
    max-height: calc(100vh - 80px);
}

.verify-panel:fullscreen .preview-container {
    min-height: calc(100vh - 200px);
}

/* ==========================================================================
   AUTO-SAVE INDICATOR
   ========================================================================== */
#autosave-indicator {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 480px;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    opacity: 0;
    transform: translateX(60px);
}
.toast.toast-out {
    animation: toastOut 0.3s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}
.toast-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.toast-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}
.toast i, .toast .icon {
    font-size: 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(60px); }
}

/* ==========================================================================
   Settings Page - Tabbed Interface
   ========================================================================== */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}

.tab-btn.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.tab-btn i {
    font-size: 0.85rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Info cards for system info section */
.info-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

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

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Settings form grid adjustments */
.form-grid {
    display: grid;
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
    }
    .tab-btn {
        border-bottom: none;
        border-left: 2px solid transparent;
        padding: 0.6rem 1rem;
    }
    .tab-btn.active {
        border-left-color: var(--accent-cyan);
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Delete Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-glass-active);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-danger {
    background: var(--status-fail);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.85;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   T32 — Dashboard Work Queues, Classification Filters, AI Quality Stats
   ========================================================================== */

/* Work Queue Grid */
.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.queue-card {
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.queue-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Quality Stats Section */
.quality-stats-section {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.quality-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quality-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Correction Insights */
.correction-insights {
    font-size: 0.85rem;
}

/* Dashboard Filters — compact layout */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.filter-row-advanced {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-input-sm {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-glass);
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-input-sm:focus {
    border-color: var(--accent-cyan);
}

.btn-xs {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-xs:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-danger.btn-xs {
    background: var(--status-fail-glow);
    color: var(--status-fail);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-warning.btn-xs {
    background: var(--status-warning-glow);
    color: var(--status-warning);
    border-color: rgba(245, 158, 11, 0.3);
}

/* Non-expense row visual distinction */
.row-non-expense {
    background: rgba(139, 92, 246, 0.04);
}

.row-non-expense td {
    border-bottom-color: rgba(139, 92, 246, 0.08);
}

/* Dashboard responsive — mobile */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .queue-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quality-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-row,
    .filter-row-advanced {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select,
    .search-box {
        width: 100% !important;
    }

    .data-table-wrapper {
        overflow-x: auto;
    }

    .data-table {
        min-width: 900px;
    }
}

@media (max-width: 640px) {
    .queue-grid {
        grid-template-columns: 1fr;
    }

    .quality-stats-grid {
        grid-template-columns: 1fr;
    }

    .correction-insights div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   T33: Upload Processing UX — Hidden file input, step timeline, retry buttons
   ========================================================================== */

.sr-only-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Upload queue item — step timeline */
.queue-item-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease;
}

.queue-item-step.step-success {
    border-left-color: var(--status-pass);
    background: rgba(34, 197, 94, 0.04);
}

.queue-item-step.step-error {
    border-left-color: var(--status-fail);
    background: rgba(239, 68, 68, 0.04);
}

.queue-item-step.step-warning {
    border-left-color: var(--status-warning);
    background: rgba(245, 158, 11, 0.04);
}

.queue-item-step.step-processing {
    border-left-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.04);
}

.queue-item-step .step-icon {
    width: 1.2rem;
    height: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.queue-item-step .step-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.queue-item-step .step-detail {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.queue-item-step .step-retry-btn {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: transparent;
    border: 1px solid var(--status-fail);
    color: var(--status-fail);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.queue-item-step .step-retry-btn:hover {
    background: var(--status-fail);
    color: #fff;
}

/* Upload queue container styling */
#upload-queue-container .queue-item {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 0.55rem;
    background: rgba(255, 255, 255, 0.025);
}

#upload-queue-container .queue-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Upload progress bar */
.upload-progress-bar {
    height: 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-bar .bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 4px;
    background: var(--accent-cyan);
    transition: width 0.3s ease, background 0.3s ease;
}

.upload-progress-bar .bar-fill.bar-success {
    background: var(--status-pass);
}

.upload-progress-bar .bar-fill.bar-error {
    background: var(--status-fail);
}

/* File-specific error display */
.queue-item-error {
    font-size: 0.7rem;
    color: var(--status-fail);
    margin-top: 0.35rem;
    padding: 0.3rem 0.5rem;
    background: rgba(239, 68, 68, 0.06);
    border-radius: 4px;
    border-left: 2px solid var(--status-fail);
}

/* Upload status widget — header */
#upload-status-widget h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--accent-cyan);
}

/* Completion summary */
.upload-completion-summary {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    font-size: 0.75rem;
}

.upload-completion-summary .summary-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.upload-completion-summary .summary-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.upload-completion-summary .summary-stat .stat-icon {
    font-size: 0.8rem;
}

/* Mobile: upload panel */
@media (max-width: 1024px) {
    .upload-panel {
        padding: 1.5rem;
    }

    .dropzone-container {
        padding: 2rem 1rem;
    }
}

@media (max-width: 640px) {
    .upload-panel {
        padding: 1rem;
    }

    .dropzone-container {
        padding: 1.5rem 0.75rem;
    }

    .upload-icon {
        font-size: 2rem;
    }

    .dropzone-title {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   T34 — Mobile Responsive Accounting Workflow (375px–768px)
   ========================================================================== */

/* --- 768px: Tablet / large phone --- */
@media (max-width: 768px) {
    /* Header: compact brand with text visible but truncatable */
    .brand {
        font-size: 1rem;
        gap: 0.5rem;
        min-width: 0;
    }
    
    .brand span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        max-width: 140px;
    }
    
    .brand-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    /* Nav: icon-only with CSS tooltip */
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.55rem;
        position: relative;
        gap: 0;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i.fa-solid:not(.fa-right-from-bracket) {
        display: none;
    }
    
    /* CSS-only tooltip on hover/focus for icon-only nav */
    .nav-link::after {
        content: attr(title);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        background: rgba(6, 9, 19, 0.95);
        color: var(--text-primary);
        font-size: 0.72rem;
        font-weight: 500;
        padding: 0.3rem 0.6rem;
        border-radius: 6px;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.15s ease;
        border: 1px solid var(--border-color);
        z-index: 1000;
    }
    
    .nav-link:hover::after,
    .nav-link:focus::after,
    .nav-link:active::after {
        opacity: 1;
    }
    
    /* User profile: avatar + logout only */
    .user-profile-widget {
        padding-left: 0.75rem;
        gap: 0.4rem;
        border-left-width: 1px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .user-profile-widget > div:nth-child(2) {
        display: none;
    }
    
    .user-role-badge {
        display: none;
    }
    
    .nav-link.fa-right-from-bracket {
        color: var(--status-fail);
        padding: 0.4rem 0.5rem;
        min-width: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Dashboard: queue and upload before quality stats */
    .queue-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin-bottom: 0.75rem;
    }
    
    .queue-card {
        padding: 0.7rem 0.8rem;
    }
    
    .queue-card > div:first-child {
        gap: 0.35rem;
    }
    
    .queue-card > div:first-child span {
        font-size: 0.65rem;
    }
    
    .queue-card > div:last-child {
        font-size: 1.5rem;
    }
    
    /* Quality stats: compact */
    .quality-stats-section {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }
    
    .quality-stats-section h3 {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .quality-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .quality-stat-item span:first-child {
        font-size: 0.6rem;
    }
    
    .quality-stat-item span:last-child {
        font-size: 1rem;
    }
    
    /* Correction insights */
    .correction-insights {
        font-size: 0.78rem;
    }
    
    .correction-insights > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Upload panel */
    .upload-panel {
        padding: 1.25rem;
    }
    
    .dropzone-container {
        padding: 1.75rem 1rem;
    }
    
    .upload-icon {
        font-size: 2.25rem;
    }
    
    .dropzone-title {
        font-size: 0.9rem;
    }
    
    .dropzone-sub {
        font-size: 0.7rem;
    }
    
    /* Queue panel */
    .queue-panel {
        padding: 1.25rem;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Filters: full-width stacking */
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: unset;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
        min-width: unset;
    }
    
    .filter-row-advanced {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group > label {
        font-size: 0.65rem;
    }
    
    .filter-group > div {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group > div > span {
        display: none;
    }
    
    .filter-input-sm {
        width: 100% !important;
    }
    
    .filter-group > div > input {
        width: 100% !important;
    }
    
    .filter-group > div > .btn-xs {
        width: 100%;
        text-align: center;
    }
    
    /* Data table: smaller padding */
    table.data-table {
        font-size: 0.72rem;
    }
    
    table.data-table th,
    table.data-table td {
        padding: 0.55rem 0.4rem;
    }
    
    /* Hide less important columns progressively */
    table.data-table th:nth-child(3),
    table.data-table td:nth-child(3) {
        display: none;
    }
    
    table.data-table th:nth-child(6),
    table.data-table td:nth-child(6) {
        display: none;
    }
    
    /* Action buttons in table: icon-only at 768px */
    table.data-table td[style*="text-align: right"] .btn-sm span {
        display: none;
    }
    
    /* Verify page */
    .verify-layout {
        padding: 0 0.75rem;
        gap: 1rem;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.85rem 1rem !important;
    }
    
    .panel-body {
        padding: 1rem !important;
    }
    
    .preview-actions {
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0.5rem;
    }
    
    .preview-actions .btn-sm {
        padding: 0.35rem 0.45rem;
        font-size: 0.7rem;
    }
    
    .preview-actions .btn-sm i {
        font-size: 0.8rem;
    }
    
    .preview-container {
        min-height: 350px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .form-section-title {
        grid-column: span 1;
        font-size: 0.9rem;
    }
    
    .form-input {
        padding: 0.65rem 0.8rem;
        font-size: 0.88rem;
    }
    
    .recalc-row-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }
    
    .recalc-row-container input {
        width: 100%;
    }
    
    .recalc-row-container button {
        width: 100%;
        text-align: center;
    }
    
    .verify-form-buttons {
        flex-direction: column;
    }
    
    .verify-form-buttons > div {
        width: 100%;
    }
    
    .verify-form-buttons button,
    .verify-form-buttons a {
        width: 100%;
    }
    
    .line-items-table th,
    .line-items-table td {
        padding: 0.45rem 0.35rem;
        font-size: 0.72rem;
    }
    
    .line-items-table input {
        padding: 0.3rem 0.2rem;
        font-size: 0.72rem;
    }
    
    /* Toast notifications: smaller on mobile */
    #toast-container {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .toast {
        min-width: 260px;
        max-width: calc(100vw - 1.5rem);
        font-size: 0.8rem;
        padding: 0.8rem 1rem;
    }
}

/* --- 640px: Small tablet / large phone --- */
@media (max-width: 640px) {
    .queue-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quality-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Document table: card-like rows */
    table.data-table {
        display: block;
    }
    
    table.data-table thead {
        display: none;
    }
    
    table.data-table tbody {
        display: block;
    }
    
    table.data-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        border: 1px solid var(--border-color);
        background: rgba(255, 255, 255, 0.015);
        overflow: hidden;
    }
    
    table.data-table tbody tr:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.03);
    }
    
    table.data-table tbody td {
        display: block;
        padding: 0.6rem 0.85rem;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        text-align: left !important;
        position: relative;
        padding-left: 35%;
    }
    
    table.data-table tbody td:last-child {
        border-bottom: none;
    }
    
    /* Show column headers as labels */
    table.data-table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.85rem;
        top: 0.6rem;
        font-size: 0.62rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    
    /* Last column (actions) goes full width */
    table.data-table tbody td[style*="text-align: right"] {
        padding-left: 0.85rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        justify-content: flex-start;
        align-items: center;
    }
    
    table.data-table tbody td[style*="text-align: right"]::before {
        display: none;
    }
    
    /* Action buttons: full-width on mobile */
    table.data-table tbody td .btn-sm {
        flex: 1;
        min-width: 0;
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        justify-content: center;
    }
    
    table.data-table tbody td .btn-sm span {
        display: inline;
    }
    
    /* Hide status column label on very small cells */
    table.data-table tbody td:nth-child(11) {
        padding-top: 0.85rem;
    }
}

/* --- 480px: Mobile --- */
@media (max-width: 480px) {
    /* Header: minimal */
    header.app-header {
        padding: 0.4rem 0.75rem;
    }
    
    .brand {
        font-size: 0.95rem;
        gap: 0.4rem;
    }
    
    .brand span {
        max-width: 80px;
        font-size: 0.85rem;
    }
    
    .brand-icon {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    
    /* Nav: tighter spacing */
    nav.main-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.35rem 0.4rem;
    }
    
    /* User profile: avatar only, no text */
    .user-profile-widget {
        padding-left: 0.5rem;
        gap: 0.3rem;
    }
    
    .user-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }
    
    /* Queue cards: single column */
    .queue-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .queue-card {
        padding: 0.65rem 0.85rem;
    }
    
    .queue-card > div:last-child {
        font-size: 1.35rem;
    }
    
    /* Quality stats: single column, compact */
    .quality-stats-section {
        padding: 0.65rem 0.85rem;
    }
    
    .quality-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .quality-stat-item span:first-child {
        font-size: 0.58rem;
    }
    
    .quality-stat-item span:last-child {
        font-size: 0.95rem;
    }
    
    /* Hide correction insights on very small screens */
    .correction-insights {
        display: none;
    }
    
    /* Upload panel: minimal padding */
    .upload-panel {
        padding: 1rem;
    }
    
    .upload-panel h3 {
        font-size: 0.9rem;
    }
    
    .upload-panel p {
        font-size: 0.72rem;
    }
    
    .dropzone-container {
        padding: 1.25rem 0.75rem;
    }
    
    .upload-icon {
        font-size: 1.75rem;
    }
    
    .dropzone-title {
        font-size: 0.82rem;
    }
    
    /* Queue panel */
    .queue-panel {
        padding: 1rem;
    }
    
    .queue-panel .panel-title {
        font-size: 0.85rem;
    }
    
    /* Dashboard filters: ultra-compact */
    .dashboard-filters {
        padding: 0.65rem;
    }
    
    .filter-row {
        gap: 0.4rem;
    }
    
    .filter-select {
        font-size: 0.78rem;
        padding: 0.45rem 0.7rem;
    }
    
    .search-input {
        font-size: 0.78rem;
        padding: 0.45rem 0.7rem 0.45rem 2rem;
    }
    
    .search-icon {
        font-size: 0.75rem;
        left: 0.7rem;
    }
    
    .filter-input-sm {
        font-size: 0.75rem;
        padding: 0.3rem 0.4rem;
    }
    
    .btn-xs {
        font-size: 0.6rem;
        padding: 0.2rem 0.45rem;
    }
    
    /* Data table: hide AI confidence column */
    table.data-table th:nth-child(9),
    table.data-table td:nth-child(9) {
        display: none;
    }
    
    /* Verify page: minimal preview */
    .verify-layout {
        padding: 0 0.5rem;
    }
    
    .panel-header {
        padding: 0.65rem 0.75rem !important;
    }
    
    .panel-header h3 {
        font-size: 0.82rem;
    }
    
    .panel-body {
        padding: 0.75rem !important;
    }
    
    .preview-actions {
        justify-content: center;
        gap: 0.25rem;
        padding: 0.4rem;
    }
    
    .preview-actions .btn-sm {
        padding: 0.3rem 0.35rem;
        font-size: 0.65rem;
    }
    
    .preview-actions .btn-sm i {
        font-size: 0.7rem;
    }
    
    .preview-container {
        min-height: 250px;
    }
    
    /* Form fields: compact */
    .form-input {
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
        min-height: 40px;
    }
    
    .form-group label {
        font-size: 0.7rem;
    }
    
    .form-section-title {
        font-size: 0.82rem;
        margin: 1rem 0 0.4rem;
        padding-bottom: 0.25rem;
    }
    
    /* Rule banner */
    .rule-banner {
        padding: 0.85rem 0.75rem;
        margin-bottom: 1rem;
    }
    
    .banner-title {
        font-size: 0.82rem;
    }
    
    .checklist-item {
        padding: 0.55rem 0.7rem;
        font-size: 0.78rem;
    }
    
    .checklist-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    /* Status select */
    #status-select {
        font-size: 0.82rem;
        padding: 0.5rem 0.65rem;
    }
    
    /* Classification summary */
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.55rem;
    }
    
    /* Action buttons: full-width, touch-friendly */
    .verify-form-buttons button,
    .verify-form-buttons a {
        padding: 0.7rem 1rem;
        font-size: 0.82rem;
        min-height: 44px;
    }
    
    #btn-save-draft,
    #btn-reject,
    #btn-confirm-save {
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    /* Reject section */
    #reject-section {
        padding: 0.75rem;
    }
    
    #reject-section textarea {
        min-height: 60px;
    }
    
    /* Line items table */
    .line-items-table th,
    .line-items-table td {
        padding: 0.35rem 0.25rem;
        font-size: 0.68rem;
    }
    
    .line-items-table input {
        padding: 0.25rem 0.15rem;
        font-size: 0.68rem;
    }
    
    .line-items-table th:nth-child(2),
    .line-items-table td:nth-child(2) {
        display: none;
    }
    
    /* Toast: smaller */
    .toast {
        min-width: 220px;
        font-size: 0.75rem;
        padding: 0.65rem 0.85rem;
    }
    
    /* Delete modal */
    .modal-content {
        width: 95%;
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    /* Settings tabs: stacked */
    .settings-tabs {
        flex-direction: column;
        gap: 0.15rem;
    }
    
    .tab-btn {
        border-bottom: none;
        border-left: 2px solid transparent;
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
    }
    
    .tab-btn.active {
        border-left-color: var(--accent-cyan);
        border-bottom-color: transparent;
    }
}

/* --- 375px: Narrow mobile --- */
@media (max-width: 375px) {
    /* Header: icon-only brand */
    .brand {
        font-size: 0.88rem;
        gap: 0.35rem;
    }
    
    .brand span {
        max-width: 50px;
        font-size: 0.78rem;
    }
    
    .brand-icon {
        width: 24px;
        height: 24px;
        font-size: 0.72rem;
    }
    
    /* Nav: tighter */
    nav.main-nav {
        gap: 0.15rem;
    }
    
    .nav-link {
        padding: 0.3rem 0.35rem;
    }
    
    /* User profile: tiny avatar */
    .user-profile-widget {
        padding-left: 0.4rem;
        gap: 0.2rem;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }
    
    /* Queue cards */
    .queue-card > div:first-child span {
        font-size: 0.6rem;
    }
    
    .queue-card > div:last-child {
        font-size: 1.2rem;
    }
    
    /* Quality stats: single column */
    .quality-stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Upload */
    .upload-panel {
        padding: 0.85rem;
    }
    
    .dropzone-container {
        padding: 1rem 0.5rem;
    }
    
    .dropzone-title {
        font-size: 0.78rem;
    }
    
    /* Table: very compact */
    table.data-table {
        font-size: 0.68rem;
    }
    
    table.data-table tbody td {
        padding: 0.5rem 0.65rem;
        padding-left: 38%;
        font-size: 0.72rem;
    }
    
    table.data-table tbody td::before {
        font-size: 0.58rem;
        left: 0.65rem;
        top: 0.5rem;
    }
    
    /* Verify: minimal */
    .panel-header {
        padding: 0.55rem 0.6rem !important;
    }
    
    .panel-body {
        padding: 0.6rem !important;
    }
    
    .preview-container {
        min-height: 200px;
    }
    
    .preview-actions .btn-sm {
        padding: 0.25rem 0.3rem;
        font-size: 0.6rem;
    }
    
    .form-input {
        padding: 0.5rem 0.55rem;
        font-size: 0.78rem;
        min-height: 38px;
    }
    
    .form-section-title {
        font-size: 0.78rem;
    }
    
    .checklist-item {
        padding: 0.45rem 0.6rem;
        font-size: 0.72rem;
    }
}

/* Accessibility Focus & Touch Target Adjustments */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
.profile-card:focus,
.tab-btn:focus,
.queue-card:focus,
.dropzone-container:focus,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.profile-card:focus-visible,
.tab-btn:focus-visible,
.queue-card:focus-visible,
.dropzone-container:focus-visible {
    outline: 2px solid var(--accent-cyan) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.6) !important;
}

input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent-cyan) !important;
    outline-offset: 1px !important;
}

/* Ensure mobile interactive components have at least 44px height for touch targets */
@media (max-width: 768px) {
    .btn, 
    .tab-btn, 
    .form-input, 
    .filter-select, 
    .search-input,
    .recalc-row-container button,
    .btn-rd-lookup,
    .btn-etax-validate {
        min-height: 44px !important;
    }
    
    .checklist-item {
        min-height: 44px;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        display: flex;
        align-items: center;
    }
    
    .checklist-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
}

/* Side sub-tab layout for Policy Center */
.policy-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.policy-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.policy-subtab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.2s ease;
    width: 100%;
    font-family: inherit;
    font-size: 0.85rem;
}
.policy-subtab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}
.policy-subtab-btn.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(59, 130, 246, 0.12));
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.08);
}
.policy-content-panel {
    flex: 1;
    min-width: 0;
    display: none;
}
.policy-content-panel.active {
    display: block;
}

@media (max-width: 768px) {
    .policy-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .policy-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        white-space: nowrap;
    }
    .policy-subtab-btn {
        width: auto;
        padding: 0.6rem 0.85rem;
    }
}

/* ==========================================================================
   P3-12 — Design System: Navy + Gold Tokens, Components, Utility Classes
   ========================================================================== */

/* --- Brand tokens --- */
:root {
    --color-navy-deep: #071527;
    --color-navy: #0B1F3A;
    --color-navy-2: #122E55;
    --color-gold: #C9A227;
    --color-gold-strong: #A8871D;
    --color-gold-soft: #F6EFD3;
    --color-page-bg: #F5F6F8;
    --color-surface: #FFFFFF;
    --color-surface-soft: #F8FAFC;
    --color-border: #E5E7EB;
    --color-ink: #0F172A;
    --color-ink-muted: #475569;
    --color-success: #15803D;
    --color-warning: #92590A;
    --color-danger: #B42318;
    --color-info: #1D4ED8;
    --color-waiting: #6F4DAA;
    --color-teal: #0F766E;
}

/* --- SVG icon sizing & animation --- */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; width: 1em; height: 1em; }
.icon-xs  { width: 12px; height: 12px; }
.icon-sm  { width: 14px; height: 14px; }
.icon-md  { width: 18px; height: 18px; }
.icon-lg  { width: 22px; height: 22px; }
.icon-xl  { width: 28px; height: 28px; }
.icon-2xl { width: 36px; height: 36px; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
.icon-spin { animation: icon-spin 1s linear infinite; }

/* --- Layout utilities --- */
.d-flex        { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-inline      { display: inline !important; }
.d-block       { display: block !important; }
.d-none        { display: none !important; }
.d-contents    { display: contents !important; }
.d-grid        { display: grid !important; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.align-center  { align-items: center; }
.align-start   { align-items: flex-start; }
.align-end     { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 6px; }
.gap-3 { gap: 8px; }
.gap-4 { gap: 12px; }
.gap-5 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.self-center  { align-self: center; }
.self-end     { align-self: flex-end; }
.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }

/* --- Grid utilities --- */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2col-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.grid-1-2col { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* --- Sizing utilities --- */
.w-100 { width: 100%; }
.min-w-130 { min-width: 130px; }
.min-w-220 { min-width: 220px; }
.w-70  { width: 70px; }
.w-110 { width: 110px; }
.max-w-180 { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-2r  { min-width: 2rem; }
.cursor-pointer { cursor: pointer; }

/* --- Text utilities --- */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-md   { font-size: 14px; }
.text-base { font-size: 15px; }
.text-07r  { font-size: 0.7rem; }
.text-08r  { font-size: 0.8rem; }
.text-09r  { font-size: 0.9rem; }
.text-085r { font-size: 0.85rem; }
.text-065r { font-size: 0.65rem; }
.fw-400  { font-weight: 400; }
.fw-500  { font-weight: 500; }
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.fw-800  { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.letter-wide { letter-spacing: 0.05em; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-wrap    { white-space: nowrap; }
.lh-16 { line-height: 1.6; }

/* --- Color utilities (old tokens for glass theme compat) --- */
.text-primary-c { color: var(--text-primary); }
.text-secondary-c { color: var(--text-secondary); }
.text-muted-c   { color: var(--text-muted); }
.text-pass      { color: var(--status-pass); }
.text-warning-c { color: var(--status-warning); }
.text-fail      { color: var(--status-fail); }
.text-review    { color: var(--status-review); }
.text-accent    { color: var(--accent-cyan); }
.text-violet    { color: #8b5cf6; }

/* --- Color utilities (new tokens) --- */
.text-ink       { color: var(--color-ink); }
.text-muted     { color: var(--color-ink-muted); }
.text-dimmed    { color: #9ca3af; }
.text-success   { color: var(--color-success); }
.text-danger    { color: var(--color-danger); }
.text-warning   { color: var(--color-warning); }
.text-info      { color: var(--color-info); }
.text-navy      { color: var(--color-navy); }
.text-gold      { color: var(--color-gold); }
.text-required  { color: #dc2626; }
.text-gray      { color: #6b7280; }
.text-dark-gray { color: #374151; }
.text-light-gray { color: #9ca3af; }
.text-inherit   { color: inherit; }

/* --- Margin/Padding utilities --- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 14px; }
.mt-5 { margin-top: 16px; }
.mt-6 { margin-top: 20px; }
.mt-7 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.m-0  { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 12px; }
.mb-5 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 20px; }
.mb-7 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 28px; }
.mb-9 { margin-bottom: 32px; }
.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 6px; }
.ml-3 { margin-left: 8px; }
.ml-4 { margin-left: 0.5rem; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 6px; }
.mr-3 { margin-right: 8px; }
.m-auto { margin: auto; }
.p-0  { padding: 0; }
.p-2  { padding: 8px; }
.p-3  { padding: 12px; }
.p-4  { padding: 14px 16px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.pb-2 { padding-bottom: 8px; }
.pl-3 { padding-left: 12px; }

/* --- Page containers --- */
.page-container     { max-width: 900px;  margin: 32px auto; padding: 0 16px; }
.page-container-md  { max-width: 800px;  margin: 32px auto; padding: 0 16px; }
.page-container-sm  { max-width: 640px;  margin: 40px auto; padding: 0 16px; }
.page-container-xs  { max-width: 560px;  margin: 60px auto; padding: 0 16px; }
.page-container-xxs { max-width: 520px;  margin: 80px auto; padding: 0 16px; text-align: center; }
.page-container-lg  { max-width: 1100px; margin: 32px auto; padding: 0 16px; }

/* --- Alert / Flash messages --- */
.alert           { border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.alert-success   { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-danger,
.alert-error     { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-warning   { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.alert-info      { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }

/* --- Cards --- */
.card        { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; }
.card-body   { padding: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--color-border); font-weight: 600; font-size: 15px; }
.card-mb     { margin-bottom: 20px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: 4px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    text-decoration: none; transition: opacity 0.15s; line-height: 1.4;
    white-space: nowrap;
}
.btn:hover           { opacity: 0.88; text-decoration: none; }
.btn-sm              { padding: 5px 12px; font-size: 13px; }
.btn-xs              { padding: 3px 8px;  font-size: 12px; }
.btn-primary         { background: var(--color-navy); color: #fff; }
.btn-gold            { background: var(--color-gold); color: #fff; }
.btn-danger          { background: var(--color-danger); color: #fff; }
.btn-ghost           { background: transparent; color: var(--color-ink-muted); border: 1px solid var(--color-border); }
.btn-outline-navy    { background: transparent; color: var(--color-navy); border: 1px solid var(--color-navy); }
.btn-link-muted      { background: transparent; color: #6b7280; border: none; padding: 0; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Badges --- */
.badge          { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-sm       { padding: 2px 6px; font-size: 10px; }
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef3c7; color: #92590a; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-waiting  { background: #ede9fe; color: #6f4daa; }
.badge-teal     { background: #ccfbf1; color: #0f766e; }
.badge-neutral  { background: #f1f5f9; color: #475569; }
.badge-navy     { background: var(--color-navy-2); color: #fff; }
.badge-gold     { background: var(--color-gold-soft); color: var(--color-gold-strong); }

/* --- Forms --- */
.form-label    { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; color: var(--color-ink); }
.form-input,
.form-select,
.form-textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 4px;
    font-size: 14px; box-sizing: border-box; background: #fff; color: var(--color-ink);
    font-family: inherit;
}
.form-textarea  { resize: vertical; }
.form-input-sm  { padding: 4px 8px; font-size: 14px; border: 1px solid #d1d5db; border-radius: 4px; box-sizing: border-box; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: 2px solid var(--color-navy-2); outline-offset: 1px;
}
.form-group     { margin-bottom: 14px; }
.form-group-lg  { margin-bottom: 16px; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-hint      { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* --- Data tables --- */
.data-table           { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th        { padding: 10px 12px; text-align: left; font-weight: 600; color: #374151; background: var(--color-surface-soft); border-bottom: 2px solid #e2e8f0; }
.data-table th.tc     { text-align: center; }
.data-table td        { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table td.tc     { text-align: center; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Teach-AI style simple tables */
.list-table           { width: 100%; border-collapse: collapse; font-size: 14px; }
.list-table thead tr  { background: #f3f4f6; }
.list-table th        { text-align: left; padding: 8px 12px; border-bottom: 1px solid #e5e7eb; font-weight: 600; color: #374151; }
.list-table th.tc     { text-align: center; }
.list-table td        { padding: 8px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.list-table td.tc     { text-align: center; }
.list-table td.mono   { font-family: monospace; font-size: 12px; }
.list-table tbody tr:last-child td { border-bottom: none; }

/* --- Tab nav --- */
.tab-nav       { display: flex; gap: 4px; margin-bottom: 28px; background: #f3f4f6; padding: 4px; border-radius: 6px; flex-wrap: wrap; }
.tab-link      { padding: 8px 16px; border-radius: 4px; text-decoration: none; font-size: 14px; font-weight: 400; color: #374151; background: transparent; display: inline-flex; align-items: center; gap: 4px; }
.tab-link.active { font-weight: 600; background: var(--color-navy-2); color: #fff; }
.tab-link:hover:not(.active) { background: #e5e7eb; color: var(--color-ink); text-shadow: none; }

/* --- Page header row --- */
.page-header       { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2,
.page-header h3    { margin: 0; }
.page-header-back  { font-size: 13px; color: #6b7280; text-decoration: none; }
.page-header-back:hover { color: var(--color-navy); text-shadow: none; }

/* --- Section header (with icon box) --- */
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.section-meta   { display: flex; flex-direction: column; gap: 2px; }
.icon-box       { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-box-blue  { background: #eff6ff; color: var(--color-info); }
.icon-box-navy  { background: var(--color-gold-soft); color: var(--color-navy); }
.icon-box-gold  { background: var(--color-gold-soft); color: var(--color-gold-strong); }
.icon-box-green { background: #f0fdf4; color: var(--color-success); }

/* --- Section sub-header line --- */
.section-title  { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--color-ink); display: flex; align-items: center; gap: 6px; }

/* --- Company switcher in nav --- */
.nav-company-wrap   { display: flex; align-items: center; gap: 6px; margin-left: 8px; padding: 0 10px; border-left: 1px solid rgba(255,255,255,0.15); }
.nav-company-name   { font-size: 13px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-company-icon   { opacity: 0.7; }
.nav-company-select { background: transparent; border: none; color: inherit; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 180px; padding: 2px 0; }
.nav-company-select option { color: #1e293b; }
.nav-company-form   { display: inline; }

/* --- User profile widget in nav --- */
.nav-user-info  { display: flex; flex-direction: column; }
.nav-user-name  { font-size: 0.85rem; font-weight: 600; }
.nav-logout     { color: var(--status-fail, var(--color-danger)) !important; margin-left: 0.5rem; }

/* --- Admin banner --- */
.admin-banner   { background: #fef3c7; border-bottom: 2px solid #fcd34d; padding: 6px 20px; font-size: 13px; color: #92400e; text-align: center; }
.admin-banner a { color: #92400e; text-decoration: underline; font-weight: 600; }

/* --- Navbar redesign: navy bg, white text, gold active underline --- */
header.app-header { background: var(--color-navy); }
.nav-link         { color: rgba(255,255,255,0.85) !important; }
.nav-link:hover   { color: #fff !important; text-shadow: none !important; }
.nav-link.active  { color: #fff !important; border-bottom: 2px solid var(--color-gold); padding-bottom: 2px; }

/* --- Dashboard queue card per-color via data-queue --- */
.queue-card[data-queue="needs_review"]  { border-left: 3px solid #3b82f6; }
.queue-card[data-queue="ready_confirm"] { border-left: 3px solid #10b981; }
.queue-card[data-queue="official_failed"] { border-left: 3px solid #ef4444; }
.queue-card[data-queue="low_confidence"]  { border-left: 3px solid #f59e0b; }
.queue-card[data-queue="duplicate"]     { border-left: 3px solid #ef4444; }
.queue-card[data-queue="non_expense"]   { border-left: 3px solid #8b5cf6; }
.queue-card[data-queue="export_failed"] { border-left: 3px solid #ef4444; }
.queue-card[data-queue="exported"]      { border-left: 3px solid #10b981; }
.queue-card[data-queue="all"]           { border-left: 3px solid #94a3b8; }

.queue-card[data-queue="needs_review"]  .queue-icon { color: #3b82f6; }
.queue-card[data-queue="ready_confirm"] .queue-icon { color: #10b981; }
.queue-card[data-queue="official_failed"] .queue-icon { color: #ef4444; }
.queue-card[data-queue="low_confidence"]  .queue-icon { color: #f59e0b; }
.queue-card[data-queue="duplicate"]     .queue-icon { color: #ef4444; }
.queue-card[data-queue="non_expense"]   .queue-icon { color: #8b5cf6; }
.queue-card[data-queue="export_failed"] .queue-icon { color: #ef4444; }
.queue-card[data-queue="exported"]      .queue-icon { color: #10b981; }
.queue-card[data-queue="all"]           .queue-icon { color: #94a3b8; }

.queue-card-row  { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.queue-label     { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.queue-count     { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); }

/* --- Dashboard: document type, score, TIN CSS classes --- */
.doc-type-label  { font-weight: 600; font-size: 0.85rem; }
.dt-FULL_TAX_INVOICE       { color: var(--status-pass); }
.dt-SIMPLIFIED_TAX_INVOICE { color: var(--status-warning); }
.dt-RECEIPT                { color: var(--status-review); }
.dt-OTHER,
.dt-OTHER_DOCUMENT         { color: var(--text-muted); }
.dt-NON_EXPENSE            { color: #8b5cf6; }

.exp-label  { font-weight: 600; font-size: 0.8rem; }
.exp-BOOKABLE      { color: var(--status-pass); }
.exp-NEEDS_REVIEW  { color: var(--status-warning); }
.exp-NON_EXPENSE   { color: #8b5cf6; }

.score-val  { font-weight: 700; }
.score-pass { color: var(--status-pass); }
.score-warn { color: var(--status-warning); }
.score-fail { color: var(--status-fail); }

.tin-matched  { color: var(--status-pass);  font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px; }
.tin-mismatch { color: var(--status-fail);  font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px; }
.tin-unknown  { color: var(--text-muted);   font-size: 0.8rem; }

/* --- Dashboard: bulk bar, upload widget, delete modal (JS-toggled hidden) --- */
#bulk-action-bar   { display: none; }
#upload-status-widget { display: none; margin-top: 1.5rem; padding: 1rem; border-radius: 8px; background: rgba(255,255,255,0.02); border: 1px solid var(--border-color); }
#deleteModal       { display: none; }
#deleteWarning     { display: none; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
#deleteDriveOption { display: none; margin-bottom: 1rem; }
.bulk-action-bar-inner { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; background: rgba(6,182,212,0.08); border: 1px solid rgba(6,182,212,0.25); border-radius: 8px; margin-bottom: 0.75rem; }
.bulk-count  { font-size: 0.85rem; font-weight: 600; color: var(--accent-cyan); }
.delete-input { width: 100%; padding: 0.5rem; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-card,#1a2035); color: var(--text-primary); font-size: 0.9rem; }
.delete-drive-label { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); cursor: pointer; }
.delete-drive-cb { width: 1rem; height: 1rem; accent-color: var(--status-fail); }

/* --- Dashboard: action column management td --- */
.td-actions { text-align: right; display: flex; justify-content: flex-end; align-items: center; gap: 0.35rem; }
.td-processing { font-size: 0.8rem; color: var(--text-muted); margin-right: 0.5rem; display: inline-flex; align-items: center; gap: 4px; }

/* --- Action button variants using old tokens --- */
.btn-retry-drive   { background: var(--status-fail-glow,rgba(239,68,68,.12)); color: var(--status-fail); }
.btn-retry-ai      { background: var(--status-warning-glow,rgba(245,158,11,.12)); color: var(--status-warning); }
.btn-del-inline    { color: var(--status-fail); border-color: rgba(239,68,68,0.2); background: transparent; }
.btn-clear-inline  { color: var(--status-fail); border-color: rgba(239,68,68,0.2); background: transparent; }

/* --- Pagination --- */
.pagination     { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.pagination-info { font-size: 0.8rem; color: var(--text-muted); }
.pagination-pages { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.page-btn { min-width: 2rem; text-align: center; }

/* --- Filter width helpers --- */
.filter-w70  { width: 70px; }
.filter-w110 { width: 110px; }
.filter-sep  { color: var(--text-muted); align-self: center; }

/* --- Modal cleanup (no inline style="") --- */
.modal-close-btn { background: transparent; border: none; cursor: pointer; font-size: 1.5rem; color: var(--text-muted); }
.modal-confirm-content { max-width: 420px; }
.modal-delete-content  { max-width: 500px; }
.modal-title-row { margin: 0; font-size: 1rem; color: var(--text-primary); }
.modal-body-text { margin: 0; color: var(--text-secondary); line-height: 1.5; }
.modal-body-label { color: var(--text-secondary); margin: 0 0 0.5rem 0; }
.modal-body-value { color: var(--text-primary); font-weight: 600; font-size: 1.1rem; margin: 0; }
.modal-body-file  { color: var(--text-primary); margin: 0; }
.modal-body-mb    { margin-bottom: 1rem; }
.modal-footer-row { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* --- Footer modal confirm button override --- */
#confirmModal { display: none; }
.confirm-modal-btn-close { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.confirm-modal-msg { margin: 0; color: var(--text-secondary); line-height: 1.5; }

/* --- Details/Summary form panels --- */
.details-panel { border: 1px solid #e5e7eb; border-radius: 6px; padding: 16px; margin-bottom: 24px; }
.details-summary { font-weight: 600; cursor: pointer; }

/* --- Login page --- */
#pin-section { display: none; }
.login-hidden-input { position: absolute; opacity: 0; pointer-events: none; }
.login-back-btn { margin-top: 0.5rem; }
.login-selected-name { color: var(--accent-cyan); margin-bottom: 1.5rem; }
.login-pin-header { margin-bottom: 0.25rem; }

/* --- Narrow page container (company_pick, company_create, onboarding) --- */
.container-narrow { max-width: 560px; margin: 40px auto; padding: 0 16px; }

/* --- Company pick page --- */
.company-pick-list { display: flex; flex-direction: column; gap: 10px; }
.company-pick-btn {
    width: 100%; text-align: left; padding: 14px 18px;
    border: 1px solid #e5e7eb; border-radius: 8px;
    background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; transition: border-color 0.15s;
}
.company-pick-btn:hover { border-color: var(--color-navy-2); }
.company-pick-name  { font-weight: 600; font-size: 15px; }
.company-pick-tax   { color: #6b7280; font-size: 12px; margin-top: 2px; }
.company-pick-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid #f3f4f6; text-align: center; }
.company-pick-footer a { font-size: 13px; color: #6b7280; text-decoration: none; }

/* --- Onboarding gate icon --- */
.onboarding-icon { width: 64px; height: 64px; border-radius: 50%; background: #eff6ff; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.onboarding-cta  { display: block; padding: 16px 24px; background: var(--color-navy); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.onboarding-wait { padding: 16px 24px; border: 1px solid #e5e7eb; border-radius: 8px; color: #374151; font-size: 14px; line-height: 1.6; text-align: left; }

/* --- Wizard step indicator --- */
.wizard-steps   { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.wizard-step-item { flex: 1; text-align: center; }
.wizard-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.wizard-step-num.active   { background: var(--color-navy); color: #fff; }
.wizard-step-num.inactive { background: #e5e7eb; color: #6b7280; }
.wizard-step-label { font-size: 12px; margin-top: 4px; }
.wizard-step-label.active   { color: var(--color-navy); font-weight: 600; }
.wizard-step-label.inactive { color: #6b7280; font-weight: 400; }
.wizard-connector { flex: 1; height: 2px; margin-bottom: 20px; }
.wizard-connector.active   { background: var(--color-navy); }
.wizard-connector.inactive { background: #e5e7eb; }

/* --- Teach AI fewshot settings box --- */
.fewshot-box { padding: 14px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; }
.fewshot-title { font-weight: 600; margin-bottom: 10px; }
.fewshot-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fewshot-check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fewshot-cap-label   { display: flex; align-items: center; gap: 8px; }
.fewshot-cap-input   { width: 70px; padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 14px; }

/* --- Admin panel specific --- */
.admin-icon-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.admin-icon-box  { width: 48px; height: 48px; border-radius: 12px; background: #eff6ff; display: flex; align-items: center; justify-content: center; }
.admin-icon-box svg { width: 22px; height: 22px; color: var(--color-info); }
.admin-header-text h2 { margin: 0; font-size: 22px; }
.admin-header-text p  { margin: 2px 0 0; color: #6b7280; font-size: 13px; }

/* --- UAT checklist (uses glass-panel compat) --- */
.uat-outer { padding: 2rem 1rem; }
.uat-inner { padding: 2rem; max-width: 900px; margin: 0 auto; }
.uat-progress-wrap { margin-bottom: 2rem; }
.progress-track { background: var(--card-bg); border-radius: 8px; height: 8px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, #22c55e, #16a34a); height: 100%; transition: width 0.3s; }
.uat-item { border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1.5rem; margin-bottom: 1rem; background: var(--card-bg); }
.uat-item.is-completed { border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.05); }
.uat-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.uat-item-num { background: var(--accent-cyan); color: #000; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }
.uat-badge-pass { background: rgba(34,197,94,0.2); color: #22c55e; padding: 0.25rem 0.75rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.uat-step-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; }
.uat-steps-list { margin: 0; padding-left: 1.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.uat-steps-list li { margin-bottom: 0.25rem; }
.uat-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.uat-notes-input { flex: 1; min-width: 200px; padding: 0.4rem 0.75rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; background: rgba(0,0,0,0.2); color: var(--text-secondary); font-size: 0.85rem; }
.uat-timestamp { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.5rem; }
.uat-reset-wrap { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* --- Admin panel table/form extras --- */
.row-inactive { opacity: 0.5; }
.member-tag { display: inline-block; margin: 1px 2px; padding: 2px 7px; background: #f3f4f6; border-radius: 3px; font-size: 11px; }
.member-tag .role-owner { color: #1d4ed8; font-weight: 600; }
.member-tag .role-member { color: #6b7280; font-weight: 600; }
.pin-input-sm { width: 110px; border: 1px solid #d1d5db; border-radius: 4px; padding: 3px 6px; font-size: 12px; }
.admin-create-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px 24px; max-width: 520px; margin-top: 32px; }
.admin-section-h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.admin-subsection-h3 { font-size: 15px; font-weight: 700; margin: 0 0 16px; }
.form-label-sm { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }

/* --- Section heading (used in members, settings lists) --- */
.section-heading { margin-bottom: 12px; font-size: 15px; }

/* --- Small select input (used in member role change form) --- */
.form-select-sm { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px; }

/* --- Delete button in list tables --- */
.btn-delete-sm { padding: 4px 10px; background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; border-radius: 4px; font-size: 12px; cursor: pointer; }
.btn-save-sm   { padding: 4px 10px; background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px; cursor: pointer; }

/* --- Google tab connected badge --- */
.google-connected-badge { color: #16a34a; font-size: 10px; }

/* --- Misc helpers --- */
.border-top-light { border-top: 1px solid #f3f4f6; }
.border-bot-2 { border-bottom: 2px solid #e2e8f0; }
.opacity-70 { opacity: 0.7; }
.radius-4 { border-radius: 4px; }
.radius-6 { border-radius: 6px; }
.radius-8 { border-radius: 8px; }
.mono { font-family: monospace; }
.font-sm12 { font-size: 12px; }

/* --- Score/confidence display (verify page) --- */
.score-display { font-size: 0.85rem; }
.score-display.pass    { color: var(--status-pass); font-weight: 700; }
.score-display.warning { color: var(--status-warning); font-weight: 700; }
.score-display.fail    { color: var(--status-fail); font-weight: 700; }

/* --- Verify page: drop-zone helpers retained, upload widget title --- */
.upload-widget-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--accent-cyan); display: flex; align-items: center; gap: 6px; }
.upload-queue-list { display: flex; flex-direction: column; gap: 0.75rem; }
.dropzone-or { color: var(--text-muted); font-size: 0.85rem; margin: 0.5rem 0; }
.dropzone-sub-mt { margin-top: 1rem; }

/* --- Settings page compat --- */
.settings-container-fluid { padding: 2rem; }

/* --- Section divider --- */
hr.section-divider { margin: 32px 0; border: none; border-top: 1px solid var(--color-border); }


/* ==========================================================================
   Verify Page Redesign & Accordion Styles (T34 / P3-14)
   ========================================================================== */
.queue-position-banner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-gold);
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    margin: 1.5rem auto 0;
    max-width: 1600px;
    width: calc(100% - 3rem);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--color-ink);
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.accordion-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-section:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(201, 162, 39, 0.4);
}
.accordion-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: var(--color-surface-soft);
    transition: background-color 0.2s ease;
}
.accordion-header:hover {
    background: rgba(201, 162, 39, 0.05);
}
.accordion-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-navy);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.accordion-status {
    margin-left: auto;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
}
.accordion-toggle-icon {
    display: inline-flex;
    transition: transform 0.2s ease;
    color: var(--color-ink-muted);
}
.accordion-content {
    display: none;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.accordion-section.expanded .accordion-content {
    display: block;
}
.accordion-section.expanded .accordion-toggle-icon {
    transform: rotate(180deg);
}

/* Helper utility classes to eliminate inline styles */
.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.text-xxs {
    font-size: 0.65rem;
}
.text-xs {
    font-size: 0.75rem;
}
.text-sm {
    font-size: 0.85rem;
}
.font-mono {
    font-family: var(--font-mono, monospace);
}
.rule-banner.info {
    margin-bottom: 1.5rem;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.25);
}
.margin-bottom-sm {
    margin-bottom: 0.5rem;
}
.margin-bottom-md {
    margin-bottom: 0.75rem;
}
.margin-top-xs {
    margin-top: 0.25rem;
}
.margin-top-sm {
    margin-top: 0.35rem;
}
.text-lh-md {
    line-height: 1.4;
}
.status-select-container {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.status-select-input {
    margin-top: 0.35rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}
.ai-classification-container {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 8px;
}
.flex-wrap-items-center {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.text-xs-muted-spaced {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}
.ai-reasoning-row {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(6, 182, 212, 0.15);
}
.label-xxs {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}
.text-sm-spaced {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}
.feedback-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #a78bfa;
    cursor: pointer;
}
.label-sm {
    font-size: 0.80rem;
    color: var(--text-muted);
}
.verify-controls-panel {
    margin-top: 2rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}
.verify-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.flex-column-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}
.btn-confirm {
    background: linear-gradient(135deg, var(--status-pass), var(--accent-cyan));
    color: white;
}
.text-kbd-info {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.7;
}
.blocker-info-text {
    color: var(--status-fail);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: right;
    max-width: 350px;
}
.reject-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
}
.reject-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fca5a5;
    display: block;
    margin-bottom: 0.5rem;
}
.w-full {
    width: 100%;
}
.flex-row-end {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}
.autosave-text {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

@media (max-width: 768px) {
    .queue-position-banner {
        width: calc(100% - 2rem);
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
}

.rd-result-container {
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}
.rd-result-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
}
.rd-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
}
.rd-result-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}
.ai-recommendation-alert {
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 4px;
    font-size: 0.72rem;
    color: #a78bfa;
}

/* Quality Warning Banner (sweeping inline style) */
.quality-warning-banner {
    margin-top: 0.6rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    padding: 0.55rem 0.75rem;
}
.quality-warning-banner li {
    margin-bottom: 0.15rem;
}
.opacity-30 {
    opacity: 0.3;
}

.hidden {
    display: none !important;
}



