/**
 * Al-Mejhem Driver App - Styles
 * Modern, RTL-aware, mobile-first design
 */

/* ========================================
   CSS Variables - Premium Executive Theme
======================================== */
:root {
    /* Brand Colors - Rich & Professional */
    --primary: #0f4c3a;
    --primary-dark: #0a3328;
    --primary-light: #1a6b52;
    --primary-gradient: linear-gradient(135deg, #0f4c3a 0%, #1a6b52 50%, #2d8f6f 100%);
    --secondary: #f8faf9;
    --accent: #d4af37;
    --accent-light: #e6c860;
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #f4d76b 50%, #d4af37 100%);

    /* Status Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Neutral Colors */
    --white: #ffffff;
    --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;
    --black: #000000;

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(15, 76, 58, 0.15);

    /* Typography */
    --font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --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;

    /* Spacing */
    --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;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Premium Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 76, 58, 0.08);
    --shadow-lg: 0 8px 24px rgba(15, 76, 58, 0.12);
    --shadow-xl: 0 16px 48px rgba(15, 76, 58, 0.16);
    --shadow-2xl: 0 24px 64px rgba(15, 76, 58, 0.2);
    --shadow-glow: 0 0 40px rgba(212, 175, 55, 0.3);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

    /* Layout */
    --header-height: 60px;
    --nav-height: 70px;
    --max-width: 520px;

    /* 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-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #e8f5f0 0%, #d4e8e0 25%, #c0dbd0 50%, #e8f5f0 100%);
    background-attachment: fixed;
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(15, 76, 58, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(15, 76, 58, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   Login Screen - Premium Executive
======================================== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    z-index: 1000;
    padding: var(--space-4);
    overflow: hidden;
}

/* Animated Background Elements */
.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
    animation: rotateGradient 20s linear infinite;
}

.login-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(212, 175, 55, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

@keyframes rotateGradient {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl), var(--shadow-glow);
    padding: var(--space-10);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUpFade 0.6s ease-out;
}

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

/* Premium Gold Accent Line */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gold-gradient);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.login-logo {
    margin-bottom: var(--space-8);
}

.logo-icon {
    font-size: 4.5rem;
    margin-bottom: var(--space-4);
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-2deg); }
    75% { transform: translateY(-4px) rotate(2deg); }
}

.login-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-2);
    line-height: 1.5;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-form {
    margin-top: var(--space-8);
}

.login-form .form-group {
    margin-bottom: var(--space-5);
    text-align: right;
    position: relative;
}

.login-form label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

