:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
}

/* =========================================================
   MODERN MINIMALIST TOP NAVBAR
========================================================= */
.modern-navbar {
    background: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1040 !important;
}


.brand-icon-box {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-img {
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #ffffff;
}

.brand-subtitle {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: #94a3b8;
}

.user-profile-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    transition: all 0.2s ease;
}

.user-profile-pill:hover {
    background: rgba(255, 255, 255, 0.14);
}

.user-avatar-circle {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-pill-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.1;
}

.user-pill-role {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    color: #93c5fd;
}

.nav-item-header {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 10px 12px 4px;
}

/* =========================================================
   MODERN SLEEK SIDEBAR
========================================================= */
.app-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 61px);
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: #f8fafc;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1030;
}

.sidebar-inner {
    position: sticky;
    top: 61px;
    max-height: calc(100vh - 61px);
    overflow-y: auto;
    z-index: 1030;
}


.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 8px 18px 4px;
    text-transform: uppercase;
}

.sidebar .nav-link {
    font-size: 0.86rem;
    font-weight: 500;
    color: #94a3b8;
    padding: 9px 14px;
    margin: 2px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.sidebar .nav-link .icon-wrap {
    font-size: 1.05rem;
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Sidebar Submenu & Minimalist Accordion */
.sidebar .nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
}
.sidebar .nav-dropdown-toggle .chevron-arrow {
    margin-left: auto;
    font-size: 0.72rem;
    transition: transform 0.25s ease, opacity 0.2s ease;
    opacity: 0.6;
}
.sidebar .nav-dropdown-toggle:not(.collapsed) .chevron-arrow {
    transform: rotate(90deg);
    opacity: 1;
}
.sidebar .nav-dropdown-toggle.parent-active {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.07);
    font-weight: 600;
}
.sidebar .nav-dropdown-toggle.parent-active .icon-wrap {
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5));
}
.sidebar-submenu {
    padding-left: 10px;
    margin: 4px 14px 8px 18px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}
.sidebar-submenu .nav-link {
    font-size: 0.81rem;
    padding: 7px 12px;
    margin: 3px 0;
    border-radius: 9px;
    color: #94a3b8;
    gap: 9px;
    font-weight: 500;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.sidebar-submenu .nav-link .icon-wrap {
    font-size: 0.92rem;
    width: 18px;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}
.sidebar-submenu .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}
.sidebar-submenu .nav-link:hover .icon-wrap {
    opacity: 1;
}
.sidebar-submenu .nav-link.active {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.sidebar-submenu .nav-link.active .icon-wrap {
    opacity: 1;
}
.sidebar-submenu .nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: #3b82f6;
    border-radius: 0 4px 4px 0;
}

/* =========================================================
   MODERN MINIMALIST SUBNAV PILLS (Untuk Ruang & Pengawas)
   ========================================================= */
.ruang-subnav-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 5px;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ruang-subnav-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ruang-subnav-pills .nav-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    padding: 7px 14px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    border: 1px solid transparent;
}

.ruang-subnav-pills .nav-link i {
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.ruang-subnav-pills .nav-link:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
}

.ruang-subnav-pills .nav-link:hover i {
    transform: translateY(-1px);
}

.ruang-subnav-pills .nav-link.active {
    color: #0f172a;
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ruang-subnav-pills .nav-link.active i {
    color: #2563eb !important;
}

/* Mobile Drawer Submenu */
.navbar-nav .nav-dropdown-toggle {
    cursor: pointer;
}
.navbar-nav .nav-dropdown-toggle .chevron-arrow {
    margin-left: auto;
    font-size: 0.72rem;
    transition: transform 0.25s ease;
    opacity: 0.6;
}
.navbar-nav .nav-dropdown-toggle:not(.collapsed) .chevron-arrow {
    transform: rotate(90deg);
    opacity: 1;
}
.mobile-submenu {
    padding-left: 14px;
    margin: 4px 0 8px 12px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.15);
}
.mobile-submenu .nav-link {
    font-size: 0.85rem;
    padding: 6px 10px;
    color: #cbd5e1;
}
.mobile-submenu .nav-link:hover {
    color: #ffffff;
}

