/* ============================================================
   EMS - Expense Management System
   Design System & Global Styles
   Clean, Light Theme with Liquid Layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
    /* Primary Palette - Brand standard orange gradient */
    --primary-50: #fdf2f0;
    --primary-100: #fbe5e0;
    --primary-200: #f7c2b5;
    --primary-300: #f29a85;
    --primary-400: #ea7155;
    --primary-500: #d45d3a; /* Brand Orange */
    --primary-600: #b84c2a;
    --primary-700: #9c3d20;
    --primary-800: #803017;
    --primary-900: #66240f;
    
    /* Accent - Brand standard green */
    --accent-400: #557c67;
    --accent-500: #3f6050;
    --accent-600: #2b4237; /* Brand Green */
    
    /* Success - Emerald */
    --success-50: #ECFDF5;
    --success-100: #D1FAE5;
    --success-500: #10B981;
    --success-600: #059669;
    --success-700: #047857;
    
    /* Warning - Amber */
    --warning-50: #FFFBEB;
    --warning-100: #FEF3C7;
    --warning-500: #F59E0B;
    --warning-600: #D97706;
    
    /* Danger - Red */
    --danger-50: #FEF2F2;
    --danger-100: #FEE2E2;
    --danger-500: #EF4444;
    --danger-600: #DC2626;
    
    /* Info - Sky */
    --info-50: #F0F9FF;
    --info-100: #E0F2FE;
    --info-500: #0EA5E9;
    --info-600: #0284C7;
    
    /* Neutrals - Slate */
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #355043; /* Brand standard dark-green */
    --slate-900: #2b4237; /* Brand standard green */
    
    /* Surfaces */
    --bg-primary: #FFFFFF;
    --bg-secondary: #e5e9ef;
    --bg-tertiary: #F1F5F9;
    --bg-overlay: rgba(15, 23, 42, 0.5);
    
    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #d45d3a 0%, #2b4237 100%);
    --gradient-primary-hover: linear-gradient(135deg, #b84c2a 0%, #1e3027 100%);
    --gradient-hero: linear-gradient(135deg, #2b4237 0%, #d45d3a 100%);
    --gradient-surface: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    --gradient-shimmer: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 4px 14px rgba(212, 93, 58, 0.25);
    --shadow-primary-lg: 0 8px 25px rgba(212, 93, 58, 0.3);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.9375rem;
    --font-size-lg: 1.0625rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Layout */
    --sidebar-width: 270px;
    --sidebar-collapsed: 72px;
    --header-height: 68px;
    --max-content-width: 1400px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input, select, textarea, button, option,
::-webkit-datetime-edit,
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-year-field,
::-webkit-calendar-picker-indicator {
    font-family: inherit;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--slate-800);
    background-color: #faf9f5; /* Light cream base */
    background-image: 
        /* Clear visible dark-sage dot grid */
        radial-gradient(circle, rgba(43, 66, 55, 0.22) 1.2px, transparent 1.3px),
        /* Pale Green accent top-left */
        radial-gradient(circle at 10% 20%, #dce8e1 0%, rgba(220, 232, 225, 0) 65%),
        /* Pale Orange accent bottom-right */
        radial-gradient(circle at 90% 80%, #f4e0d4 0%, rgba(244, 224, 212, 0) 65%),
        /* Pale Green accent bottom-left */
        radial-gradient(circle at 15% 80%, #e5ede9 0%, rgba(229, 237, 233, 0) 60%),
        /* Pale Orange accent top-right */
        radial-gradient(circle at 85% 20%, #f7e7dd 0%, rgba(247, 231, 221, 0) 60%);
    background-size: 
        24px 24px,
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Global Rich Grain Overlay Effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.06;
    mix-blend-mode: overlay;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted { color: var(--slate-500); }
.text-small { font-size: var(--font-size-sm); }
.text-center { text-align: center; }

/* ============================================================
   BUTTONS (Tactile 3D Keycaps)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 22px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    
    /* Tactile borders and bevels */
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-bottom: 3.5px solid rgba(0, 0, 0, 0.28);
    transition: transform 0.08s cubic-bezier(0.25, 0.8, 0.25, 1), 
                border-bottom-width 0.08s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.08s cubic-bezier(0.25, 0.8, 0.25, 1), 
                background-color 0.2s ease;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-shimmer);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn:active {
    transform: translateY(2.5px);
    border-bottom-width: 1px;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border-color: rgba(212, 93, 58, 0.8);
    border-bottom-color: var(--primary-800);
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.35), 
        0 4px 6px rgba(212, 93, 58, 0.2), 
        0 8px 16px rgba(212, 93, 58, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--primary-600) 0%, var(--primary-700) 100%);
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.4), 
        0 6px 10px rgba(212, 93, 58, 0.25), 
        0 12px 20px rgba(212, 93, 58, 0.15);
    color: white;
}

.btn-primary:active {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(212, 93, 58, 0.1);
}

.btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: var(--slate-700);
    border-color: rgba(203, 213, 225, 0.9);
    border-bottom-color: #94a3b8;
    box-shadow: 
        inset 0 1.5px 0 #ffffff, 
        0 3px 5px rgba(15, 23, 42, 0.04), 
        0 6px 12px rgba(15, 23, 42, 0.02);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: rgba(148, 163, 184, 0.8);
    border-bottom-color: #64748b;
    color: var(--slate-800);
    box-shadow: 
        inset 0 1.5px 0 #ffffff, 
        0 4px 8px rgba(15, 23, 42, 0.06), 
        0 8px 16px rgba(15, 23, 42, 0.03);
}

.btn-secondary:active {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.02);
}

