/**
 * Hotel POS Mobile App - Beautiful Light Theme
 * Mobile-First Design with Smooth Animations
 */

/* =====================================================
   CSS VARIABLES - Light Color Palette
   ===================================================== */
:root {
    /* Primary Colors */
    --primary: #6366F1;
    --primary-light: #A5B4FC;
    --primary-dark: #4F46E5;
    --primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    
    /* Secondary Colors */
    --secondary: #10B981;
    --secondary-light: #6EE7B7;
    --secondary-dark: #059669;
    
    /* Accent Colors */
    --accent: #F472B6;
    --accent-light: #FBCFE8;
    
    /* Status Colors */
    --success: #22C55E;
    --success-light: #DCFCE7;
    --warning: #FBBF24;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #06B6D4;
    --info-light: #CFFAFE;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Background */
    --bg-main: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-input: #F8FAFC;
    
    /* Text */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --text-white: #FFFFFF;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-colored: 0 4px 14px 0 rgba(99, 102, 241, 0.25);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Spacing */
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 60px;
    --bottom-nav-height: 70px;
}

/* =====================================================
   RESET & BASE STYLES
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* =====================================================
   LAYOUT - APP CONTAINER
   ===================================================== */
.app-container {
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 20px);
}

.main-content {
    padding: 20px 16px;
    max-width: 100%;
}

/* =====================================================
   HEADER - TOP APP BAR
   ===================================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.app-header .logo-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.app-header .logo-text span {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.header-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Content padding for fixed header */
.has-header {
    padding-top: calc(var(--header-height) + 16px);
}

/* =====================================================
   BOTTOM NAVIGATION
   ===================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    min-height: 60px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    display: block;
}

.nav-item span {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: scale(1.15);
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 0 0 6px 6px;
}

.nav-item:hover:not(.pos-btn) {
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-item:hover:not(.pos-btn) i {
    transform: scale(1.1);
}

/* Center POS Button */
.nav-item.pos-btn {
    position: relative;
    margin-top: -32px;
    flex: 0 0 auto;
    min-width: 64px;
}

.nav-item.pos-btn .pos-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    border: 3px solid white;
}

.nav-item.pos-btn:active .pos-icon {
    transform: scale(0.95);
}

.nav-item.pos-btn:hover .pos-icon {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.nav-item.pos-btn span {
    margin-top: 8px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.75rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .bottom-nav {
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
    }
    
    .nav-item {
        padding: 10px 2px;
        min-height: 64px;
    }
    
    .nav-item i {
        font-size: 1.375rem;
        margin-bottom: 5px;
    }
    
    .nav-item span {
        font-size: 0.625rem;
    }
    
    .nav-item.pos-btn .pos-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 1.625rem;
        border: 2px solid white;
    }
    
    .nav-item.active::before {
        width: 40px;
        height: 3px;
    }
}

@media (max-width: 576px) {
    .nav-item {
        padding: 8px 2px;
        min-height: 60px;
    }
    
    .nav-item i {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }
    
    .nav-item span {
        font-size: 0.5625rem;
        font-weight: 600;
    }
    
    .nav-item.pos-btn .pos-icon {
        width: 56px;
        height: 56px;
        min-width: 56px;
        font-size: 1.5rem;
        margin-top: -28px;
    }
    
    .nav-item.pos-btn {
        margin-top: -28px;
    }
    
    .nav-item.active::before {
        width: 36px;
        height: 3px;
    }
}

@media (max-width: 360px) {
    .nav-item span {
        font-size: 0.5rem;
    }
    
    .nav-item i {
        font-size: 1.125rem;
    }
    
    .nav-item.pos-btn .pos-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
        font-size: 1.375rem;
    }
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* =====================================================
   STATS CARDS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.primary::before { background: var(--primary-gradient); }
