/* ========================================
   PROFESSIONAL OCEAN BLUE THEME
   Income & Expense Tracker
   Version 6.0 - Enterprise Ready
   ======================================== */

/* ========================================
   DESIGN TOKENS - Ocean Blue Professional
   ======================================== */
:root {
    /* Ocean Blue Primary - Professional Palette */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    
    /* Ocean Blue Variations */
    --ocean-50: #ecfdf5;
    --ocean-100: #d1fae5;
    --ocean-200: #a7f3d0;
    --ocean-300: #6ee7b7;
    --ocean-400: #34d399;
    --ocean-500: #10b981;
    --ocean-600: #059669;
    --ocean-700: #047857;
    --ocean-800: #065f46;
    --ocean-900: #064e3b;
    
    /* Success - Ocean Teal */
    --success-50: #f0fdfa;
    --success-100: #ccfbf1;
    --success-200: #99f6e4;
    --success-300: #5eead4;
    --success-400: #2dd4bf;
    --success-500: #14b8a6;
    --success-600: #0d9488;
    --success-700: #0f766e;
    --success-800: #115e59;
    --success-900: #134e4a;
    
    /* Danger - Deep Ocean Red */
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --danger-900: #7f1a1a;
    
    /* Warning - Ocean Amber */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    /* Info - Light Ocean */
    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-200: #bfdbfe;
    --info-300: #93c5fd;
    --info-400: #60a5fa;
    --info-500: #3b82f6;
    --info-600: #2563eb;
    --info-700: #1d4ed8;
    --info-800: #1e40af;
    --info-900: #1e3a8a;
    
    /* Neutral - Professional Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Surface Colors - Light Mode */
    --surface-0: #ffffff;
    --surface-1: #f9fafb;
    --surface-2: #f3f4f6;
    --surface-3: #e5e7eb;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-disabled: #9ca3af;
    
    /* Gradients - Ocean Blue Theme */
    --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    --gradient-success: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    --gradient-danger: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-600) 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
    --gradient-info: linear-gradient(135deg, var(--info-500) 0%, var(--info-600) 100%);
    --gradient-ocean: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-600) 100%);
    
    /* Spacing - 4px base */
    --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;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    
    /* Shadows - Professional */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Navigation */
    --top-nav-height: 64px;
    --bottom-nav-height: 72px;
    
    /* 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);
    
    /* Z-Index Layers */
    --z-dropdown: 1000;
    --z-sticky: 100;
    --z-fixed: 200;
    --z-modal-backdrop: 1000;
    --z-modal: 1010;
    --z-popover: 1020;
    --z-toast: 1030;
    --z-tooltip: 1040;
    
    /* Opacity */
    --opacity-disabled: 0.5;
    --opacity-hover: 0.9;
    --opacity-active: 0.95;
}

/* ========================================
   DARK MODE - Professional Dark Ocean
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode Surfaces */
        --surface-0: #0f172a;
        --surface-1: #1e293b;
        --surface-2: #334155;
        --surface-3: #475569;
        
        /* Dark Mode Text - Light for contrast */
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;
        --text-disabled: #64748b;
        
        /* Gray Colors - Adjusted for dark */
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --gray-300: #475569;
        --gray-400: #64748b;
        --gray-500: #94a3b8;
        --gray-600: #cbd5e1;
        --gray-700: #e2e8f0;
        --gray-800: #f1f5f9;
        --gray-900: #f8fafc;
        
        /* Gradients - Brighter for dark mode */
        --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
        --gradient-success: linear-gradient(135deg, var(--success-400) 0%, var(--success-500) 100%);
        --gradient-danger: linear-gradient(135deg, var(--danger-400) 0%, var(--danger-500) 100%);
        --gradient-warning: linear-gradient(135deg, var(--warning-400) 0%, var(--warning-500) 100%);
        
        /* Shadows for dark mode */
        --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--surface-1);
    min-height: 100vh;
    padding-top: var(--top-nav-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-3));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   FOCUS VISIBLE - Accessibility
   ======================================== */
*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

*:focus {
    outline: none;
}

