:root {
    /* Light mode colors v1 */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #0ea5e9;
    --secondary-hover: #0284c7;
    --accent: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #06b6d4;
    --secondary-hover: #0891b2;
    --accent: #a78bfa;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.2s ease;
    line-height: 1.5rem; /* A - match font-size */
}
.logo:hover {
    color: var(--primary-hover);
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    position: relative;
}

nav a:hover {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

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

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:disabled, select:disabled, textarea:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-control {
    width: 100%;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Results Display */
.result-box {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.result-row:last-child {
    border-bottom: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-medium);
}

.result-label {
    color: var(--text-muted);
    font-weight: 500;
}

.result-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

/* Route Cards */
.route-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.route-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.route-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.route-detail {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.route-detail span:first-child {
    font-weight: 500;
}

.route-detail span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

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

.close {
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

/* Activity Log */
.activity-item {
    padding: 1rem;
    border-left: 3px solid var(--primary);
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    align-items: center;
}

.activity-user {
    font-weight: 600;
    color: var(--primary);
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.activity-action {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Copy Button */
.copy-btn {
    margin-top: 1rem;
}

/* Hide/Show */
.hidden {
    display: none !important;
}

/* Toggle Buttons */
.toggle-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.toggle-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Pre/Code blocks */
pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--border-light);
}

code {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
  

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .result-row:last-child {
        font-size: 1.25rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

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

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Result Card Highlight */
.result-card-highlight {
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* Result Summary Grid */
.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.result-summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.result-summary-item:hover::before {
    transform: scaleY(1);
}

.result-summary-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.result-item-full {
    grid-column: span 3;
}

.result-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-summary-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-summary-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.copy-icon {
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--primary);
    flex-shrink: 0;
}

.result-summary-item:hover .copy-icon {
    opacity: 1;
}

/* Calculator Layout - Side by Side */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.calculator-card {
    /* No special styling needed, inherits from .card */
}

.route-info-card {
    position: sticky;
    top: 100px;
}

/* Route Info Content */
.route-info-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* Result Breakdown */
.result-breakdown {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.breakdown-row.total-row {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border-medium);
}

/* Full width button */
.btn-full-width {
    width: 100%;
    justify-content: center;
}

/* Responsive adjustments for result summary */
@media (max-width: 768px) {
    .result-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .result-item-full {
        grid-column: span 1;
    }
    
    .result-summary-item {
        padding: 1rem;
    }
    
    .result-summary-label {
        font-size: 0.6875rem;
    }
    
    .result-summary-value {
        font-size: 1rem;
    }
    
    .breakdown-row.total-row {
        font-size: 1.125rem;
    }
    
    /* Stack calculator and route info on mobile */
    .calculator-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .route-info-card {
        position: relative;
        top: 0;
    }
}

/* Admin Panel Styles */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-guest {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.role-member {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
}

.role-leadership {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent);
}

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

/* Action Badges */
.action-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

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

.action-update, .action-update_role {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
}

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

.action-login, .action-registered {
    background: rgba(14, 165, 233, 0.2);
    color: var(--secondary);
}

/* ID Badge */
.id-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Table Cell Styles */
.route-cell, .user-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}


.route-destination-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.route-meta, .user-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.pricing-cell, .limits-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.btn-icon-primary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-icon-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-icon-danger:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-1px);
}

/* Role Select */
.role-select {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-medium);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.role-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Notifications */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    font-weight: 600;
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

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

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

/* Responsive admin adjustments */
@media (max-width: 768px) {
    .admin-tabs {
        gap: 0.25rem;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .tab-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .tab-header .btn {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Additional notification style for info/loading */
.notification-info {
    background: var(--secondary);
    color: white;
}

/* Loading pulse animation */
.loading.pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Row deletion animation */
tr {
    transition: all 0.3s ease;
}


/* Error Modal Styles */

.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.error-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--danger);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.error-modal-icon {
    display: flex;
    justify-content: center;
    color: var(--danger);
    animation: shake 0.5s ease;
}

.error-modal-content {
    text-align: center;
}

.error-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 0.75rem;
}

.error-modal-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.error-modal-limit {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--danger);
}

.error-modal-limit strong {
    color: var(--danger);
    font-weight: 700;
}

.error-modal-close {
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.error-modal-close:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Input error state animation */
input[style*="border-color: var(--danger)"] {
    animation: inputShake 0.5s ease;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .error-modal {
        width: 95%;
        padding: 1.5rem;
    }
    
    .error-modal-title {
        font-size: 1.25rem;
    }
    
    .error-modal-message {
        font-size: 0.9375rem;
    }
    
    .error-modal-limit {
        font-size: 1rem;
        padding: 0.75rem;
    }
}
/* Footer -  */

footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid var(--border-medium);
    transition: all 0.2s ease;
}

.footer-login-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Responsive footer */
@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    .footer-login-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
}


/* Queue Badge Styles */
.queue-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

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

.queue-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

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

/* Queue badge in route header */
.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.route-header .queue-badge {
    font-size: 0.6875rem;
    padding: 0.2rem 0.6rem;
}



/* Input error state */
.input-error {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.input-error:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Shake animation for validation errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Input helper text - shows max limits */
.input-helper {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.input-helper small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-helper strong {
    color: var(--primary);
    font-weight: 700;
}

/* Add icon to helper text */
.input-helper small::before {
    content: '⚠';
    font-size: 1rem;
    color: var(--primary);
    font-weight: bold;
}

/* Pulse animation for helper text when first shown */
@keyframes helperPulse {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-helper {
    animation: helperPulse 0.3s ease-out;
}

/* Update error modal to support HTML content */
.error-modal-message strong {
    color: var(--danger);
    font-weight: 700;
}

/* Disabled submit button styling */
button[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: var(--text-muted) !important;
}

button[type="submit"]:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-helper {
        font-size: 0.8125rem;
        padding: 0.4rem 0.6rem;
    }
    
    .input-helper small::before {
        font-size: 0.875rem;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .input-helper {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-left-color: var(--secondary);
}

[data-theme="dark"] .input-error {
    background: rgba(239, 68, 68, 0.1);
}

/* Smaller font for routes table */
#routesTableBody td {
    font-size: 0.875rem; /* Slightly smaller than default */
}

#routesTableBody td small {
    font-size: 0.75rem;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    #routesTableBody td {
        font-size: 0.8125rem;
    }
}


/* LIMIT EXCEEDED POPUP  */
.limit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.limit-popup-overlay.popup-closing {
    animation: fadeOut 0.2s ease;
}

.limit-popup {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--danger);
    animation: slideUpBounce 0.4s ease;
    position: relative;
}

.limit-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.limit-popup-close:hover {
    background: var(--bg-hover);
    color: var(--danger);
    transform: rotate(90deg);
}

.limit-popup-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--danger);
    animation: iconPulse 2s ease-in-out infinite;
}

