/* ============================================
   SCHOOL FLEET MANAGEMENT SYSTEM
   Enterprise SaaS Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables / Design Tokens ---- */
:root {
    /* Primary Blues */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Grays */
    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;

    /* Semantic Colors */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;

    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    --info-50: #eff6ff;
    --info-500: #3b82f6;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 25px -5px rgba(59, 130, 246, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Theme Colors (Light) */
    --bg-body: #f8f9fc;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #f9fafb;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
    --bg-body: #0f1117;
    --bg-surface: #1a1d29;
    --bg-surface-secondary: #21253a;
    --bg-sidebar: #14161f;
    --bg-header: rgba(20, 22, 31, 0.9);
    --border-color: #2a2d3a;
    --border-light: #21253a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-inverse: #0f172a;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 25px -5px rgba(59, 130, 246, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-700);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-base), width var(--transition-base);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 16px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-400);
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary-600);
    font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-400);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-600);
    border-radius: 0 4px 4px 0;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger-500);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--gray-50);
}

[data-theme="dark"] .sidebar-user:hover {
    background: var(--gray-800);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-400), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

/* ---- Header ---- */
.header {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 32px 0 36px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.header-search input::placeholder {
    color: var(--text-tertiary);
}

.header-search input:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.header-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.stat-badge:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-sm);
}

.stat-badge .stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

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

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

.header-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    position: relative;
    transition: all var(--transition-fast);
}

.header-icon-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

[data-theme="dark"] .header-icon-btn:hover {
    background: var(--gray-800);
}

.header-icon-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger-500);
    border-radius: 50%;
    border: 2px solid var(--bg-header);
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-400), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}

.header-avatar:hover {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ---- Theme Toggle ---- */
.theme-toggle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--gray-800);
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 28px 32px 28px 44px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-600), var(--success-500));
    color: white;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-600), var(--danger-500));
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    overflow: hidden;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface-secondary);
}

/* ---- Metric Cards (Fleet Overview) ---- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.metric-card.blue::before {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

.metric-card.green::before {
    background: linear-gradient(90deg, var(--success-600), var(--success-500));
}

.metric-card.amber::before {
    background: linear-gradient(90deg, var(--warning-500), #fbbf24);
}

.metric-card.red::before {
    background: linear-gradient(90deg, var(--danger-500), #f87171);
}

.metric-card.purple::before {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.metric-card.teal::before {
    background: linear-gradient(90deg, #0d9488, #2dd4bf);
}

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

.metric-card .metric-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.metric-card .metric-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.metric-card.blue .metric-icon {
    background: var(--primary-50);
    color: var(--primary-600);
}

.metric-card.green .metric-icon {
    background: var(--success-50);
    color: var(--success-600);
}

.metric-card.amber .metric-icon {
    background: var(--warning-50);
    color: var(--warning-600);
}

.metric-card.red .metric-icon {
    background: var(--danger-50);
    color: var(--danger-600);
}

.metric-card.purple .metric-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.metric-card.teal .metric-icon {
    background: #f0fdfa;
    color: #0d9488;
}

[data-theme="dark"] .metric-card.blue .metric-icon {
    background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .metric-card.green .metric-icon {
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .metric-card.amber .metric-icon {
    background: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .metric-card.red .metric-icon {
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .metric-card.purple .metric-icon {
    background: rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .metric-card.teal .metric-icon {
    background: rgba(13, 148, 136, 0.15);
}

.metric-card .metric-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.metric-card .metric-change.up {
    background: var(--success-50);
    color: var(--success-600);
}

.metric-card .metric-change.down {
    background: var(--danger-50);
    color: var(--danger-600);
}

[data-theme="dark"] .metric-card .metric-change.up {
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .metric-card .metric-change.down {
    background: rgba(239, 68, 68, 0.15);
}

.metric-card .metric-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.metric-card .metric-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ---- Content Grid ---- */
.content-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-7-5 {
    grid-template-columns: 7fr 5fr;
}

.grid-5-7 {
    grid-template-columns: 5fr 7fr;
}

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

/* ============================================
   DATA TABLE
   ============================================ */

.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--primary-50);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table tbody td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Status Badges ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.status-badge.good {
    background: var(--success-50);
    color: var(--success-700);
}

