/* ============================================================
   febBook — B2B Invoice Management SaaS
   Master Stylesheet
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    /* Primary Palette */
    --primary: #DC2F3F;
    --primary-dark: #B8202E;
    --primary-light: #F0636E;
    --primary-pale: #FEF1F2;
    --primary-glow: rgba(220, 47, 63, 0.16);

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F4F8;
    --gray-200: #E5E9F0;
    --gray-300: #D3DAE4;
    --gray-400: #97A1B2;
    --gray-500: #667085;
    --gray-600: #4F5869;
    --gray-700: #394150;
    --gray-800: #232A36;
    --gray-900: #111723;

    /* Semantic */
    --success: #15803D;
    --success-pale: #ECFDF3;
    --warning: #D97706;
    --warning-pale: #FFF7E6;
    --danger: #DC2626;
    --danger-pale: #FEF2F2;
    --info: #2563EB;
    --info-pale: #EFF5FF;
    --success-text: #166534;
    --warning-text: #92400E;
    --danger-text: #991B1B;
    --info-text: #1E40AF;

    /* Surface */
    --bg-body: #F6F7FB;
    --bg-card: #FFFFFF;
    --bg-sidebar: #1A1D23;
    --bg-sidebar-alt: #22262F;

    /* Typography */
    --font-primary: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .05);
    --shadow-lg: 0 16px 32px -8px rgba(16, 24, 40, .14), 0 4px 8px -4px rgba(16, 24, 40, .06);
    --shadow-xl: 0 28px 56px -12px rgba(16, 24, 40, .22);
    --shadow-primary: 0 6px 16px -4px rgba(220, 47, 63, .40);

    /* Transitions */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, .72);
    --glass-border: rgba(255, 255, 255, .55);
    --glass-blur: 18px;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 66px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #0D1016;
    --bg-card: #161A23;
    --gray-50: #1B202B;
    --gray-100: #212735;
    --gray-200: #2A3141;
    --gray-300: #374054;
    --gray-400: #5E687D;
    --gray-500: #8D97AB;
    --gray-600: #A8B1C3;
    --gray-700: #C3CAD8;
    --gray-800: #DCE1EB;
    --gray-900: #F1F4F9;
    --primary: #F0505E;
    --primary-dark: #DC2F3F;
    --primary-light: #F57E88;
    --primary-pale: rgba(240, 80, 94, .14);
    --primary-glow: rgba(240, 80, 94, .22);
    --success: #34D27B;
    --success-pale: rgba(52, 210, 123, .12);
    --warning: #F5A524;
    --warning-pale: rgba(245, 165, 36, .12);
    --danger: #F87171;
    --danger-pale: rgba(248, 113, 113, .12);
    --info: #60A5FA;
    --info-pale: rgba(96, 165, 250, .12);
    --success-text: #4ADE80;
    --warning-text: #FBBF24;
    --danger-text: #FCA5A5;
    --info-text: #93C5FD;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
    --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, .55);
    --glass-bg: rgba(22, 26, 35, .78);
}

/* ── Bootstrap → theme bridge ───────────────────────────────
   Bootstrap hard-codes its blue in a few places; point them at the
   red brand colour so pagination, switches, links and focus rings
   match the rest of the interface. */
:root {
    --bs-primary: #DC2F3F;
    --bs-primary-rgb: 220, 47, 63;
    --bs-primary-text-emphasis: #B8202E;
    --bs-primary-bg-subtle: #FEF1F2;
    --bs-primary-border-subtle: #FBCBD0;
    --bs-focus-ring-color: rgba(220, 47, 63, .16);
    --bs-body-font-family: var(--font-primary);
    --bs-body-color: var(--gray-800);
    --bs-secondary-color: var(--gray-500);
}

[data-theme="dark"] {
    --bs-primary-text-emphasis: #FF6B6B;
    --bs-primary-bg-subtle: rgba(230, 57, 70, .16);
    --bs-primary-border-subtle: rgba(230, 57, 70, .35);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.pagination {
    --bs-pagination-color: var(--gray-700);
    --bs-pagination-bg: var(--bg-card);
    --bs-pagination-border-color: var(--gray-200);
    --bs-pagination-border-radius: var(--radius-md);
    --bs-pagination-hover-color: var(--primary);
    --bs-pagination-hover-bg: var(--primary-pale);
    --bs-pagination-hover-border-color: var(--primary-light);
    --bs-pagination-focus-color: var(--primary);
    --bs-pagination-focus-bg: var(--primary-pale);
    --bs-pagination-focus-box-shadow: 0 0 0 3px var(--primary-glow);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--primary);
    --bs-pagination-active-border-color: var(--primary);
    --bs-pagination-disabled-color: var(--gray-400);
    --bs-pagination-disabled-bg: var(--gray-50);
    --bs-pagination-disabled-border-color: var(--gray-200);
    gap: 4px;
    flex-wrap: wrap;
}

.pagination .page-link {
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: .82rem;
    transition: all var(--duration-fast) var(--ease);
}

/* Bootstrap paints its own blue/green/red border under the theme's button
   backgrounds, leaving a coloured edge; keep the edge in step with the fill. */
.btn-primary { border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus-visible, .btn-primary:active { border-color: var(--primary-dark); }
.btn-success, .btn-danger, .btn-warning { border-color: transparent; }

.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--primary);
    --bs-dropdown-link-hover-bg: rgba(230, 57, 70, .08);
    --bs-dropdown-link-hover-color: var(--primary);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-body);
    color: var(--gray-800);
    line-height: 1.55;
    letter-spacing: -0.006em;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ── Utility Classes ────────────────────────────────────────── */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary-pale {
    background: var(--primary-pale) !important;
}

.font-600 {
    font-weight: 600;
}

.font-700 {
    font-weight: 700;
}

.font-800 {
    font-weight: 800;
}

.radius-lg {
    border-radius: var(--radius-lg);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    letter-spacing: -0.005em;
    border-radius: var(--radius-md);
    padding: 9px 18px;
    font-size: .875rem;
    line-height: 1.35;
    transition: background-color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease),
        color var(--duration-fast) var(--ease), box-shadow var(--duration-base) var(--ease), transform var(--duration-fast) var(--ease);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--duration-fast);
}

.btn:hover::after {
    background: rgba(255, 255, 255, .1);
}

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

.btn-primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 92%, #fff) 0%, var(--primary) 100%);
    color: var(--white);
    box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 20px -6px rgba(220, 47, 63, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
    transform: translateY(-1px);
    color: var(--white);
}

.btn-outline-primary {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
}

