/* ===================================================
   SISTEM UJIAN SEKOLAH DIGITAL + OMR
   Modern School Admin Stylesheet
   =================================================== */

:root {
    --primary-color: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-subtle: #eff6ff;
    --secondary-color: #475569;
    --accent-color: #0284c7;
    --bg-canvas: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #1e293b;
    --topbar-height: 64px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 0.925rem;
    line-height: 1.6;
}

/* Typography Helpers */
.fs-7 { font-size: 0.875rem !important; }
.fs-8 { font-size: 0.8rem !important; }
.fs-9 { font-size: 0.725rem !important; }

/* Wrapper Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1040;
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.brand-title {
    letter-spacing: 0.04em;
    color: #ffffff;
}

.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-nav .nav-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.85rem 0.75rem 0.35rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    color: #94a3b8;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

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

.sidebar-nav .nav-link.active {
    color: #ffffff;
    background-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

/* Top Navbar */
.top-navbar {
    height: var(--topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1020;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--primary-subtle);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

/* Content Body */
.content-body {
    flex: 1;
    padding: 1.5rem 1.75rem;
}

/* Modern Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Metric / Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* Tables */
.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Status Badges */
.badge-benar { background-color: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-salah { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-kosong { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-ganda { background-color: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.badge-verifikasi { background-color: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }

/* OMR Preview & Inspection */
.omr-inspector-container {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1e293b;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
}

.omr-img-preview {
    max-width: 100%;
    max-height: 700px;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.bubble-highlight-box {
    position: absolute;
    border: 2px solid #ef4444;
    background-color: rgba(239, 68, 68, 0.2);
    border-radius: 4px;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Animated Pulse for urgent alerts */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}
.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

/* Watermark for Student Exam View */
.exam-watermark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-content: space-around;
    transform: rotate(-25deg) scale(1.2);
    font-size: 1.5rem;
    font-weight: 800;
    color: #000000;
    user-select: none;
}

/* Responsive Breakpoints */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
    }
    .sidebar.show {
        left: 0;
    }
    .content-body {
        padding: 1rem;
    }
}