.main-content {
    flex: 1;
    background-color: #f8fafc;
    overflow-x: hidden;
}

/* =========================================================
   MODERN FORM CONTROLS & BUTTONS
========================================================= */
.form-control, .form-select {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    padding: 9px 14px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 16px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn-sm {
    min-height: 32px;
    padding: 0.35rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 8px;
}

.btn-group .btn {
    display: inline-flex;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

/* =========================================================
   BENTO-GRID STAT CARDS & WIDGETS
========================================================= */
.bento-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.bento-icon-box {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.bento-value {
    font-size: 1.95rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #0f172a;
    margin-top: 8px;
}

.bento-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

/* =========================================================
   MODERN CARDS & TABLES
========================================================= */
.card-modern {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.card-modern .card-header {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 18px 24px;
}

.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    background-color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 18px;
}

.table-modern tbody td {
    padding: 14px 18px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

.table-modern tbody tr:hover {
    background-color: #f8fafc;
}


/* Exam UI Mobile-First */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
}

.exam-timer-card {
    position: sticky;
    top: 10px;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.soal-card {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

.opsi-item {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: #ffffff;
    user-select: none;
}

.opsi-item:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
}

.opsi-item.selected {
    border-color: var(--primary-color);
    background-color: #eff6ff;
    font-weight: 500;
}

.opsi-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.opsi-item.selected .opsi-badge {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Number Navigator Grid */
.number-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.btn-number-nav {
    height: 42px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive adjustment */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }
    .main-content {
        padding: 16px;
    }
    .number-nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Exam Navigation Mobile Optimization */
.exam-nav-card .btn {
    white-space: nowrap;
    font-size: 0.9rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

@media (max-width: 575.98px) {
    .exam-nav-card .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.35rem;
        min-height: 38px;
    }
    .soal-card {
        padding: 16px;
    }
    .opsi-item {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
}

/* =========================================================
   Interactive Matching (Menjodohkan Drag & Drop & Tap-to-Pair)
   ========================================================= */
.matching-container {
    user-select: none;
}

.matching-left-row {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.matching-left-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.06);
}

.matching-left-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.matching-dropzone {
    min-height: 48px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.matching-dropzone.drop-hover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
    transform: scale(1.01);
}

.matching-dropzone.has-item {
    border-style: solid;
    border-color: #93c5fd;
    background-color: #eff6ff;
}

.matching-dropzone-placeholder {
    font-size: 0.85rem;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.matching-bank-area {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.matching-bank-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.matching-bank-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.draggable-item {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.draggable-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.12);
}

.draggable-item:active, .draggable-item.dragging {
    cursor: grabbing;
    opacity: 0.6;
    transform: scale(0.98);
}

.draggable-item.item-selected {
    border-color: var(--primary-color);
    background-color: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.draggable-item.item-disabled {
    opacity: 0.45;
    background-color: #f1f5f9;
    border-style: dashed;
    border-color: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.draggable-item .drag-handle {
    color: #94a3b8;
    font-size: 1.1rem;
}

.paired-chip {
    background: #ffffff;
    border: 1px solid #93c5fd;
    color: #1e40af;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.paired-chip .btn-unpair {
    border: none;
    background: none;
    color: #94a3b8;
    padding: 0 4px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}

.paired-chip .btn-unpair:hover {
    color: #ef4444;
}

@keyframes pulseDropzone {
    0%, 100% {
        border-color: #2563eb;
        background-color: #eff6ff;
    }
    50% {
        border-color: #16a34a;
        background-color: #f0fdf4;
    }
}

.matching-dropzone.matching-ready {
    border-style: solid;
    border-width: 2px;
    animation: pulseDropzone 1.8s infinite ease-in-out;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@media (max-width: 767.98px) {
    .matching-dropzone {
        min-height: 48px;
        margin-top: 8px;
        padding: 8px;
    }

    .draggable-item {
        padding: 10px 16px;
        font-size: 0.95rem;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .paired-chip {
        padding: 8px 12px;
    }

    .paired-chip .btn-unpair {
        padding: 4px 8px;
        font-size: 1.2rem;
    }
}

/* =========================================================
   A4 EXAM & DESK CARDS (10 CARDS PER PAGE - 2x5 GRID)
========================================================= */
.a4-workspace {
    background-color: #0f172a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1.5px, transparent 0);
    background-size: 24px 24px;
    border-radius: 16px;
    padding: 30px 20px;
    overflow-x: auto;
    min-height: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.sheet-container-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sheet-header-badge {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

.sheet-scaler {
    transform-origin: top center;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

.sheet-a4 {
    width: 210mm;
    height: 297mm;
    max-height: 297mm;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    padding: 6mm 5mm;
    display: grid;
    grid-template-columns: repeat(2, 98mm);
    grid-template-rows: repeat(5, 55mm);
    column-gap: 4mm;
    row-gap: 2.5mm;
    justify-content: center;
    align-content: start;
    page-break-after: always;
    break-after: page;
    position: relative;
    color: #1e293b;
    font-family: Arial, Helvetica, sans-serif;
    border-radius: 2px;
}

.exam-card {
    width: 98mm;
    height: 55mm;
    max-height: 55mm;
    box-sizing: border-box;
    padding: 2.5mm 3mm;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Border styles */
.border-dashed-card { border: 1px dashed #94a3b8; }
.border-solid-card  { border: 1px solid #cbd5e1; }
.border-double-card { border: 2px solid #0f172a; }
.border-none-card   { border: 1px solid transparent; }

/* Color Themes */
.theme-blue    { --card-accent: #1e40af; --card-light: #eff6ff; }
.theme-emerald { --card-accent: #065f46; --card-light: #ecfdf5; }
.theme-purple  { --card-accent: #6b21a8; --card-light: #faf5ff; }
.theme-ruby    { --card-accent: #991b1b; --card-light: #fef2f2; }
.theme-mono    { --card-accent: #0f172a; --card-light: #f8fafc; }


/* Card Header */
.exam-card-header {
    display: flex;
    align-items: center;
    gap: 2mm;
    border-bottom: 1.5px double var(--card-accent, #0f172a);
    padding-bottom: 1.2mm;
    margin-bottom: 1.5mm;
}

.exam-card-logo {
    width: 10mm;
    height: 10mm;
    object-fit: contain;
    flex-shrink: 0;
}

.exam-card-titles {
    flex-grow: 1;
    text-align: center;
    line-height: 1.1;
}

.exam-card-school {
    font-size: 7pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: var(--card-accent, #0f172a);
}

.exam-card-title {
    font-size: 6.5pt;
    font-weight: 700;
    text-transform: uppercase;
}

.exam-card-subtitle {
    font-size: 5.5pt;
    color: #475569;
}

/* Card Body */
.exam-card-body {
    display: flex;
    gap: 2.5mm;
    flex-grow: 1;
    overflow: hidden;
}

.exam-card-photo-box {
    width: 18mm;
    height: 24mm;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 5pt;
    color: #94a3b8;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

.exam-card-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exam-card-info-table {
    flex: 0 0 auto;
    flex-grow: 0;
    flex-shrink: 0;
    height: auto;
    font-size: 5.8pt;
    line-height: 1.25;
    border-collapse: collapse;
}

.exam-card-info-table tr,
.exam-card-info-table td {
    height: auto;
}

.exam-card-info-table td {
    padding: 0.4mm 0.5mm;
    vertical-align: top;
}

.exam-card-info-table td.label-col {
    width: 23mm;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.exam-card-info-table td.val-col {
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}

.exam-card-info-table td.val-col.student-name {
    font-weight: 800;
    color: var(--card-accent, #0f172a);
    font-size: 6.2pt;
    text-transform: uppercase;
}

.login-pill {
    display: inline-block;
    background: var(--card-light, #eff6ff);
    border: 1px solid #bfdbfe;
    padding: 0.2mm 1.2mm;
    border-radius: 2px;
    font-family: monospace;
    font-size: 6pt;
    font-weight: bold;
    color: var(--card-accent, #1e40af);
}

/* Card Footer (TTD & Stamp) */
.exam-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 5pt;
    line-height: 1.15;
}

.exam-card-body.photo-pos-right {
    flex-direction: row-reverse !important;
}

/* -------------------------------------------------------------
   KARTU RESMI DINAS / MADRASAH PERSIS GAMBAR REFERENSI USER
   ------------------------------------------------------------- */
.exam-card.card-style-dinas {
    width: 98mm !important;
    height: 55mm !important;
    max-height: 55mm !important;
    padding: 0 !important;
    border: 1.5px solid #000000 !important;
    background: #ffffff;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    overflow: hidden;
    box-sizing: border-box !important;
    position: relative !important;
}

.exam-card.card-style-dinas.border-dashed-card { border: 1.2px dashed #000000 !important; }
.exam-card.card-style-dinas.border-double-card { border: 2.5px double #000000 !important; }
.exam-card.card-style-dinas.border-none-card   { border: 1px solid transparent !important; }

.exam-card-header-dinas {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100%;
    height: 16mm;
    min-height: 16mm;
    max-height: 16mm;
    border-bottom: 2px solid #000000;
    box-sizing: border-box;
    flex-shrink: 0;
    background: #ffffff;
    margin: 0;
    padding: 0;
}

.header-dinas-logo {
    width: 16mm;
    min-width: 16mm;
    max-width: 16mm;
    height: 100%;
    border-right: 1.5px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1mm;
    box-sizing: border-box;
    flex-shrink: 0;
    background: #ffffff;
}

.header-dinas-logo.is-hidden {
    display: none !important;
}

.header-dinas-titles {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.5mm 1.5mm;
    line-height: 1.25;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
    background: #ffffff;
}

/* Baris 1 – besar & tebal (font-size diatur via inline style dari PHP/JS) */
.header-dinas-titles .dyn-kop-baris1 {
    font-weight: 800;
    text-transform: uppercase;
    color: #000000;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

/* Baris 2 – tebal (font-size diatur via inline style) */
.header-dinas-titles .dyn-kop-baris2 {
    font-weight: 800;
    text-transform: uppercase;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin: 0.3mm 0;
    padding: 0;
    line-height: 1.2;
}

/* Baris 3 – sedang (font-size diatur via inline style) */
.header-dinas-titles .dyn-kop-baris3 {
    font-weight: 600;
    color: #111111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.header-dinas-strip {
    width: 6.5mm;
    min-width: 6.5mm;
    max-width: 6.5mm;
    height: 100%;
    border-left: 1.5px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-sizing: border-box;
    flex-shrink: 0;
    padding: 0;
}

.header-dinas-strip .strip-text {
    writing-mode: vertical-rl;
    -webkit-writing-mode: vertical-rl;
    -ms-writing-mode: tb-rl;
    font-size: 5.5pt;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #000000;
    text-align: center;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    transform: none;
}

.exam-card-body-dinas {
    padding: 1.2mm 2.2mm 1.5mm 2.2mm;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* .body-dinas-subhead sudah dihapus — sub-judul tidak lagi ditampilkan di badan kartu */

.body-dinas-content {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.5mm;
    width: 100%;
    height: 100%;
    flex-grow: 1;
}

.body-dinas-left {
    flex: 1 1 54mm;
    max-width: 56mm;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    box-sizing: border-box;
}

.body-dinas-left .exam-card-info-table {
    width: 100%;
    font-size: 5.6pt;
    line-height: 1.24;
    border-collapse: collapse;
    flex: 0 0 auto;
    flex-grow: 0;
    flex-shrink: 0;
    height: auto;
}

.body-dinas-left .exam-card-info-table td {
    padding: 0.18mm 0.35mm;
    vertical-align: middle;
}

.body-dinas-left .exam-card-info-table td.label-col {
    width: 17mm;
    color: #111111;
    font-weight: 600;
    white-space: nowrap;
}

.body-dinas-left .exam-card-info-table td.val-col {
    color: #000000;
    font-weight: 600;
    word-break: break-word;
}

.body-dinas-left .student-name {
    font-size: 5.7pt !important;
    text-transform: uppercase;
    color: #000000 !important;
    font-weight: 800;
}

.body-dinas-left .login-pill {
    display: inline-block;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.1mm 1.2mm;
    border-radius: 2px;
    font-family: monospace;
    font-size: 5.8pt;
    font-weight: bold;
    color: #1e40af;
}

.body-dinas-left .box-qr {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1.8mm !important;
    margin-top: auto !important;
    padding: 0.6mm 1mm !important;
    background: #f8fafc !important;
    border: 0.7px solid #cbd5e1 !important;
    border-radius: 3px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 54mm !important;
}

.body-dinas-left .box-qr.is-hidden {
    display: none !important;
}

.body-dinas-left .qr-info-meta {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0.3mm !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
}

.body-dinas-left .qr-badge-type {
    font-size: 4.4pt !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2px !important;
    color: #1e40af !important;
    background: #dbeafe !important;
    padding: 0.15mm 0.8mm !important;
    border-radius: 2px !important;
    display: inline-block !important;
    width: fit-content !important;
    white-space: nowrap !important;
}

.card-mode-meja .body-dinas-left .qr-badge-type {
    color: #065f46 !important;
    background: #d1fae5 !important;
}

.body-dinas-left .qr-text-hint {
    font-size: 3.8pt !important;
    font-weight: 600 !important;
    color: #475569 !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2px !important;
}

.body-dinas-right {
    flex: 0 0 35mm;
    width: 35mm;
    min-width: 35mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    height: 100%;
    text-align: center;
}

.body-dinas-right .exam-card-sign-area {
    width: 100%;
    text-align: center;
    margin-top: auto;
}

.body-dinas-right .exam-card-sign-date {
    font-size: 4.8pt;
    color: #111111;
}

.body-dinas-right .exam-card-sign-title {
    font-size: 5pt;
    font-weight: 700;
    color: #000000;
}

.body-dinas-right .exam-card-sign-stamp-wrap {
    height: 9.5mm;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.2mm 0;
}

.body-dinas-right .exam-card-sign-name {
    font-size: 5.2pt;
    font-weight: 800;
    color: #000000;
    text-decoration: underline;
}

.body-dinas-right .exam-card-sign-nip {
    font-size: 4.6pt;
    color: #222222;
}

.exam-card-qr-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    aspect-ratio: 1 / 1 !important;
    line-height: 0 !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding: 0.3mm !important;
    border: 0.5px solid #d1d5db !important;
    border-radius: 2px !important;
}

.exam-card-qr-box canvas,
.exam-card-qr-box img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    image-rendering: pixelated !important;
    margin: 0 !important;
    padding: 0 !important;
}

.exam-card-qr-box canvas[style*="none"],
.exam-card-qr-box canvas[style*="display: none"] {
    display: none !important;
}

.exam-card-qr-box img[style*="none"],
.exam-card-qr-box img[style*="display: none"] {
    display: none !important;
}

.exam-card-sign-area {

    text-align: center;
    min-width: 34mm;
    position: relative;
}

.exam-card-sign-date {
    font-size: 4.8pt;
    color: #475569;
}

.exam-card-sign-title {
    font-weight: bold;
    color: #0f172a;
    font-size: 5pt;
}

.exam-card-sign-stamp-wrap {
    height: 11mm;
    position: relative;
    margin: 0.3mm 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-card-stamp-img {
    position: absolute;
    height: 12mm;
    max-width: 18mm;
    object-fit: contain;
    opacity: 0.85;
    transform: translate(-30%, -5%) rotate(-6deg);
    z-index: 2;
    pointer-events: none;
}

.exam-card-ttd-img {
    position: absolute;
    height: 9mm;
    max-width: 22mm;
    object-fit: contain;
    z-index: 1;
}

.exam-card-sign-name {
    font-weight: 800;
    text-decoration: underline;
    font-size: 5.2pt;
    color: #0f172a;
}

.exam-card-sign-nip {
    font-size: 4.8pt;
    color: #475569;
}

/* Desk Card Mode (Kartu Meja) */
.card-mode-meja .exam-card-photo-box {
    display: none !important;
}

.card-mode-meja .row-akun {
    display: none !important;
}

.card-mode-meja .meja-badge {
    position: absolute;
    top: 2.5mm;
    right: 2.5mm;
    background: var(--card-accent, #0f172a);
    color: #ffffff;
    padding: 1.5mm 3mm;
    border-radius: 4px;
    text-align: center;
    font-weight: 900;
    font-size: 10pt;
    line-height: 1;
}

.card-mode-meja .meja-badge small {
    display: block;
    font-size: 4.5pt;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.card-mode-meja .student-name {
    font-size: 7.5pt !important;
}

/* =========================================================
   PRINT MEDIA — Cetak hanya lembar kartu A4
   Semua elemen UI (navbar, sidebar, toolbar) disembunyikan
   ========================================================= */
@media print {

    /* Reset body */
    body, html {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Pastikan container aplikasi & workspace utama selalu tampil */
    body > .app-container,
    .app-container {
        display: block !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        background: transparent !important;
        overflow: visible !important;
        visibility: visible !important;
    }

    /* Sembunyikan elemen UI non-cetak */
    .no-print,
    nav, .navbar,
    .navbar-fixed-top,
    .sidebar, aside,
    .offcanvas, .offcanvas-backdrop,
    header, footer,
    .btn,
    .alert,
    .modal, .modal-backdrop,
    .sheet-header-badge,
    .ruang-subnav-container,
    .studio-top-bar,
    .studio-fullwidth-card,
    #studioSettingsPanel,
    .door-studio-topbar,
    .door-studio-panel,
    .card-customizer-sidebar,
    .row > .card-customizer-sidebar,
    .row > [class*="col-"].no-print {
        display: none !important;
        visibility: hidden !important;
    }

    /* Kontainer Bootstrap — jadikan full-width & transparent tanpa padding */
    .container, .container-fluid,
    .container-xl, .container-lg, .container-xxl {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        overflow: visible !important;
        visibility: visible !important;
    }

    /* Row wrapper menjadi block */
    .row {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Kolom preview kartu / cetak — full width */
    .col-lg-8, .col-xl-9,
    [class*="col-"]:not(.no-print) {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0 !important;
    }

    /* Workspace area */
    .a4-workspace {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        display: block !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        min-height: unset !important;
        overflow: visible !important;
        visibility: visible !important;
    }

    .sheet-scaler {
        transform: none !important;
        display: block !important;
        gap: 0 !important;
        overflow: visible !important;
        visibility: visible !important;
    }

    .sheet-container-wrap {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-after: always !important;
        break-after: page !important;
        visibility: visible !important;
    }

    .sheet-container-wrap:last-child {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    /* Lembar A4 */
    .sheet-a4 {
        width: 210mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        box-shadow: none !important;
        margin: 0 auto !important;
        padding: 6mm 5mm !important;
        box-sizing: border-box !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}