.btn-outline-primary:hover {
    background: var(--primary-pale);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: var(--bg-card);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(21, 128, 61, .45);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

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

.btn-lg {
    padding: 12px 24px;
    font-size: .95rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: .8rem;
    border-radius: 8px;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card-modern {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-200);
    transition: box-shadow var(--duration-base) var(--ease), border-color var(--duration-base) var(--ease);
}

.card-modern:hover {
    box-shadow: var(--shadow-sm);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ── Badges / Status ────────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent);
}

.badge-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-approved {
    background: var(--success-pale);
    color: #166534;
}

.badge-approved .dot {
    background: var(--success);
}

.badge-pending {
    background: var(--warning-pale);
    color: #92400E;
}

.badge-pending .dot {
    background: var(--warning);
}

.badge-rejected {
    background: var(--danger-pale);
    color: #991B1B;
}

.badge-rejected .dot {
    background: var(--danger);
}

.badge-processing {
    background: var(--info-pale);
    color: #1E40AF;
}

.badge-processing .dot {
    background: var(--info);
}

.badge-draft {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-draft .dot {
    background: var(--gray-500);
}

/* ── Confidence Bar ─────────────────────────────────────────── */
.confidence-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
}

.confidence-bar .track {
    flex: 1;
    height: 5px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.confidence-bar .fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width .6s var(--ease);
}

.confidence-high .fill {
    background: var(--success);
}

.confidence-mid .fill {
    background: var(--warning);
}

.confidence-low .fill {
    background: var(--danger);
}

/* ── Skeleton Loader ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 400% 100%;
    animation: skeleton-wave 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-wave {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-control-modern {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-xs);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: .875rem;
    color: var(--gray-900);
    background: var(--bg-card);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    outline: none;
}

.form-control-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-label-modern {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}

/* ── Section Heading ────────────────────────────────────────── */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-pale);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    color: var(--gray-900);
    line-height: 1.2;
}

.section-heading span {
    color: var(--primary);
}

.section-sub {
    font-size: 1.05rem;
    color: var(--gray-600);
    max-width: 560px;
    line-height: 1.7;
}

/* ── Stat Card ──────────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
}

.stat-card::before {
    content: none;
}

.stat-card.stat-red::before {
    background: var(--primary);
}

.stat-card.stat-green::before {
    background: var(--success);
}

.stat-card.stat-orange::before {
    background: var(--warning);
}

.stat-card.stat-blue::before {
    background: var(--info);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-card .icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-bottom: 14px;
}

.stat-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
}

.stat-card .label {
    font-size: .8rem;
    color: var(--gray-500);
    margin-top: 6px;
    font-weight: 500;
}

.stat-card .trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: 8px;
}

.trend-up {
    background: var(--success-pale);
    color: #1a7a45;
}

.trend-down {
    background: var(--danger-pale);
    color: #922b21;
}

/* ═══════════════════════════════════════════════════════════
      LANDING PAGE
   ═══════════════════════════════════════════════════════════ */

/* Navbar */
.landing-nav {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 !important;
}

.navbar-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--gray-900);
}

.brand-name span {
    color: var(--primary);
}

.nav-link-modern {
    color: var(--gray-700) !important;
    font-weight: 500;
    font-size: .9rem;
    padding: 8px 14px !important;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}

.nav-link-modern:hover {
    color: var(--primary) !important;
    background: var(--primary-pale);
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #fff 0%, #FFF5F5 50%, #fff 100%);
    padding: 100px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(230, 57, 70, .08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(230, 57, 70, .06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-pale), #fff);
    border: 1px solid rgba(230, 57, 70, .25);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 20px;
}

.hero-badge .pulse {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .6;
        transform: scale(1.4);
    }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    color: var(--gray-900);
    line-height: 1.12;
    margin-bottom: 22px;
}

.hero-title .highlight {
    color: var(--primary);
    position: relative;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-full);
    opacity: .35;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--gray-600);
    line-height: 1.75;
    max-width: 520px;
    margin-bottom: 36px;
}

.hero-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--gray-200);
}

.hero-stat-item {
    text-align: left;
}

.hero-stat-item .num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}

.hero-stat-item .lbl {
    font-size: .78rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Dashboard Mockup */
.dashboard-mockup {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--gray-200);
    overflow: hidden;
    position: relative;
}

.mockup-topbar {
    background: var(--gray-900);
    height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
}

.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mockup-inner {
    display: grid;
    grid-template-columns: 55px 1fr;
    min-height: 320px;
}

.mockup-sidebar {
    background: #1A1D23;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mockup-nav-item {
    height: 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    margin-bottom: 2px;
}

.mockup-nav-item.active {
    background: var(--primary);
}

.mockup-content {
    background: #F4F6F9;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mockup-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mockup-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.mockup-stat-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.mockup-stat-bar .fill {
    height: 100%;
    border-radius: 4px;
}

.mockup-chart-area {
    background: #fff;
    border-radius: 8px;
    height: 120px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.mockup-table {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
}

.mockup-row {
    height: 22px;
    background: var(--gray-100);
    border-radius: 4px;
    margin-bottom: 5px;
}

.mockup-row:first-child {
    background: var(--primary-pale);
}

/* Features Section */
.features-section {
    padding: var(--space-3xl) 0;
    background: var(--white);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    height: 100%;
    transition: all var(--duration-base) var(--ease);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-slow) var(--ease);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

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

.feature-icon {
    width: 54px;
    height: 54px;
    background: var(--primary-pale);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
    transition: all var(--duration-base) var(--ease);
}

.feature-card:hover .feature-icon {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.feature-title {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    font-size: 1rem;
}

.feature-desc {
    font-size: .875rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Workflow Section */
.workflow-section {
    padding: var(--space-3xl) 0;
    background: var(--bg-body);
}

.workflow-step {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-md);
    transition: all var(--duration-base) var(--ease);
    position: relative;
}

.workflow-step:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.step-num {
    min-width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: var(--shadow-primary);
}

.step-title {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.step-desc {
    font-size: .85rem;
    color: var(--gray-600);
}

/* Testimonials */
.testimonials-section {
    padding: var(--space-3xl) 0;
    background: var(--white);
}

.testimonial-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    height: 100%;
    position: relative;
    transition: all var(--duration-base) var(--ease);
}

.testimonial-card:hover {
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    transform: translateY(-3px);
}

.testimonial-card .quote-icon {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: .3;
    line-height: 1;
    margin-bottom: 12px;
}

.testimonial-text {
    font-size: .9rem;
    color: var(--gray-700);
    line-height: 1.75;
    margin-bottom: 20px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.author-name {
    font-weight: 700;
    font-size: .9rem;
    color: var(--gray-900);
}

.author-role {
    font-size: .78rem;
    color: var(--gray-500);
}

.stars {
    color: #F6C90E;
    font-size: .85rem;
    margin-bottom: 12px;
}

/* Pricing */
.pricing-section {
    padding: var(--space-3xl) 0;
    background: var(--bg-body);
}

.pricing-card {
    background: var(--bg-card);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--duration-slow) var(--ease);
    position: relative;
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: var(--shadow-primary), var(--shadow-lg);
    transform: scale(1.03);
}

.popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 4px 18px;
    border-radius: var(--radius-full);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.price-amount {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gray-900);
    line-height: 1;
}

.price-amount sup {
    font-size: 1.2rem;
    vertical-align: top;
    margin-top: 10px;
    display: inline-block;
}

.price-period {
    font-size: .85rem;
    color: var(--gray-500);
}

.price-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .875rem;
    color: var(--gray-700);
    padding: 7px 0;
    border-bottom: 1px solid var(--gray-100);
}

