/* ========================================
   Car Rental PWA - Design System
   ======================================== */

/* CSS Variables */
:root {
    /* Colors - Dark Theme (default) - Navy Theme */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #252542;
    --bg-hover: #2d2d4a;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;

    /* Navy Accent - consistent with light mode */
    --accent-primary: #4a7ab0;
    --accent-secondary: #3b5a8a;
    --accent-gradient: linear-gradient(135deg, #3b5a8a, #4a7ab0);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --border-color: #3a3a5a;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* Safe Areas for iOS */
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);

    /* Header & Nav Heights */
    --header-height: 60px;
    --nav-height: 70px;
}

/* Light Theme - Navy */
body.light-mode {
    --bg-primary: #f0f4f8;
    --bg-secondary: #f7f9fc;
    --bg-card: #ffffff;
    --bg-hover: #e4eaf0;

    --text-primary: #1e3a5f;
    --text-secondary: #4a6580;
    --text-muted: #7a94a8;

    /* Navy Accent for light mode */
    --accent-primary: #1e3a5f;
    --accent-secondary: #2d5a87;
    --accent-gradient: linear-gradient(135deg, #1e3a5f, #2d5a87);

    --border-color: #d0dce8;

    --shadow-sm: 0 2px 8px rgba(30, 58, 95, 0.08);
    --shadow-md: 0 4px 16px rgba(30, 58, 95, 0.1);
    --shadow-lg: 0 8px 32px rgba(30, 58, 95, 0.12);
}

/* Light mode input fields styling */
body.light-mode .form-input,
body.light-mode .form-textarea,
body.light-mode .form-select,
body.light-mode input[type="text"],
body.light-mode input[type="number"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode input[type="date"],
body.light-mode input[type="datetime-local"],
body.light-mode textarea,
body.light-mode select {
    background: #ffffff;
    border: 1px solid #d0d0d8;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.light-mode .form-input:focus,
body.light-mode .form-textarea:focus,
body.light-mode .form-select:focus,
body.light-mode input:focus,
body.light-mode textarea:focus,
body.light-mode select:focus {
    border-color: var(--primary);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(30, 58, 95, 0.15);
}

/* Light mode section separators */
body.light-mode div[style*="border-top"] {
    border-top-color: #e0e0e5 !important;
    background: rgba(0, 0, 0, 0.02);
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 8px;
}

/* Light mode header - Navy theme */
body.light-mode .app-header {
    border-bottom: 1px solid var(--border-color);
}

body.light-mode .app-header h1 {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--text-primary);
    background-clip: unset;
    color: var(--text-primary);
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    /* Lower than bottom-nav (100) so menu slides behind it */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Align page title to the left */
    position: absolute;
    left: 16px;
}

.header-actions {
    position: absolute;
    right: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.sync-btn,
.theme-toggle {
    background: var(--bg-hover);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.7rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.sync-btn:hover,
.theme-toggle:hover {
    transform: scale(1.1);
}

/* Main Content */
.app-content {
    padding-top: calc(var(--header-height) + var(--safe-top) + var(--spacing-md));
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--spacing-md));
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    min-height: 100vh;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
}

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

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
}

.nav-item.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(74, 122, 176, 0.15);
}

.nav-item:active {
    transform: scale(0.95);
    background: var(--bg-hover);
}

/* Light mode nav items */
body.light-mode .nav-item {
    background: none;
    border: 1px solid transparent;
}

body.light-mode .nav-item.active {
    background: rgba(30, 58, 95, 0.1);
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.nav-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-total .stat-icon {
    background: rgba(30, 58, 95, 0.2);
}

.stat-available .stat-icon {
    background: rgba(16, 185, 129, 0.2);
}

.stat-rented .stat-icon {
    background: rgba(245, 158, 11, 0.2);
}

.stat-revenue .stat-icon {
    background: rgba(139, 92, 246, 0.2);
}

/* SVG icons color in stat-icon */
.stat-icon svg {
    stroke: var(--text-primary);
}

.dashboard-section {
    margin-bottom: var(--spacing-lg);
}

.dashboard-section h2 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
}

.dashboard-section h2 svg {
    stroke: var(--text-secondary);
}

