/**
 * EduDeen Learning - Modern UI Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #29b6f6; /* Bright Sky Blue */
    --primary-dark: #0288d1;
    --primary-light: #81d4fa;
    --primary-soft: #e1f5fe;
    --primary-50: rgba(41, 182, 246, 0.06);
    --primary-100: rgba(41, 182, 246, 0.1);
    --gradient-primary: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
    --gradient-soft: linear-gradient(135deg, #29b6f6 0%, #81d4fa 60%, #e1f5fe 100%);
    --gradient-sidebar: linear-gradient(180deg, #0288d1 0%, #29b6f6 100%);
    --accent: #fbc02d; /* Honey Gold */
    --accent-hover: #fbc02d;
    --success: #66bb6a; /* Pastel Green */
    --warning: #fbc02d; /* Honey Gold */
    --danger: #e57373; /* Soft red danger */
    --info: #29b6f6;
    --light-bg: #f0f7fb; /* Very soft sky-blue bg */
    --white: #ffffff;
    --text: #2a3f4d;
    --text-muted: #7a919e;
    --border: #e2eaef;
    --sidebar-width: 270px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 14px rgba(41, 182, 246, 0.05);
    --shadow-hover: 0 8px 24px rgba(41, 182, 246, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    background: var(--light-bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 16px rgba(6, 109, 143, 0.12);
}

.sidebar-header {
    padding: 1.4rem 1.5rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--white);
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
}

.sidebar-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand-text h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.sidebar-brand-text small {
    font-size: 0.7rem;
    opacity: 0.65;
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border-left: none;
}

.sidebar-menu li a i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    opacity: 0.85;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateX(3px);
}

.sidebar-menu li a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.sidebar-menu li a.active i {
    opacity: 1;
}

.sidebar-menu li a.logout-link {
    color: #ff8a80;
}

.sidebar-menu li a.logout-link:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #ffcdd2;
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-user-role {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* ===== MAIN CONTENT ===== */
.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wrapper.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.wrapper.sidebar-collapsed .content {
    margin-left: 0;
    width: 100%;
}

.top-navbar {
    background: var(--white);
    color: var(--text);
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: 0 1px 8px rgba(42, 63, 77, 0.04);
    border-bottom: 1px solid var(--border);
}

.top-navbar .btn-link {
    color: var(--primary-dark);
    text-decoration: none;
    padding: 0.35rem;
    border-radius: 8px;
    transition: var(--transition);
}

.top-navbar .btn-link:hover {
    background: var(--light-bg);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.navbar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-badge {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 1.75rem !important;
    min-width: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer-text {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: var(--white);
    border-top: 1px solid var(--border);
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 1.75rem;
}

.page-header h2 {
    color: var(--text);
    font-weight: 700;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ===== WELCOME BANNER ===== */
.welcome-banner {
    background: var(--gradient-primary);
    border-radius: var(--radius);
    padding: 2rem 2.25rem;
    color: var(--white);
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(194, 208, 217, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    position: relative;
    letter-spacing: -0.02em;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    position: relative;
}

.welcome-banner p {
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
    position: relative;
    max-width: 70%;
}

.welcome-banner .welcome-icon {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 5rem;
    height: 5rem;
    object-fit: contain;
    opacity: 0.12;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    height: 100%;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    border-radius: 3px 0 0 3px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.stat-card.stat-primary::before { background: var(--primary); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-info::before { background: var(--primary); }
.stat-card.stat-accent::before { background: var(--primary); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-primary .stat-icon { background: var(--primary-soft); color: var(--primary); }
.stat-success .stat-icon { background: rgba(45, 159, 111, 0.1); color: var(--success); }
.stat-warning .stat-icon { background: rgba(212, 146, 10, 0.1); color: var(--warning); }
.stat-info .stat-icon { background: var(--primary-soft); color: var(--primary); }
.stat-accent .stat-icon { background: var(--primary-soft); color: var(--primary); }

.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-info .stat-value { color: var(--primary); }

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-card .progress {
    height: 6px;
    border-radius: 3px;
    background: var(--light-bg);
    margin-top: 0.75rem;
}

.stat-card .progress-bar {
    background: var(--primary);
    border-radius: 3px;
}

/* ===== QUICK ACTION CARDS ===== */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    text-align: center;
    height: 100%;
}

.quick-action-card:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.quick-action-card .qa-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.quick-action-card span {
    font-weight: 600;
    font-size: 0.9rem;
}

.quick-action-card:hover .qa-icon {
    background: var(--primary);
    color: var(--white);
}

/* ===== MATERI CARDS ===== */
.materi-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--border);
}

.materi-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.materi-card .card-cover {
    height: 170px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.materi-card .card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
}

.materi-card .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.materi-card .card-body {
    padding: 1.35rem;
}

.materi-card .card-body h5 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.materi-card .card-body .btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem;
}

/* ===== CARD TABLE / PANEL ===== */
.card-table {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-table h5 {
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
}

.card-table h5 i {
    color: var(--primary);
    margin-right: 0.35rem;
}

.card-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* ===== FORMS ===== */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-50);
}

.input-group-text {
    border: 2px solid var(--border);
    border-right: none;
    background: var(--light-bg);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control {
    border-left: none;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.55rem 1.15rem;
    transition: var(--transition);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0288d1;
    --bs-btn-border-color: #0288d1;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0277bd;
    --bs-btn-hover-border-color: #0277bd;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #01579b;
    --bs-btn-active-border-color: #01579b;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0288d1;
    --bs-btn-disabled-border-color: #0288d1;
    --bs-btn-focus-shadow-rgb: 2, 136, 209;
    box-shadow: 0 2px 8px rgba(2, 136, 209, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.28);
}

.btn-outline-primary {
    --bs-btn-color: #0288d1;
    --bs-btn-border-color: #0288d1;
    --bs-btn-hover-color: #01579b;
    --bs-btn-hover-bg: var(--primary-soft);
    --bs-btn-hover-border-color: #0288d1;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0288d1;
    --bs-btn-active-border-color: #0288d1;
    --bs-btn-disabled-color: #0288d1;
    --bs-btn-disabled-border-color: #0288d1;
    border-width: 1.5px;
}

.btn-success { box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25); }
.btn-danger { box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25); }
.btn-warning { box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25); }
.btn-info { box-shadow: 0 4px 12px rgba(26, 188, 156, 0.25); }

.btn-sm {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
}

/* ===== TABLES ===== */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background: var(--primary-soft);
    color: var(--text);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
    padding: 0.85rem 0.75rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--primary-50);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    --bs-table-bg-type: rgba(240, 243, 246, 0.5);
}