/* ========================================
   SCROLLBAR - Ocean Blue Theme
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-2);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-400) var(--surface-2);
}

/* ========================================
   TOP NAVIGATION - Ocean Blue
   ======================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-nav-height);
    background: var(--surface-0);
    border-bottom: 1px solid var(--primary-100);
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-sm);
}

.top-nav-content {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

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

.nav-action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--primary-500);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-action-btn:hover {
    background-color: var(--primary-50);
}

.nav-action-btn:active {
    background-color: var(--primary-100);
    transform: scale(0.95);
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-semibold);
    font-size: var(--font-size-base);
    box-shadow: var(--shadow-sm);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(var(--top-nav-height) - 5px);
    right: var(--space-4);
    min-width: 220px;
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--primary-100);
    overflow: hidden;
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--primary-50);
}

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

.dropdown-item:hover {
    background-color: var(--primary-50);
}

.dropdown-item:focus-visible {
    background-color: var(--primary-50);
    outline: none;
}

.dropdown-item.logout {
    color: var(--danger-500);
}

.dropdown-item.logout:hover {
    background-color: var(--danger-50);
    color: var(--danger-600);
}

/* ========================================
   BOTTOM NAVIGATION - Ocean Blue
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface-0);
    border-top: 1px solid var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 var(--space-2);
    z-index: var(--z-fixed);
    box-shadow: 0 -4px 10px rgba(99, 102, 241, 0.05);
}

.nav-item {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: var(--font-medium);
    transition: all var(--transition-fast);
    padding: var(--space-2) 0;
    border-radius: var(--radius-lg);
    max-width: 70px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.nav-item:hover {
    background-color: var(--primary-50);
    color: var(--primary-600);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: var(--primary-600);
}

.nav-item.active span {
    color: var(--primary-600);
    font-weight: var(--font-semibold);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-4);
    min-height: 100vh;
    background-color: var(--surface-1);
}

/* ========================================
   PAGE HEADERS - Ocean Blue
   ======================================== */
.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-6) var(--space-5);
    margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-4) calc(var(--space-4) * -1);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.page-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: white;
}

.page-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    line-height: var(--leading-normal);
}

/* Header Variations - Ocean Theme */
.page-header.success { background: var(--gradient-success); }
.page-header.danger { background: var(--gradient-danger); }
.page-header.warning { background: var(--gradient-warning); }
.page-header.info { background: var(--gradient-info); }

/* ========================================
   CARDS - Professional Ocean Blue
   ======================================== */
.card {
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary-100);
    transition: all var(--transition-fast);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Stats Cards - Ocean Accents */
.stat-card {
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.stat-card.primary { border-left-color: var(--primary-500); }
.stat-card.success { border-left-color: var(--success-500); }
.stat-card.danger { border-left-color: var(--danger-500); }
.stat-card.warning { border-left-color: var(--warning-500); }

.stat-card .stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    line-height: var(--leading-tight);
}

.stat-card .stat-value.positive { color: var(--success-500); }
.stat-card .stat-value.negative { color: var(--danger-500); }

/* ========================================
   FORMS - Ocean Blue Theme
   ======================================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.form-label .required {
    color: var(--danger-500);
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--primary-400);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 1;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 48px;
    padding: 0 var(--space-3);
    padding-left: calc(var(--space-3) + 28px);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--surface-0);
    transition: all var(--transition-fast);
}

.form-textarea {
    height: auto;
    min-height: 100px;
    padding: var(--space-3);
    resize: vertical;
}

.form-input:hover:not(:disabled),
.form-select:hover:not(:disabled),
.form-textarea:hover:not(:disabled) {
    border-color: var(--primary-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
    outline: none;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--danger-500);
    background-color: var(--danger-50);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    background-color: var(--surface-2);
}

/* Error Message */
.form-error-message {
    font-size: var(--font-size-xs);
    color: var(--danger-500);
    margin-top: var(--space-1);
    display: none;
}

.form-input.error + .form-error-message,
.form-select.error + .form-error-message,
.form-textarea.error + .form-error-message {
    display: block;
}

/* Success Message */
.form-success-message {
    font-size: var(--font-size-xs);
    color: var(--success-500);
    margin-top: var(--space-1);
}