.btn-success {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    color: white;
    border-color: rgba(5, 150, 105, 0.8);
    border-bottom-color: #047857;
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.35), 
        0 4px 6px rgba(16, 185, 129, 0.2), 
        0 8px 16px rgba(16, 185, 129, 0.1);
}

.btn-success:hover {
    background: linear-gradient(180deg, #059669 0%, #047857 100%);
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.4), 
        0 6px 10px rgba(16, 185, 129, 0.25), 
        0 12px 20px rgba(16, 185, 129, 0.15);
    color: white;
}

.btn-success:active {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(16, 185, 129, 0.1);
}

.btn-danger {
    background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border-color: rgba(220, 38, 38, 0.8);
    border-bottom-color: #991b1b;
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.35), 
        0 4px 6px rgba(239, 68, 68, 0.2), 
        0 8px 16px rgba(239, 68, 68, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.4), 
        0 6px 10px rgba(239, 68, 68, 0.25), 
        0 12px 20px rgba(239, 68, 68, 0.15);
    color: white;
}

.btn-danger:active {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(239, 68, 68, 0.1);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--slate-600);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: var(--slate-100);
    color: var(--slate-800);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 32px;
    font-size: var(--font-size-base);
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

.btn:disabled, .btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: var(--space-2);
}

.form-label .required {
    color: var(--danger-500);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--slate-800);
    background: #fbfcfd;
    border: 1px solid #cbd5e1;
    border-top-color: #94a3b8; /* top bezel shadow simulation */
    border-radius: var(--radius-md);
    box-shadow: 
        inset 0 2.5px 5px rgba(15, 23, 42, 0.08), 
        inset 0 1px 1px rgba(0, 0, 0, 0.04), 
        0 1px 0 rgba(255, 255, 255, 0.95);
    transition: all var(--transition-base);
    outline: none;
}

.form-control:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary-500);
    box-shadow: 
        inset 0 1px 2px rgba(212, 93, 58, 0.05),
        0 0 0 4px rgba(212, 93, 58, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.95);
}

.form-control::placeholder {
    color: var(--slate-400);
}

.form-control.is-invalid {
    border-color: var(--danger-500);
    border-top-color: var(--danger-600);
    box-shadow: 
        inset 0 2.5px 5px rgba(239, 68, 68, 0.08), 
        0 1px 0 rgba(255, 255, 255, 0.95);
}

