:root {
    --bg-main: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --brand-primary: #4f46e5;
    --brand-indigo: #4338ca;
    --brand-blue: #3b82f6;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: var(--bg-main); 
    color: var(--text-primary); 
    -webkit-font-smoothing: antialiased; 
    line-height: 1.5;
}

.admin-layout { display: flex; height: 100vh; overflow: hidden; background: var(--bg-main); }

/* Sidebar */
.sidebar { 
    width: 280px; 
    background: var(--sidebar-bg); 
    display: flex; 
    flex-direction: column; 
    z-index: 10; 
    box-shadow: 4px 0 24px rgba(0,0,0,0.05); 
}
.logo { 
    padding: 2rem; 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: white; 
    letter-spacing: -0.5px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    text-decoration: none;
}
.logo img { box-shadow: 0 0 15px rgba(255,255,255,0.1); }

.nav-menu { padding: 1.5rem 1rem; flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;}
.nav-menu a { 
    display: flex; 
    align-items: center; 
    padding: 0.8rem 1.2rem; 
    color: var(--sidebar-text); 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: 500; 
    border-radius: var(--radius-md); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}
.nav-menu a:hover { background: rgba(255,255,255,0.05); color: white; transform: translateX(4px); }
.nav-menu a.active { 
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-indigo)); 
    color: white; 
    font-weight: 600; 
    box-shadow: var(--shadow-glow); 
}

.back-home { padding: 1.5rem; border-top: 1px solid rgba(255,255,255,0.05); }
.back-home a { color: var(--sidebar-text); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s;}
.back-home a:hover { color: white; }

/* Main Content */
.main-content { flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; position: relative; }
.topbar { 
    height: 80px; 
    background: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(12px); 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 3rem; 
    position: sticky; 
    top: 0; 
    z-index: 5; 
}
.topbar h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.user-profile { 
    font-weight: 600; 
    color: var(--brand-indigo); 
    font-size: 0.9rem; 
    background: #e0e7ff; 
    padding: 0.6rem 1.2rem; 
    border-radius: 30px; 
    border: 1px solid #c7d2fe; 
    cursor: pointer; 
    transition: all 0.2s; 
}
.user-profile:hover { box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); transform: translateY(-1px); }

.content-wrapper { padding: 2.5rem; max-width: 1600px; margin: 0 auto; width: 100%; animation: fadeUp 0.4s ease-out; }
.content-section { display: none; }
.content-section.active { display: block; animation: fadeUp 0.3s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Premium Cards & Layouts */
.grid-layout { display: grid; gap: 24px; margin-bottom: 24px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card { 
    background: white; 
    border: 1px solid rgba(226, 232, 240, 0.8); 
    border-radius: var(--radius-lg); 
    padding: 1.5rem; 
    box-shadow: var(--shadow-card); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative; 
    overflow: hidden; 
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.stat-card h3 { 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: var(--text-secondary); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    margin-bottom: 0.75rem; 
    display: flex; 
    align-items: center; 
    gap: 8px;
}
.stat-card .value { font-size: 2.25rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.25rem; letter-spacing: -1px; line-height: 1.2; }
.stat-card .subtitle { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* Dashboard Specific Beautiful Cards */
.card-gradient-1 { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.card-gradient-1 .value { color: #1e3a8a; }
.card-gradient-1 h3 { color: #2563eb; }

.card-gradient-2 { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-color: #bbf7d0; }
.card-gradient-2 .value { color: #14532d; }
.card-gradient-2 h3 { color: #059669; }

.card-gradient-3 { background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); border-color: #fecaca; }
.card-gradient-3 .value { color: #7f1d1d; }
.card-gradient-3 h3 { color: #dc2626; }

.icon-box { 
    width: 40px; 
    height: 40px; 
    border-radius: 10px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.2rem; 
    background: white; 
    box-shadow: var(--shadow-sm); 
}

/* Chart Containers */
.chart-container {
    width: 100%;
    position: relative;
    padding-top: 15px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 24px;
}
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid var(--border-color); font-weight: 500; }
.data-table th { 
    background: #f8fafc; 
    font-weight: 600; 
    color: var(--text-secondary); 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 0.5px; 
    border-bottom: 2px solid var(--border-color); 
    white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr { transition: background-color 0.2s; }
.data-table tr:hover td { background-color: #f8fafc; }

/* Badges */
.badge { 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    display: inline-block;
}
.badge.green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0;}
.badge.red { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;}
.badge.yellow { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a;}
.badge.blue { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe;}
.badge.dark { background: #1e293b; color: white; }

/* Forms & Buttons */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.form-input { 
    width: 100%; 
    padding: 0.75rem 1rem; 
    border: 1px solid var(--border-color); 
    background: white; 
    border-radius: var(--radius-md); 
    font-family: inherit; 
    font-size: 0.95rem; 
    outline: none; 
    transition: all 0.2s; 
    font-weight: 500;
}
.form-input:focus { border-color: var(--brand-indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

.btn { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white; 
    color: var(--text-primary); 
    border: 1px solid var(--border-color); 
    padding: 0.75rem 1.2rem; 
    border-radius: var(--radius-md); 
    font-weight: 600; 
    font-size: 0.9rem; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: var(--shadow-sm); 
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-primary { 
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-indigo)); 
    color: white; 
    border: none; 
    box-shadow: var(--shadow-glow); 
}
.btn-primary:hover { 
    background: linear-gradient(135deg, var(--brand-indigo), var(--brand-primary)); 
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.5); 
    color: white; 
}
.btn-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; color: #b91c1c; }
.btn-success { background: #dcfce7; color: #059669; border: 1px solid #bbf7d0; }
.btn-success:hover { background: #bbf7d0; color: #047857; }

/* Map Area styling */
.map-layout { gap: 24px; height: calc(100vh - 200px); min-height: 500px; }
.content-section.active.map-layout { display: flex; }
.map-area { flex: 1; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); position: relative; border: 1px solid var(--border-color); }
.rider-point { position: absolute; width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: 0 10px 25px rgba(0,0,0,0.15); cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 2; border: 3px solid var(--brand-blue); text-decoration: none;}
.rider-point:hover { transform: scale(1.15) translateY(-5px); box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4); z-index: 10; }
.rider-point.alert { border-color: var(--danger); animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Misc Utilities */
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 9999; }
.modal { background: white; padding: 2rem; border-radius: var(--radius-xl); width: 500px; max-width: 95%; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
#modal-overlay .modal { display: none; }
@keyframes slideUp { from { transform: translateY(20px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* Timeline */
.timeline { position: relative; padding-left: 20px; margin-top: 15px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: white; border: 2px solid var(--text-muted); z-index: 1; box-shadow: 0 0 0 4px white; }
.timeline-item.pending::before { border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); background: var(--brand-blue); }

.section-header {
    margin-bottom: 1.5rem;
}
.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.section-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}