.price-feature i.check {
    color: var(--success);
    font-size: .9rem;
}

.price-feature i.times {
    color: var(--gray-400);
    font-size: .9rem;
}

/* Footer */
.landing-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-brand .logo-mark {
    background: var(--primary);
}

.footer-brand .brand-name {
    color: var(--white);
}

.footer-heading {
    color: var(--white);
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 14px;
}

.footer-link {
    display: block;
    color: var(--gray-500);
    font-size: .85rem;
    padding: 4px 0;
    transition: color var(--duration-fast);
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: var(--space-lg);
    margin-top: var(--space-2xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .08);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    transition: all var(--duration-fast);
}

.social-link:hover {
    background: var(--primary);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
      AUTH PAGES
   ═══════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-left {
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 50%, #ff8a80 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, .07);
    border-radius: 50%;
    top: -200px;
    left: -200px;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, .05);
    border-radius: 50%;
    bottom: -100px;
    right: -100px;
}

.auth-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

.auth-left-content .logo-mark {
    background: rgba(255, 255, 255, .2);
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}

.auth-left h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.auth-left p {
    opacity: .85;
    line-height: 1.7;
    font-size: .95rem;
    max-width: 360px;
    margin: 0 auto;
}

.auth-feature-list {
    margin-top: 32px;
    text-align: left;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .9);
    font-size: .875rem;
    padding: 6px 0;
}

.auth-feature-item i {
    font-size: .9rem;
    color: rgba(255, 255, 255, .75);
}

.auth-right {
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.auth-form-wrap h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.7rem;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.auth-form-wrap .subtitle {
    color: var(--gray-500);
    font-size: .9rem;
    margin-bottom: 28px;
}

.divider-text {
    text-align: center;
    position: relative;
    color: var(--gray-400);
    font-size: .82rem;
    margin: 20px 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 20px);
    height: 1px;
    background: var(--gray-200);
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
}

.oauth-btn {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-200);
    font-family: var(--font-primary);
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--duration-fast);
    cursor: pointer;
}

.oauth-btn:hover {
    border-color: var(--primary);
    background: var(--primary-pale);
    color: var(--primary);
}

.input-group-modern {
    position: relative;
}

.input-group-modern .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: .9rem;
    pointer-events: none;
}

.input-group-modern .form-control-modern {
    padding-left: 36px;
}

.input-group-modern .toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    cursor: pointer;
    font-size: .9rem;
    transition: color var(--duration-fast);
}

.input-group-modern .toggle-pass:hover {
    color: var(--primary);
}

.strength-meter {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.strength-meter .seg {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    transition: background .3s;
}

.strength-meter.s1 .seg:nth-child(1) {
    background: var(--danger);
}

.strength-meter.s2 .seg:nth-child(-n+2) {
    background: var(--warning);
}

.strength-meter.s3 .seg:nth-child(-n+3) {
    background: var(--info);
}

.strength-meter.s4 .seg {
    background: var(--success);
}

/* ═══════════════════════════════════════════════════════════
      APP LAYOUT (Dashboard, Modules)
   ═══════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — white surface; red is reserved for hover / active states */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 900;
    transition: width var(--duration-slow) var(--ease),
        transform var(--duration-slow) var(--ease),
        box-shadow var(--duration-slow) var(--ease);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 18px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-header .brand-name {
    color: var(--gray-900);
    white-space: nowrap;
    transition: opacity .3s, width .3s;
}

.sidebar.collapsed .sidebar-header .brand-name {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--gray-600);
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast), color var(--duration-fast);
}

.sidebar-close:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nav-section-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    padding: 16px 12px 6px;
    white-space: nowrap;
    transition: opacity .3s;
}

/* Collapsed rail: section labels become hairline dividers between icon groups */
.sidebar.collapsed .nav-section-label {
    height: 1px;
    margin: 10px 16px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    background: var(--gray-200);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    color: var(--gray-600);
    font-size: .875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    position: relative;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--duration-fast) var(--ease),
        color var(--duration-fast) var(--ease),
        transform var(--duration-fast) var(--ease);
}

.sidebar-link i {
    font-size: 1.05rem;
    min-width: 20px;
    text-align: center;
    transition: transform var(--duration-base) var(--ease-bounce);
}

.sidebar-link .link-text {
    transition: opacity .3s;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}

.sidebar.collapsed .sidebar-link .link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-link .badge-count {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    transition: opacity .3s;
}

.sidebar.collapsed .badge-count {
    opacity: 0;
}

.sidebar-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.sidebar-link:hover i {
    transform: none;
}

.sidebar-link:active {
    background: rgba(230, 57, 70, .12);
    transform: scale(.98);
}

.sidebar-link:focus-visible {
    outline: none;
    color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.sidebar-link.active {
    background: var(--primary-pale);
    color: var(--primary);
    font-weight: 600;
    transform: none;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar.collapsed .sidebar-link.active::before {
    left: -10px;
}

.sidebar-footer {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
}

.sidebar-user:hover {
    background: var(--gray-100);
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    transition: opacity .3s;
    min-width: 0;
}

.sidebar-user-info .name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info .role {
    font-size: .7rem;
    color: var(--gray-500);
}

.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Mobile drawer backdrop + bottom navigation (both hidden on desktop) */
.sidebar-backdrop,
.bottom-nav {
    display: none;
}

.sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border: 1.5px solid var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: var(--gray-600);
    cursor: pointer;
    z-index: 10;
    transition: all var(--duration-fast);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--duration-slow) var(--ease);
    min-width: 0;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    gap: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 800;
    box-shadow: none;
}

.topbar-search {
    flex: 1;
    max-width: 380px;
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0 12px;
    gap: 8px;
    transition: all var(--duration-fast);
}