.form-control.is-invalid:focus {
    box-shadow: 
        inset 0 1px 2px rgba(239, 68, 68, 0.05),
        0 0 0 4px rgba(239, 68, 68, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.95);
}

.form-control.is-valid {
    border-color: var(--success-500);
    border-top-color: var(--success-600);
    box-shadow: 
        inset 0 2.5px 5px rgba(16, 185, 129, 0.08), 
        0 1px 0 rgba(255, 255, 255, 0.95);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-text {
    font-size: var(--font-size-xs);
    color: var(--slate-500);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--danger-500);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-error::before {
    content: '⚠';
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-600);
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--slate-300);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-600);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* File Input */
.file-upload-area {
    border: 2px dashed var(--slate-300);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--slate-50);
}

.file-upload-area:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.file-upload-area.dragover {
    border-color: var(--primary-500);
    background: var(--primary-50);
    transform: scale(1.01);
}

.file-upload-area .upload-icon {
    font-size: 2.5rem;
    color: var(--slate-400);
    margin-bottom: var(--space-3);
}

.file-upload-area .upload-text {
    font-size: var(--font-size-sm);
    color: var(--slate-600);
}

.file-upload-area .upload-text strong {
    color: var(--primary-600);
}

/* ============================================================
   CARDS (Tactile Skeuomorphic Panels)
   ============================================================ */
.card {
    background: linear-gradient(180deg, #fbfcfd 0%, #f1f5f9 100%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 15px 35px rgba(15, 23, 42, 0.08),
        0 5px 15px rgba(0, 0, 0, 0.03),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(15, 23, 42, 0.05);
    transition: all var(--transition-base);
    overflow: hidden;
    position: relative;
}

.card:hover {
    box-shadow: 
        0 20px 45px rgba(15, 23, 42, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.04),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(15, 23, 42, 0.05);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    background: rgba(255, 255, 255, 0.2);
}

.card-header h3,
.card-header h4 {
    font-size: var(--font-size-lg);
    font-weight: 750;
    letter-spacing: -0.01em;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    background: rgba(15, 23, 42, 0.02);
}

/* Glass Card */
.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 20px 40px rgba(31, 38, 135, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Stat Cards */
.stat-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, #fbfcfd 0%, #f1f5f9 100%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 10px 25px rgba(15, 23, 42, 0.05),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(15, 23, 42, 0.03);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 35px rgba(15, 23, 42, 0.08),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(15, 23, 42, 0.03);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: var(--space-4);
}

.stat-card .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: var(--font-size-sm);
    color: var(--slate-500);
    font-weight: 500;
    margin-top: var(--space-1);
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: var(--space-3);
}

.stat-change.positive {
    background: var(--success-50);
    color: var(--success-700);
}

.stat-change.negative {
    background: var(--danger-50);
    color: var(--danger-600);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary-700);
}

.badge-success {
    background: var(--success-50);
    color: var(--success-700);
}

.badge-warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.badge-danger {
    background: var(--danger-50);
    color: var(--danger-600);
}

.badge-info {
    background: var(--info-50);
    color: var(--info-600);
}

.badge-secondary {
    background: var(--slate-100);
    color: var(--slate-600);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 14px 18px;
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    background: var(--slate-50);
    border-bottom: 2px solid var(--slate-200);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 18px;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--primary-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Sortable headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--primary-600);
}

/* ============================================================
   NAVIGATION - Admin Sidebar
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #fbfcfd 0%, #f1f5f9 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
    box-shadow: 
        1px 0 0 rgba(255, 255, 255, 0.95),
        5px 0 25px rgba(15, 23, 42, 0.05);
}

.sidebar-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--slate-500);
    letter-spacing: 0;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-400);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-3);
    border-radius: var(--radius-md);
    color: var(--slate-600);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--slate-50);
    color: var(--slate-900);
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger-500);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--slate-100);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--font-size-xs);
    color: var(--slate-500);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-header {
    padding: var(--space-5) var(--space-8);
    background: white;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-xs);
}

.content-header .page-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.content-header .breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--slate-500);
}

.content-header .breadcrumbs a {
    color: var(--slate-500);
}

.content-header .breadcrumbs a:hover {
    color: var(--primary-600);
}

.content-header .breadcrumbs .separator {
    color: var(--slate-300);
}

.content-body {
    padding: var(--space-8);
    flex: 1;
}

/* ============================================================
   MULTI-STEP FORM (Progress Steps)
   ============================================================ */