.limit-popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--danger);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.limit-popup-content {
    text-align: center;
}

.limit-popup-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.limit-popup-values {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-light);
}

.limit-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 1rem;
}

.limit-value-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.75rem;
}

.limit-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.limit-amount {
    font-weight: 700;
    font-size: 1.125rem;
    font-family: 'SF Mono', Monaco, monospace;
}

.error-value .limit-amount {
    color: var(--danger);
}

.max-value .limit-amount {
    color: var(--success);
}

.limit-popup-instruction {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 1rem;
}

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

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

@keyframes slideUpBounce {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    70% {
        transform: translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .limit-popup {
        width: 95%;
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }
    
    .limit-popup-title {
        font-size: 1.5rem;
    }
    
    .limit-popup-message {
        font-size: 0.9375rem;
    }
    
    .limit-popup-values {
        padding: 1rem;
    }
    
    .limit-value-row {
        font-size: 0.9375rem;
    }
    
    .limit-amount {
        font-size: 1rem;
    }
}
/* =================================================================
   ACCESS DENIED PAGE - MODERN RESPONSIVE STYLES v1
 
   ================================================================= */

/* Access Denied Container */
.access-denied-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0;
}

.access-denied-container .card {
    text-align: center;
    padding: 3rem 2.5rem;
}

/* Icon Styling */
.access-denied-icon {
    margin: 0 auto 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.access-denied-icon svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(var(--shadow-md));
}

/* Title */
.access-denied-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Message Container */
.access-denied-message {
    text-align: left;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-secondary);
}

.access-denied-message p {
    margin-bottom: 1rem;
}

.access-denied-message p:last-child {
    margin-bottom: 0;
}

.access-denied-message strong {
    color: var(--text-primary);
    font-weight: 600;
}
/* Contract Tracking Styles */
.tracking-auth-box {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0;
}

.tracking-auth-box.authenticated {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: var(--success-color);
}

.tracking-auth-box.not-authenticated {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: var(--danger-color);
}

.tracking-auth-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tracking-auth-icon {
    font-size: 2.5rem;
}

.tracking-auth-icon.success {
    color: var(--success-color);
}

.tracking-auth-icon.danger {
    color: var(--danger-color);
}

.tracking-char-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.tracking-char-portrait {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.tracking-health-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
}

