/* SIMkudewe - Sistem Informasi Manajemen Sekolah
   Mobile First Responsive Design
    */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --info: #118ab2;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* LOGIN PAGE */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    text-align: center;
}

.login-logo {
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.login-logo p {
    color: var(--gray);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input-icon {
    position: relative;
}

.form-input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.form-input-icon input {
    padding-left: 45px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-info {
    background: var(--info);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 12px;
}

/* MOBILE HEADER */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--dark);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.logo i {
    font-size: 24px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray);
    display: none;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-light);
}

.close-sidebar {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.sidebar-info {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 2px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--gray-light);
    color: var(--primary);
}

.sidebar-nav li.active a {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav i {
    width: 24px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-light);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--danger);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: #d63447;
}

/* OVERLAY */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* MAIN CONTENT */
.main-content {
    padding: 80px 15px 30px;
    min-height: 100vh;
}

.page-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--gray);
}

/* CARDS */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 20px;
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.blue {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.stat-icon.green {
    background: rgba(6, 214, 160, 0.1);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(255, 209, 102, 0.1);
    color: #f39c12;
}

.stat-icon.red {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}

.stat-info p {
    font-size: 12px;
    color: var(--gray);
}

/* FORMS */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.data-table th {
    background: var(--gray-light);
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(67, 97, 238, 0.03);
}

.data-table .no-data {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* ACTION BUTTONS */
.action-btns {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.btn-edit {
    background: rgba(17, 138, 178, 0.1);
    color: var(--info);
}

.btn-edit:hover {
    background: var(--info);
    color: var(--white);
}

.btn-delete {
    background: rgba(239, 71, 111, 0.1);
    color: var(--danger);
}

.btn-delete:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-view {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.btn-view:hover {
    background: var(--primary);
    color: var(--white);
}

/* FILTER SECTION */
.filter-section {
    background: var(--gray-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* KEHADIRAN FORM */
.kehadiran-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kehadiran-item {
    background: var(--gray-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.kehadiran-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kehadiran-no {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.kehadiran-nama {
    font-weight: 500;
    font-size: 14px;
}

.kehadiran-nis {
    font-size: 12px;
    color: var(--gray);
}

.kehadiran-select {
    padding: 10px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    min-width: 100px;
}

.kehadiran-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* REKAP BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    min-width: 35px;
}

.badge-success {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 209, 102, 0.15);
    color: #f39c12;
}

.badge-info {
    background: rgba(17, 138, 178, 0.15);
    color: var(--info);
}

.badge-danger {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

/* NILAI INPUT */
.nilai-input {
    width: 70px;
    padding: 8px 10px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
    font-family: inherit;
}

.nilai-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ALERT */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(6, 214, 160, 0.5);
    color: #ffffff;
}

.alert-error {
    background: rgba(239, 71, 111, 0.15);
    color: #dc2626;
}

.alert-info {
    background: rgba(17, 138, 178, 0.15);
    color: #0e7490;
}

.close-alert {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
}

.close-alert:hover {
    opacity: 1;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.pagination a {
    background: var(--gray-light);
    color: var(--dark);
}

.pagination a:hover {
    background: var(--primary);
    color: var(--white);
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 60px;
    color: var(--gray-light);
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray);
}

/* SEARCH BOX */
.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

/* FILE UPLOAD */
.file-upload {
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.03);
}

.file-upload i {
    font-size: 40px;
    color: var(--gray);
    margin-bottom: 10px;
}

.file-upload p {
    font-size: 14px;
    color: var(--gray);
}

/* DETAIL VIEW */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-light);
}

.detail-label {
    font-weight: 500;
    color: var(--gray);
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

/* PRINT STYLES */
@media print {
    .mobile-header,
    .sidebar,
    .overlay,
    .btn,
    .action-btns {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* RESPONSIVE - TABLET */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .filter-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .user-name {
        display: block;
    }
    
    .data-table th,
    .data-table td {
        padding: 15px 20px;
    }
}

/* RESPONSIVE - DESKTOP */
@media (min-width: 1024px) {
    .mobile-header {
        display: none;
    }
    
    .sidebar {
        left: 0;
        width: 260px;
    }
    
    .close-sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 260px;
        padding: 30px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .filter-row {
        grid-template-columns: repeat(4, 1fr) auto;
    }
}

/* LOADING SPINNER */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 3px;
}

.materi-tap {
    font-size: 11px;
    color: #555;
    cursor: pointer;
    text-decoration: underline dotted;
}

/* Overlay */
.materi-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Box */
.materi-popup-content {
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    max-width: 90%;
    width: 320px;
    text-align: center;
    animation: popupFade 0.2s ease;
}

.materi-popup-content h4 {
    margin-bottom: 16px;
    font-size: 16px;
}

.materi-popup-close {
    border: none;
    background: #007bff;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

@keyframes popupFade {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.tab-nav {
    display: flex;
    gap: 6px;
}

.tab-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #f4f6f8;
    cursor: pointer;
}

.tab-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* Warna */
.badge-red {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}.badge-blue { background:#3498db; color:#fff; }
.badge-green {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}
.badge-purple { background:#9b59b6; color:#fff; }
.badge-grey { background:#95a5a6; color:#fff; }

/* ===============================
   TABLE REKAP NILAI SCROLL
================================= */
.table-scroll{
    width:100%;
    overflow:auto;
    border-radius:12px;
    border:1px solid #e5e7eb;
    max-height:75vh;
    position:relative;
    background:#fff;
}

/* Scroll horizontal & vertical */
.table-scroll::-webkit-scrollbar{
    height:10px;
    width:10px;
}

.table-scroll::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:10px;
}

.table-scroll::-webkit-scrollbar-track{
    background:#f1f5f9;
}

/* Tabel */
.rekap-table{
    width:max-content;
    min-width:1200px;
    border-collapse:separate;
    border-spacing:0;
}

/* Header sticky */
.rekap-table thead th{
    position:sticky;
    top:0;
    z-index:5;
    background:#f8fafc;
    white-space:nowrap;
    box-shadow:0 1px 0 #e5e7eb;
}

/* =========================
   STICKY TABLE REKAP NILAI
========================= */

/* Kolom NO */
.rekap-table th:nth-child(1),
.rekap-table td:nth-child(1){
    min-width:50px;
    text-align:center;
}

/* Kolom NAMA SISWA (sticky) */
.rekap-table th:nth-child(2),
.rekap-table td:nth-child(2){
    position:sticky;
    left:0;
    z-index:20;
    background:#fff;
    min-width:180px;
    max-width:180px;
    white-space:nowrap;
    box-shadow:1px 0 0 #e5e7eb;
}

/* Header nama lebih atas */
.rekap-table thead th:nth-child(2){
    z-index:30;
    background:#f8fafc;
}

/* Kolom NIS ikut scroll */
.rekap-table th:nth-child(3),
.rekap-table td:nth-child(3){
    min-width:100px;
}

/* Kolom aksi sticky kanan */
.rekap-table th:last-child,
.rekap-table td:last-child{
    position:sticky;
    right:0;
    background:#fff;
    z-index:15;
    box-shadow:-1px 0 0 #e5e7eb;
}

/* Header sticky */
.rekap-table thead th{
    position:sticky;
    top:0;
    z-index:25;
    background:#f8fafc;
}

/* =========================
   MOBILE FIX
========================= */

@media (max-width:768px){

    .card-body{
        padding:10px;
    }

    .table-scroll{
        width:100%;
        display:block;
        overflow-x:auto;
        overflow-y:auto;
        -webkit-overflow-scrolling:touch;
        max-height:70vh;
        border-radius:12px;
    }

    .rekap-table{
        min-width:1200px;
        width:max-content;
        font-size:12px;
    }

    .rekap-table th,
    .rekap-table td{
        padding:8px 10px;
        white-space:nowrap;
    }

    /* Nama siswa tetap terlihat */
    .rekap-table th:nth-child(2),
    .rekap-table td:nth-child(2){
        position:sticky;
        left:0;
        min-width:140px;
        max-width:140px;
        background:#fff;
        z-index:30;
    }

    .rekap-table thead th:nth-child(2){
        background:#f1f5f9;
        z-index:40;
    }

    /* Tombol kanan tetap */
    .rekap-table th:last-child,
    .rekap-table td:last-child{
        position:sticky;
        right:0;
        min-width:80px;
        background:#fff;
        z-index:30;
    }

    .rekap-table thead th:last-child{
        z-index:40;
    }

    /* Button */
    .rekap-table .btn{
        padding:6px 8px;
        font-size:11px;
    }

    /* Badge */
    .rekap-table .badge{
        font-size:11px;
        padding:4px 6px;
    }
}