.topbar-search:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.topbar-search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: .875rem;
    color: var(--gray-900);
    font-family: var(--font-primary);
    padding: 9px 0;
}

.topbar-search i {
    color: var(--gray-400);
    font-size: .9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: .95rem;
    background: transparent;
    position: relative;
    transition: all var(--duration-fast);
    cursor: pointer;
}

.topbar-icon-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.user-chip:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.user-chip .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-chip .name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Page Content Area */
.page-area {
    padding: 28px 32px 40px;
    flex: 1;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.page-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--gray-900);
}

.breadcrumb-modern {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.breadcrumb-modern a {
    color: var(--gray-500);
    transition: color var(--duration-fast);
}

.breadcrumb-modern a:hover {
    color: var(--primary);
}

.breadcrumb-sep {
    color: var(--gray-400);
}

/* Chart Container */
.chart-container {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════
      UPLOAD MODULE
   ═══════════════════════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    transition: all var(--duration-base) var(--ease);
    cursor: pointer;
    background: var(--gray-50);
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-pale);
}

.upload-zone.drag-over {
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-pale);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: 2rem;
    color: var(--primary);
    transition: all var(--duration-base) var(--ease-bounce);
}

.upload-zone:hover .upload-icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
    box-shadow: var(--shadow-primary);
}

.file-type-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.file-chip {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    padding: 3px 12px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.upload-queue {
    margin-top: var(--space-lg);
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    transition: all var(--duration-fast);
}

.queue-item:hover {
    border-color: var(--primary);
}

.file-icon-wrap {
    width: 40px;
    height: 40px;
    background: var(--primary-pale);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: .875rem;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: .75rem;
    color: var(--gray-500);
}

.progress-slim {
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 5px;
}

.progress-slim .bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width .4s var(--ease);
    position: relative;
}

.progress-slim .bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6));
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0
    }

    50% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

/* OCR Processing */
.ocr-processing-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.ocr-header {
    background: linear-gradient(135deg, var(--gray-900), #2d333d);
    padding: var(--space-lg);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ai-badge {
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    animation: glow 2s infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(230, 57, 70, .4);
    }

    50% {
        box-shadow: 0 0 12px rgba(230, 57, 70, .7);
    }
}

.ocr-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.ocr-left {
    padding: var(--space-lg);
    border-right: 1px solid var(--gray-200);
}

.ocr-right {
    padding: var(--space-lg);
}

.invoice-preview-frame {
    background: var(--gray-100);
    border-radius: var(--radius-md);
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 2.5s ease-in-out infinite;
    box-shadow: 0 0 8px var(--primary);
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

.extracted-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    margin-bottom: 8px;
    transition: all var(--duration-fast);
}

.extracted-field:hover {
    border-color: var(--primary);
    background: var(--primary-pale);
}

.field-key {
    font-size: .72rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
    min-width: 90px;
}

.field-value {
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.field-conf {
    font-size: .7rem;
    color: var(--gray-400);
    margin-top: 2px;
}

.validation-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border-left: 3px solid;
    font-size: .83rem;
}

.alert-warning-mod {
    background: var(--warning-pale);
    border-color: var(--warning);
    color: #7a5400;
}

.alert-danger-mod {
    background: var(--danger-pale);
    border-color: var(--danger);
    color: #7a1c14;
}

.alert-success-mod {
    background: var(--success-pale);
    border-color: var(--success);
    color: #145a32;
}

/* ═══════════════════════════════════════════════════════════
      INVOICE TABLE
   ═══════════════════════════════════════════════════════════ */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    transition: all var(--duration-fast);
}

.table-search:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.table-search input {
    border: none;
    background: none;
    outline: none;
    font-size: .85rem;
    width: 200px;
    font-family: var(--font-primary);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: .8rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.filter-chip:hover,
.filter-chip.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-pale);
}

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

.data-table thead th {
    background: var(--gray-50);
    padding: 11px 16px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-table thead th:hover {
    color: var(--gray-800);
    background: var(--gray-100);
}

.data-table thead th.sorted {
    color: var(--primary);
}

.data-table thead th i.sort-icon {
    font-size: .7rem;
    margin-left: 4px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--duration-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr.selected {
    background: var(--primary-pale);
}

.data-table td {
    padding: 13px 16px;
    font-size: .86rem;
    color: var(--gray-800);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.data-table .checkbox-col {
    width: 44px;
}

.data-table input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
}

.vendor-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vendor-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-pale);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.vendor-name {
    font-weight: 600;
    color: var(--gray-900);
}

.vendor-id {
    font-size: .73rem;
    color: var(--gray-400);
}

.amount-cell {
    font-family: var(--font-display);
    font-weight: 700;
}

.action-btns {
    display: flex;
    gap: 4px;
}

.action-btns .btn {
    padding: 5px 8px;
    font-size: .78rem;
}

.inline-edit-input {
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: .85rem;
    font-family: var(--font-primary);
    outline: none;
    background: var(--primary-pale);
    width: 100%;
}

.pagination-modern {
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.page-info {
    font-size: .8rem;
    color: var(--gray-500);
}

.page-btns {
    display: flex;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-pale);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sticky-header {
    /* position: sticky; */
    top: var(--topbar-height);
    z-index: 100;
}

/* ═══════════════════════════════════════════════════════════
      VENDOR MODULE
   ═══════════════════════════════════════════════════════════ */
.vendor-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    height: 100%;
    transition: all var(--duration-base) var(--ease);
    position: relative;
}

.vendor-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.vendor-logo-wrap {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
}

.vendor-verified {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--success-pale);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, .2);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vendor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.vendor-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    color: var(--gray-500);
}

.vendor-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.vendor-stat-mini {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 10px;
}

.vendor-stat-mini .val {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-900);
}

.vendor-stat-mini .lbl {
    font-size: .72rem;
    color: var(--gray-500);
}

/* ═══════════════════════════════════════════════════════════
      REPORTS & ANALYTICS
   ═══════════════════════════════════════════════════════════ */
.report-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    font-size: .85rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.date-range-picker:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
      SETTINGS PAGE
   ═══════════════════════════════════════════════════════════ */
.settings-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 12px;
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.settings-nav-item:hover,
.settings-nav-item.active {
    background: var(--primary-pale);
    color: var(--primary);
}

.settings-nav-item i {
    font-size: .95rem;
    width: 18px;
    text-align: center;
}

.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.settings-section-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-track {
    width: 42px;
    height: 24px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    position: relative;
    transition: background .3s;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: left .3s var(--ease-bounce);
}

.toggle-switch input:checked+.toggle-track {
    background: var(--primary);
}