/* DataTables */
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    /* ruang kanan untuk ikon panah agar angka tidak tertimpa */
    padding: 0.3rem 2rem 0.3rem 0.7rem;
    background-position: right 0.6rem center;
    background-size: 12px 10px;
    min-width: 4.75rem;
    margin: 0 0.4rem;
    display: inline-block;
    width: auto;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== BADGES ===== */
.badge {
    font-weight: 600;
    padding: 0.4em 0.75em;
    border-radius: 6px;
    font-size: 0.78rem;
}

.badge-lulus { background-color: var(--success) !important; }
.badge-tidak { background-color: var(--danger) !important; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.alert-info {
    background: var(--primary-50);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #d68910;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    border-left: 4px solid var(--danger);
}

/* ===== PROGRESS ===== */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--light-bg);
}

.progress-bar {
    background: var(--primary);
    border-radius: 4px;
}

/* ===== MEDIA IFRAME ===== */
.media-view-wrapper {
    position: relative;
}

.media-frame-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
}

.media-frame-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.media-frame-container iframe {
    border: none;
    border-radius: var(--radius-sm);
    width: 100%;
    min-height: 700px;
    display: block;
}

.media-fullview-exit {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2100;
    box-shadow: var(--shadow-hover);
}

body.media-fullview-active {
    overflow: hidden;
}

body.media-fullview-active .sidebar,
body.media-fullview-active .footer-text,
body.media-fullview-active .media-page-header {
    display: none !important;
}

body.media-fullview-active .top-navbar {
    display: none !important;
}

body.media-fullview-active .main-content {
    padding: 0 !important;
}

body.media-fullview-active .media-frame-container {
    position: fixed;
    inset: 0;
    z-index: 2000;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

body.media-fullview-active .media-frame-toolbar {
    display: none;
}

body.media-fullview-active .media-frame-container iframe {
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
}

body.media-fullview-active .media-fullview-exit {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ===== QUIZ ===== */
.quiz-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.quiz-question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.quiz-question h5 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.15rem;
    margin: 0.5rem 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    font-weight: 500;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.quiz-option input[type="radio"] {
    margin-right: 0.85rem;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(2, 136, 209, 0.4) 0%, rgba(41, 182, 246, 0.2) 100%), url('../images/bahan/background.jpg') no-repeat center center / cover;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.05);
    pointer-events: none;
    z-index: 0;
}

.login-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}

.login-shape-1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    background: radial-gradient(circle, rgba(8, 142, 185, 0.08) 0%, transparent 70%);
    animation: loginFloat 8s ease-in-out infinite;
}

.login-shape-2 {
    width: 240px;
    height: 240px;
    bottom: -40px;
    left: -40px;
    background: radial-gradient(circle, rgba(8, 142, 185, 0.1) 0%, transparent 70%);
    animation: loginFloat 10s ease-in-out infinite reverse;
}

.login-shape-3 {
    width: 120px;
    height: 120px;
    top: 40%;
    left: 8%;
    background: rgba(8, 142, 185, 0.05);
    animation: loginFloat 6s ease-in-out infinite 1s;
}

@keyframes loginFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.login-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

.login-container::before {
    content: '';
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 50% 40%, rgba(8, 142, 185, 0.18) 0%, transparent 65%);
    filter: blur(32px);
    z-index: -1;
    pointer-events: none;
}

.login-card {
    position: relative;
    background: rgba(255, 255, 255, 0.90);
    border-radius: 28px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition: var(--transition);
}

.login-card:hover {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.18),
        0 8px 20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.login-card-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(8, 142, 185, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 40% 30% at 100% 0%, rgba(194, 208, 217, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 35% 25% at 0% 100%, rgba(8, 142, 185, 0.06) 0%, transparent 50%);
}

.login-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.25rem 2rem 0.5rem;
    background: transparent;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(8, 142, 185, 0.12), transparent);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.logo-circle {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    background: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 1px rgba(8, 142, 185, 0.08),
        0 8px 24px rgba(8, 142, 185, 0.14),
        0 2px 6px rgba(42, 63, 77, 0.04);
    transition: var(--transition);
    overflow: hidden;
    padding: 10px;
}

.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-card:hover .logo-circle {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 0 0 1px rgba(8, 142, 185, 0.12),
        0 14px 32px rgba(8, 142, 185, 0.18),
        0 4px 8px rgba(42, 63, 77, 0.05);
}

.login-body {
    position: relative;
    z-index: 1;
    padding: 1.25rem 2.5rem 0.5rem;
}

.login-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.4rem;
    letter-spacing: -0.03em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0.25rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.login-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
}

.login-role-guru {
    background: rgba(8, 142, 185, 0.1);
    color: var(--primary-dark);
}

.login-role-siswa {
    background: rgba(45, 159, 111, 0.1);
    color: var(--success);
}

.login-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.login-input-group {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.login-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-50);
}

.login-input-group .input-group-text {
    background: var(--primary-50);
    border: none;
    color: var(--primary);
    padding-left: 1rem;
    padding-right: 0.75rem;
}

.login-input-group .login-input {
    border: none;
    padding: 0.75rem 0.9rem;
}

.login-input {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    transition: var(--transition);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-50);
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(214, 69, 69, 0.08);
    color: var(--danger);
    margin-bottom: 1.25rem;
}

.login-form {
    animation: fadeInUp 0.4s ease;
}

.role-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 160px;
    min-height: 150px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    padding: 1.25rem 0.75rem;
}

.role-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(8, 142, 185, 0.12);
    background: linear-gradient(180deg, var(--white) 0%, var(--primary-soft) 100%);
}

.role-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.85rem;
    transition: var(--transition);
}

.role-btn:hover .role-icon {
    background: var(--gradient-primary);
    color: var(--white);
    transform: scale(1.05);
}

.role-btn span {
    font-size: 0.9rem;
    font-weight: 700;
}

.role-btn small {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.role-btn:hover small {
    color: var(--primary);
}

.btn-login {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(8, 142, 185, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 142, 185, 0.3);
    color: var(--white);
    background: linear-gradient(135deg, #066d8f 0%, #088EB9 100%);
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.btn-back:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.login-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0.75rem 2rem 1.75rem;
}

.login-footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(8, 142, 185, 0.1), transparent);
    margin-bottom: 1rem;
}

.login-footer-school {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
    letter-spacing: 0.02em;
}

.login-footer-copy {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
}

/* ===== ANIMATIONS ===== */
.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }

