﻿/* =========================================================
   LMS Ujian — Design System
   Putih bersih dengan aksen hijau lembut, ramah HP & desktop
   ========================================================= */
:root {
    --green-900: #1f4d36;
    --green-800: #275e43;
    --green-700: #2f6f4f;
    --green-600: #3a805d;
    --green-500: #4b9470;
    --green-300: #a6cfb8;
    --green-200: #cfe6d8;
    --green-100: #e8f3ec;
    --green-50:  #f4f9f6;

    --gray-900: #1d2622;
    --gray-700: #3f4b45;
    --gray-600: #5d6a63;
    --gray-500: #7f8b85;
    --gray-400: #a8b2ad;
    --gray-300: #d4dbd7;
    --gray-200: #e6ebe8;
    --gray-100: #f2f5f3;
    --white: #ffffff;

    --maroon-900: #4a0e1b;
    --maroon-800: #5f1223;
    --maroon-700: #7a1a2e;
    --maroon-600: #8f2238;
    --maroon-100: #f6e4e8;
    --maroon-50:  #fbf3f5;
    --red-600: #c24141;
    --red-50: #fdf0f0;
    --amber-600: #b7791f;
    --amber-50: #fdf7ea;
    --blue-600: #2f6a9e;
    --blue-50: #eef5fb;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(31, 77, 54, .06);
    --shadow: 0 2px 10px rgba(31, 77, 54, .07);
    --shadow-lg: 0 12px 32px rgba(31, 77, 54, .12);
    --sidebar-w: 256px;
    --topbar-h: 62px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--gray-900);
    background: var(--green-50);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-900); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
small, .text-sm { font-size: .82rem; }
.text-xs { font-size: .74rem; }
.text-muted { color: var(--gray-500); }
.text-green { color: var(--green-700); }
.text-red { color: var(--red-600); }
.text-amber { color: var(--amber-600); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #eef7f1 0%, #e3f1e8 100%);
    border-right: 1px solid var(--green-200);
    display: flex; flex-direction: column;
    z-index: 50;
    transition: transform .25s ease;
    color: var(--gray-900);
}
.sidebar-brand {
    display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
    padding: .9rem 1.25rem .8rem;
    border-bottom: 1px solid var(--green-200);
}
.brand-img { width: 100%; max-width: 200px; height: auto; display: block; }
.brand-logo {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    flex-shrink: 0; overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; display: block; }
.brand-name { font-weight: 700; font-size: 1rem; color: var(--maroon-700); line-height: 1.2; }
.brand-sub { font-size: .72rem; color: var(--gray-500); }

.sidebar-user {
    margin: 1rem; padding: .85rem;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--green-200);
    display: flex; gap: .75rem; align-items: center;
}
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--maroon-600), var(--maroon-800)); color: #fff;
    display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(122,26,46,.25);
}
.sidebar-user .name { font-weight: 600; font-size: .88rem; line-height: 1.25; word-break: break-word; color: var(--gray-900); }
.sidebar-user .meta { font-size: .74rem; color: var(--gray-500); }

.nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.nav-label {
    font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    color: var(--maroon-700); text-transform: uppercase;
    padding: .9rem .6rem .4rem;
}
.nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem .85rem; margin-bottom: 3px;
    border-radius: var(--radius-sm);
    color: var(--gray-700); font-weight: 500; font-size: .86rem;
    transition: background .15s, color .15s;
}
.nav a i { font-size: 1.15rem; width: 22px; text-align: center; color: var(--gray-500); transition: color .15s; }
.nav a:hover { background: rgba(255,255,255,.7); color: var(--green-800); }
.nav a.active {
    background: #ffffff;
    color: var(--green-900);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--maroon-700);
}
.nav a.active i { color: var(--maroon-700); }
.sidebar-footer { padding: .75rem; border-top: 1px solid var(--green-200); }
.sidebar-footer button {
    width: 100%; display: flex; align-items: center; gap: .7rem;
    padding: .65rem .75rem; border: 0; background: none; cursor: pointer;
    border-radius: var(--radius-sm); color: var(--maroon-700); font: inherit; font-weight: 500;
}
.sidebar-footer button:hover { background: var(--maroon-50); color: var(--maroon-800); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1.5rem;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .crumb { font-size: .74rem; color: var(--gray-500); }
.clock {
    font-family: ui-monospace, Consolas, monospace; font-weight: 600;
    font-size: .85rem; color: var(--green-800);
    background: var(--green-50); border: 1px solid var(--green-100);
    padding: .35rem .7rem; border-radius: var(--radius-sm);
}
.menu-toggle {
    display: none; border: 1px solid var(--gray-200); background: #fff;
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    font-size: 1.2rem; color: var(--gray-700); cursor: pointer;
}
.content { padding: 1.5rem; flex: 1; width: 100%; max-width: 1280px; }
.backdrop { display: none; }

/* ---------- Card ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.card-header h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-header h2 i { color: var(--green-600); }
.card-header .sub { font-size: .8rem; color: var(--gray-500); margin: .15rem 0 0; }
.card-body { padding: 1.25rem; }
.card-accent { border-top: 4px solid var(--maroon-700); }
.card-accent-green { border-top: 4px solid var(--green-600); }
.card-accent-blue { border-top: 4px solid var(--maroon-600); }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .35rem; } .gap-2 { gap: .6rem; } .gap-3 { gap: 1rem; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: .35rem; } .mt-2 { margin-top: .7rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: .7rem; } .mb-3 { margin-bottom: 1rem; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }

/* ---------- Stats ---------- */
.stat {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); padding: 1rem 1.1rem;
    display: flex; align-items: center; gap: .9rem;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--green-100); color: var(--green-700);
    display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0;
}
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--gray-500); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1rem; min-height: 38px;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .85rem; line-height: 1.2;
    cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: #133c6a; color: #fff; }