.toggle-switch input:checked+.toggle-track::after {
    left: 21px;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .2s, border-color .2s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--gray-900);
}

.api-key-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    margin-bottom: 10px;
}

.api-key-row code {
    flex: 1;
    color: var(--gray-700);
    letter-spacing: .05em;
}

.integration-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    transition: all var(--duration-fast);
}

.integration-card:hover {
    border-color: var(--primary);
    background: var(--primary-pale);
}

.integration-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
      AI CHATBOT
   ═══════════════════════════════════════════════════════════ */
.chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: var(--shadow-primary), 0 0 0 4px rgba(230, 57, 70, .15);
    cursor: pointer;
    z-index: 9999;
    transition: all var(--duration-base) var(--ease-bounce);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.chatbot-bubble:hover {
    transform: scale(1.12) !important;
    box-shadow: 0 12px 36px rgba(230, 57, 70, .45);
    animation: none;
}

.chatbot-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 340px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    max-height: 480px;
}

.chatbot-panel.open {
    display: flex;
    animation: slideUp .3s var(--ease-bounce);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, .2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: var(--radius-lg);
    font-size: .85rem;
    line-height: 1.5;
}

.chat-msg.bot {
    background: var(--gray-100);
    color: var(--gray-800);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-row {
    padding: 12px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: .85rem;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color var(--duration-fast);
}

.chat-input:focus {
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
      NOTIFICATIONS DRAWER
   ═══════════════════════════════════════════════════════════ */
.notif-drawer {
    position: fixed;
    top: 0;
    right: -380px;
    bottom: 0;
    width: 360px;
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right var(--duration-slow) var(--ease);
    border-left: 1px solid var(--gray-200);
}

.notif-drawer.open {
    right: 0;
}

.notif-drawer-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--duration-fast);
    cursor: pointer;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item.unread {
    background: var(--primary-pale);
}

.notif-item-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

.notif-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-900);
}

.notif-text {
    font-size: .78rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.notif-time {
    font-size: .7rem;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
      MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-modern .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-modern .modal-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--gray-200);
    padding: 18px 24px;
}

.modal-modern .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-900);
}

.modal-modern .modal-body {
    padding: 24px;
}

.modal-modern .modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 16px 24px;
}

.modal-modern .btn-close:focus {
    box-shadow: none;
}

/* ── Form modal: sectioned, sticky header/footer ──────────────
   Markup: .modal.fmodal > .modal-dialog.modal-dialog-scrollable
   header: .fm-icon + .fm-heading(.modal-title, .fm-sub)
   body:   .fm-section > .fm-section-head(.fm-chip, .fm-section-title, .fm-section-hint, actions) + fields */
.fmodal .modal-content { background: var(--bg-body); border: 1px solid var(--gray-200); }
/* A <form> wrapping body + footer must pass the scrollable-dialog flex layout through. */
.fmodal .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.fmodal .modal-body > :empty, .fmodal .fm-ref:empty { display: none; }
.fmodal .modal-header { gap: 14px; align-items: center; padding: 18px 22px; background: var(--bg-card); }
.fmodal .fm-icon {
    flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.15rem; color: var(--primary);
    background: linear-gradient(145deg, var(--primary-pale), color-mix(in srgb, var(--primary) 16%, var(--bg-card)));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}
.fmodal .fm-heading { min-width: 0; flex: 1; }
.fmodal .modal-title { font-family: var(--font-display); font-size: 1.08rem; letter-spacing: -.01em; line-height: 1.25; margin: 0; }
.fmodal .modal-title .fm-ref {
    margin-left: 6px; padding: 2px 9px; border-radius: 999px; vertical-align: 2px;
    font-family: var(--font-primary); font-size: .74rem; font-weight: 600;
    background: var(--primary-pale); color: var(--primary);
}
.fmodal .fm-sub { margin-top: 2px; font-size: .8rem; color: var(--gray-500); line-height: 1.4; }
.fmodal .btn-close {
    flex: none; align-self: flex-start; width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 10px;
    background-size: 11px; opacity: .55; transition: background-color var(--duration-fast) var(--ease), opacity var(--duration-fast) var(--ease);
}
.fmodal .btn-close:hover { opacity: 1; background-color: var(--gray-100); }
[data-theme="dark"] .fmodal .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

.fmodal .modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.fmodal .modal-footer {
    justify-content: space-between; gap: 10px; padding: 14px 22px; background: var(--bg-card);
    box-shadow: 0 -8px 20px -16px rgba(16, 24, 40, .25);
}
.fmodal .modal-footer > * { margin: 0; }
.fmodal .fm-footer-note { font-size: .76rem; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.fmodal .fm-footer-note kbd {
    padding: 1px 6px; border-radius: 5px; font-size: .7rem; font-family: var(--font-primary);
    background: var(--gray-100); color: var(--gray-700); box-shadow: inset 0 -1px 0 var(--gray-300);
}
.fmodal .fm-footer-actions { display: flex; gap: 8px; margin-left: auto; }
.fmodal .modal-footer .btn { min-width: 104px; justify-content: center; }

/* Intro callout (e.g. "doesn't use your scan quota"). */
.fm-callout {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-lg);
    background: var(--info-pale); color: var(--gray-700); font-size: .82rem; line-height: 1.5;
    border: 1px solid color-mix(in srgb, var(--info) 18%, transparent);
}
.fm-callout > i { color: var(--info); font-size: 1rem; line-height: 1.3; }
.fm-callout strong { color: var(--gray-900); }

/* Section card. */
.fm-section {
    background: var(--bg-card); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    padding: 16px 18px 18px; box-shadow: var(--shadow-xs);
}
.fm-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fm-chip {
    flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
    font-size: .88rem; background: var(--gray-100); color: var(--gray-700);
}
.fm-chip.is-green { background: var(--success-pale); color: var(--success); }
.fm-chip.is-blue { background: var(--info-pale); color: var(--info); }
.fm-chip.is-amber { background: var(--warning-pale); color: var(--warning); }
.fm-chip.is-red { background: var(--primary-pale); color: var(--primary); }
.fm-section-title { font-family: var(--font-display); font-weight: 700; font-size: .92rem; color: var(--gray-900); line-height: 1.2; }
.fm-section-hint { font-size: .74rem; color: var(--gray-500); margin-top: 1px; }
.fm-section-head > .btn, .fm-section-head > .fm-head-actions { margin-left: auto; flex: none; }