.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    margin-bottom: var(--space-8);
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    border: 1px solid #cbd5e1;
    color: var(--slate-500);
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    box-shadow: 
        inset 0 1.5px 0 #ffffff,
        0 2px 4px rgba(15, 23, 42, 0.05),
        0 4px 8px rgba(15, 23, 42, 0.03);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.step-item.active .step-circle {
    background: linear-gradient(180deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-color: var(--primary-600);
    color: white;
    box-shadow: 
        0 0 15px rgba(212, 93, 58, 0.55),
        0 0 4px rgba(212, 93, 58, 0.3),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.step-item.completed .step-circle {
    background: linear-gradient(180deg, var(--accent-500) 0%, var(--accent-600) 100%);
    border-color: var(--accent-600);
    color: white;
    box-shadow: 
        0 0 15px rgba(43, 66, 55, 0.45),
        inset 0 1.5px 0 rgba(255, 255, 255, 0.4);
}

.step-item.completed .step-circle::after {
    content: '✓';
}

.step-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--slate-500);
    white-space: nowrap;
}

.step-item.active .step-label {
    color: var(--primary-700);
    font-weight: 650;
}

.step-item.completed .step-label {
    color: var(--success-700);
}

.step-connector {
    width: 60px;
    height: 6px;
    background: #cbd5e1;
    margin: 0 var(--space-2);
    border-radius: 3px;
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.12);
    transition: background var(--transition-base), box-shadow var(--transition-base);
}

.step-connector.completed {
    background: #10b981;
    box-shadow: 
        0 0 8px rgba(16, 185, 129, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.step-content {
    display: none;
    animation: fadeSlideUp 0.4s ease;
}

.step-content.active {
    display: block;
}

/* ============================================================
   SIGNATURE PAD
   ============================================================ */
.signature-pad-container {
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    position: relative;
}

.signature-pad-container canvas {
    width: 100%;
    height: 200px;
    cursor: crosshair;
    touch-action: none;
}

.signature-pad-actions {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--slate-50);
    border-top: 1px solid var(--slate-200);
}

.signature-pad-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--slate-300);
    font-size: var(--font-size-sm);
    pointer-events: none;
}

/* ============================================================
   APPROVAL TIMELINE
   ============================================================ */
.approval-timeline {
    position: relative;
    padding-left: 32px;
}

.approval-timeline::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: #cbd5e1;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.12);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: none;
}

.timeline-item.approved .timeline-dot {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    box-shadow: 
        0 0 10px rgba(16, 185, 129, 0.75),
        0 0 3px rgba(16, 185, 129, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.timeline-item.rejected .timeline-dot {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 
        0 0 10px rgba(239, 68, 68, 0.75),
        0 0 3px rgba(239, 68, 68, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.timeline-item.pending .timeline-dot {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 
        0 0 10px rgba(245, 158, 11, 0.75),
        0 0 3px rgba(245, 158, 11, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite;
}

.timeline-content {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border: 1px solid #cbd5e1;
    border-top-color: #94a3b8;
    box-shadow: 
        inset 0 2px 4px rgba(15, 23, 42, 0.05),
        0 1px 0 rgba(255, 255, 255, 0.95);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.timeline-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--slate-800);
}

.timeline-date {
    font-size: var(--font-size-xs);
    color: var(--slate-500);
}

.timeline-body {
    font-size: var(--font-size-sm);
    color: var(--slate-600);
}

.timeline-signature {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--slate-200);
}

.timeline-signature img {
    max-height: 60px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--slate-400);
    min-width: 320px;
    max-width: 450px;
    animation: slideInRight 0.4s var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.toast.toast-success { border-left-color: var(--success-500); }
.toast.toast-error { border-left-color: var(--danger-500); }
.toast.toast-warning { border-left-color: var(--warning-500); }
.toast.toast-info { border-left-color: var(--info-500); }

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--slate-900);
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--font-size-sm);
    color: var(--slate-600);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--slate-400);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-500);
    border-radius: 0 0 0 var(--radius-md);
    animation: shrink 5s linear forwards;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: var(--font-size-lg);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ============================================================
   ALERT MESSAGES
   ============================================================ */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    font-size: var(--font-size-sm);
    border: 1px solid;
}