.status-badge.warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.status-badge.critical {
    background: var(--danger-50);
    color: var(--danger-600);
}

.status-badge.info {
    background: var(--info-50);
    color: var(--primary-600);
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.good .status-dot {
    background: var(--success-500);
}

.status-badge.warning .status-dot {
    background: var(--warning-500);
}

.status-badge.critical .status-dot {
    background: var(--danger-500);
}

.status-badge.info .status-dot {
    background: var(--primary-500);
}

[data-theme="dark"] .status-badge.good {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .status-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .status-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* ---- Progress Bar ---- */
.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .progress-bar {
    background: var(--gray-800);
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
    position: relative;
}

.progress-bar .progress-fill.green {
    background: linear-gradient(90deg, var(--success-500), #4ade80);
}

.progress-bar .progress-fill.blue {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

.progress-bar .progress-fill.amber {
    background: linear-gradient(90deg, var(--warning-500), #fbbf24);
}

.progress-bar .progress-fill.red {
    background: linear-gradient(90deg, var(--danger-500), #f87171);
}

.progress-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

/* ============================================
   CHARTS AREA
   ============================================ */

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

.chart-container.tall {
    height: 350px;
}

.chart-container.short {
    height: 200px;
}

/* ============================================
   ALERTS PANEL
   ============================================ */

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-item.alert-danger {
    background: var(--danger-50);
    border-left: 3px solid var(--danger-500);
}

.alert-item.alert-warning {
    background: var(--warning-50);
    border-left: 3px solid var(--warning-500);
}

.alert-item.alert-info {
    background: var(--info-50);
    border-left: 3px solid var(--primary-500);
}

[data-theme="dark"] .alert-item.alert-danger {
    background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .alert-item.alert-warning {
    background: rgba(245, 158, 11, 0.08);
}

[data-theme="dark"] .alert-item.alert-info {
    background: rgba(59, 130, 246, 0.08);
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.alert-danger .alert-icon {
    background: var(--danger-100);
    color: var(--danger-600);
}

.alert-warning .alert-icon {
    background: var(--warning-100);
    color: var(--warning-600);
}

.alert-info .alert-icon {
    background: var(--primary-100);
    color: var(--primary-600);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.alert-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.alert-time {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ============================================
   STUDENT TRANSPORT MODULE
   ============================================ */

.student-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 20px;
}

.student-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.student-name {
    font-size: 18px;
    font-weight: 700;
}

.student-meta {
    font-size: 13px;
    opacity: 0.85;
}

/* Form Elements */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input,
.form-select {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13.5px;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Slider */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    margin: 8px 0;
}

[data-theme="dark"] .range-slider {
    background: var(--gray-700);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-600);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-track {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--gray-300);
    position: relative;
    transition: background var(--transition-fast);
}

[data-theme="dark"] .toggle-track {
    background: var(--gray-600);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.toggle-switch input:checked+.toggle-track {
    background: var(--primary-600);
}

.toggle-switch input:checked+.toggle-track::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Suggested Fee Card */
.suggested-fee-card {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

[data-theme="dark"] .suggested-fee-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-color: rgba(34, 197, 94, 0.3);
}

.suggested-fee-card .fee-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--success-600);
    margin: 8px 0;
}

.suggested-fee-card .fee-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Fee History Table */
.fee-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

/* ============================================
   PROFITABILITY SECTION
   ============================================ */

.profit-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.profit-metric:last-child {
    border-bottom: none;
}

.profit-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.profit-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.badge-profit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.badge-profit.positive {
    background: var(--success-50);
    color: var(--success-600);
}

.badge-profit.negative {
    background: var(--danger-50);
    color: var(--danger-600);
}

[data-theme="dark"] .badge-profit.positive {
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .badge-profit.negative {
    background: rgba(239, 68, 68, 0.15);
}

/* ============================================
   PAGES - NAVIGATION & VISIBILITY
   ============================================ */

.page-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-view.active {
    display: block;
}

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

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

/* ============================================
   TABS
   ============================================ */

.tabs-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: var(--bg-surface-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background: var(--bg-surface);
    color: var(--primary-600);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    backdrop-filter: blur(2px);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .header-stats {
        display: none;
    }

    .grid-2,
    .grid-7-5,
    .grid-5-7 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .mobile-menu-btn {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .header-search {
        width: 200px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .page-content {
        padding: 18px 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .student-profile-card {
        flex-direction: column;
        text-align: center;
    }
}

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

    .header-search {
        display: none;
    }

    .stat-badge {
        display: none;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

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

.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

.animate-slide-up-delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.animate-slide-up-delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-slide-up-delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.animate-slide-up-delay-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

.animate-slide-up-delay-5 {
    animation-delay: 0.5s;
    opacity: 0;
}

.animate-slide-up-delay-6 {
    animation-delay: 0.6s;
    opacity: 0;
}

/* ---- Number counter animation ---- */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ---- Sparkle Indicator ---- */
.sparkle-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.sparkle-dot.live {
    background: var(--success-500);
}

.sparkle-dot.warning {
    background: var(--warning-500);
}

.sparkle-dot.danger {
    background: var(--danger-500);
}

/* ---- Tooltip ---- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--gray-900);
    color: white;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ---- Gradient Accent Lines ---- */
.gradient-accent {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-500), #8b5cf6, #ec4899);
}

/* ---- Empty State ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ---- Divider ---- */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

/* ============================================
   LIVE TRACKING MODULE
   ============================================ */

/* Live Badge Pulse */
.nav-badge.live-pulse {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    font-size: 9px;
    letter-spacing: 0.05em;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        opacity: 0.85;
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

/* Map Container */
.live-map-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--bg-surface-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.live-map-svg {
    width: 100%;
    height: 100%;
}

/* Bus Markers */
.bus-marker {
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bus-marker:hover {
    transform: scale(1.3);
}

.bus-pulse {
    animation: busPulseAnim 2s ease-in-out infinite;
}

@keyframes busPulseAnim {

    0%,
    100% {
        r: 14;
        opacity: 0.2;
    }

    50% {
        r: 20;
        opacity: 0.05;
    }
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 14px;
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Active Bus Status Card */
.bus-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: var(--bg-surface);
}

.bus-status-card:last-child {
    margin-bottom: 0;
}

.bus-status-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-sm);
    transform: translateX(3px);
}

.bus-status-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.bus-status-icon.on-time {
    background: linear-gradient(135deg, var(--success-600), var(--success-500));
}

.bus-status-icon.delayed {
    background: linear-gradient(135deg, var(--warning-600), var(--warning-500));
}

.bus-status-icon.late {
    background: linear-gradient(135deg, var(--danger-600), var(--danger-500));
}

.bus-status-info {
    flex: 1;
    min-width: 0;
}

.bus-status-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.bus-status-route {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bus-status-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.bus-speed {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.bus-eta {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Trip Timeline */
.trip-timeline {
    position: relative;
    padding-left: 28px;
}

.trip-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.timeline-stop {
    position: relative;
    padding: 10px 0 10px 16px;
}

.timeline-stop::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid var(--bg-surface);
    z-index: 1;
}

.timeline-stop.completed::before {
    background: var(--success-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.timeline-stop.current::before {
    background: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    animation: timelinePulse 2s infinite;
}

.timeline-stop.upcoming::before {
    background: var(--gray-300);
}

@keyframes timelinePulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.1);
    }
}

.timeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.timeline-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.timeline-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.timeline-stop.completed .timeline-name {
    color: var(--success-600);
}

.timeline-stop.current .timeline-name {
    color: var(--primary-600);
}

.timeline-stop.upcoming .timeline-name {
    color: var(--text-tertiary);
}

/* Parent Notification Item */
.parent-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.parent-notif-item:hover {
    border-color: var(--primary-200);
}

.parent-notif-item:last-child {
    margin-bottom: 0;
}

.notif-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.notif-avatar.pickup {
    background: linear-gradient(135deg, var(--success-500), #4ade80);
}

.notif-avatar.dropoff {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
}

.notif-avatar.delay {
    background: linear-gradient(135deg, var(--warning-500), #fbbf24);
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.notif-text strong {
    font-weight: 700;
}

.notif-time {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 3px;
}

/* Tracking Map Card */
.tracking-map-card .card-body {
    background: var(--bg-surface-secondary);
}

@media (max-width: 768px) {
    .live-map-container {
        height: 280px;
    }

    .map-legend {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ============================================
   MAINTENANCE & SERVICE MODULE
   ============================================ */

/* Service Schedule Card */
.service-schedule-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    transition: all var(--transition-fast);
    background: var(--bg-surface);
}

.service-schedule-item:last-child {
    margin-bottom: 0;
}

.service-schedule-item:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-sm);
}

.service-countdown {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

.service-countdown .countdown-num {
    font-size: 20px;
    line-height: 1;
}

.service-countdown .countdown-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.service-countdown.urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-600);
}

.service-countdown.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning-600);
}

.service-countdown.normal {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: var(--primary-600);
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-bus-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.service-type {
    font-size: 12px;
    color: var(--text-tertiary);
}

.service-meta-right {
    text-align: right;
    flex-shrink: 0;
}

.service-odometer {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.service-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Work Order Card */
.work-order-item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    transition: all var(--transition-fast);
    background: var(--bg-surface);
}

.work-order-item:last-child {
    margin-bottom: 0;
}

.work-order-item:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-sm);
}

.wo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wo-id {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

[data-theme="dark"] .wo-id {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-400);
}

.wo-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wo-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.wo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.wo-assigned {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.wo-assigned-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: 700;
}

/* Parts Inventory Row */
.parts-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.parts-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 16px;
    flex-shrink: 0;
}

.parts-name {
    flex: 1;
    min-width: 0;
}

.parts-name-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.parts-sku {
    font-size: 11px;
    color: var(--text-tertiary);
}

.parts-stock {
    text-align: right;
    flex-shrink: 0;
}

.stock-qty {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.stock-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stock-status.good {
    color: var(--success-500);
}

.stock-status.low {
    color: var(--warning-500);
}

.stock-status.critical {
    color: var(--danger-500);
}


/* ============================================
   ATTENDANCE & SAFETY MODULE
   ============================================ */

/* Safety Checklist */
.safety-checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.safety-check-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.safety-check-icon.passed {
    background: var(--success-50);
    color: var(--success-600);
}

.safety-check-icon.warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.safety-check-icon.failed {
    background: var(--danger-50);
    color: var(--danger-600);
}

[data-theme="dark"] .safety-check-icon.passed {
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .safety-check-icon.warning {
    background: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .safety-check-icon.failed {
    background: rgba(239, 68, 68, 0.15);
}

.safety-check-info {
    flex: 1;
}

.safety-check-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.safety-check-detail {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Emergency Contact Card */
.emergency-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    transition: all var(--transition-fast);
    background: var(--bg-surface);
}

.emergency-contact-item:last-child {
    margin-bottom: 0;
}

.emergency-contact-item:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-sm);
}

.emergency-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.emergency-avatar.police {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
}

.emergency-avatar.ambulance {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.emergency-avatar.school {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.emergency-avatar.transport {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
}

.emergency-info {
    flex: 1;
}

.emergency-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.emergency-role {
    font-size: 11px;
    color: var(--text-tertiary);
}

.emergency-phone {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-600);
    flex-shrink: 0;
}

/* Absent Student Row */
.absent-student-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.absent-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

[data-theme="dark"] .absent-avatar {
    background: var(--gray-700);
}

.absent-info {
    flex: 1;
    min-width: 0;
}

.absent-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.absent-meta {
    font-size: 11px;
    color: var(--text-tertiary);
}

.absent-reason {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.absent-reason.informed {
    background: var(--primary-50);
    color: var(--primary-600);
}

.absent-reason.uninformed {
    background: var(--danger-50);
    color: var(--danger-600);
}

[data-theme="dark"] .absent-reason.informed {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-400);
}

[data-theme="dark"] .absent-reason.uninformed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Incident Log Item */
.incident-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.incident-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.incident-severity {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.incident-severity.low {
    background: var(--primary-500);
}

.incident-severity.medium {
    background: var(--warning-500);
}

.incident-severity.high {
    background: var(--danger-500);
}

.incident-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.incident-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-tertiary);
}

.incident-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
    padding-left: 16px;
}

/* ============================================
   DASHBOARD V2 (reference-style layout)
   ============================================ */

.dashboard-v2 {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kpi-tiles {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.kpi-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 14px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.kpi-tile:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-200);
}

[data-theme="dark"] .kpi-tile:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.kpi-icon.blue {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
}

.kpi-icon.green {
    background: linear-gradient(135deg, var(--success-600), var(--success-500));
}

.kpi-icon.red {
    background: linear-gradient(135deg, var(--danger-600), var(--danger-500));
}

.kpi-icon.amber {
    background: linear-gradient(135deg, var(--warning-600), var(--warning-500));
}

.kpi-icon.purple {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.kpi-icon.teal {
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
}

.kpi-body {
    min-width: 0;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-top: 2px;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.span-3 {
    grid-column: span 3;
}

.span-4 {
    grid-column: span 4;
}

.span-6 {
    grid-column: span 6;
}

.span-8 {
    grid-column: span 8;
}

.data-table-compact {
    min-width: 0;
}

.data-table-compact thead th {
    padding: 10px 12px;
}

.data-table-compact tbody td {
    padding: 10px 12px;
    font-size: 12.5px;
}

.best-driver-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.best-driver-banner i {
    color: var(--warning-500);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick-actions-grid .btn {
    justify-content: flex-start;
}

.mini-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.45;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-surface-secondary);
}

[data-theme="dark"] .status-row {
    border-color: var(--border-color);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.status-dot-lg {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-count {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.mini-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-surface-secondary);
}

[data-theme="dark"] .mini-alert {
    border-color: var(--border-color);
}

.mini-alert .mini-alert-text {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-alert .mini-alert-badge {
    flex-shrink: 0;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.mini-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.mini-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 10px;
}

.legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-light);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

[data-theme="dark"] .legend-pill {
    border-color: var(--border-color);
}

.legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

@media (max-width: 1200px) {
    .kpi-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .span-3,
    .span-4,
    .span-6,
    .span-8 {
        grid-column: span 12;
    }

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

@media (max-width: 768px) {
    .kpi-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}
/* ==========================================================================
   Laravel additions
   --------------------------------------------------------------------------
   Everything above this line is the original template stylesheet, unmodified.
   Below are the few controls a real application needs that a static mockup
   did not: a working logout button, server-side flash messages and validation
   errors. They are built from the same tokens as the rest of the sheet, so
   they inherit dark mode for free.
   ========================================================================== */

.sidebar-user-form { margin: 0; }

.sidebar-logout {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 14px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-logout:hover {
    background: var(--danger-50);
    color: var(--danger-600);
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.flash-success { background: var(--success-50); color: var(--success-700); border-color: var(--success-100); }
.flash-error   { background: var(--danger-50);  color: var(--danger-600);  border-color: var(--danger-100); }

.field-error {
    color: var(--danger-600);
    font-size: 13px;
    margin-top: 6px;
}

.input-invalid { border-color: var(--danger-500) !important; }

/* --- forms ---------------------------------------------------------------
   The mockup had no form anywhere: nothing was ever submitted. These rules are
   new, and stay deliberately close to .header-search and .data-table so the
   create/edit screens read as part of the same product.
   ------------------------------------------------------------------------ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.form-field { display: flex; flex-direction: column; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* --- auth screens --------------------------------------------------------
   Login, register and the public landing page. Also new -- the template had
   no notion of a user who was not already signed in.
   ------------------------------------------------------------------------ */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 10% -10%, var(--primary-50), transparent 60%),
        var(--bg-body);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 32px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.auth-sub { font-size: 14px; color: var(--text-tertiary); margin: 0 0 24px; }
.auth-fields { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { margin-top: 20px; font-size: 14px; color: var(--text-tertiary); text-align: center; }
.auth-foot a { color: var(--primary-600); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.btn-block { width: 100%; justify-content: center; }

/* --- public landing page ------------------------------------------------- */

.landing { max-width: 1120px; margin: 0 auto; padding: 24px; }

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 0 32px;
}

.landing-hero { text-align: center; padding: 48px 0 64px; }

.landing-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-700);
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 24px;
}

.landing-hero h1 {
    font-size: clamp(32px, 6vw, 56px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.landing-hero p {
    max-width: 620px;
    margin: 0 auto 32px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 56px;
}

.landing-feature {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.landing-feature:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.landing-feature h3 { font-size: 16px; color: var(--text-primary); margin: 16px 0 8px; }
.landing-feature p { font-size: 14px; line-height: 1.6; color: var(--text-tertiary); margin: 0; }

.landing-foot {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-tertiary);
}