/* Fields. */
.fmodal .form-label {
    display: flex; align-items: center; gap: 4px; margin-bottom: 6px;
    font-size: .76rem; font-weight: 600; color: var(--gray-700); letter-spacing: .01em;
}
.fmodal .form-label .req { color: var(--primary); font-weight: 700; }
.fmodal .form-label .fm-opt { margin-left: auto; font-weight: 500; color: var(--gray-400); font-size: .7rem; }
.fmodal .form-control, .fmodal .form-select { min-height: 40px; font-size: .88rem; padding-top: 8px; padding-bottom: 8px; }
.fmodal textarea.form-control { min-height: 76px; resize: vertical; }
.fmodal .form-control:focus, .fmodal .form-select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow);
}
.fmodal .form-control[readonly] { background: var(--gray-50); color: var(--gray-700); box-shadow: none; cursor: default; }
.fmodal .form-control[readonly]:focus { border-color: var(--gray-300); box-shadow: none; }
.fmodal .form-text { font-size: .72rem; color: var(--gray-500); margin-top: 5px; }
.fmodal input[type="date"].form-control { font-variant-numeric: tabular-nums; }
.fmodal input[type="number"] { font-variant-numeric: tabular-nums; }

/* Amount with currency affix. */
.fm-affix { position: relative; }
.fm-affix > .fm-affix-label {
    position: absolute; left: 1px; top: 1px; bottom: 1px; min-width: 46px; padding: 0 10px;
    display: grid; place-items: center; border-right: 1px solid var(--gray-200);
    border-radius: calc(var(--radius-md) - 1px) 0 0 calc(var(--radius-md) - 1px);
    background: var(--gray-50); color: var(--gray-500); font-size: .74rem; font-weight: 600; pointer-events: none;
}
.fm-affix > .form-control { padding-left: 58px; }
.fm-affix.is-lg > .form-control { font-size: 1rem; font-weight: 600; color: var(--gray-900); }

/* Segmented choice driven by a visually hidden <select> (keeps form.<name> a select). */
.fm-seg { display: grid; grid-template-columns: repeat(var(--fm-seg-cols, 3), minmax(0, 1fr)); gap: 8px; }
.fm-seg-btn {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 9px 12px; text-align: left;
    border: 1px solid var(--gray-300); border-radius: var(--radius-md); background: var(--bg-card);
    color: var(--gray-700); box-shadow: var(--shadow-xs); cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease), background-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.fm-seg-btn:hover { border-color: var(--gray-400); }
.fm-seg-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.fm-seg-btn > i { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--gray-100); font-size: .95rem; }
.fm-seg-btn b { display: block; font-size: .84rem; font-weight: 600; color: var(--gray-900); line-height: 1.2; }
.fm-seg-btn small { display: block; font-size: .7rem; color: var(--gray-500); line-height: 1.25; }
.fm-seg-btn[aria-checked="true"] { border-color: var(--primary); background: var(--primary-pale); box-shadow: 0 0 0 1px var(--primary); }
.fm-seg-btn[aria-checked="true"] > i { background: var(--primary); color: #fff; }
.fm-seg-btn.is-earned[aria-checked="true"] { border-color: var(--success); background: var(--success-pale); box-shadow: 0 0 0 1px var(--success); }
.fm-seg-btn.is-earned[aria-checked="true"] > i { background: var(--success); }
.fm-seg-btn.is-spent > i { color: var(--danger); }
.fm-seg-btn.is-earned > i { color: var(--success); }
.fm-seg-btn[aria-checked="true"] > i { color: #fff; }

/* Toggle row (checkbox as switch + label + trailing field). */
.fm-toggle-row {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px;
    border: 1px solid var(--gray-300); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-xs);
}
.fm-toggle-row .form-check-input { margin: 0; width: 2.1em; height: 1.15em; cursor: pointer; }
.fm-toggle-row .form-check-input:checked { background-color: var(--warning); border-color: var(--warning); }
.fm-toggle-row .form-control { border: 0; box-shadow: none; min-height: 36px; padding-left: 0; background: transparent; }
.fm-toggle-row .form-control:focus { box-shadow: none; }
.fm-toggle-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }

/* Drop zone around a real file input (the input covers the zone so drag & drop works). */
.fm-drop {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    border: 1.5px dashed var(--gray-300); border-radius: var(--radius-lg); background: var(--gray-50);
    transition: border-color var(--duration-fast) var(--ease), background-color var(--duration-fast) var(--ease);
}
.fm-drop:hover, .fm-drop.is-over { border-color: var(--primary); background: var(--primary-pale); }
.fm-drop:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.fm-drop > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fm-drop-icon {
    flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    background: var(--bg-card); color: var(--primary); font-size: 1.15rem; box-shadow: var(--shadow-xs);
}
.fm-drop-title { font-size: .86rem; font-weight: 600; color: var(--gray-900); overflow-wrap: anywhere; }
.fm-drop-title span { color: var(--primary); }
.fm-drop-hint { font-size: .74rem; color: var(--gray-500); }
.fm-drop.has-file { border-style: solid; border-color: var(--success); background: var(--success-pale); }
.fm-drop.has-file .fm-drop-icon { color: var(--success); }

/* Tax breakdown rows. */
.fm-tax-rows { display: flex; flex-direction: column; gap: 8px; }
.fm-tax-rows:empty::before {
    content: attr(data-empty); display: block; padding: 14px; text-align: center; font-size: .8rem; color: var(--gray-500);
    border: 1px dashed var(--gray-300); border-radius: var(--radius-md); background: var(--gray-50);
}
.fm-tax-rows .tax-row-line { display: grid; grid-template-columns: minmax(0, 1fr) 160px 40px; gap: 8px; margin: 0; }
.fm-tax-rows .tax-row-line .tax-val { max-width: none !important; }
.fm-tax-rows .tax-del { width: 40px; height: 40px; color: var(--gray-500); }
.fm-tax-rows .tax-del:hover { color: var(--danger); background: var(--danger-pale); }

@media (max-width: 575.98px) {
    .fmodal .modal-header, .fmodal .modal-body, .fmodal .modal-footer { padding-left: 16px; padding-right: 16px; }
    .fm-section { padding: 14px 14px 16px; }
    .fm-seg { grid-template-columns: 1fr; }
    .fm-seg-btn { min-height: 46px; }
    .fmodal .fm-footer-note { display: none; }
    .fmodal .fm-footer-actions { width: 100%; }
    .fmodal .fm-footer-actions .btn { flex: 1; }
    .fm-tax-rows .tax-row-line { grid-template-columns: minmax(0, 1fr) 110px 40px; }
}

/* ═══════════════════════════════════════════════════════════
      ACTIVITY LOG
   ═══════════════════════════════════════════════════════════ */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.activity-line {
    font-size: .83rem;
    color: var(--gray-700);
}

.activity-line strong {
    font-weight: 600;
    color: var(--gray-900);
}