/* ===== OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 63, 77, 0.4);
    z-index: 1045;
    transition: opacity 0.3s;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== RATIO VIDEO ===== */
.ratio {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .welcome-banner .welcome-icon {
        display: none;
    }

    .dashboard-hero {
        flex-direction: column;
        text-align: center;
        padding: 1.75rem;
    }

    .dashboard-hero-content {
        max-width: none;
    }

    .dashboard-hero-visual {
        width: 190px;
        margin: 0 auto;
    }

    .islamic-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .wrapper.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    .content {
        margin-left: 0;
        width: 100%;
    }

    .main-content {
        padding: 1.25rem !important;
    }

    .top-navbar {
        padding: 0.75rem 1rem;
    }

    .navbar-page-title {
        font-size: 0.95rem;
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
    }

    .welcome-banner {
        padding: 1.5rem;
    }

    .welcome-banner h3 {
        font-size: 1.15rem;
    }

    .card-table {
        padding: 1.25rem;
    }

    .media-frame-container iframe {
        min-height: 450px;
    }

    .quiz-container {
        padding: 1.25rem;
    }

    .page-header h2 {
        font-size: 1.35rem;
    }

    .page-header-flex {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-header {
        padding: 1.5rem 1.5rem 0.25rem;
    }

    .login-body {
        padding: 1rem 1.5rem 0.5rem;
    }

    .logo-circle {
        width: 80px;
        height: 80px;
        border-radius: 18px;
    }

    .role-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .role-btn {
        max-width: none;
        min-height: auto;
        flex-direction: row;
        gap: 1rem;
        padding: 1.15rem 1.25rem;
        text-align: left;
    }

    .role-icon {
        margin-bottom: 0;
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .role-btn span,
    .role-btn small {
        text-align: left;
    }

    .role-btn small {
        display: block;
    }

    .quick-action-card {
        padding: 1.25rem;
    }
}

/* ===== SISWA DASHBOARD ===== */
.siswa-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2.25rem;
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(135deg, #eef7fa 0%, #f8fbfc 55%, #e8f1f5 100%);
    border: 1px solid rgba(8, 142, 185, 0.1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: 20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(8, 142, 185, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    max-width: 58%;
}

.dashboard-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(8, 142, 185, 0.1);
    color: var(--primary-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.dashboard-hero h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.45rem;
    letter-spacing: -0.03em;
}

.dashboard-hero p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
    line-height: 1.65;
}

.dashboard-hero-visual {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 220px;
}

.dashboard-hero-visual img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(8, 142, 185, 0.12));
}

.islamic-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.islamic-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(8, 142, 185, 0.18);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.islamic-action-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 142, 185, 0.18);
}

.dashboard-stats {
    margin-bottom: 0;
}

.dashboard-stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    height: 100%;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dashboard-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(8, 142, 185, 0.15);
}

.dashboard-stat-card-featured {
    background: linear-gradient(180deg, var(--white) 0%, var(--primary-soft) 100%);
}

.dashboard-stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.dashboard-stat-score {
    margin-bottom: 0.35rem;
}

.dashboard-stat-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dashboard-stat-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}

.dashboard-stat-progress {
    height: 7px;
    border-radius: 50px;
    background: var(--light-bg);
    overflow: hidden;
    margin: 0.75rem 0 0.5rem;
}

.dashboard-stat-progress-bar {
    height: 100%;
    border-radius: 50px;
    background: var(--gradient-primary);
    transition: width 0.6s ease;
}

.dashboard-last-materi {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.dashboard-last-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    overflow: hidden;
    flex-shrink: 0;
}

.dashboard-last-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-last-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.dashboard-achievement {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.dashboard-achievement-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(212, 146, 10, 0.12);
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.dashboard-achievement-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.dashboard-achievement-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.dashboard-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    background: var(--primary-50);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 600;
}

.dashboard-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dashboard-section-header h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dashboard-section-header a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.dashboard-section-header a:hover {
    color: var(--primary-dark);
}

.dashboard-materi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    transition: var(--transition);
}

.dashboard-materi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(8, 142, 185, 0.18);
}

.dashboard-materi-cover {
    height: 110px;
    background: var(--gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    overflow: hidden;
}

.dashboard-materi-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-materi-body {
    padding: 1rem;
}

.dashboard-materi-body h6 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.dashboard-materi-body p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    min-height: 2.4em;
}

/* ===== MATERI SISWA CUSTOM STYLES ===== */

/* 1. Header Banner Premium */
.materi-hero-banner {
    background: linear-gradient(135deg, #088EB9 0%, #066d8f 50%, #2a3f4d 100%);
    border-radius: var(--radius);
    padding: 2.25rem 2.5rem;
    color: var(--white);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(8, 142, 185, 0.15);
}

.materi-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
}

.materi-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(194, 208, 217, 0.15) 0%, transparent 75%);
    border-radius: 50%;
    pointer-events: none;
}

.materi-hero-banner h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
}

.materi-hero-banner p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    font-weight: 500;
    color: var(--white);
}

/* 2. Filter Kapsul Modern */
.materi-pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.35rem;
    background: rgba(42, 63, 77, 0.04);
    border-radius: 50px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.materi-pill-item {
    list-style: none;
}

.materi-pill-link {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.35rem;
    background: transparent;
    border: none;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}

.materi-pill-link:hover {
    color: var(--primary);
    background: rgba(8, 142, 185, 0.05);
}

.materi-pill-link.active {
    color: var(--white) !important;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(8, 142, 185, 0.25);
}

/* 3. Modern Card Enhancements */
.materi-card-cover-container {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--gradient-primary);
}

.materi-card-cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.materi-card:hover .materi-card-cover-container img {
    transform: scale(1.08);
}

/* Geometric Gradients for cards without covers */
.materi-card-cover-geometric {
    height: 100%;
    background: linear-gradient(135deg, #e8f1f5 0%, #C2D0D9 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.materi-card-cover-geometric::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, rgba(8, 142, 185, 0.12) 0%, transparent 80%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: rotateShape 20s linear infinite;
}

@keyframes rotateShape {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.materi-card-cover-geometric i {
    font-size: 3.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1;
}

/* Float Badges on Cover */
.materi-card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

/* Progress bar inside card */
.materi-card-progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.materi-card-progress-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
}

.materi-card-progress-bar-container {
    height: 6px;
    background: var(--primary-soft);
    border-radius: 50px;
    overflow: hidden;
}

.materi-card-progress-bar-fill {
    height: 100%;
    border-radius: 50px;
    background: var(--success);
    transition: width 0.5s ease;
}

/* 4. Button & Interaction Improvements */
.btn-materi-cta {
    border-radius: 50px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    padding: 0.65rem 1.25rem !important;
    transition: var(--transition) !important;
}

.btn-materi-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 142, 185, 0.25);
}

