:root {
    /* Color Palette */
    --primary: #4a6ee0;
    --primary-dark: #3a5ac7;
    --primary-light: #eef2ff;
    --secondary: #6c757d;
    --success: #3bd475;
    --error: #ff6b6b;
    --warning: #ffd166;
    --info: #4ecdc4;
    
    /* Backgrounds */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-table-header: #f8f9fa;
    --bg-input: #ffffff;
    
    /* Text */
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    
    /* Borders */
    --border: #dee2e6;
    --border-light: #e9ecef;
    
    /* Shadows */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);
    
    /* Accents */
    --focus-glow: 0 0 0 3px rgba(74, 110, 224, 0.15);
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--space-md);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

h1 {
    font-size: 2.2rem;
    color: var(--primary);
}

h2 {
    font-size: 1.6rem;
    position: relative;
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

/* Layout Containers */
.auth-container, 
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.auth-container {
    max-width: 480px;
    margin: var(--space-xl) auto;
}

.auth-card, 
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition-normal);
}

.auth-card {
    padding: var(--space-xl) var(--space-lg);
}

.logo-container {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.logo {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-sm);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    background: var(--bg-header);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

/* Form Elements */
.form-container {
    margin-top: var(--space-md);
}

.input-group {
    margin-bottom: var(--space-md);
}

.input-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

input, 
select, 
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition-normal);
}

input:focus, 
select:focus, 
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: var(--focus-glow);
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition-normal);
}

.tab.active {
    color: var(--primary);
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.error {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--error);
    color: var(--error);
}

.success {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

/* Tables */
.route-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.route-table th, 
.route-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.route-table th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.route-table tr:hover {
    background-color: var(--primary-light);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

/* Filters */
.filter-container {
    margin-bottom: var(--space-md);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    margin-bottom: var(--space-md);
}

.filter-group label {
    margin-bottom: 0;
    font-weight: 500;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.autocomplete-suggestions div {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.autocomplete-suggestions div:hover {
    background: var(--primary-light);
}

/* Form States */
.form-container {
    display: none;
}

.form-container.active {
    display: block;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active {
    background-color: rgba(59, 212, 117, 0.15);
    color: #3bd475;
}

.status-badge.expired {
    background-color: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: var(--space-sm);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}