@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@mdi/font@7.2.96/css/materialdesignicons.min.css');

/* =========================================================
   CBT Enterprise — Modern Theme (Omni UI Style)
   ========================================================= */

:root {
    --wc-green: #25D366;
    --wc-teal: #128C7E;
    --wc-dark: #075E54;
    --wc-ink: #0f172a;
    --wc-muted: #64748b;
    --wc-line: #e2e8f0;
    --wc-bg: #f8fafc;
    --wc-sidebar-bg: linear-gradient(180deg, #0b3d35 0%, #075E54 100%);
    --wc-grad: linear-gradient(135deg, #075E54 0%, #128C7E 55%, #25D366 100%);
    --wc-grad-accent: linear-gradient(135deg, #25D366, #128C7E);

    --accent-primary: #128C7E;
    --accent-hover: #075E54;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    background: #f4f6f9;
    color: #1e293b;
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   APP SHELL & LAYOUT (SIDEBAR + TOPBAR + MAIN)
   ========================================================= */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    background: var(--wc-sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    box-shadow: 4px 0 26px rgba(0,0,0,.12);
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.app-sidebar__brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--wc-grad-accent);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.app-sidebar__brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .2px;
}

.app-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 24px;
}

.app-sidebar__nav::-webkit-scrollbar {
    width: 5px;
}
.app-sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.15);
    border-radius: 3px;
}

.app-sidebar__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(203,213,225,.55);
    font-weight: 700;
    margin: 18px 12px 8px;
}
.app-sidebar__title:first-child {
    margin-top: 4px;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 3px;
    border-radius: 11px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .18s, color .18s, transform .12s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.app-sidebar__link i.mdi {
    font-size: 20px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.app-sidebar__link span {
    flex: 1;
}

.app-sidebar__link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.app-sidebar__link--active {
    background: var(--wc-grad-accent);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 8px 18px -6px rgba(37,211,102,.55);
}

.app-sidebar__link--logout {
    color: #fca5a5;
    margin-top: 14px;
}
.app-sidebar__link--logout:hover {
    background: rgba(239,68,68,.16);
    color: #fecaca;
}

/* Main Column */
.app-main {
    margin-left: 264px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin .28s;
}

/* Topbar */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 66px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
}

.app-topbar__toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #0f172a;
    cursor: pointer;
    transition: background .15s;
}
.app-topbar__toggle:hover {
    background: #e2e8f0;
}

.app-topbar__title h1,
.app-topbar__title h2,
.app-topbar__title h3,
.app-topbar__title .page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.2px;
}

.app-topbar__spacer {
    flex: 1;
}

/* Topbar TA Selector */
.topbar-ta-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1.5px solid #a7f3d0;
    padding: 6px 12px;
    border-radius: 12px;
}

.topbar-ta-selector label {
    font-size: 12.5px;
    font-weight: 700;
    color: #075E54;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-ta-selector select {
    border: 1px solid #6ee7b7;
    background: #ffffff;
    color: #065f46;
    font-weight: 700;
    font-size: 13.5px;
    padding: 4px 8px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.topbar-ta-selector select:focus {
    border-color: var(--wc-green);
    box-shadow: 0 0 0 3px rgba(37,211,102,.2);
}

.app-topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 6px;
    background: #f1f5f9;
    border-radius: 999px;
    text-decoration: none;
}

.app-topbar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--wc-grad-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
}

.app-topbar__user-name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.15;
}
.app-topbar__user-role {
    display: block;
    font-size: 11px;
    color: #64748b;
}

.app-topbar__logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 11px;
    text-decoration: none;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .18s, color .18s, transform .12s;
}
.app-topbar__logout:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    transform: translateY(-1px);
}

.app-content {
    flex: 1;
    padding: 24px 26px 36px;
    width: 100%;
}

.app-footer {
    text-align: center;
    padding: 14px 24px;
    color: #94a3b8;
    font-size: 12.5px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

/* =========================================================
   CARDS & DASHBOARD STATS (OMNI MODERN STYLE)
   ========================================================= */
.dash-modern {
    padding: 4px 0 20px;
}

.dash-modern__hello {
    margin-bottom: 24px;
}
.dash-modern__hello h1 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    letter-spacing: -.3px;
}
.dash-modern__hello p {
    margin: 0;
    color: #64748b;
    font-size: 14.5px;
}