/* 5. Detail Page Enhancements */
.materi-detail-header-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.materi-detail-breadcrumb {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.materi-detail-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.materi-detail-breadcrumb a:hover {
    color: var(--primary-dark);
}

.materi-detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.materi-detail-title-row h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

/* Interactive Media Button layout */
.materi-interactive-media-btn-container {
    text-align: center;
}

.btn-interactive-media {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 2rem;
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 750;
    font-size: 1.05rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 6px 20px rgba(8, 142, 185, 0.25);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-interactive-media:hover {
    color: var(--white);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(8, 142, 185, 0.35);
}

.btn-interactive-media::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: all 0.6s;
}

.btn-interactive-media:hover::before {
    left: 100%;
}

/* Pulsating shadow */
.materi-media-pulse {
    animation: mediaPulseAnim 2s infinite;
}

@keyframes mediaPulseAnim {
    0% {
        box-shadow: 0 0 0 0 rgba(8, 142, 185, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(8, 142, 185, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(8, 142, 185, 0);
    }
}

/* Polaroid cover style */
.materi-polaroid-cover {
    background: var(--white);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    text-align: center;
}

.materi-polaroid-cover img {
    border-radius: 6px;
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Progress Checklist */
.materi-progress-checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
    background: var(--light-bg);
    transition: var(--transition);
}

.materi-progress-checklist-item.done {
    background: rgba(45, 159, 111, 0.05);
    border-color: rgba(45, 159, 111, 0.15);
}

.materi-progress-checklist-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.materi-progress-checklist-item.done .materi-progress-checklist-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.materi-progress-checklist-text i {
    font-size: 1.1rem;
}

.materi-progress-checklist-text i.done-icon {
    color: var(--success);
}

.materi-progress-checklist-text i.pending-icon {
    color: var(--text-muted);
    opacity: 0.6;
}

.materi-progress-checklist-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 50px;
}

/* ===== SISWA KIDS THEME OVERRIDES (SD IT INSAN MADANI) ===== */
body.siswa-kids-theme {
    --primary: #29b6f6; /* Bright Sky Blue */
    --primary-dark: #0288d1;
    --primary-soft: #e1f5fe;
    --success: #66bb6a; /* Pastel Green */
    --warning: #fbc02d; /* Honey Gold */
    --light-bg: #f0f7fb; /* Very soft sky-blue bg */
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 6px 16px rgba(41, 182, 246, 0.08);
    --shadow-hover: 0 12px 28px rgba(41, 182, 246, 0.15);
    background-color: var(--light-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(41, 182, 246, 0.02) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(251, 192, 45, 0.03) 0%, transparent 25%);
}

/* Sidebar styling for kids */
body.siswa-kids-theme .sidebar {
    background: linear-gradient(180deg, #0288d1 0%, #29b6f6 100%);
    border-right: 4px solid rgba(255, 255, 255, 0.1);
}

body.siswa-kids-theme .sidebar-brand {
    padding-bottom: 1.5rem;
}

body.siswa-kids-theme .sidebar-menu li a {
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.siswa-kids-theme .sidebar-menu li a i {
    font-size: 1.25rem;
}

body.siswa-kids-theme .sidebar-menu li a:hover {
    transform: scale(1.05) translateX(5px);
    background: rgba(255, 255, 255, 0.15);
}

body.siswa-kids-theme .sidebar-menu li a.active {
    background: #ffffff;
    color: #0288d1 !important;
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.2);
}

/* Interactive elements bouncing effects */
body.siswa-kids-theme .btn,
body.siswa-kids-theme .materi-card,
body.siswa-kids-theme .card-table,
body.siswa-kids-theme .materi-pill-link,
body.siswa-kids-theme .dashboard-hero,
body.siswa-kids-theme .dashboard-stat-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.siswa-kids-theme .materi-card:hover,
body.siswa-kids-theme .dashboard-stat-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 14px 30px rgba(41, 182, 246, 0.18) !important;
    border-color: #29b6f6 !important;
}

/* Rounded and cute card table panel */
body.siswa-kids-theme .card-table {
    border-radius: 20px;
    border: 2px solid rgba(41, 182, 246, 0.08);
}

/* Cute filter pills */
body.siswa-kids-theme .materi-pill-tabs {
    background: rgba(41, 182, 246, 0.05);
    border: 2px solid rgba(41, 182, 246, 0.1);
    border-radius: 30px;
    padding: 0.45rem;
}

body.siswa-kids-theme .materi-pill-link {
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
}

body.siswa-kids-theme .materi-pill-link.active {
    background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
    box-shadow: 0 4px 10px rgba(41, 182, 246, 0.3);
}

/* Rainbow / Colorful Progress Bar for children motivation */
body.siswa-kids-theme .materi-card-progress-bar-fill,
body.siswa-kids-theme .dashboard-stat-progress-bar,
body.siswa-kids-theme .progress-bar {
    background: linear-gradient(90deg, #29b6f6 0%, #66bb6a 60%, #fbc02d 100%) !important;
    border-radius: 30px;
}

body.siswa-kids-theme .materi-card-progress-bar-container,
body.siswa-kids-theme .dashboard-stat-progress,
body.siswa-kids-theme .progress {
    height: 10px !important;
    background: #e1f5fe !important;
    border-radius: 30px;
    overflow: hidden;
}

/* Polaroid cover extra cute border */
body.siswa-kids-theme .materi-polaroid-cover {
    border: 3px solid rgba(41, 182, 246, 0.12);
    border-radius: 16px;
    transform: rotate(-1.5deg);
    transition: transform 0.3s ease;
}

body.siswa-kids-theme .materi-polaroid-cover:hover {
    transform: rotate(0deg) scale(1.03);
}

/* Welcome banner / Dashboard Hero */
body.siswa-kids-theme .dashboard-hero {
    background: linear-gradient(135deg, #e1f5fe 0%, #ffffff 50%, #fffde7 100%) !important;
    border: 2px solid rgba(41, 182, 246, 0.12) !important;
    border-radius: 24px !important;
}

body.siswa-kids-theme .materi-hero-banner {
    background: linear-gradient(135deg, #0288d1 0%, #29b6f6 50%, #66bb6a 100%) !important;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(2, 136, 209, 0.2);
}

body.siswa-kids-theme .materi-hero-banner h2 {
    font-size: 2rem;
    font-weight: 850;
}

/* Kids friendly badges */
body.siswa-kids-theme .materi-card-badge {
    background: #ffffff;
    color: #0288d1;
    border: 2.5px solid rgba(41, 182, 246, 0.15);
    font-size: 0.78rem;
    font-weight: 800;
}

/* Dynamic bouncy button hover */
body.siswa-kids-theme .btn-materi-cta,
body.siswa-kids-theme .btn-interactive-media {
    border-radius: 30px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

body.siswa-kids-theme .btn-materi-cta:hover {
    transform: translateY(-4px) scale(1.04) !important;
    box-shadow: 0 6px 16px rgba(41, 182, 246, 0.3) !important;
}

body.siswa-kids-theme .btn-interactive-media:hover {
    transform: translateY(-5px) scale(1.05) !important;
    box-shadow: 0 8px 24px rgba(2, 136, 209, 0.4) !important;
}

/* Avatar on kids layout */
body.siswa-kids-theme .sidebar-avatar {
    background: #fffde7;
    color: #fbc02d;
    border: 2px dashed #fbc02d;
    font-size: 1.15rem;
}

/* Android-style Bottom Navigation for Kids (Mobile & Tablet) */
@media (max-width: 992px) {
    /* Hide vertical sidebar and overlay for kids */
    body.siswa-kids-theme .sidebar {
        display: none !important;
    }
    body.siswa-kids-theme .sidebar-overlay {
        display: none !important;
    }
    body.siswa-kids-theme #sidebarToggle {
        display: none !important; /* Hide sidebar drawer toggle button */
    }
    
    /* Remove sidebar margins from main content wrapper */
    body.siswa-kids-theme .content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    body.siswa-kids-theme .main-content {
        padding-bottom: 85px !important; /* Add space for bottom nav */
    }
    
    /* Bottom Navigation Styling */
    .android-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #ffffff;
        border-top: 2.5px solid rgba(41, 182, 246, 0.15);
        box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.05);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1040;
        border-radius: 20px 20px 0 0; /* Rounded top like modern Android UI */
        padding: 0 0.5rem;
    }
    
    .android-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 800;
        width: 20%;
        height: 100%;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    .android-bottom-nav .nav-item i {
        font-size: 1.35rem;
        margin-bottom: 0.15rem;
        transition: transform 0.3s ease;
        color: var(--text-muted);
    }
    
    /* Active indicator like Android Pill */
    .android-bottom-nav .nav-item.active {
        color: #0288d1;
    }
    
    .android-bottom-nav .nav-item.active i {
        transform: scale(1.15) translateY(-2px);
        color: #0288d1;
    }
    
    /* Add subtle active indicator dot/pill underneath */
    .android-bottom-nav .nav-item.active::after {
        content: '';
        width: 6px;
        height: 6px;
        background: #0288d1;
        border-radius: 50%;
        margin-top: 2px;
    }
    
    /* Hide top navbar left margins & adjustments to fit screen */
    body.siswa-kids-theme .top-navbar {
        border-radius: 0 0 16px 16px;
        box-shadow: 0 4px 12px rgba(42, 63, 77, 0.03);
    }
}

/* ===== GLOBAL RESPONSIVE POLISH (ADMIN & SISWA) ===== */
@media (max-width: 768px) {
    /* 1. Page Headers Wrapping */
    .page-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.45rem !important;
        margin-bottom: 0.5rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .page-header-flex, 
    .page-header.d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: center;
        gap: 0.75rem !important;
    }
    
    .page-header.d-flex .btn,
    .page-header-flex .btn {
        margin-top: 0.25rem;
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 2. DataTables Responsive Controls */
    .dataTables_wrapper .row {
        flex-direction: column;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center !important;
        margin-bottom: 0.75rem;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter label {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        justify-content: center !important;
        margin-top: 0.5rem;
        width: 100%;
    }

    .dataTables_wrapper .pagination {
        justify-content: center !important;
    }

    /* 3. Cards Padding Adjustments */
    .card-table {
        padding: 1.15rem !important;
        margin-bottom: 1.25rem !important;
    }

    /* 4. Table responsive scroll indicator hint */
    .table-responsive {
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        box-shadow: inset 0 0 8px rgba(0,0,0,0.02);
    }
    
    /* 5. Quick actions grids spacing */
    .quick-action-card {
        padding: 1rem 0.5rem !important;
    }
    
    .quick-action-card span {
        font-size: 0.8rem;
    }

    /* 6. Form elements spacing */
    .form-control, .form-select {
        font-size: 0.88rem;
        padding: 0.6rem 0.8rem;
    }
    
    /* 7. Viewport Adaptive Iframes */
    .media-frame-container iframe {
        min-height: 65vh !important;
    }
}

/* Kids Quiz Option Styling */
body.siswa-kids-theme .quiz-option:hover {
    border-color: #29b6f6 !important;
    background-color: #e1f5fe !important;
    transform: translateY(-2px) scale(1.02);
}

body.siswa-kids-theme .quiz-option.selected {
    border-color: #0288d1 !important;
    background-color: #e1f5fe !important;
    box-shadow: 0 0 0 4px rgba(2, 136, 209, 0.15) !important;
}

/* Activity Log Custom Scrollbar */
.activity-log-container::-webkit-scrollbar {
    width: 6px;
}
.activity-log-container::-webkit-scrollbar-track {
    background: transparent;
}
.activity-log-container::-webkit-scrollbar-thumb {
    background-color: rgba(41, 182, 246, 0.2);
    border-radius: 10px;
}
.activity-log-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(41, 182, 246, 0.4);
}

/* Kids Login Page Customizations */
.login-brand {
    font-weight: 800;
    font-size: 2rem !important;
    text-shadow: 0 2px 4px rgba(41, 182, 246, 0.1);
}

.role-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-siswa-choice {
    border-color: #29b6f6 !important;
    border-width: 2.5px !important;
    background-color: #fffde7 !important; /* Soft yellow bg for contrast */
    box-shadow: 0 4px 10px rgba(41, 182, 246, 0.15) !important;
}

.btn-siswa-choice:hover {
    background-color: #e1f5fe !important;
    border-color: #0288d1 !important;
    transform: translateY(-8px) scale(1.05) !important;
    box-shadow: 0 12px 24px rgba(2, 136, 209, 0.25) !important;
}

.btn-siswa-choice .role-icon {
    background-color: #29b6f6 !important;
    color: #ffffff !important;
    border-radius: 20px !important;
}

.btn-guru-choice {
    border-color: #66bb6a !important;
    border-width: 2.5px !important;
    background-color: #f1f8e9 !important;
}

.btn-guru-choice:hover {
    background-color: #d0e7b5 !important;
    border-color: #4caf50 !important;
    transform: translateY(-5px) !important;
}

.btn-guru-choice .role-icon {
    background-color: #66bb6a !important;
    color: #ffffff !important;
    border-radius: 20px !important;
}

/* Custom login inputs */
.login-input {
    border-radius: 12px !important;
    border: 2px solid var(--border) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

.login-input:focus {
    border-color: #29b6f6 !important;
    box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.2) !important;
}

.btn-login {
    background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%) !important;
    color: #ffffff !important;
    border-radius: 30px !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    padding: 0.85rem !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-login:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(2, 136, 209, 0.3) !important;
}

/* ===== SINGLE QUESTION LAYOUT MOCKUP OVERRIDES ===== */
/* Sidebar Nav Active and Answered states */
.question-nav-btn {
    border: 3px solid var(--border) !important;
    color: var(--text) !important;
    background-color: var(--white) !important;
    box-shadow: 0 4px 0 var(--border) !important;
    transform: translateY(0);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.question-nav-btn:hover {
    border-color: #29b6f6 !important;
    background-color: #fffde7 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(41, 182, 246, 0.2) !important;
}

.question-nav-btn.active-question {
    background-color: #e8f5e9 !important;
    border-color: #66bb6a !important;
    color: #2e7d32 !important;
    box-shadow: 0 4px 0 #66bb6a, 0 8px 16px rgba(102, 187, 106, 0.25) !important;
    transform: translateY(-3px) scale(1.08);
}

.question-nav-btn.answered-question {
    border-color: #66bb6a !important;
    background-color: #f1f8e9 !important;
    box-shadow: 0 4px 0 #81c784 !important;
}

/* Radio button selections list item */
.quiz-option-item {
    cursor: pointer;
    background-color: var(--white);
    border: 3px solid var(--border) !important;
    border-radius: 18px !important;
    padding: 1.15rem 1.4rem !important;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 0 var(--border) !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.quiz-option-item:hover {
    border-color: #29b6f6 !important;
    background-color: #e1f5fe !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 0 rgba(41, 182, 246, 0.25) !important;
}

.quiz-option-item.selected-option {
    border-color: #2d9f6f !important;
    background-color: #e8f5e9 !important;
    box-shadow: 0 5px 0 #2d9f6f, 0 8px 20px rgba(45, 159, 111, 0.2) !important;
    transform: translateY(-2px);
}

/* ===== RESPONSIVE DESIGN (MOBILE & TABLET) ===== */

/* For Tablet and Mobile (Screens up to 991.98px) */
@media (max-width: 991.98px) {
    #sidebarToggle {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        z-index: 1050;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        display: flex !important;
    }
    
    .sidebar.show {
        transform: translateX(0) !important;
    }
    
    .content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .top-navbar {
        padding: 0.75rem 1.25rem;
    }
    
    .main-content {
        padding: 1.25rem !important;
        padding-bottom: 85px !important;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(42, 63, 77, 0.4);
        backdrop-filter: blur(3px);
        z-index: 1045;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block !important;
        opacity: 1 !important;
    }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    .page-header h2 {
        font-size: 1.35rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .card-table {
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }
    
    /* Adjust quick action cards text */
    .quick-action-card span {
        font-size: 0.75rem !important;
    }
}

/* Active sidebar item style for Admin (solid white background, matching student panel) */
body.admin-theme .sidebar-menu li a.active {
    background: #ffffff !important;
    color: #0288d1 !important;
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.2);
    font-weight: 700;
}

body.admin-theme .sidebar-menu li a.active i {
    color: #0288d1 !important;
}

/* ===== STUDENT PANEL RESPONSIVE POLISH ===== */

@media (max-width: 991.98px) {
    .dashboard-hero {
        flex-direction: column-reverse !important;
        text-align: center !important;
        padding: 1.5rem !important;
        gap: 1.25rem !important;
    }
    
    .dashboard-hero-content {
        max-width: 100% !important;
    }
    
    .dashboard-hero-visual {
        width: 160px !important;
        margin: 0 auto !important;
    }
    
    .materi-hero-banner {
        text-align: center !important;
        padding: 1.75rem 1.25rem !important;
    }
    
    .materi-hero-banner h2 {
        font-size: 1.5rem !important;
        justify-content: center !important;
    }
    
    /* Swipable scroll list for topics in mobile / tablet */
    .materi-pill-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 0.5rem !important;
        padding: 0.25rem 0.25rem 0.65rem !important;
        scrollbar-width: none !important;
    }
    
    .materi-pill-tabs::-webkit-scrollbar {
        display: none !important;
    }
    
    .materi-pill-link {
        flex: 0 0 auto !important;
        padding: 0.5rem 1.15rem !important;
        font-size: 0.85rem !important;
        border-radius: 20px !important;
    }
}

@media (max-width: 576px) {
    .dashboard-hero-visual {
        display: none !important;
    }
    
    .dashboard-hero h2 {
        font-size: 1.35rem !important;
    }
    
    .dashboard-hero p {
        font-size: 0.85rem !important;
    }
}

/* ===== RESPONSIVE LOGIN PAGE ===== */
@media (max-width: 576px) {
    .login-container {
        padding: 0.5rem;
        max-width: 100% !important;
    }
    
    .login-card {
        border-radius: 20px !important;
    }
    
    .login-header {
        padding: 1.75rem 1.25rem 0.5rem !important;
    }
    
    .logo-circle {
        width: 76px !important;
        height: 76px !important;
        border-radius: 16px !important;
    }
    
    .login-brand {
        font-size: 1.5rem !important;
    }
    
    .login-subtitle {
        font-size: 0.8rem !important;
        max-width: 260px !important;
    }
    
    .login-body {
        padding: 1rem 1.25rem 0.5rem !important;
    }
    
    .role-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .role-btn {
        max-width: 100% !important;
        min-height: auto !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        padding: 1rem !important;
        gap: 1rem !important;
    }
    
    .role-icon {
        margin-bottom: 0 !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
        border-radius: 12px !important;
    }
    
    .role-btn small {
        display: block !important;
        margin-top: 0.15rem !important;
    }
    
    .login-footer {
        padding: 0.5rem 1.25rem 1.5rem !important;
    }
}

@media (max-width: 360px) {
    .login-brand {
        font-size: 1.3rem !important;
    }
    
    .role-btn span {
        font-size: 0.85rem !important;
    }
}





/* =====================================================================
 * UX OVERHAUL — navigasi halus, tombol konsisten, form inline, notifikasi
 * ===================================================================== */

/* --- Transisi halus antar halaman (full load) & tanpa kedip saat load --- */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: app-sidebar; }
.top-navbar { view-transition-name: app-topbar; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.18s; }

body.preload *,
body.preload *::before,
body.preload *::after { transition: none !important; }

/* Panel guru: tidak ada animasi masuk berulang yang terasa "glitch" */
body.admin-theme .animate-in { animation: none; opacity: 1; }

.main-content.pjax-enter { animation: pjaxEnter 0.22s ease both; }
@keyframes pjaxEnter { from { opacity: 0.35; } to { opacity: 1; } }

.main-content.is-busy .card-table,
.main-content.is-busy .page-header { opacity: 0.6; transition: opacity 0.2s ease; }
.main-content.is-busy { cursor: progress; }

#pjax-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 3000;
    background: linear-gradient(90deg, #29b6f6, #0288d1);
    box-shadow: 0 0 10px rgba(2, 136, 209, 0.5);
    opacity: 0;
    transition: width 0.25s ease, opacity 0.3s ease;
    pointer-events: none;
}
#pjax-bar.is-active { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .main-content.pjax-enter { animation: none; }
    .form-panel { transition: none !important; }
}