.tracking-health-item.ok {
    border-left-color: var(--success-color);
    background: #d4edda;
}

.tracking-health-item.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.tracking-health-item.error {
    border-left-color: var(--danger-color);
    background: #f8d7da;
}

.tracking-health-item h5 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tracking-health-item p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}
/* Permission Info Box */
.permission-box {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--warning);
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.permission-box:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.permission-box.leadership-box {
    border-left-color: var(--accent);
}

.permission-box.admin-box {
    border-left-color: var(--danger);
}

.permission-box strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.permission-box ul {
    margin: 0.75rem 0 0 0;
    padding: 0;
    list-style: none;
}

.permission-box li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1.75rem;
    position: relative;
}

.permission-box li:last-child {
    margin-bottom: 0;
}

.permission-box li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.permission-box li .role-badge {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Suggestions Box */
.suggestions-box {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    text-align: left;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

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

.suggestions-box strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.suggestions-box ul {
    margin: 0.75rem 0 0 0;
    padding: 0;
    list-style: none;
}

.suggestions-box li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    padding-left: 0;
    position: relative;
    color: var(--text-secondary);
}

.suggestions-box li:last-child {
    margin-bottom: 0;
}

/* When list items don't have buttons/links starting with btn class */
.suggestions-box li:not(:has(.btn))::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    margin-right: 0.5rem;
}

.suggestions-box li:not(:has(.btn)) {
    padding-left: 1.75rem;
}

.suggestions-box a:not(.btn) {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.suggestions-box a:not(.btn):hover {
    border-bottom-color: var(--primary);
    color: var(--primary-hover);
}

/* Button styling within suggestions box */
.suggestions-box .btn {
    margin: 0.25rem 0;
    width: auto;
    min-width: 200px;
}

.suggestions-box .btn-primary {
    background: var(--primary);
    color: #ffffff !important; /* Force white text */
    border: none;
}

.suggestions-box .btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff !important; /* Force white text on hover */
}

.suggestions-box li:has(.btn) {
    display: flex;
    align-items: center;
}

/* Same fix for permission box buttons */
.permission-box .btn-primary {
    background: var(--primary);
    color: #ffffff !important;
    border: none;
}

.permission-box .btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff !important;
}

/* Role Badge Enhancements */
.role-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.role-badge:hover {
    transform: scale(1.05);
}

/* Tablet Responsive (768px - 1024px) */
@media (max-width: 1024px) {
    .access-denied-container {
        max-width: 90%;
        margin: 1.5rem auto;
    }
    
    .access-denied-container .card {
        padding: 2.5rem 2rem;
    }
    
    .access-denied-icon svg {
        width: 72px;
        height: 72px;
    }
    
    .access-denied-title {
        font-size: 1.75rem;
    }
}