.dash-modern__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px -4px rgba(15,23,42,.06);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -18px rgba(15,23,42,.2);
    border-color: transparent;
}

.stat-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 26px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 10px 20px -8px rgba(0,0,0,.25);
}

.stat-card__value {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -.5px;
}

.stat-card__label {
    font-size: 13px;
    color: #64748b;
    margin-top: 3px;
    font-weight: 500;
}

.stat-card--green .stat-card__icon   { background: linear-gradient(135deg,#25D366,#128C7E); }
.stat-card--indigo .stat-card__icon  { background: linear-gradient(135deg,#6366f1,#4f46e5); }
.stat-card--blue .stat-card__icon    { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.stat-card--emerald .stat-card__icon { background: linear-gradient(135deg,#10b981,#059669); }
.stat-card--red .stat-card__icon     { background: linear-gradient(135deg,#ef4444,#dc2626); }
.stat-card--amber .stat-card__icon   { background: linear-gradient(135deg,#f59e0b,#d97706); }

/* Standard Content Card */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 20px -4px rgba(15,23,42,.06);
    margin-bottom: 24px;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.card__title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* =========================================================
   TABLES & FORMS
   ========================================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    padding: 12px 16px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1.5px solid #e2e8f0;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #1e293b;
    vertical-align: middle;
}

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

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background-color: #ffffff;
    color: #0f172a;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--wc-green);
    box-shadow: 0 0 0 4px rgba(37,211,102,.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 11px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    color: #ffffff;
}

.btn-primary {
    background: var(--wc-grad-accent);
    box-shadow: 0 8px 18px -6px rgba(18,140,126,.5);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(18,140,126,.65);
    color: #fff;
}

.btn-success { background: #10b981; }
.btn-success:hover { background: #059669; transform: translateY(-1px); color: #fff; }

.btn-warning { background: #f59e0b; color: #1e293b; }
.btn-warning:hover { background: #d97706; color: #fff; transform: translateY(-1px); }

.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; color: #fff; transform: translateY(-1px); }

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-primary { background: #dbeafe; color: #1e40af; }

/* Impersonate Banner */
.impersonate-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 600;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13.5px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Backdrop */
.app-sidebar__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s;
}
.app-sidebar__backdrop--show {
    opacity: 1;
    visibility: visible;
}

/* Tab Navigation Login */
.login-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.login-tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s;
}

.login-tab-btn.active {
    background: #ffffff;
    color: #075E54;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Number Grid Soal CBT Mobile Responsive */
.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.q-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s;
}

.q-btn.active { border-color: var(--wc-teal); background: var(--wc-teal); color: #fff; }
.q-btn.answered { background: var(--wc-green); border-color: var(--wc-green); color: #fff; }
.q-btn.doubtful { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* Responsive Breakpoints */
@media (min-width: 992px) {
    .app-body--collapse .app-sidebar { transform: translateX(-100%); }
    .app-body--collapse .app-main { margin-left: 0; }
}

@media (max-width: 991.98px) {
    .app-topbar { position: sticky; top: 0; z-index: 1050; }
    .app-sidebar {
        top: 66px;
        height: calc(100vh - 66px);
        bottom: 0;
        z-index: 1040;
        transform: translateX(-100%);
        box-shadow: 0 15px 30px rgba(0,0,0,.25);
    }
    .app-sidebar__brand { display: none; }
    .app-sidebar--open { transform: translateX(0); }
    .app-sidebar__backdrop { top: 66px; z-index: 1035; }
    .app-main { margin-left: 0; }
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
    .app-topbar { padding: 0 14px; gap: 8px; }
    .app-content { padding: 16px 14px 28px; }
    .topbar-ta-selector { padding: 4px 8px; }
    .topbar-ta-selector label span { display: none; }
    .app-topbar__user-role { display: none; }
    .app-topbar__logout span { display: none; }
}