/* --- Sistem tombol: state jelas & konsisten --- */
.btn:focus-visible {
    box-shadow: 0 0 0 0.22rem rgba(var(--bs-btn-focus-shadow-rgb, 2, 136, 209), 0.35);
}
.btn:not(:disabled):not(.disabled):active { transform: scale(0.97); }

.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    opacity: 0.68;
    filter: saturate(0.8);
    box-shadow: none !important;
    transform: none !important;
}
/* kursor "dilarang" (lingkaran silang) saat tombol belum bisa dipakai */
button.btn:disabled,
button.btn.disabled {
    pointer-events: auto;
    cursor: not-allowed;
}
.btn:disabled:hover {
    color: var(--bs-btn-disabled-color);
    background-color: var(--bs-btn-disabled-bg);
    border-color: var(--bs-btn-disabled-border-color);
}
/* tombol yang sedang memproses tidak boleh tampak "mati" */
.btn.is-loading {
    opacity: 1 !important;
    filter: none !important;
    cursor: progress !important;
}
.btn .btn-spinner {
    width: 0.85rem;
    height: 0.85rem;
    border-width: 0.15em;
    margin-right: 0.35rem;
    vertical-align: -0.1em;
}
.btn.btn-sm.is-loading .btn-spinner { margin-right: 0; }
.btn.btn-sm.is-loading .btn-spinner + i { display: none; }