/* Bell icon SVG */
.bell-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bell-icon svg {
    stroke: var(--text-primary);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab.active {
    background: var(--accent-gradient);
    color: #ffffff;
}

/* Search Bar */
.search-bar {
    margin-bottom: var(--spacing-md);
}

.search-bar input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* Card List */
.card-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Item Card */
.item-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-card:active {
    transform: scale(0.98);
    background: var(--bg-hover);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.item-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.item-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.item-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status Badge */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-available {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-rented {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.status-maintenance {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.status-reserved {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-cancelled {
    background: rgba(107, 107, 128, 0.2);
    color: var(--text-muted);
}

.status-waiting-confirm {
    background: rgba(245, 158, 11, 0.25);
    /* Stronger yellow background */
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    /* Add border for emphasis */
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.blink-animation {
    animation: blink 1.5s infinite ease-in-out;
}

/* Buttons */
.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:active {
    background: var(--bg-hover);
}

/* Light mode btn-secondary */
body.light-mode .btn-secondary {
    background: #f0f4f8;
    color: #1e3a5f;
    border: 1px solid #1e3a5f;
}

body.light-mode .btn-secondary:hover {
    background: #e4eaf0;
}

/* Outline Action Button - Lưu, Đổi mật khẩu */
.btn-outline-action {
    padding: 8px 16px;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-outline-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline-action:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Light mode btn-outline-action */
body.light-mode .btn-outline-action {
    color: #1e3a5f;
    border: 2px solid #1e3a5f;
    background: transparent;
}

body.light-mode .btn-outline-action:hover {
    background: rgba(30, 58, 95, 0.08);
}

/* Owner Type Toggle Buttons */
.owner-type-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.owner-type-btn:hover {
    background: var(--bg-hover);
}

.owner-type-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border: 2px solid var(--accent-primary);
    font-weight: 600;
}

/* Light mode */
body.light-mode .owner-type-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

body.light-mode .owner-type-btn:hover {
    background: #f5f5f5;
}

body.light-mode .owner-type-btn.active {
    background: #7c3aed;
    background: var(--accent-gradient);
    color: #fff !important;
    border: 2px solid var(--accent-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* Floating Action Button */
.btn-fab {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--spacing-md));
    right: var(--spacing-md);
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 300;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 100000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(90vh - 60px);
    padding-bottom: calc(var(--spacing-xl) + var(--safe-bottom));
}

/* Form */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Fix for date inputs on iOS/Mobile */
.form-input[type="date"],
.form-input[type="datetime-local"],
.form-input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
    /* Ensure same height as text inputs */
    line-height: normal;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Prevent date/time inputs from wrapping */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    white-space: nowrap;
    min-width: 0;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.form-actions .btn-primary {
    flex: 1;
}

/* Report Cards */
.report-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.report-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.month-selector button {
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.month-selector span {
    font-size: 1rem;
    font-weight: 500;
}

.revenue-display {
    text-align: center;
}

.revenue-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    /* White in dark mode, navy in light mode */
}

body.light-mode .revenue-value {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.revenue-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.revenue-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.top-item-rank {
    width: 24px;
    height: 24px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: var(--spacing-sm);
}

.top-item-info {
    flex: 1;
}

.top-item-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.top-item-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.top-item-value {
    font-weight: 600;
    color: var(--accent-primary);
}

/* Toast Notification */
/* Toast Notification */
.toast {
    position: fixed;
    top: calc(var(--safe-top) + var(--spacing-lg));
    bottom: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: normal;
    word-break: break-word;
    max-width: 90vw;
    text-align: center;
    width: max-content;
    max-width: calc(100vw - 40px);
    line-height: 1.4;
}

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

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--info);
}

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1);
}

.confirm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.confirm-close:hover {
    color: var(--text-primary);
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.confirm-buttons button {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    /* border: none; Removed to allow btn-secondary border */
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 48px;
    /* Force equal height */
    font-size: 1rem;
}

.confirm-buttons .btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Ensure border is visible */
    background: transparent;
    /* Keep it subtle */
    color: var(--text-secondary);
}

.confirm-buttons .btn-secondary:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Light mode specific override for cancel button border */
body.light-mode .confirm-buttons .btn-secondary {
    border: 1px solid #d1d5db;
    color: var(--text-secondary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Upgrade Banner Styles */
.upgrade-banner {
    text-align: center;
}

.upgrade-icon {
    font-size: 4rem;
    margin-bottom: 8px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

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

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

.upgrade-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.upgrade-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.current-limit {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
}

.limit-label {
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 500;
}

.pro-benefits {
    text-align: left;
    margin-bottom: 20px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.benefit-item strong {
    color: var(--success);
}

.benefit-icon {
    font-size: 1.2rem;
}

.upgrade-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.upgrade-note {
    color: var(--text-muted);
    font-size: 0.75rem;
    /* Reduced slightly to ensure fit */
    margin-top: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    /* Prevent text touching edges */
}

/* Pricing Options */
.pricing-options {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.price-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    /* Consider changing this too if invisible, but user asked for border */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.price-item:hover {
    border-color: rgba(245, 158, 11, 0.5);
}

.price-item.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.price-duration {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.price-amount {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f59e0b;
}

.price-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Bank Info */
.bank-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: left;
}

.bank-title {
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.bank-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.bank-detail:last-child {
    border-bottom: none;
}

.bank-detail span {
    color: var(--text-muted);
}

.bank-detail strong {
    color: var(--text-primary);
}

/* Empty State */
.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl);
    font-size: 0.9rem;
}

/* Price Display */
.price {
    font-weight: 600;
    color: var(--success);
}

/* Detail View */
.detail-header {
    text-align: center;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-md);
}

.detail-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

/* Car container and driving animation */
.detail-icon.car-container {
    position: relative;
    width: 150px;
    height: 50px;
    overflow: hidden;
    margin: 0 auto var(--spacing-sm);
}

.car-drive-animation {
    position: absolute;
    left: -70px;
    top: 5px;
    animation: carDrive 4s linear infinite;
    transform: scaleX(-1);
    /* Flip car to face right */
}

@keyframes carDrive {
    0% {
        transform: translateX(-20px) scaleX(-1);
    }

    100% {
        transform: translateX(200px) scaleX(-1);
    }
}

/* Smoke styling - changes color based on mode */
.smoke {
    fill: #888888;
    animation: smokePuff 0.5s ease-in-out infinite alternate;
}

.smoke-1 {
    animation-delay: 0s;
}

.smoke-2 {
    animation-delay: 0.1s;
}

.smoke-3 {
    animation-delay: 0.2s;
}

.smoke-4 {
    animation-delay: 0.3s;
}

.smoke-5 {
    animation-delay: 0.4s;
}

.smoke-6 {
    animation-delay: 0.5s;
}

.smoke-7 {
    animation-delay: 0.6s;
}

@keyframes smokePuff {
    0% {
        opacity: 0.2;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0.6;
        transform: translateX(-3px) scale(1.2);
    }
}

/* Light mode smoke color */
body.light-mode .smoke {
    fill: #aaaaaa;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.detail-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 8px;
}

.detail-label {
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 100px;
}

.detail-value {
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.detail-actions button {
    flex: 1 1 auto;
    min-width: 80px;
    white-space: nowrap;
    font-size: 0.875rem;
    padding: 10px 12px;
}

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

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

.mt-md {
    margin-top: var(--spacing-md);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

/* PIN Lock Screen */
.pin-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-lock-overlay.hidden {
    display: none;
}

.pin-lock-container {
    background: var(--bg-card);
    padding: 40px 32px;
    border-radius: 20px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.pin-lock-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.pin-lock-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.pin-lock-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.pin-input-container {
    margin-bottom: 16px;
}

.pin-input {
    width: 100%;
    padding: 16px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--bg-hover);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

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

.pin-input::placeholder {
    letter-spacing: 4px;
    color: var(--text-muted);
}

.pin-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
}

.pin-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.pin-submit-btn:hover {
    transform: scale(1.02);
}

.pin-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pin-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 20px;
}

/* ========================================
   Multi-Car Calendar Table
   ======================================== */

.calendar-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 16px;
    background: var(--bg-card);
    /* #252542 in dark mode */
    border-radius: 25px;
    padding: 4px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.light-mode .calendar-mode-toggle {
    background: var(--bg-hover);
    border-color: var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-mode-toggle button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    /* #a0a0b8 dark, #4a6580 light */
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.calendar-mode-toggle button:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.calendar-mode-toggle button.active {
    background: var(--accent-gradient);
    /* Navy gradient */
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
    transform: scale(1.02);
}

body.light-mode .calendar-mode-toggle button.active {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.light-mode .calendar-mode-toggle button:not(.active) {
    color: var(--text-secondary);
}

.calendar-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 8px;
}

.calendar-nav-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.calendar-nav-header button {
    background: var(--bg-hover);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
}

.calendar-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.calendar-table {
    border-collapse: collapse;
    width: 100%;
    min-width: max-content;
}

.calendar-table th,
.calendar-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    min-width: 90px;
    font-size: 0.85rem;
}

.calendar-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.calendar-table thead th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-secondary);
    font-weight: 500;
    min-width: 80px;
}

.calendar-table thead .sticky-col {
    z-index: 3;
}

.calendar-table .day-name {
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-table .day-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.calendar-table .day-holiday {
    font-size: 0.7rem;
    color: var(--danger);
    margin-top: 2px;
}

.calendar-table .weekend .day-name {
    color: var(--danger);
}

.calendar-cell {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-cell:hover {
    opacity: 0.8;
}

.calendar-cell-available {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.calendar-cell-rented {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    cursor: default;
    font-weight: 500;
}

.calendar-cell-reserved {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    cursor: default;
    font-weight: 500;
}

.calendar-cell-blocked {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    font-weight: 500;
}

.calendar-cell-blocked::before {
    content: '●';
    margin-right: 4px;
}

.calendar-table .today-row {
    background: rgba(30, 58, 95, 0.08);
}

.calendar-table .today-row .sticky-col {
    background: rgba(30, 58, 95, 0.15);
    border-left: 3px solid var(--primary);
}

/* Light mode specific adjustments for calendar */
body.light-mode .calendar-cell-rented {
    background: rgba(239, 68, 68, 0.12);
}

body.light-mode .calendar-cell-blocked {
    background: rgba(16, 185, 129, 0.15);
}

body.light-mode .calendar-table .sticky-col {
    background: #f8f8fa;
}

body.light-mode .calendar-table thead th {
    background: #f0f0f2;
}

/* Ratio bar for partial day blocks */
.calendar-cell-blocked {
    position: relative;
    overflow: hidden;
}

.calendar-cell-blocked::before {
    display: none;
    /* Remove default bullet */
}

.ratio-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 0 2px 2px 0;
    min-width: 10%;
}

.block-hours {
    font-size: 0.7rem;
    font-weight: 600;
    display: block;
    margin-top: 4px;
}

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

/* Light mode adjustments for ratio bar */
body.light-mode .ratio-bar {
    background: linear-gradient(90deg, #059669, #10b981);
}

/* ========================================
   Auth Section Styles
   ======================================== */

.auth-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: var(--spacing-lg);
    overflow: auto;
}

.auth-section.hidden {
    display: none !important;
}

.auth-container {
    width: min(380px, 92vw);
    max-width: 380px;
    background: var(--bg-card);
    border-radius: 24px;
    padding: clamp(24px, 5vh, 40px) clamp(20px, 6vw, 32px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.auth-logo {
    text-align: center;
    margin-bottom: clamp(20px, 5vh, 32px);
}

.auth-logo span {
    font-size: clamp(3rem, 15vw, 4rem);
    display: block;
    margin-bottom: 8px;
}

.auth-logo h1 {
    margin: 12px 0 8px;
    font-size: clamp(1.6rem, 8vw, 2rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--bg-hover);
    padding: 6px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

.auth-tab:not(.active):hover {
    color: var(--text-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 3vh, 20px);
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-form .form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-form .form-group input {
    width: 100%;
    padding: clamp(12px, 2.5vh, 14px) 16px;
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.auth-form .form-group input::placeholder {
    color: var(--text-muted);
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.form-input.error,
.form-select.error {
    border-color: #ef4444;
}

.form-error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.auth-form button[type="submit"],
.auth-form .btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.4);
    margin-top: 8px;
}

.auth-form button[type="submit"]:hover,
.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.5);
}

.auth-form button[type="submit"]:active,
.auth-form .btn-primary:active {
    transform: translateY(0);
}

/* User info in header */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-primary);
}

.hamburger-icon {
    display: block;
}

/* Dropdown Menu */
.dropdown-menu {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top) + 8px);
    right: 16px;
    width: 280px;

    /* Max height: Viewport (dvh) - Top Offset - Bottom Nav Height - Buffer */
    max-height: calc(100dvh - var(--header-height) - var(--safe-top) - 8px - var(--nav-height) - var(--safe-bottom) - 16px);
    overflow-y: auto;

    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 16px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overscroll-behavior: contain;
}

/* When menu touches bottom nav (added via JS) */
.dropdown-menu.touching-bottom {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    /* Optional: merge visually */
}

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

.menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
}

.menu-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.menu-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.menu-user-email {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    cursor: default;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.menu-item.menu-logout {
    cursor: pointer;
    color: var(--danger);
    transition: background 0.2s;
}

.menu-item.menu-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.menu-label strong {
    color: var(--primary);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* Card-based Menu Styles */
.menu-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.menu-card-title {
    padding: 12px 16px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    transition: background 0.2s ease;
}

.menu-card-row:hover {
    background: var(--bg-hover);
}

.menu-card-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0 16px;
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 300;
}

.menu-card-logout {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.menu-card-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Light mode card styles */
body.light-mode .menu-card {
    background: #fff;
    border-color: #e5e7eb;
}

body.light-mode .menu-card-row:hover {
    background: #f3f4f6;
}

body.light-mode .menu-card-divider {
    background: #e5e7eb;
}

body.light-mode .menu-card-logout {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Small Upgrade Button in Menu */
.btn-upgrade-sm {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: #000;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(255, 165, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: 8px;
    white-space: nowrap;
}

.btn-upgrade-sm:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(255, 165, 0, 0.2);
}

/* Extend VIP Button */
.btn-extend-vip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: 8px;
    white-space: nowrap;
}

.btn-extend-vip:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Customer Dropdown */
.customer-option:hover {
    background: var(--bg-hover);
}

.customer-option:last-child {
    border-bottom: none;
}

/* ========================================
   Notification Center Styles
   ======================================== */
.notification-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: var(--bg-hover);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
}

.notification-dropdown {
    position: absolute;
    top: 120%;
    right: -10px;
    width: 320px;
    max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.notification-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.notification-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.notification-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-text-sm {
    background: none;
    border: none;
    color: var(--info);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    border-left: 3px solid var(--accent-primary);
}

body.light-mode .notification-item.unread {
    background: rgba(30, 58, 95, 0.05);
}

body.dark-mode .notification-item.unread {
    background: rgba(30, 58, 95, 0.1);
}

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

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
    white-space: nowrap;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.notification-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

/* PWA Install Prompts */
.pwa-install-floating {
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    right: 16px;
    background: var(--primary-color, #1e3a5f);
    color: white;
    padding: 10px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
    animation: slideInUp 0.5s ease-out;
}

.pwa-install-floating:active {
    transform: scale(0.95);
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.ios-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Bottom sheet style */
    padding-bottom: 20px;
}

.ios-install-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.ios-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.ios-icon {
    margin-bottom: 16px;
}

.ios-install-content h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.ios-install-content p {
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    font-size: 0.95rem;
}

.ios-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ios-step {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.ios-action-icon {
    font-size: 1.2rem;
    color: #007aff;
    /* iOS Blue */
}

/* Animated Car Login Icon */
.animated-car-container {
    position: relative;
    width: 140px;
    height: 70px;
    margin: 0 auto 10px;
    overflow: hidden;
}

.animated-car {
    position: absolute;
    bottom: 5px;
    width: 54px;
    height: 36px;
    color: var(--primary-color);
    animation: car-drive-across 5s linear infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.car-svg {
    width: 100%;
    height: 100%;
    color: #4a7ab0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.wind-effect {
    position: absolute;
    top: 50%;
    left: -20px;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 95, 0.4), transparent);
    animation: wind-blow 1s infinite linear;
}

@keyframes car-drive-across {
    0% {
        transform: translateX(-60px) scale(0.9);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    40% {
        transform: translateX(30px) scale(1);
    }

    60% {
        transform: translateX(50px) scale(1);
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateX(200px) scale(0.9);
        opacity: 0;
    }
}

@keyframes wind-blow {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(-10px);
        opacity: 0;
    }
}

/* Chart Toggle Buttons */
.chart-toggle {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    /* Add border */
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.chart-toggle.active {
    background: var(--bg-hover);
    /* Subtle active background */
    color: var(--accent-primary);
    /* Highlight text color */
    border-color: var(--accent-primary);
    /* Highlight border */
    font-weight: 600;
}

/* Light mode specific adjustments if needed, though vars should handle it */
body.light-mode .chart-toggle.active {
    background: rgba(30, 58, 95, 0.1);
}

/* Chat Button Styles */
.chat-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-btn:hover {
    background-color: var(--bg-secondary);
}

.chat-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

.chat-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ef4444;
    /* Red notification color */
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    /* Border matches header bg for cut-out effect */
}

/* Manual Sign Warning Animation */
@keyframes blinkOrangeBorder {
    0% {
        border-color: rgba(249, 115, 22, 0.3);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }

    50% {
        border-color: #f97316;
        box-shadow: 0 0 4px rgba(249, 115, 22, 0.3);
    }

    100% {
        border-color: rgba(249, 115, 22, 0.3);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

.manual-sign-warning {
    margin-top: 15px;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 8px;
    background-color: rgba(249, 115, 22, 0.05);
    animation: blinkOrangeBorder 1.4s infinite;
}