/* ==========================================================================
   EXAMVERSE Comprehensive Modern Admin Panel Design System
   Sleek Navy Brand Sidebar (#00152e), Clean Light Workspaces (#f8fafc),
   Crisp High-Contrast Typography, Polished SaaS Components & Tables
   ========================================================================== */

:root {
    /* Main Layout & Backgrounds */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --sidebar-bg: #00152e;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: #2563eb;
    
    /* Legacy / Compatibility aliases */
    --bg-dark: #ffffff;
    --card-dark: #ffffff;
    --card-bg: #ffffff;
    --border-glass: #e2e8f0;
    --card-border: #e2e8f0;
    --surface-elevated: #f8fafc;
    
    /* Typography Inks */
    --text: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --on-accent: #ffffff;

    /* Vibrant Accent Palette */
    --accent: #2563eb;
    --accent-primary: #2563eb;
    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;
    --accent-emerald: #10b981;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-orange: #f97316;
    --accent-purple: #8b5cf6;
    --accent-violet: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-rose: #ef4444;
    --accent-danger: #ef4444;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Elevation & Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);

    --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 1. GLOBAL RESETS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #1d4ed8;
}

/* 2. SIDEBAR NAVIGATION */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 1.25rem 0.5rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.75rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.brand-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #93c5fd;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 2rem;
}

.nav-section-label {
    padding: 14px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
}

.nav-badge.new {
    background: #3b82f6;
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
}

/* 3. MAIN CONTENT LAYOUT */
.main-wrapper {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 250px);
}

/* 4. TOP APP BAR */
.top-bar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.search-box {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    width: 380px;
    gap: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: var(--text-primary);
}

.search-shortcut {
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-quick-action {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
    transition: background 0.15s ease;
}

.btn-quick-action:hover {
    background: #1d4ed8;
}

.icon-button {
    background: transparent;
    border: 1px solid #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.icon-button:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 4px;
    min-width: 16px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}

/* 5. PAGE BODY & CONTAINERS */
.content-body {
    padding: 1.75rem 2rem;
    flex: 1;
}

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

/* 6. CARDS & PANELS */
.card, .table-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header-flex, .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title-main, .table-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-link-action {
    font-size: 12.5px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 7. STATS & METRICS GRIDS */
.metrics-grid, .stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card-modern, .metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-title, .metric-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-card-value, .metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-card-trend {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.trend-up { color: #10b981; }
.trend-down { color: #ef4444; }

/* 8. DASHBOARD MULTI-COLUMN GRIDS */
.dash-row-3 {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-row-2 {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dash-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1280px) {
    .dash-row-3, .dash-row-2, .dash-row-4 {
        grid-template-columns: 1fr;
    }
}

/* 9. DATA TABLES */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table, .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-primary);
}

table th, .table th {
    text-align: left;
    padding: 10px 14px;
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

table td, .table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-secondary);
    vertical-align: middle;
}

table tr:hover td, .table tr:hover td {
    background: #f8fafc;
}

/* 10. FORM INPUTS & SELECTS */
input, select, textarea, .form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

select {
    cursor: pointer;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-group {
    margin-bottom: 14px;
}

/* 11. BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.btn-outline {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

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

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

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

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: 6px;
}

/* 12. STATUS BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-info { background: #cffafe; color: #0e7490; }

/* 13. ALERTS & NOTIFICATIONS */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger { background: #fee2e2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fef3c7; border: 1px solid #fde68a; color: #b45309; }
.alert-info { background: #dbeafe; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* 14. MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

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

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