.alert-success {
    background: var(--success-50);
    border-color: var(--success-100);
    color: var(--success-700);
}

.alert-error {
    background: var(--danger-50);
    border-color: var(--danger-100);
    color: var(--danger-600);
}

.alert-warning {
    background: var(--warning-50);
    border-color: var(--warning-100);
    color: var(--warning-600);
}

.alert-info {
    background: var(--info-50);
    border-color: var(--info-100);
    color: var(--info-600);
}

/* ============================================================
   PUBLIC PAGES LAYOUT
   ============================================================ */
.public-layout {
    min-height: 100vh;
}

.public-header {
    background: white;
    border-bottom: 1px solid var(--slate-100);
    padding: var(--space-4) var(--space-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.public-header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.public-header-brand .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: var(--font-size-lg);
}

.public-header-brand .brand-name {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--slate-900);
}

.public-header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.public-header-nav a {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--slate-600);
    padding: var(--space-2) 0;
    position: relative;
}

.public-header-nav a:hover,
.public-header-nav a.active {
    color: var(--primary-600);
}

.public-header-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-600);
    border-radius: 1px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(43, 66, 55, 0.85) 0%, rgba(212, 93, 58, 0.85) 100%);
    padding: var(--space-20) var(--space-8);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: float 6s ease-in-out infinite;
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 800;
    margin-bottom: var(--space-4);
    position: relative;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto var(--space-8);
    position: relative;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    position: relative;
}



/* Public Content */
.public-content {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-6);
}

.public-footer {
    text-align: center;
    padding: var(--space-8);
    color: var(--slate-500);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--slate-200);
}

/* ============================================================
   LOADING & ANIMATIONS
   ============================================================ */
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-4);
    z-index: 10000;
}

.skeleton {
    background: linear-gradient(90deg, var(--slate-200) 25%, var(--slate-100) 50%, var(--slate-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    width: 80%;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 22px;
    width: 60%;
    margin-bottom: var(--space-3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--slate-300);
    margin-bottom: var(--space-4);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    color: var(--slate-500);
    max-width: 400px;
    margin: 0 auto var(--space-6);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-nav {
    display: flex;
    justify-content: center;
    padding: var(--space-6) 0;
}

.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    list-style: none;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--slate-600);
    transition: all var(--transition-fast);
}

.pagination-link:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.pagination-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.pagination-ellipsis {
    padding: 0 var(--space-2);
    color: var(--slate-400);
}

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */
.search-bar {
    position: relative;
}

.search-bar input {
    padding-left: 44px;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    font-size: 1.1rem;
    pointer-events: none;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filter-group label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--slate-600);
    white-space: nowrap;
}

.filter-group select.form-control {
    width: auto;
    min-width: 160px;
}

/* ============================================================
   MOBILE BURGER MENU
   ============================================================ */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-2);
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--slate-700);
    margin: 5px 0;
    transition: all var(--transition-base);
    border-radius: 2px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 99;
}

/* ============================================================
   INSTALLER STYLES
   ============================================================ */
.installer-page {
    min-height: 100vh;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.installer-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 680px;
    width: 100%;
    overflow: hidden;
}

.installer-header {
    background: var(--gradient-primary);
    padding: var(--space-8) var(--space-8) var(--space-6);
    text-align: center;
    color: white;
}

.installer-header h1 {
    color: white;
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-2);
}

.installer-header p {
    opacity: 0.85;
    font-size: var(--font-size-sm);
}

.installer-body {
    padding: var(--space-8);
}

.installer-footer {
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    background: var(--slate-50);
}

/* System check items */
.check-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--slate-100);
}