.btn-primary:hover { background: #0c2b4f; color: #fff; }
.btn-green { background: var(--green-700); color: #fff; }
.btn-green:hover { background: var(--green-800); color: #fff; }
.btn-navy { background: #133c6a; color: #fff; }
.btn-navy:hover { background: #0c2b4f; color: #fff; }
.btn-outline { background: #fff; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--green-500); color: var(--green-800); background: var(--green-50); }
.btn-soft { background: var(--green-100); color: var(--green-800); }
.btn-soft:hover { background: var(--green-200); color: var(--green-900); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #a63636; color: #fff; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: .35rem .65rem; min-height: 32px; font-size: .78rem; }
.btn-lg { padding: .8rem 1.4rem; min-height: 46px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-icon {
    width: 32px; height: 32px; padding: 0; min-height: 0;
    display: inline-grid; place-items: center;
    border-radius: var(--radius-sm); border: 1px solid var(--gray-200);
    background: #fff; color: var(--gray-600); cursor: pointer; font-size: .95rem;
}
.btn-icon:hover { border-color: var(--green-300); color: var(--green-700); background: var(--green-50); }
.btn-icon.danger:hover { border-color: #e7b4b4; color: var(--red-600); background: var(--red-50); }
.actions { display: inline-flex; gap: .3rem; align-items: center; }
.actions form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .35rem; color: var(--gray-700); }
.form-label .req { color: var(--red-600); }
.form-control, .form-select {
    width: 100%; padding: .6rem .8rem; min-height: 40px;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    background: #fff; font: inherit; font-size: .9rem; color: var(--gray-900);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    outline: 0; border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(75, 148, 112, .15);
}
.form-control[readonly], .form-control:disabled { background: var(--gray-100); color: var(--gray-500); }
textarea.form-control { min-height: 90px; resize: vertical; }
.form-select {
    appearance: none; padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235d6a63' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px;
}
.form-hint { font-size: .75rem; color: var(--gray-500); margin-top: .3rem; }
.invalid { font-size: .76rem; color: var(--red-600); margin-top: .3rem; }
.is-invalid { border-color: var(--red-600) !important; }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .87rem; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--green-700); cursor: pointer; }
.check-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
    display: inline-block; padding: .4rem .8rem; border-radius: 999px;
    border: 1px solid var(--gray-300); font-size: .82rem; font-weight: 500; cursor: pointer;
    background: #fff; transition: all .15s;
}
.chip-check input:checked + span { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(75,148,112,.25); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; min-height: 36px; padding-top: .45rem; padding-bottom: .45rem; font-size: .85rem; }
.search { position: relative; }
.search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.search .form-control { padding-left: 2rem; }

.seg { display: inline-flex; background: var(--gray-100); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: .45rem .95rem; border-radius: 6px; font-weight: 600; font-size: .83rem; color: var(--gray-600); cursor: pointer; }
.seg input:checked + span { background: #fff; color: var(--green-800); box-shadow: var(--shadow-sm); }

/* ---------- Table ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
    text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--gray-500);
    background: var(--gray-100); padding: .7rem .9rem; white-space: nowrap;
    border-bottom: 1px solid var(--gray-200);
}
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
.table tbody tr:hover { background: var(--green-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .empty { text-align: center; color: var(--gray-500); padding: 2.5rem 1rem; }
.table-legger th, .table-legger td { text-align: center; }
.table-legger th.l, .table-legger td.l { text-align: left; }
.table-legger td.nilai { font-weight: 600; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; white-space: nowrap;
    background: var(--gray-100); color: var(--gray-700);
}
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-red { background: var(--red-50); color: var(--red-600); }
.badge-amber { background: var(--amber-50); color: var(--amber-600); }
.badge-blue { background: var(--blue-50); color: var(--blue-600); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Alerts ---------- */
.alert {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .85rem 1rem; border-radius: var(--radius);
    margin-bottom: 1rem; font-size: .87rem; border: 1px solid;
    animation: slideDown .25s ease;
}
.alert i { font-size: 1.05rem; margin-top: 1px; }
.alert-success { background: var(--green-50); border-color: var(--green-200); color: var(--green-900); }
.alert-error { background: var(--red-50); border-color: #f1c9c9; color: #8f2c2c; }
.alert-info { background: var(--blue-50); border-color: #cfe0ef; color: #244f75; }
.alert-warn { background: var(--amber-50); border-color: #f0dcb0; color: #7a5212; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; font-size: 1rem; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Modal (dialog) ---------- */
dialog.modal {
    border: 0; padding: 0; border-radius: var(--radius-lg);
    width: min(560px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 2rem);
    box-shadow: var(--shadow-lg);
    color: var(--gray-900);
}
dialog.modal-lg { width: min(820px, calc(100vw - 1.5rem)); }
dialog.modal::backdrop { background: rgba(20, 35, 28, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-header h3 { margin: 0; }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--gray-200); background: var(--gray-100); position: sticky; bottom: 0; }

/* ---------- Upload ---------- */
.dropzone {
    border: 2px dashed var(--gray-300); border-radius: var(--radius);
    padding: 1.5rem 1rem; text-align: center; background: var(--gray-100);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--green-500); background: var(--green-50); }
.dropzone i { font-size: 2rem; color: var(--green-600); }
.dropzone .fname { font-weight: 600; color: var(--green-800); margin-top: .35rem; word-break: break-all; }
.dropzone input { display: none; }
.code-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.code-tags code { background: #fff; border: 1px solid var(--gray-200); padding: .1rem .45rem; border-radius: 6px; font-size: .75rem; color: var(--green-800); }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .9rem 1.25rem; border-top: 1px solid var(--gray-200); }
.pager .info { font-size: .8rem; color: var(--gray-500); }
.pager .pages { display: flex; gap: .25rem; flex-wrap: wrap; }
.pager .pages a, .pager .pages span {
    min-width: 34px; height: 34px; padding: 0 .55rem;
    display: inline-grid; place-items: center;
    border-radius: var(--radius-sm); border: 1px solid var(--gray-200);
    font-size: .82rem; font-weight: 600; color: var(--gray-700); background: #fff;
}
.pager .pages a:hover { border-color: var(--green-300); background: var(--green-50); }
.pager .pages .active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.pager .pages .disabled { color: var(--gray-400); }

/* ---------- Exam list cards (mahasiswa) ---------- */
.exam-card {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem;
    box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.exam-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.exam-card .head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.exam-card .title { font-weight: 650; font-size: .98rem; }
.exam-card .mk { font-size: .8rem; color: var(--gray-500); }
.exam-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem; font-size: .8rem; color: var(--gray-600); }
.exam-meta i { color: var(--green-600); margin-right: .25rem; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--gray-500); }
.empty-state i { font-size: 2.4rem; color: var(--green-300); display: block; margin-bottom: .5rem; }

/* ---------- Soal preview ---------- */
.q-item { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .6rem; background: #fff; }
.q-item .q-head { display: flex; gap: .6rem; align-items: flex-start; }
.q-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.q-text { flex: 1; white-space: pre-line; word-break: break-word; }
.opt-list { list-style: none; padding: 0; margin: .5rem 0 0 2.2rem; display: grid; gap: .25rem; font-size: .85rem; }
.opt-list li.correct { color: var(--green-800); font-weight: 600; }
.kw { display: inline-block; padding: .12rem .5rem; margin: .12rem; border-radius: 999px; font-size: .74rem; background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.kw.hit { background: var(--green-100); color: var(--green-800); border-color: var(--green-200); }

/* ---------- Auth ---------- */
.auth-page {
    min-height: 100vh; display: grid; place-items: center; padding: 1.25rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(166,207,184,.35), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(207,230,216,.5), transparent 45%),
        var(--green-50);
}
.auth-card {
    width: 100%; max-width: 400px; background: #fff;
    border: 1px solid var(--gray-200); border-radius: 20px;
    box-shadow: var(--shadow-lg); padding: 2rem 1.75rem;
}
.auth-card .brand-logo { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; margin: 0 auto 1rem; }
.auth-card h1 { text-align: center; font-size: 1.3rem; margin-bottom: .25rem; }
.auth-card .lead { text-align: center; color: var(--gray-500); font-size: .87rem; margin-bottom: 1.5rem; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.input-icon .form-control { padding-left: 2.4rem; min-height: 46px; }
.input-icon .toggle-pass { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--gray-500); padding: .35rem; left: auto; }
.auth-foot { text-align: center; font-size: .76rem; color: var(--gray-400); margin-top: 1.5rem; }

/* =========================================================
   Exam (halaman mengerjakan ujian)
   ========================================================= */
.exam-body { background: var(--green-50); user-select: none; -webkit-user-select: none; }
.exam-body textarea { user-select: text; -webkit-user-select: text; }
.exam-top {
    position: sticky; top: 0; z-index: 40;
    background: #fff; border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.exam-top-inner { max-width: 1180px; margin: 0 auto; padding: .65rem 1rem; display: flex; align-items: center; gap: .8rem; }
.exam-title { flex: 1; min-width: 0; }
.exam-title .t { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-title .s { font-size: .74rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer {
    display: flex; align-items: center; gap: .4rem;
    font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 1.05rem;
    padding: .4rem .8rem; border-radius: var(--radius-sm);
    background: var(--green-100); color: var(--green-800);
}
.timer.warn { background: var(--amber-50); color: var(--amber-600); }
.timer.danger { background: var(--red-50); color: var(--red-600); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.violation-pill { font-size: .74rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }
.violation-pill.on { background: var(--red-50); color: var(--red-600); }
.progress { height: 4px; background: var(--gray-200); }
.progress > div { height: 100%; background: var(--green-500); transition: width .3s; }

.exam-wrap { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1rem 6rem; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.25rem; align-items: start; }
.question-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.question-card .qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: .5rem; }
.question-card .qno { font-weight: 700; color: var(--green-800); }
.question-text { font-size: 1rem; line-height: 1.7; white-space: pre-line; word-break: break-word; margin-bottom: 1.2rem; }
.options { display: grid; gap: .6rem; }
.option {
    display: flex; gap: .8rem; align-items: flex-start;
    padding: .85rem 1rem; border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--green-300); background: var(--green-50); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .letter {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
    border: 1.5px solid var(--gray-300); display: grid; place-items: center;
    font-weight: 700; font-size: .85rem; color: var(--gray-600); transition: all .15s;
}
.option .otext { flex: 1; padding-top: 4px; word-break: break-word; }
.option.selected { border-color: var(--green-600); background: var(--green-50); }
.option.selected .letter { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.essay-input { min-height: 180px; font-size: .95rem; line-height: 1.6; }
.qnav-btns { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.4rem; }
.save-state { font-size: .75rem; color: var(--gray-500); display: inline-flex; align-items: center; gap: .3rem; }

.side-panel { position: sticky; top: 82px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow-sm); }
.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin: .75rem 0; }
.num-btn {
    aspect-ratio: 1; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
    background: #fff; font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer; color: var(--gray-700);
}
.num-btn.answered { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.num-btn.current { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green-500); }
.num-btn.flag { background: var(--amber-50); border-color: #e9c46a; color: var(--amber-600); }
.legend { display: flex; flex-wrap: wrap; gap: .6rem; font-size: .72rem; color: var(--gray-500); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; border: 1.5px solid var(--gray-300); }
.legend .l-ans::before { background: var(--green-600); border-color: var(--green-600); }
.legend .l-flag::before { background: var(--amber-50); border-color: #e9c46a; }

.mobile-nav-toggle { display: none; }

.warning-overlay {
    position: fixed; inset: 0; z-index: 100; display: none;
    background: rgba(20,35,28,.6); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; padding: 1rem;
}
.warning-overlay.show { display: flex; }
.warning-box { background: #fff; border-radius: 18px; max-width: 420px; width: 100%; padding: 1.75rem 1.5rem; text-align: center; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
.warning-box .ic { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; background: var(--red-50); color: var(--red-600); }
.warning-box h3 { font-size: 1.15rem; }
.warning-box .count { font-size: 2rem; font-weight: 800; color: var(--red-600); margin: .35rem 0; }

/* hasil */
.score-ring {
    width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 1rem;
    display: grid; place-items: center;
    background: conic-gradient(var(--green-600) calc(var(--p) * 1%), var(--gray-200) 0);
}
.score-ring > div { width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.score-ring .v { font-size: 2rem; font-weight: 800; color: var(--green-800); line-height: 1; }
.score-ring .l { font-size: .72rem; color: var(--gray-500); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .exam-wrap { grid-template-columns: 1fr; }
    .side-panel {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 45;
        border-radius: 18px 18px 0 0; max-height: 70vh; overflow-y: auto;
        transform: translateY(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
    }
    .side-panel.open { transform: none; }
    .num-grid { grid-template-columns: repeat(8, 1fr); }
    .mobile-nav-toggle {
        display: flex; position: fixed; bottom: 1rem; right: 1rem; z-index: 44;
        align-items: center; gap: .4rem; box-shadow: var(--shadow-lg); border-radius: 999px;
    }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(20,35,28,.4); z-index: 45; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
}
@media (max-width: 560px) {
    body { font-size: 13.5px; }
    .content { padding: 1rem .75rem; }
    .topbar { padding: 0 .75rem; }
    .clock { display: none; }
    .card-header, .card-body { padding: .95rem; }
    .grid-4 { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .stat { padding: .8rem; gap: .6rem; }
    .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; }
    .stat-value { font-size: 1.15rem; }
    .filters { width: 100%; }
    .filters .form-control, .filters .form-select, .filters .search { flex: 1 1 140px; min-width: 0; width: 100%; }
    .question-card { padding: 1rem; }
    .question-text { font-size: .95rem; }
    .num-grid { grid-template-columns: repeat(6, 1fr); }
    .exam-top-inner { gap: .5rem; padding: .55rem .75rem; }
    .timer { font-size: .92rem; padding: .35rem .6rem; }
    .btn-text-sm { display: none; }
    .exam-meta { grid-template-columns: 1fr; }
    .hide-sm { display: none !important; }
    .auth-card { padding: 1.6rem 1.25rem; }
}
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin: 0; }
    .card { box-shadow: none; border: 0; }
}