/* Select arrow */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-2) center;
    padding-right: var(--space-6);
}

/* Amount Input */
.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: var(--space-3);
    color: var(--primary-600);
    font-weight: var(--font-medium);
    background: var(--primary-50);
    padding: 4px 8px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: 1px solid var(--primary-200);
    z-index: 1;
    pointer-events: none;
}

.amount-input {
    padding-left: 70px !important;
}

/* ========================================
   BUTTONS - Ocean Blue Theme
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: 0 var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-500);
    color: var(--primary-600);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-50);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-3);
}

.btn-sm {
    min-height: 40px;
    padding: 0 var(--space-3);
    font-size: var(--font-size-sm);
}

.btn-lg {
    min-height: 56px;
    padding: 0 var(--space-5);
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
    display: flex;
}

/* ========================================
   PAYMENT MODE SELECTORS - Ocean Blue
   ======================================== */
.payment-modes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.payment-mode-card {
    background: var(--surface-1);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    color: var(--text-primary);
}

.payment-mode-card:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.payment-mode-card.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
    color: var(--primary-700);
}

.payment-mode-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Payment Fields */
.payment-fields {
    background: var(--surface-1);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-top: var(--space-3);
    border: 1px solid var(--primary-100);
    animation: slideDown var(--transition-base);
}

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

/* ========================================
   LISTS & TRANSACTIONS - Ocean Blue
   ======================================== */
.list-container {
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--primary-100);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    border-bottom: 1px solid var(--primary-50);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
    content-visibility: auto;
    contain-intrinsic-size: 0 80px;
}

.list-item:hover {
    background-color: var(--primary-50);
}

.list-item:active {
    background-color: var(--primary-100);
    transform: scale(0.99);
}

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

.list-item-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

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

.list-item-icon.sale { background: var(--primary-50); color: var(--primary-600); }
.list-item-icon.expense { background: var(--danger-50); color: var(--danger-600); }
.list-item-icon.customer { background: var(--primary-50); color: var(--primary-600); }

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin-bottom: 2px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.list-item-subtitle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.list-item-right {
    text-align: right;
    flex-shrink: 0;
}

.list-item-amount {
    font-size: var(--font-size-base);
    font-weight: var(--font-semibold);
    margin-bottom: 2px;
    white-space: nowrap;
}

.list-item-amount.sale { color: var(--success-500); }
.list-item-amount.expense { color: var(--danger-500); }

/* ========================================
   BADGES - Ocean Blue Theme
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-medium);
    line-height: var(--leading-none);
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-800);
}

.badge-success {
    background: var(--success-100);
    color: var(--success-800);
}

.badge-danger {
    background: var(--danger-100);
    color: var(--danger-800);
}

.badge-warning {
    background: var(--warning-100);
    color: var(--warning-800);
}

/* Payment Badges - Ocean Theme */
.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-medium);
    line-height: var(--leading-none);
    white-space: nowrap;
}

.payment-badge.cash {
    background: var(--primary-100);
    color: var(--primary-800);
}

.payment-badge.mpesa {
    background: var(--warning-100);
    color: var(--warning-800);
}

.payment-badge.cheque {
    background: var(--primary-100);
    color: var(--primary-800);
}

.payment-badge.bank {
    background: var(--info-100);
    color: var(--info-800);
}

/* ========================================
   ALERTS - Ocean Blue Theme
   ======================================== */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    border-left-width: 4px;
    border-left-style: solid;
    animation: slideDown var(--transition-fast);
}

.alert-success {
    background: var(--success-50);
    border-left-color: var(--success-600);
    color: var(--success-800);
}

.alert-danger {
    background: var(--danger-50);
    border-left-color: var(--danger-600);
    color: var(--danger-800);
}

.alert-warning {
    background: var(--warning-50);
    border-left-color: var(--warning-600);
    color: var(--warning-800);
}

.alert-info {
    background: var(--primary-50);
    border-left-color: var(--primary-600);
    color: var(--primary-800);
}