.check-item:last-child {
    border-bottom: none;
}

.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.check-icon.pass {
    background: var(--success-50);
    color: var(--success-600);
}

.check-icon.fail {
    background: var(--danger-50);
    color: var(--danger-600);
}

.check-label {
    flex: 1;
    font-size: var(--font-size-sm);
}

.check-value {
    font-size: var(--font-size-xs);
    color: var(--slate-500);
}

/* ============================================================
   403 / ERROR PAGES
   ============================================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8);
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-4);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

@keyframes shrink {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Entrance animations for elements */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: fadeSlideUp 0.5s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease forwards;
}

/* Staggered delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================================
   CHARTS CONTAINER
   ============================================================ */
.chart-container {
    position: relative;
    padding: var(--space-4);
}

.chart-container canvas {
    max-height: 100%;
}

/* ============================================================
   LUCIDE ICONS INTEGRATION
   ============================================================ */
/* Ensure nav icons properly size Lucide SVGs */
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

/* Stat card icons */
.stat-icon svg {
    width: 24px;
    height: 24px;
}

/* Card header icons */
.card-header h4 svg,
h4 svg,
h5 svg {
    margin-right: 4px;
}

/* Button icons */
.btn svg {
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 2px;
}

.btn-lg svg {
    width: 18px;
    height: 18px;
}

/* Sidebar logo */
.sidebar-logo svg {
    width: 22px;
    height: 22px;
}

/* Badge icons (small) */
.badge svg {
    width: 12px;
    height: 12px;
    vertical-align: text-bottom;
}

/* Alert icons */
.alert > span svg {
    width: 18px;
    height: 18px;
}

/* Empty state icons */
.empty-state-icon svg {
    width: 48px;
    height: 48px;
}