/* Mobile Responsive (up to 768px) */
@media (max-width: 768px) {
    .access-denied-container {
        margin: 1rem;
        padding: 0;
    }
    
    .access-denied-container .card {
        padding: 2rem 1.5rem;
    }
    
    .access-denied-icon {
        margin-bottom: 1.5rem;
    }
    
    .access-denied-icon svg {
        width: 56px !important;
        height: 56px !important;
    }
    
    .access-denied-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .access-denied-message {
        font-size: 0.9375rem;
    }
    
    .permission-box,
    .suggestions-box {
        padding: 1.25rem;
        margin: 1.25rem 0;
    }
    
    .permission-box strong,
    .suggestions-box strong {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .permission-box ul,
    .suggestions-box ul {
        margin-top: 0.5rem;
        font-size: 0.875rem;
    }
    
    .permission-box li,
    .suggestions-box li {
        margin-bottom: 0.6rem;
        padding-left: 1.5rem;
    }
    
    .permission-box li::before,
    .suggestions-box li:not(:has(.btn))::before {
        font-size: 1rem;
    }
    
    .role-badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.65rem;
    }
    
    /* Make buttons full width on mobile */
    .suggestions-box .btn {
        width: 100%;
        min-width: auto;
        justify-content: center;
    }
    
    .suggestions-box li:has(.btn) {
        display: block;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .access-denied-container {
        margin: 0.75rem;
    }
    
    .access-denied-container .card {
        padding: 1.5rem 1rem;
    }
    
    .access-denied-icon {
        margin-bottom: 1rem;
    }
    
    .access-denied-icon svg {
        width: 48px !important;
        height: 48px !important;
    }
    
    .access-denied-title {
        font-size: 1.25rem;
        margin-bottom: 0.875rem;
    }
    
    .access-denied-message {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .permission-box,
    .suggestions-box {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 10px;
    }
    
    .permission-box strong,
    .suggestions-box strong {
        font-size: 0.9rem;
    }
    
    .permission-box ul,
    .suggestions-box ul {
        font-size: 0.8125rem;
    }
    
    .permission-box li,
    .suggestions-box li {
        padding-left: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .role-badge {
        font-size: 0.625rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Animation for Access Denied Page */
@keyframes accessDeniedFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.access-denied-container .card {
    animation: accessDeniedFadeIn 0.5s ease;
}

/* Dark mode specific enhancements */
[data-theme="dark"] .permission-box {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(51, 65, 85, 0.5) 100%);
}

[data-theme="dark"] .suggestions-box {
    background: rgba(51, 65, 85, 0.5);
    border-color: var(--border-medium);
}

/* =================================================================
   HAMBURGER MENU - FIXED ALIGNMENT
   ================================================================= */

/* Hamburger Menu Button - BASE STYLES */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center; /* Center the container */
    align-items: center;
    width: 30px;
    height: 30px; /* Same as a letter height */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    z-index: 200;
    transition: all 0.3s ease;
    position: relative;
    pointer-events: auto !important;
}

.hamburger:hover {
    opacity: 0.8;
}

.hamburger:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* The three lines - with explicit spacing */
.hamburger-line {
    width: 24px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
    pointer-events: none;
}

.hamburger-line:nth-child(1) {
    margin-bottom: 5px;
}

.hamburger-line:nth-child(2) {
    margin-bottom: 5px;
}

/* Hamburger animation when open */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    margin-bottom: 0;
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Menu Container */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 160;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 80px 0 2rem 0;
}

.mobile-menu.active {
    right: 0;
}

/* Mobile Menu Items */
.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin-bottom: 1.5rem;
}

.mobile-menu nav a,
.mobile-menu nav button {
    width: 100%;
    padding: 1rem 2rem;
    text-align: left;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    border-left: 3px solid transparent;
}

.mobile-menu nav a:hover,
.mobile-menu nav button:hover {
    background: var(--bg-secondary);
    border-left-color: var(--primary);
    color: var(--primary);
}

.mobile-menu nav a::after {
    display: none;
}

/* Mobile Menu User Info */
.mobile-menu .user-info {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-medium);
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.mobile-menu .user-info span {
    font-size: 0.9rem;
}

.mobile-menu .user-info .btn {
    width: 100%;
    justify-content: center;
}

/* Theme Toggle in Mobile Menu */
.mobile-menu .theme-toggle {
    margin: 1.5rem 2rem 1rem 2rem;
    width: calc(100% - 4rem);
    justify-content: center;
}

/* Language Toggle in Mobile Menu */
.mobile-menu #languageToggleMobile {
    margin: 0 2rem 1.5rem 2rem;
    width: calc(100% - 4rem);
}

/* Desktop: Show normal nav, hide hamburger and mobile menu */
@media (min-width: 769px) {
    .hamburger,
    .mobile-nav-overlay,
    .mobile-menu {
        display: none !important;
    }
}

/* Mobile: Show hamburger, hide desktop nav */
@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
    }
    
    header nav {
        display: none !important;
    }
    
    .mobile-nav-overlay,
    .mobile-menu {
        display: block;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    .mobile-menu {
        width: 85%;
        max-width: 280px;
    }
    
    .mobile-menu nav a,
    .mobile-menu nav button {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Smooth scrolling for mobile menu */
.mobile-menu {
    -webkit-overflow-scrolling: touch;
}

/* Dark mode adjustments */
[data-theme="dark"] .mobile-menu {
    background: var(--bg-primary);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .mobile-nav-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .hamburger-line {
    background: var(--text-primary);
}

/* Ensure hamburger is always clickable */
.hamburger * {
    pointer-events: none;
}

.hamburger {
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

.route-arrow-icon {
    color: var(--primary);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.contracts-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.contract-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.contract-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.contract-id {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: monospace;
}

.contract-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-outstanding {
    background: #ffc107;
    color: #000;
}

.status-in_progress {
    background: #0dcaf0;
    color: #000;
}

.status-finished {
    background: #198754;
    color: white;
}

.contract-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.contract-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contract-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.contract-detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.contract-route {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.route-location {
    flex: 1;
}

.route-arrow {
    color: var(--primary);
    font-size: 1.5rem;
}

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

.location-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sync-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    text-align: center;
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}














.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls button:not(:disabled):hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.pagination-controls input[type="number"]::-webkit-inner-spin-button,
.pagination-controls input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.pagination-controls input[type="number"] {
    font-family: inherit;
    font-size: 1rem;
}