.stat-card.success::before { background: linear-gradient(135deg, #10B981, #34D399); }
.stat-card.warning::before { background: linear-gradient(135deg, #FBBF24, #FCD34D); }
.stat-card.danger::before { background: linear-gradient(135deg, #EF4444, #F87171); }
.stat-card.info::before { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.stat-card.accent::before { background: linear-gradient(135deg, #F472B6, #FB7185); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.stat-card.primary .stat-icon { background: var(--primary-light); color: var(--primary-dark); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--secondary-dark); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: #B45309; }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.info .stat-icon { background: var(--info-light); color: #0891B2; }
.stat-card.accent .stat-icon { background: var(--accent-light); color: #DB2777; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   QUICK ACTIONS
   ===================================================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    background: var(--white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action:active {
    transform: scale(0.98);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 8px;
}

.quick-action:nth-child(1) .quick-action-icon { background: #EEF2FF; color: #6366F1; }
.quick-action:nth-child(2) .quick-action-icon { background: #D1FAE5; color: #10B981; }
.quick-action:nth-child(3) .quick-action-icon { background: #FEF3C7; color: #F59E0B; }
.quick-action:nth-child(4) .quick-action-icon { background: #FCE7F3; color: #EC4899; }
.quick-action:nth-child(5) .quick-action-icon { background: #CFFAFE; color: #06B6D4; }
.quick-action:nth-child(6) .quick-action-icon { background: #FEE2E2; color: #EF4444; }
.quick-action:nth-child(7) .quick-action-icon { background: #E0E7FF; color: #4F46E5; }
.quick-action:nth-child(8) .quick-action-icon { background: #DCFCE7; color: #22C55E; }

.quick-action-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
    color: white;
}

.btn-info:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #F87171);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #FBBF24, #FCD34D);
    color: var(--gray-800);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

.btn-icon.sm {
    width: 32px;
    height: 32px;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition-fast);
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.error {
    border-color: var(--danger);
}

.form-control.success {
    border-color: var(--success);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 44px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

input[type="file"].form-control {
    padding: 10px;
    cursor: pointer;
}

input[type="file"].form-control::-webkit-file-upload-button {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    margin-right: 12px;
}

input[type="file"].form-control::-webkit-file-upload-button:hover {
    background: var(--primary-dark);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon .form-control {
    padding-left: 48px;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 6px;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }
.badge-success { background: var(--success-light); color: #166534; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info { background: var(--info-light); color: #0E7490; }

/* =====================================================
   ALERTS & TOASTS
   ===================================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-light);
    color: #166534;
}

.alert-danger {
    background: var(--danger-light);
    color: #991B1B;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
}

.alert-info {
    background: var(--info-light);
    color: #0E7490;
}

.toast {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    right: 16px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   TABLES
   ===================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.table td {
    color: var(--text-secondary);
}

.table tr:hover td {
    background: var(--gray-50);
}

/* =====================================================
   LIST ITEMS
   ===================================================== */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.list-item:hover {
    box-shadow: var(--shadow-md);
}

.list-item:active {
    transform: scale(0.99);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 14px;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.list-item-action {
    margin-left: 12px;
    color: var(--text-muted);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-height: 90vh;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 12px;
    padding-bottom: calc(20px + var(--safe-bottom));
}

/* =====================================================
   SEARCH BAR
   ===================================================== */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
}

.search-bar input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--white);
    font-size: 0.9375rem;
    transition: var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
    margin: 0 auto 20px;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-danger { background: var(--danger); }
.bg-warning { background: var(--warning); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* =====================================================
   ANIMATIONS
   ===================================================== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered animations for lists */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* =====================================================
   LOGIN PAGE SPECIFIC
   ===================================================== */
.login-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    overflow: hidden;
}

.login-logo {
    background: #FFFFFF;
    padding: 40px 30px 30px;
    text-align: center;
    color: #1E293B;
    margin-bottom: 0;
    border-bottom: 1px solid #E2E8F0;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.login-logo-icon i {
    font-size: 2.5rem;
    color: white;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1E293B;
}

.login-logo p {
    color: #64748B;
    margin: 0;
    font-size: 0.9375rem;
}

.login-card > form {
    padding: 32px 30px 30px;
}

.login-card .form-group:last-of-type {
    margin-bottom: 0;
}

/* Modern input wrapper for login */
.login-card .input-icon {
    position: relative;
    background: var(--gray-50);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.login-card .input-icon:focus-within {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-card .input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    z-index: 1;
}

.login-card .input-icon .form-control {
    padding: 16px 16px 16px 52px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.login-card .input-icon .form-control:focus {
    outline: none;
    box-shadow: none;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.login-card .btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Mobile Optimizations for Login */
@media (max-width: 576px) {
    .login-page {
        padding: 0;
        align-items: flex-start;
    }
    
    .login-container {
        max-width: 100%;
        padding: 0;
    }
    
    .login-card {
        border-radius: 0;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        flex-direction: column;
    }
    
    .login-logo {
        padding: 50px 24px 32px;
        border-radius: 0;
    }
    
    .login-logo-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }
    
    .login-logo-icon i {
        font-size: 2rem;
    }
    
    .login-logo h1 {
        font-size: 1.5rem;
    }
    
    .login-logo p {
        font-size: 0.875rem;
    }
    
    .login-card > form {
        padding: 32px 24px 24px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 15px 16px;
        min-height: 48px;
    }
    
    .input-icon .form-control {
        padding-left: 50px;
    }
    
    .btn {
        min-height: 52px;
        font-size: 16px;
        padding: 15px 20px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .login-logo {
        padding: 40px 20px 28px;
    }
    
    .login-logo-icon {
        width: 60px;
        height: 60px;
    }
    
    .login-logo-icon i {
        font-size: 1.75rem;
    }
    
    .login-logo h1 {
        font-size: 1.375rem;
    }
    
    .login-card > form {
        padding: 28px 20px 20px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .login-card {
        min-height: auto;
    }
    
    .login-logo {
        padding: 30px 24px 20px;
    }
    
    .login-logo-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    
    .login-card > form {
        padding: 24px 24px 20px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
}

/* Prevent zoom on input focus (iOS Safari) */
@supports (-webkit-touch-callout: none) {
    .login-page .form-control {
        font-size: 16px !important;
    }
}

/* =====================================================
   PAGE HEADERS
   ===================================================== */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* =====================================================
   SECTION HEADERS
   ===================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-link {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 500;
}

/* =====================================================
   GREETING SECTION
   ===================================================== */
.greeting-section {
    margin-bottom: 24px;
}

.greeting-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.greeting-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.greeting-name span {
    color: var(--primary);
}

/* =====================================================
   PULL TO REFRESH
   ===================================================== */
.pull-indicator {
    position: fixed;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: var(--transition);
    z-index: 100;
}

.pull-indicator.active {
    opacity: 1;
}

/* =====================================================
   TABLET & DESKTOP ADJUSTMENTS
   ===================================================== */
@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .modal {
        max-width: 500px;
        border-radius: var(--radius-xl);
        margin: auto;
    }
    
    .modal-overlay {
        align-items: center;
    }
    
    .modal-overlay.active .modal {
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 900px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .app-container {
        padding-bottom: 24px;
    }
}