.btn-light {
    --bs-btn-color: var(--text);
    --bs-btn-bg: #eef3f6;
    --bs-btn-border-color: #e2eaef;
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: #e3ebf0;
    --bs-btn-hover-border-color: #d5e1e8;
    --bs-btn-active-bg: #d5e1e8;
}

.btn .bi-plus-lg { display: inline-block; transition: transform 0.25s ease; }
.btn.is-active .bi-plus-lg { transform: rotate(45deg); }
.btn-primary.is-active {
    --bs-btn-bg: #01579b;
    --bs-btn-border-color: #01579b;
}

.top-navbar .btn-link:focus-visible { box-shadow: 0 0 0 0.2rem rgba(2, 136, 209, 0.3); }

/* --- Tombol kembali (halaman tanpa menu sidebar) --- */
.btn-back-page {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.4rem 0.9rem 0.4rem 0.7rem;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.btn-back-page:hover {
    color: #0288d1;
    border-color: #b3e5fc;
    background: var(--primary-soft);
}
.btn-back-page i { transition: transform 0.2s ease; }
.btn-back-page:hover i { transform: translateX(-3px); }

/* --- Header halaman & tombol aksi --- */
.page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* --- Navbar --- */
.navbar-title-block { min-width: 0; }
.navbar-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2a3f4d;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-page-subtitle {
    font-size: 0.8rem;
    display: block;
    margin-top: 1px;
}
.navbar-left { min-width: 0; }

/* --- Form panel (tambah/edit slide-down) --- */
.form-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s ease,
                transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.32s;
}
.form-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease 0.05s,
                transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s;
}
.form-panel.no-anim { transition: none !important; }
.form-panel-inner {
    overflow: hidden;
    min-height: 0;
    padding: 4px 4px 0;
    margin: -4px -4px 0;
}
.form-panel-card {
    margin-bottom: 1.5rem;
    border-top: 3px solid #0288d1 !important;
}
.form-panel.is-edit .form-panel-card { border-top-color: #fbc02d !important; }
.form-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-panel-head h5 { margin: 0; }
.form-panel.is-edit .form-panel-head h5 i { color: #f9a825; }
.form-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

/* --- Tabel --- */
.table > :not(caption) > * > * { vertical-align: middle; }
.col-check { width: 1%; min-width: 40px; text-align: center; white-space: nowrap; }
.col-check .form-check-input { margin: 0; float: none; cursor: pointer; width: 1.1em; height: 1.1em; }
.col-no { width: 1%; white-space: nowrap; }
.col-aksi { width: 1%; white-space: nowrap; }
.action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}
.action-group form { margin: 0; }

th.dtr-ctrl, td.dtr-ctrl {
    width: 1% !important;
    padding-left: 0.35rem !important;
    padding-right: 0.15rem !important;
}
table.dataTable.dtr-column > tbody > tr > td.dtr-control:before {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: #e1f5fe;
    color: #0288d1;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1;
    box-shadow: none;
}
table.dataTable.dtr-column > tbody > tr.dtr-expanded > td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.parent > td.dtr-control:before {
    content: "\2212";
    background: #0288d1;
    color: #fff;
    border: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr.child ul.dtr-details > li { padding: 0.5rem 0; }
table.dataTable > tbody > tr.child span.dtr-title { min-width: 90px; font-weight: 700; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; }

table.dataTable > tbody > tr.is-selected > * {
    box-shadow: inset 0 0 0 9999px rgba(2, 136, 209, 0.07);
}
table.dataTable > tbody > tr.row-editing > * {
    box-shadow: inset 0 0 0 9999px rgba(251, 192, 45, 0.16);
}
table.dataTable > tbody > tr.row-editing > td:nth-child(2) {
    box-shadow: inset 3px 0 0 #fbc02d, inset 0 0 0 9999px rgba(251, 192, 45, 0.16);
}

.table-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.table-thumb-empty { background: var(--light-bg); color: var(--text-muted); font-size: 1.2rem; }

.cell-link a {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    color: var(--text-muted);
}
.dataTables_wrapper .dataTables_filter input { margin-left: 0.4rem; }
.dataTables_wrapper .dataTables_paginate .page-link { border-radius: 8px; margin: 0 2px; }
.table-responsive { overflow-x: auto; }

/* --- Toolbar & filter --- */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.toolbar-select { width: auto; min-width: 170px; }
.segmented {
    display: inline-flex;
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    flex-wrap: wrap;
}
.segmented label {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin: 0;
}
.segmented label:hover { color: var(--text); }
.segmented .btn-check:checked + label {
    background: #fff;
    color: #0288d1;
    box-shadow: 0 1px 4px rgba(42, 63, 77, 0.12);
}
.segmented .btn-check:focus-visible + label { outline: 2px solid rgba(2, 136, 209, 0.4); }

.filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}
.filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.soal-eval-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0.85rem;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
}
.soal-eval-info i { color: #0288d1; margin-right: 0.25rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; color: var(--primary-light); display: block; margin-bottom: 0.75rem; }
.empty-state h5 { color: var(--text); font-weight: 700; }
.empty-state p { margin: 0; font-size: 0.9rem; }

.chart-filter-select {
    width: auto;
    min-width: 170px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.3rem 2.2rem 0.3rem 0.9rem;
    background-position: right 0.8rem center;
}

/* --- Notifikasi navbar --- */
.notif-bell {
    color: var(--text) !important;
    padding: 0.4rem !important;
    border: 0;
}
.notif-bell:hover { background: var(--light-bg); }
.notif-count {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: content-box;
}
.notif-count[hidden] { display: none; }
.notif-menu {
    width: 360px;
    max-width: calc(100vw - 24px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-top: 10px !important;
    overflow: hidden;
}
.notif-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.88rem;
}
.notif-mark-all,
.link-action {
    border: 0;
    background: none;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    color: #0288d1;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.notif-mark-all:hover,
.link-action:hover { background: var(--primary-soft); }
.notif-mark-all[hidden],
.link-action[hidden] { display: none; }
.notif-menu-body { max-height: 360px; overflow-y: auto; }
.notif-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.78rem;
    position: relative;
    transition: background 0.2s ease;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: #f3faff; }
.notif-item.is-unread::before {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: #0288d1;
}
.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-text { flex: 1; min-width: 0; line-height: 1.3; }
.notif-desc { color: var(--text); font-weight: 600; font-size: 0.8rem; }
.notif-item:not(.is-unread) .notif-desc { font-weight: 500; color: #546e7a; }
.notif-text small { color: var(--text-muted); font-size: 0.68rem; }
.notif-read-btn,
.activity-read-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: #2e7d32;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.notif-item.is-unread .notif-read-btn,
.activity-item.is-unread .activity-read-btn { display: inline-flex; }
.notif-read-btn:hover,
.activity-read-btn:hover { background: #e8f5e9; border-color: #a5d6a7; }
.notif-read-btn:disabled,
.activity-read-btn:disabled { opacity: 0.5; cursor: progress; }
.notif-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.notif-empty i { display: block; font-size: 1.6rem; margin-bottom: 0.35rem; }
.notif-menu-footer {
    display: block;
    text-align: center;
    padding: 0.7rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 700;
    color: #0288d1;
    text-decoration: none;
}
.notif-menu-footer:hover { background: var(--light-bg); color: #01579b; }

.sidebar-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #ff5252;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}
.sidebar-badge[hidden] { display: none; }

/* --- Dashboard: aktivitas terbaru --- */
.activity-list { display: flex; flex-direction: column; gap: 0.35rem; }
.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    transition: background 0.2s ease;
}
.activity-item:hover { background: var(--light-bg); }
.activity-item.is-unread { background: #f3faff; }
.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.activity-text { flex: 1; min-width: 0; line-height: 1.3; }
.activity-desc {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-item.is-unread .activity-desc { font-weight: 700; }
.activity-text small { color: var(--text-muted); font-size: 0.72rem; }
.btn-see-all {
    border-radius: 12px;
    font-size: 0.85rem;
    border: 2px solid #e2eaef;
    color: #2a3f4d;
    --bs-btn-hover-bg: var(--light-bg);
    --bs-btn-hover-color: #0288d1;
    --bs-btn-hover-border-color: #b3e5fc;
}

/* --- Halaman aktivitas --- */
.mini-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow);
    height: 100%;
}
.mini-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.mini-stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.mini-stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.table-aktivitas tbody tr.is-unread > td:nth-child(2) { box-shadow: inset 3px 0 0 #0288d1; }
.table-aktivitas tbody tr.is-unread .aktivitas-cell span:last-child { font-weight: 700; }
.aktivitas-cell { display: flex; align-items: center; gap: 0.6rem; min-width: 220px; }
.aktivitas-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.role-badge {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.role-siswa { background: #f3e5f5; color: #8e24aa; }
.role-guru { background: #e1f5fe; color: #0277bd; }
.status-unread { background: #e1f5fe !important; color: #0277bd !important; }
.status-read { background: #eceff1 !important; color: #607d8b !important; }

/* --- Responsif --- */
@media (max-width: 991.98px) {
    .navbar-page-title { font-size: 1.15rem; }
    .navbar-page-subtitle { display: none; }
    body.sidebar-open { overflow: hidden; }
}

@media (max-width: 768px) {
    .page-actions { width: 100%; }
    .page-actions > *,
    .page-actions > form .btn { flex: 1 1 0; }
    .page-actions > form { display: flex !important; }
    .page-header.d-flex .page-actions .btn { margin-top: 0; }
    .page-header.d-flex .btn,
    .page-header-flex .btn,
    .filter-footer .btn { gap: 0.4rem; }
    .form-panel-actions .btn { flex: 1 1 auto; }
    .filter-footer { flex-direction: column; align-items: stretch; }
    .filter-footer .d-flex > .btn { flex: 1 1 0; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-select { width: 100%; }
    .segmented { justify-content: center; }
    .dataTables_wrapper .dataTables_length label { justify-content: center; }
    .dataTables_wrapper .dataTables_filter label { display: flex; width: 100%; }
    .dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
    .dataTables_wrapper { padding: 0.25rem; }
    .cell-link a { max-width: 160px; }
}

@media (max-width: 575.98px) {
    .navbar-page-title { font-size: 1rem; max-width: 52vw; }
    .notif-menu {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: 64px !important;
        width: auto;
        transform: none !important;
        inset: 64px 12px auto 12px !important;
    }
}