.login-form input {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all var(--transition-base);
    background: var(--white);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 76, 58, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.login-form input:hover:not(:focus) {
    border-color: var(--gray-400);
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
    display: none;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: shake 0.5s ease;
}

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

.login-error:not(:empty) {
    display: block;
}

.login-btn {
    width: 100%;
    margin-top: var(--space-6);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-footer {
    margin-top: var(--space-8);
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    padding-top: var(--space-6);
    border-top: 1px solid var(--gray-200);
}

/* ========================================
   App Container
======================================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   App Header - Premium Executive (Mobile Optimized)
======================================== */
.app-header {
    background: var(--primary-gradient);
    color: var(--white);
    padding: var(--space-2) var(--space-3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    min-height: 56px;
}

/* Premium Gold Border Bottom */
.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    gap: var(--space-2);
}

.header-brand {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.app-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 420px) {
    .app-title {
        font-size: var(--font-size-sm);
    }
}

.app-subtitle {
    font-size: 9px;
    opacity: 0.85;
    margin: 2px 0 0 0;
    font-weight: 500;
    letter-spacing: 0.03em;
    display: none; /* Hide on small screens */
}

@media (min-width: 400px) {
    .app-subtitle {
        display: block;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 4px 8px;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-logout:active {
    transform: scale(0.95);
}

/* ========================================
   Sync Status - Premium
======================================== */
.sync-status {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 6px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition-base);
}

.sync-status .status-text {
    display: none;
}

@media (min-width: 400px) {
    .sync-status .status-text {
        display: inline;
    }
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all var(--transition-base);
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
    opacity: 0;
}

.status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
}

.status-dot.online::after {
    border: 2px solid #4ade80;
    animation: pulse-ring 2s ease-out infinite;
}

.status-dot.offline {
    background: #f87171;
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
}

.status-dot.offline::after {
    border: 2px solid #f87171;
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.status-text {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* GPS Status Indicator - Compact */
.gps-status {
    display: none; /* Hide on very small screens */
    align-items: center;
    gap: 2px;
    font-size: 9px;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 6px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

@media (min-width: 360px) {
    .gps-status {
        display: flex;
    }
}

.gps-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.gps-dot.active {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.gps-dot.inactive {
    background: #9ca3af;
}

/* Role Indicator - Compact */
.role-indicator {
    font-size: 8px;
    background: var(--gold-gradient);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

@media (min-width: 400px) {
    .role-indicator {
        font-size: 9px;
        padding: 3px 8px;
    }
}

/* ========================================
   Bottom Navigation - Premium (Compact)
======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: var(--space-2) var(--space-2);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    max-height: 70px;
}

/* Premium top accent */
.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gold-gradient);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    position: relative;
    border-radius: var(--radius-lg);
}

.nav-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: transform var(--transition-base);
}

.nav-btn.active {
    color: var(--primary);
    background: rgba(15, 76, 58, 0.08);
}

.nav-btn.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-btn:hover:not(.active) {
    color: var(--gray-600);
    background: rgba(0, 0, 0, 0.03);
}

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

.nav-icon {
    font-size: 1.6rem;
    margin-bottom: var(--space-1);
    transition: transform var(--transition-bounce);
}

.nav-btn.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.nav-label small {
    font-weight: 500;
    opacity: 0.7;
}

/* ========================================
   Main Content
======================================== */
.main-content {
    flex: 1;
    padding: calc(var(--header-height) + var(--space-3)) var(--space-3) calc(var(--nav-height) + var(--space-8));
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    padding-bottom: 100px; /* Extra padding for bottom nav */
}

/* ========================================
   Views
======================================== */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ========================================
   Form Sections - Premium Cards
======================================== */
.form-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.form-section:hover::before {
    opacity: 1;
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: var(--space-4);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 2px;
    background: var(--gold-gradient);
}

.section-icon {
    font-size: var(--font-size-2xl);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(15, 76, 58, 0.2));
}

.section-title .en {
    font-size: var(--font-size-sm);
    color: var(--gray-400);
    font-weight: 500;
    margin-right: auto;
}

/* ========================================
   Form Groups
======================================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

.form-group .en {
    color: var(--gray-500);
    font-weight: 400;
}

.form-group .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

/* Product Select Styling */
.product-select {
    cursor: pointer;
}

.product-custom-input {
    margin-top: var(--space-2);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-3);
}

/* Phone Input with Prefix */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

.phone-prefix {
    background: var(--gray-100);
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    color: var(--primary);
    border-left: 2px solid var(--gray-300);
    font-size: var(--font-size-base);
}

.phone-input-wrapper input {
    border: none;
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-lg);
    letter-spacing: 2px;
    font-weight: 500;
}

.phone-input-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

.phone-hint {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* Customer Autocomplete Dropdown */
.customer-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
}

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

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

.autocomplete-name {
    font-weight: 600;
    color: var(--gray-800);
}

.autocomplete-phone {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    direction: ltr;
}

/* Make form-group relative for autocomplete positioning */
.form-group {
    position: relative;
}

/* Input with Unit */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit .unit {
    font-weight: 600;
    color: var(--gray-600);
}

/* Inline Form Group */
.form-group.inline {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.form-group.inline label {
    margin-bottom: 0;
    white-space: nowrap;
}

.discount-group {
    background: var(--gray-100);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
}

/* ========================================
   Item Rows
======================================== */
.item-row {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    position: relative;
}

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

.item-number {
    font-weight: 700;
    color: var(--primary);
    font-size: var(--font-size-sm);
    background: rgba(26, 95, 42, 0.1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.btn-remove-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    border: none;
    font-size: var(--font-size-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.btn-remove-item:hover {
    background: #c82333;
    transform: scale(1.1);
}

.item-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.item-total-group {
    text-align: center;
}

.item-total {
    font-weight: 700;
    color: var(--primary);
    font-size: var(--font-size-lg);
}

/* ========================================
   Summary Section - Premium
======================================== */
.summary-section {
    background: linear-gradient(135deg, #f0f9f4 0%, #e3f2e9 50%, #f0f9f4 100%);
    border: 2px solid var(--primary-light);
    position: relative;
}

.summary-section::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px dashed rgba(15, 76, 58, 0.2);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-bottom: 1px dashed var(--gray-300);
    position: relative;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    border-top: 3px solid var(--primary);
    padding-top: var(--space-5);
    margin-top: var(--space-4);
    background: rgba(255, 255, 255, 0.5);
    margin: var(--space-4) calc(var(--space-6) * -1) calc(var(--space-6) * -1);
    padding: var(--space-5) var(--space-6);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.summary-value {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--gray-700);
}

.total-value {
    font-size: var(--font-size-3xl);
    color: var(--primary);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(15, 76, 58, 0.1);
}

/* ========================================
   Signature Section
======================================== */
.signature-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

@media (max-width: 400px) {
    .signature-container {
        grid-template-columns: 1fr;
    }
}

.signature-box {
    text-align: center;
}

.signature-box label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

.signature-wrapper {
    background: var(--white);
    border: 2px dashed var(--gray-400);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    margin-bottom: var(--space-2);
}

.signature-pad {
    display: block;
    width: 100%;
    height: 120px;
    background: var(--white);
    border-radius: var(--radius-sm);
    touch-action: none;
}

.btn-clear {
    background: var(--gray-200);
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-clear:hover {
    background: var(--gray-300);
}

/* ========================================
   Buttons - Premium Executive
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md), 0 4px 15px rgba(15, 76, 58, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), 0 8px 25px rgba(15, 76, 58, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: rgba(15, 76, 58, 0.05);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: rgba(15, 76, 58, 0.03);
    transform: translateY(-2px);
}

.btn-large {
    padding: var(--space-5) var(--space-8);
    font-size: var(--font-size-lg);
    width: 100%;
    border-radius: var(--radius-xl);
}

.btn-large small {
    font-size: var(--font-size-sm);
    opacity: 0.85;
    font-weight: 500;
}

.btn-icon {
    font-size: var(--font-size-xl);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.btn-add-item {
    width: 100%;
    margin-top: var(--space-4);
    border-style: dashed;
    border-width: 2px;
}

.btn-add-item:hover {
    border-style: solid;
}

.btn-submit {
    margin-top: var(--space-5);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================
   Form Actions
======================================== */
.form-actions {
    margin-top: var(--space-4);
}

/* ========================================
   Orders List
======================================== */
.orders-header {
    margin-bottom: var(--space-4);
}

.orders-header h2 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
    margin-bottom: var(--space-3);
}

.filter-tabs {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
}

.filter-btn {
    padding: var(--space-2) var(--space-4);
    border: none;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.order-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.order-info h4 {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.order-number {
    font-size: var(--font-size-sm);
    color: var(--primary);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.order-date {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.order-meta {
    text-align: left;
}

.order-total {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-2);
}

.order-status {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.synced {
    background: #d4edda;
    color: #155724;
}

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

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--gray-500);
}

.spinner-small {
    width: 32px;
    height: 32px;
    margin: 0 auto var(--space-4);
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   Sync Panel
======================================== */
.sync-panel {
    text-align: center;
}

.sync-panel h2 {
    font-size: var(--font-size-xl);
    color: var(--gray-800);
    margin-bottom: var(--space-6);
}

.sync-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.stat-card.pending-card {
    border-top: 4px solid var(--warning);
}

.stat-card.synced-card {
    border-top: 4px solid var(--success);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.3;
}

.connection-status {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.status-icon {
    font-size: var(--font-size-xl);
}

.status-message {
    font-weight: 500;
    color: var(--gray-700);
}

.sync-log {
    background: var(--gray-900);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-top: var(--space-6);
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    direction: ltr;
}

.log-entry {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    padding: var(--space-1) 0;
}

.log-entry.log-success {
    color: var(--success);
}

.log-entry.log-error {
    color: var(--danger);
}

.log-time {
    color: var(--gray-600);
}

/* ========================================
   Modal - Premium Executive
======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--space-4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-2xl), var(--shadow-glow);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Premium Gold Accent */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gold-gradient);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    margin-bottom: var(--space-6);
}

.modal-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: var(--space-4);
    animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both;
}

@keyframes successPop {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header h3 {
    font-size: var(--font-size-xl);
    color: var(--primary);
    margin-bottom: var(--space-2);
    font-weight: 700;
}

.modal-header .en {
    font-size: var(--font-size-sm);
    color: var(--gray-400);
    font-weight: 500;
}

.modal-body {
    margin-bottom: var(--space-6);
    background: var(--gray-50);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
}

.modal-body p {
    margin-bottom: var(--space-2);
    color: var(--gray-600);
}

.modal-body strong {
    color: var(--primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.email-status {
    font-size: var(--font-size-sm);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    margin-top: var(--space-3);
}

.email-status.pending {
    background: #fff3cd;
    color: #856404;
}

.email-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

.email-status.error {
    background: #f8d7da;
    color: #721c24;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Modal close/back button */
.modal-close {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    background: var(--gray-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: var(--font-size-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
}

.modal-close:hover {
    background: var(--gray-200);
    transform: scale(1.1);
}

.email-status.success {
    background: #d4edda;
    color: #155724;
}

/* ========================================
   Loading Overlay - Premium
======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: spinPremium 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: var(--space-5);
    box-shadow: 0 0 20px rgba(15, 76, 58, 0.1);
}

@keyframes spinPremium {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-weight: 600;
    color: var(--gray-600);
    font-size: var(--font-size-lg);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ========================================
   Toast Notification - Premium
======================================== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--space-6));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: var(--white);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    box-shadow: var(--shadow-2xl);
    z-index: 250;
    opacity: 0;
    transition: all var(--transition-bounce);
    max-width: calc(100% - var(--space-8));
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    box-shadow: var(--shadow-xl), 0 8px 25px rgba(16, 185, 129, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    box-shadow: var(--shadow-xl), 0 8px 25px rgba(239, 68, 68, 0.3);
}

.toast.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: var(--white);
    box-shadow: var(--shadow-xl), 0 8px 25px rgba(245, 158, 11, 0.3);
}

.toast.info {
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
    box-shadow: var(--shadow-xl), 0 8px 25px rgba(59, 130, 246, 0.3);
}

.toast-icon {
    font-size: var(--font-size-xl);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.toast-message {
    font-weight: 600;
    font-size: var(--font-size-sm);
    letter-spacing: 0.01em;
}

/* ========================================
   Utility Classes
======================================== */
.text-center {
    text-align: center;
}

.en {
    font-size: 0.85em;
    color: var(--gray-500);
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 360px) {
    :root {
        --font-size-base: 0.9375rem;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .item-total-group {
        grid-column: span 2;
    }

    .modal-actions {
        gap: var(--space-2);
    }

    .btn-large {
        padding: var(--space-3) var(--space-4);
    }
}

/* ========================================
   Dashboard Tabs Navigation
======================================== */
.dashboard-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    background: var(--white);
    padding: var(--space-2);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.tab-btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(15, 76, 58, 0.05);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.tab-btn .tab-icon {
    font-size: var(--font-size-lg);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ========================================
   Driver Filter Dropdown
======================================== */
.driver-filter-section {
    background: var(--white);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.driver-filter-section label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.driver-filter-section select {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
    transition: border-color var(--transition-base);
}

.driver-filter-section select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========================================
   Drivers Grid
======================================== */
.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.driver-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.driver-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.driver-card:hover::before {
    opacity: 1;
}

.driver-card.inactive {
    opacity: 0.6;
    background: var(--gray-50);
}

.driver-card.inactive::before {
    background: var(--gray-400);
}

.driver-card.admin-card {
    border-color: var(--accent);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.driver-card.admin-card::before {
    background: var(--gold-gradient);
    opacity: 1;
}

/* Driver Card Header */
.driver-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.driver-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    color: var(--white);
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.driver-card.admin-card .driver-avatar {
    background: var(--gold-gradient);
    color: var(--primary-dark);
}

.driver-status-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.driver-status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.driver-status-badge.inactive {
    background: var(--danger-bg);
    color: var(--danger);
}

.driver-status-badge.admin {
    background: var(--gold-gradient);
    color: var(--primary-dark);
}

/* Driver Info */
.driver-info {
    margin-bottom: var(--space-4);
}

.driver-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.driver-id {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-family: monospace;
}

/* Driver Stats */
.driver-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    background: var(--gray-50);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.driver-stat {
    text-align: center;
}

.driver-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
}

.driver-stat-label {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

/* Driver Actions */
.driver-actions {
    display: flex;
    gap: var(--space-2);
}

.driver-actions .btn {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-reset-password {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-reset-password:hover {
    background: var(--info);
    color: var(--white);
}

.btn-toggle-status {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-toggle-status:hover {
    background: var(--warning);
    color: var(--white);
}

.btn-toggle-status.activate {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-toggle-status.activate:hover {
    background: var(--success);
    color: var(--white);
}

/* ========================================
   Add Driver Form
======================================== */
.add-driver-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 2px dashed var(--gray-300);
}

.add-driver-section h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.add-driver-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    align-items: end;
}

.add-driver-form .form-group {
    margin-bottom: 0;
}

.add-driver-form .btn {
    height: 44px;
}

/* ========================================
   Password Reset Modal
======================================== */
.password-modal .modal-content {
    max-width: 380px;
}

.password-modal .modal-body {
    text-align: right;
}

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

.password-input-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: 48px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color var(--transition-base);
}

.password-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.toggle-password {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-lg);
    color: var(--gray-400);
    transition: color var(--transition-base);
}

.toggle-password:hover {
    color: var(--gray-600);
}

/* ========================================
   Driver Badge (in order cards)
======================================== */
.driver-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: var(--primary-gradient);
    color: var(--white);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-top: var(--space-1);
}

.driver-badge .badge-icon {
    font-size: 0.7rem;
}

/* ========================================
   Dashboard Stats Update
======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.highlight {
    background: var(--primary-gradient);
    color: var(--white);
}

.stat-card.highlight .stat-value,
.stat-card.highlight .stat-label {
    color: var(--white);
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .app-header,
    .bottom-nav,
    .btn,
    .loading-overlay,
    .modal {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    body {
        background: white;
    }
}