.activity-time {
    font-size: .72rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* Overlay */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    backdrop-filter: blur(3px);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base);
}

.drawer-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════
      TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-container-custom {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast-modern {
    background: var(--gray-900);
    color: #fff;
    padding: 11px 20px;
    border-radius: var(--radius-lg);
    font-size: .85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xl);
    animation: toastIn .35s var(--ease-bounce);
    white-space: nowrap;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.9);
    }
}

.toast-modern.success i {
    color: var(--success);
}

.toast-modern.error i {
    color: var(--primary);
}

.toast-modern.info i {
    color: var(--info);
}

/* ═══════════════════════════════════════════════════════════
      RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    :root {
        --topbar-height: 60px;
    }

    /* Sidebar becomes an off-canvas drawer */
    .sidebar,
    .sidebar.collapsed {
        width: min(300px, 86vw);
        z-index: 1050;
        transform: translateX(-100%);
        visibility: hidden;
        box-shadow: none;
        transition: transform var(--duration-slow) var(--ease),
            box-shadow var(--duration-slow) var(--ease),
            visibility 0s linear var(--duration-slow);
    }

    .sidebar.mobile-open {
        transform: none;
        visibility: visible;
        box-shadow: var(--shadow-xl);
        transition-delay: 0s;
    }

    .sidebar.collapsed .sidebar-header .brand-name,
    .sidebar.collapsed .sidebar-link .link-text,
    .sidebar.collapsed .sidebar-user-info,
    .sidebar.collapsed .badge-count {
        opacity: 1;
        width: auto;
    }

    .sidebar.collapsed .nav-section-label {
        height: auto;
        margin: 0;
        padding: 16px 12px 6px;
        overflow: visible;
        font-size: .66rem;
        background: none;
    }

    .sidebar.collapsed .sidebar-link {
        justify-content: flex-start;
        padding: 10px 12px;
        gap: 12px;
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-link {
        padding: 12px;
        font-size: .92rem;
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0;
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1045;
        background: rgba(17, 20, 26, .45);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration-base) var(--ease);
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 850;
        align-items: flex-end;
        justify-content: space-around;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: var(--bg-card);
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .06);
    }

    .bn-item {
        flex: 1;
        max-width: 92px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 4px;
        border: 0;
        border-radius: var(--radius-md);
        background: none;
        color: var(--gray-500);
        font-family: var(--font-primary);
        font-size: .66rem;
        font-weight: 600;
        line-height: 1.1;
        -webkit-tap-highlight-color: transparent;
        transition: color var(--duration-fast) var(--ease),
            background var(--duration-fast) var(--ease),
            transform var(--duration-fast) var(--ease);
    }

    .bn-item i {
        font-size: 1.25rem;
        line-height: 1;
        transition: transform var(--duration-base) var(--ease-bounce);
    }

    .bn-item:hover,
    .bn-item.active {
        color: var(--primary);
    }

    .bn-item.active i {
        transform: translateY(-1px);
    }

    .bn-item:active {
        transform: scale(.94);
        background: rgba(230, 57, 70, .08);
    }

    .bn-fab {
        width: 50px;
        height: 50px;
        margin-top: -24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary);
        color: #fff;
        border: 4px solid var(--bg-card);
        box-shadow: var(--shadow-primary);
    }

    .bn-fab i {
        font-size: 1.3rem;
    }

    .bn-item.bn-primary,
    .bn-item.bn-primary:hover {
        color: var(--primary);
    }

    .toast-container-custom {
        bottom: calc(84px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 24px);
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        padding: var(--space-xl) var(--space-lg);
    }

    .ocr-body {
        grid-template-columns: 1fr;
    }

    .ocr-left {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }

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

    .hero-section {
        padding: 60px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    .page-area {
        padding: 16px 14px 24px;
    }

    .page-header {
        margin-bottom: 16px;
        gap: 10px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    /* 16px stops iOS from zooming the page when a field is focused */
    .form-control,
    .form-select,
    .form-control-modern,
    .table-search input,
    .topbar-search input {
        font-size: 16px;
    }

    .btn {
        padding: 10px 18px;
    }

    .btn-sm {
        padding: 8px 14px;
    }

    .table-toolbar {
        padding: 12px 14px;
    }

    .pagination-modern {
        padding: 12px 14px;
        justify-content: center;
    }

    .table-card {
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 575.98px) {
    .page-area {
        padding: 16px 14px 24px;
    }

    .topbar {
        padding: 0 var(--space-md);
    }

    .topbar-search {
        display: none;
    }

    .chatbot-panel {
        width: calc(100vw - 32px);
        right: 16px;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── AOS Override ────────────────────────────────────────── */
[data-aos] {
    transition-timing-function: var(--ease) !important;
}

/* ── Loading Spinner ─────────────────────────────────────── */
.spinner-primary {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(230, 57, 70, .2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

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

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 14px;
    display: block;
}

.empty-state p {
    font-size: .9rem;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {

    /* App chrome never prints: the mobile bottom nav would otherwise show up
       as a footer on every page, and fixed buttons / toasts over the content. */
    .sidebar,
    .sidebar-backdrop,
    .topbar,
    .bottom-nav,
    .chat-launcher,
    .chatbot-bubble,
    .chatbot-panel,
    #pageLoader,
    #toastContainer {
        display: none !important;
    }

    /* Entrance animations start at opacity 0; a block that is hidden on
       screen (.print-only) never runs its animation, so it would print blank. */
    .page-area > *,
    .page-area > * * {
        animation: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-area {
        padding: 0;
    }
}

/* ── Dashboard form system ──────────────────────────────────
   Shared sectioned-card form pattern (used by company/sub-vendor/
   account edit forms) so every settings-style form in the app looks
   and behaves the same way. */
.dsf-wrap { max-width: 960px; --dsf-sel: rgba(230, 57, 70, .08); }

.dsf-card {
    background: var(--bg-card); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}

.dsf-section { padding: 22px 24px; border-bottom: 1px solid var(--gray-200); }
.dsf-body { padding: 24px; }

@media (max-width: 575.98px) { .dsf-section, .dsf-body { padding: 18px 16px; } }

.dsf-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

.dsf-sico {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: var(--dsf-sel); color: var(--primary); font-size: 1rem;
}

.dsf-section-title { font-family: var(--font-display); font-weight: 700; font-size: .98rem; color: var(--gray-900); line-height: 1.2; }
.dsf-section-desc { font-size: .76rem; color: var(--gray-500); margin-top: 1px; }

.dsf-footer {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 16px 24px; background: var(--gray-50); border-top: 1px solid var(--gray-200);
}

@media (max-width: 575.98px) { .dsf-footer { padding: 14px 16px; } }

.dsf-req-note { font-size: .76rem; color: var(--gray-500); }
.dsf-req-note b { color: var(--primary); }

.dsf-label { display: block; font-size: .78rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.dsf-label .req { color: var(--primary); }
.dsf-field { position: relative; }

.dsf-field > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray-500); font-size: .95rem; pointer-events: none; transition: color var(--duration-fast);
}

.dsf-field.is-area > i { top: 15px; transform: none; }
.dsf-field:focus-within > i { color: var(--primary); }

.dsf-input {
    width: 100%; padding: 10px 14px 10px 40px; font-family: var(--font-primary); font-size: .875rem;
    color: var(--gray-900); background: var(--bg-card); border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md); outline: none;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

textarea.dsf-input { resize: vertical; min-height: 78px; }
.dsf-input::placeholder { color: var(--gray-500); text-transform: none; }
.dsf-input:hover { border-color: var(--gray-400); }
.dsf-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.dsf-input.is-invalid { border-color: var(--danger); }
.dsf-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(231, 76, 60, .18); }
.dsf-upper { text-transform: uppercase; }
.dsf-hint { font-size: .72rem; color: var(--gray-500); margin-top: 5px; }
.dsf-error { font-size: .76rem; color: var(--danger); margin-top: 5px; }

.dsf-logo { display: flex; align-items: center; gap: 16px; }

.dsf-logo-preview {
    width: 72px; height: 72px; flex: 0 0 72px; border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300); background: var(--gray-50); color: var(--gray-400);
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; overflow: hidden;
}

.dsf-logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.dsf-alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin-bottom: var(--space-lg);
    background: var(--danger-pale); border: 1px solid rgba(231, 76, 60, .3);
    border-radius: var(--radius-md); color: #922b21; font-size: .85rem;
}

.dsf-alert ul { margin: 0; padding-left: 18px; list-style: disc; }

.dsf-note {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; margin-bottom: 18px;
    background: var(--info-pale); border: 1px solid rgba(52, 152, 219, .28);
    border-radius: var(--radius-md); color: #1f5f8b; font-size: .8rem; line-height: 1.5;
}

.dsf-note i { margin-top: 2px; }

/* Company access & permissions matrix (sub-vendor create/edit) */
.dsf-matrix-wrap { overflow-x: auto; }

.dsf-matrix { width: 100%; border-collapse: collapse; font-size: .82rem; }
.dsf-matrix th { padding: 8px 10px; text-align: center; font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); }
.dsf-matrix th:first-child { text-align: left; }
.dsf-matrix td { padding: 10px; text-align: center; border-bottom: 1px solid var(--gray-200); }
.dsf-matrix tr:last-child td { border-bottom: 0; }
.dsf-matrix td:first-child { text-align: left; font-weight: 600; color: var(--gray-900); }
.dsf-matrix input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
      POLISH LAYER — focus, numbers, motion (shared by all pages)
   ═══════════════════════════════════════════════════════════ */

/* Visible, consistent keyboard focus everywhere (mouse clicks stay clean). */
:where(a, button, .btn, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 70%, transparent);
    outline-offset: 2px;
    border-radius: 8px;
}
.btn:focus-visible { box-shadow: 0 0 0 4px var(--primary-glow); }