/* ========================================
   EMPTY STATES - Ocean Blue Theme
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-300);
    margin-bottom: var(--space-3);
    display: inline-block;
}

.empty-state h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.empty-state p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* ========================================
   PAGINATION - Ocean Blue Theme
   ======================================== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--surface-0);
    border-top: 1px solid var(--primary-100);
    font-size: var(--font-size-sm);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.pagination-controls {
    display: flex;
    gap: var(--space-1);
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-1);
    color: var(--text-primary);
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-50);
    transform: translateY(-1px);
    border-color: var(--primary-400);
}

.pagination-btn:active:not(.disabled) {
    transform: scale(0.95);
}

.pagination-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   TOAST NOTIFICATIONS - Ocean Blue Theme
   ======================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--space-4));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    width: auto;
    max-width: 90%;
    pointer-events: none;
}

.toast {
    background: var(--surface-0);
    color: var(--text-primary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    animation: slideUp var(--transition-base);
    pointer-events: auto;
    margin-bottom: var(--space-2);
    border: 1px solid var(--primary-100);
}

.toast.success { 
    background: var(--success-50);
    color: var(--success-800);
    border-left: 4px solid var(--success-500);
}
.toast.error { 
    background: var(--danger-50);
    color: var(--danger-800);
    border-left: 4px solid var(--danger-500);
}
.toast.warning { 
    background: var(--warning-50);
    color: var(--warning-800);
    border-left: 4px solid var(--warning-500);
}
.toast.info { 
    background: var(--primary-50);
    color: var(--primary-800);
    border-left: 4px solid var(--primary-500);
}

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

/* ========================================
   MODAL - Ocean Blue Theme
   ======================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--surface-0);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--primary-100);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

.modal-body {
    padding: var(--space-4);
    overflow-y: auto;
    flex: 1;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-4);
    border-top: 1px solid var(--primary-100);
}

/* ========================================
   SKELETON LOADERS - Ocean Blue Theme
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 120px;
    background: var(--surface-2);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.skeleton-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99, 102, 241, 0.1),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   UTILITIES
   ======================================== */
/* Spacing utilities remain the same */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }

.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Text */
.text-xs { font-size: var(--font-size-xs); line-height: var(--leading-normal); }
.text-sm { font-size: var(--font-size-sm); line-height: var(--leading-normal); }
.text-base { font-size: var(--font-size-base); line-height: var(--leading-normal); }
.text-lg { font-size: var(--font-size-lg); line-height: var(--leading-normal); }
.text-xl { font-size: var(--font-size-xl); line-height: var(--leading-tight); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Colors */
.text-primary { color: var(--primary-600); }
.text-success { color: var(--success-500); }
.text-danger { color: var(--danger-500); }
.text-warning { color: var(--warning-500); }
.text-info { color: var(--info-500); }

/* Backgrounds */
.bg-primary { background: var(--primary-500); }
.bg-success { background: var(--success-500); }
.bg-danger { background: var(--danger-500); }
.bg-warning { background: var(--warning-500); }

/* Borders */
.border { border: 1px solid var(--primary-100); }
.border-t { border-top: 1px solid var(--primary-100); }
.border-b { border-bottom: 1px solid var(--primary-100); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Width & Height */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .top-nav,
    .bottom-nav,
    .btn,
    .no-print,
    .dropdown-menu,
    .modal,
    .toast-container,
    .pagination-container {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
        background: white !important;
        color: black !important;
    }
    
    .main-content {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .card,
    .stat-card,
    .list-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .page-header {
        background: var(--primary-100) !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    a {
        text-decoration: none;
        color: black !important;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 640px) {
    .payment-modes-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .list-item-left {
        width: 100%;
    }
    
    .list-item-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .toast-container {
        width: 90%;
    }
    
    .btn {
        min-height: 44px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .main-content,
    .top-nav-content {
        max-width: 640px;
    }
}

@media (min-width: 1025px) {
    .main-content,
    .top-nav-content {
        max-width: 640px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    animation: fadeIn var(--transition-base);
}

.fade-out {
    animation: fadeOut var(--transition-base);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (forced-colors: active) {
    .btn-primary,
    .btn-success,
    .btn-danger,
    .btn-warning {
        border: 1px solid currentColor;
    }
}