/* Search bar icon */
.search-bar .search-icon svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 1280px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .content-body {
        padding: var(--space-5);
    }
    
    .content-header {
        padding: var(--space-4) var(--space-5);
    }
    
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 1.875rem;
        --font-size-5xl: 2.25rem;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .content-body {
        padding: var(--space-4);
    }
    
    .hero-section {
        padding: var(--space-12) var(--space-4);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .steps-container {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .step-connector {
        width: 2px;
        height: 24px;
        margin: 0;
    }
    
    .step-item {
        flex-direction: column;
        text-align: center;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select.form-control {
        width: 100%;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .public-header {
        padding: var(--space-3) var(--space-4);
    }
    
    .public-header-nav {
        gap: var(--space-3);
    }
    
    .public-content {
        padding: var(--space-6) var(--space-4);
    }
    
    .modal {
        margin: var(--space-4);
        border-radius: var(--radius-lg);
    }
    
    .installer-container {
        border-radius: var(--radius-lg);
    }
    
    .installer-body {
        padding: var(--space-5);
    }
    
    .data-table {
        font-size: var(--font-size-xs);
    }
    
    .data-table thead th,
    .data-table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .public-header-brand .brand-name {
        font-size: var(--font-size-base);
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .stat-card .stat-value {
        font-size: var(--font-size-2xl);
    }
    
    .toast {
        min-width: auto;
        right: var(--space-4);
        left: var(--space-4);
    }
}

/* ============================================================
   THE MENU PARTNERS INSPIRED PUBLIC STYLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Poppins:wght@300;400;500;600;700&display=swap');

.public-layout {
    color: #2c2a29;
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.public-header {
    background-color: rgba(250, 249, 245, 0.82); /* Translucent cream */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(232, 230, 224, 0.5);
    padding: 24px 64px;
}

.public-header-brand .brand-name {
    font-family: var(--font-family);
    font-weight: 700;
    color: #2b4237;
    letter-spacing: -0.01em;
}

.public-header-brand .logo-icon {
    background: #d45d3a;
    border-radius: 50% !important;
}

.public-header-nav a {
    font-family: var(--font-family);
    font-weight: 500;
    color: #615e5c;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 13px;
    transition: color 0.3s ease;
}

.public-header-nav a:hover,
.public-header-nav a.active {
    color: #d45d3a;
}

.public-header-nav a.active::after {
    background: #d45d3a;
    height: 1.5px;
}

/* Elegant Hero Centered Layout */
.hero-container-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 64px 32px;
    text-align: center;
}

.hero-section {
    background: transparent;
    color: #2c2a29;
    padding: 0;
    text-align: center;
    overflow: visible;
}

.hero-section::before {
    display: none;
}

.hero-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.hero-tag {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: #d45d3a;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-title {
    font-family: var(--font-family);
    font-weight: 800;
    font-size: 52px;
    line-height: 1.15;
    color: #2b4237;
    margin-bottom: 24px;
    text-align: center;
}

.hero-subtitle {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: #615e5c;
    max-width: 680px;
    margin: 0 auto 32px auto;
    text-align: center;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.hero-actions .btn {
    border-radius: 30px !important;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-actions .btn-light {
    background: #d45d3a;
    color: white;
    border: 2px solid #d45d3a;
    box-shadow: 0 4px 14px rgba(212, 93, 58, 0.2);
    transition: all 0.3s ease;
}

.hero-actions .btn-light:hover {
    background: #2b4237;
    border-color: #2b4237;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(43, 66, 55, 0.2);
}

.hero-actions .btn-outline-light {
    background: transparent;
    color: #2b4237;
    border: 2px solid #2b4237;
    transition: all 0.3s ease;
}

.hero-actions .btn-outline-light:hover {
    background: #2b4237;
    color: white;
    transform: translateY(-2px);
}


/* Elegant Blurbs */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-family: var(--font-family);
    font-size: 38px;
    font-weight: 700;
    color: #2b4237;
}

.section-header p {
    font-family: var(--font-family);
    color: #8a8580;
    margin-top: 4px;
}

.menu-blurb-card {
    background: linear-gradient(180deg, #fbfcfd 0%, #f1f5f9 100%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s ease;
    text-align: left;
    height: 100%;
    box-shadow: 
        0 10px 25px rgba(15, 23, 42, 0.05),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(15, 23, 42, 0.03);
}

.menu-blurb-card:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 20px 40px rgba(15, 23, 42, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 3px rgba(15, 23, 42, 0.03);
    border-color: rgba(255, 255, 255, 0.95);
}

.menu-blurb-num {
    font-family: var(--font-family);
    font-size: 40px;
    font-weight: 300;
    color: #d45d3a;
    line-height: 1;
    margin-bottom: 16px;
}

.menu-blurb-card h4 {
    font-family: var(--font-family);
    font-size: 22px;
    font-weight: 700;
    color: #2b4237;
    margin-bottom: 12px;
}

.menu-blurb-card p {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: #615e5c;
    flex-grow: 1;
    margin-bottom: 24px;
}

.menu-blurb-link {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 13px;
    color: #d45d3a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.menu-blurb-link:hover {
    color: #2b4237;
}

/* Supported Expense Types Section */
.supported-types-card {
    background: white;
    border: 1px solid #e8e6e0;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 64px;
}

.supported-types-card h4 {
    font-family: var(--font-family);
    font-size: 24px;
    color: #2b4237;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8e6e0;
    padding-bottom: 12px;
}

.type-item {
    background: #faf9f5 !important;
    border: 1px solid #e8e6e0 !important;
    border-radius: 8px !important;
    font-family: var(--font-family);
    color: #2b4237 !important;
    font-weight: 500;
}

/* Call to Action Section */
.cta-banner {
    background: #2b4237 !important;
    border-radius: 20px !important;
    padding: 64px 32px !important;
    text-align: center;
}

.cta-banner h3 {
    font-family: var(--font-family);
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.cta-banner p {
    font-family: var(--font-family);
    font-weight: 300;
    margin-bottom: 32px !important;
    color: rgba(255, 255, 255, 0.9);
}

.cta-banner .btn-light {
    background: #d45d3a;
    color: white;
    border: none;
    border-radius: 30px !important;
    padding: 14px 40px;
    font-family: var(--font-family);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(212, 93, 58, 0.3);
    display: inline-flex;
    align-items: center;
}

.cta-banner .btn-light:hover {
    background: #2b4237;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(43, 66, 55, 0.3);
}

/* Public Footer */
.public-footer {
    background: #f3efe8;
    border-top: 1px solid #e8e6e0;
    padding: 32px;
    color: #8a8580;
    font-family: var(--font-family);
    margin-top: auto;
}

@media (max-width: 992px) {
    .hero-container-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 32px;
        padding: 32px 16px;
    }
    
    .hero-title {
        font-size: 38px;
        text-align: center;
    }
    
    .hero-subtitle {
        text-align: center;
        margin: 0 auto 24px;
    }
    
    .hero-actions {
        justify-content: center;
        width: 100%;
    }
    
    .public-header {
        padding: 16px 24px;
    }
}

/* ============================================================
   RESPONSIVE JOURNEY LOG CARDS & SUMMARY
   ============================================================ */
.journeys-cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.journey-card {
    background: #ffffff;
    border: 1px solid #e8e6e0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(43, 66, 55, 0.02);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.journey-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(43, 66, 55, 0.05);
}

.journey-card-header {
    background: #faf9f5;
    padding: 12px 18px;
    border-bottom: 1px solid #e8e6e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.journey-card-header h5 {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 15px;
    color: #2b4237;
    margin: 0;
}

.journey-card-remove {
    background: transparent;
    border: none;
    color: #d45d3a;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.journey-card-remove:hover {
    background: #fdf2f0;
    color: #b84c2a;
}

.journey-card-body {
    padding: 18px;
}

.journey-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.journey-outputs-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    background: #faf9f5;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #e8e6e0;
}

.journey-output-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.journey-output-label {
    font-family: var(--font-family);
    font-size: 10px;
    font-weight: 600;
    color: #8a8580;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.journey-output-val {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    color: #2b4237;
    background: transparent;
    border: none;
    padding: 0;
    outline: none;
    width: 100%;
}

.journey-output-val.disallowed {
    color: #d45d3a;
}

.journey-output-val.allowable {
    color: #2b4237;
}

.journey-output-val.amount {
    color: #d45d3a;
    font-size: 15px;
}

/* Totals Summary Box */
.journey-totals-summary {
    background: #faf9f5;
    border: 1px solid #e8e6e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.journey-totals-title {
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 700;
    color: #2b4237;
    margin-bottom: 14px;
    border-bottom: 1px solid #e8e6e0;
    padding-bottom: 8px;
}

.journey-totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.journey-total-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.journey-total-label {
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: 500;
    color: #8a8580;
    text-transform: uppercase;
}

.journey-total-val {
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 700;
    color: #2b4237;
}

.journey-total-item.text-danger .journey-total-val {
    color: #d45d3a;
}

.journey-total-item.text-success .journey-total-val {
    color: #2b4237;
}

.journey-total-item.text-primary .journey-total-val {
    color: #d45d3a;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .sidebar, .content-header, .public-header,
    .btn, .toast-container, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Custom Flatpickr styles to match the EMS design tokens */
.flatpickr-calendar {
    font-family: var(--font-family) !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    box-shadow: 
        0 15px 35px rgba(15, 23, 42, 0.12) !important,
        inset 0 1.5px 0 rgba(255, 255, 255, 0.95) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: linear-gradient(180deg, var(--primary-500) 0%, var(--primary-600) 100%) !important;
    border-color: var(--primary-600) !important;
    color: white !important;
    box-shadow: 
        0 0 10px rgba(212, 93, 58, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.flatpickr-day.today {
    border-color: var(--primary-600) !important;
    border-radius: 50% !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.flatpickr-day.today:hover {
    background: var(--primary-50) !important;
}

.flatpickr-day:hover {
    background: var(--slate-100) !important;
    border-radius: 50% !important;
}

.flatpickr-months .flatpickr-month {
    color: var(--slate-800) !important;
    fill: var(--slate-800) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp::after {
    border-bottom-color: var(--slate-600) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown::after {
    border-top-color: var(--slate-600) !important;
}