/* Headings: display face, tight tracking (colour stays with each page). */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* Money & counts line up in columns. */
.value, .stat-value, .kpi-value, .amount, .money, td .amount { font-variant-numeric: tabular-nums; }

.text-muted { color: var(--gray-500) !important; }
::selection { background: color-mix(in srgb, var(--primary) 18%, transparent); }

/* Inputs share one calm look (Bootstrap + custom). */
.form-control, .form-select {
    border-color: var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-900);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.form-control:hover, .form-select:hover, .form-control-modern:hover { border-color: var(--gray-400); }
.form-control::placeholder, .form-control-modern::placeholder { color: var(--gray-400); }

/* Modals & dropdowns: soft depth, rounded. */
.modal-content { border: 1px solid var(--gray-200); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); }
.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    animation: pop-in .14s var(--ease);
    transform-origin: top left;
}
.dropdown-menu-end { transform-origin: top right; }
.dropdown-menu[data-popper-placement^="top"] { transform-origin: bottom left; animation-name: pop-in-up; }
.dropdown-menu-end[data-popper-placement^="top"] { transform-origin: bottom right; }
.dropdown-item { border-radius: 8px; padding: 7px 10px; font-size: .86rem; }

/* Page content eases in; cards follow in a short stagger. */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Uses the standalone translate/scale properties, not `transform`: Popper positions
   dropdown menus with an inline transform, which an animated `transform` would
   override — the menu would flash at the top of the page, then jump into place. */
@keyframes pop-in { from { opacity: 0; translate: 0 -4px; scale: .98; } to { opacity: 1; translate: none; scale: none; } }
@keyframes pop-in-up { from { opacity: 0; translate: 0 4px; scale: .98; } to { opacity: 1; translate: none; scale: none; } }
.page-area > * { animation: page-in .35s var(--ease) both; }
.page-area > *:nth-child(2) { animation-delay: .03s; }
.page-area > *:nth-child(3) { animation-delay: .06s; }
.page-area > *:nth-child(4) { animation-delay: .09s; }
.page-area > *:nth-child(n+5) { animation-delay: .12s; }
/* The entry animation leaves every section in its own stacking context, so a
   dropdown opening out of one section paints under the sections after it.
   Keep the header's menus on top, and lift any section with an open menu. */
.page-area > .page-header { position: relative; z-index: 20; }
.page-area > :has(.dropdown-menu.show):not(.page-header) { position: relative; z-index: 30; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 767.98px) {
    .page-area { padding: 18px 16px 28px; }
    .page-title { font-size: 1.35rem; }
}

/* Dark theme: status text uses the bright semantic tokens (the light-mode
   badge text colours are too dark on dark surfaces). */
[data-theme="dark"] .badge-approved { color: var(--success); }
[data-theme="dark"] .badge-pending { color: var(--warning); }
[data-theme="dark"] .badge-rejected { color: var(--danger); }
[data-theme="dark"] .badge-processing { color: var(--info); }
[data-theme="dark"] .badge-draft { color: var(--gray-600); }
[data-theme="dark"] .manual-badge { color: var(--info) !important; }
[data-theme="dark"] .dupe-badge { color: var(--warning) !important; }
[data-theme="dark"] .dupe-badge[style*="danger"] { color: var(--danger) !important; }
[data-theme="dark"] .trend-up { color: var(--success); }
[data-theme="dark"] .trend-down { color: var(--danger); }
