/* Mengimpor font dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Times+New+Roman&display=swap');

/* Reset dan Pengaturan Dasar Body */
:root {
    /* Legacy colors (keep for compatibility) */
    --primary-blue: #1a73e8;
    --dark-green: #006400;
    --light-gray: #ffffff;
    --text-dark: #333;
    --text-light: #555555;
    --border-color: #2522226c;
    --danger-red: #d93025;
    --success-green: #1e8e3e;
    --info-blue: #17a2b8;
    --warning-orange: #ff9800;
    
    /* New Theme System Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border-color-new: #e0e0e0;
    --shadow: rgba(0,0,0,0.1);
    --accent-primary: #1e8e3e;
    --accent-secondary: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --success: #28a745;
    
    /* Animation variables */
    --animation-duration: 0.3s;
    --transition-duration: 0.2s;
}

/* ===== ACCESSIBILITY & FONT SIZE SUPPORT ===== */
/* Support untuk ukuran font yang dapat disesuaikan */

/* Focus indicators untuk aksesibilitas */
button:focus, input:focus, select:focus, textarea:focus, a:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== REAL-TIME COLLABORATION STYLES ===== */

/* Field update indicators */
.remote-updated {
    border: 2px solid #28a745 !important;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3) !important;
    animation: remoteUpdate 0.3s ease-in-out;
}

.remote-focused {
    border: 2px solid #17a2b8 !important;
    box-shadow: 0 0 5px rgba(23, 162, 184, 0.3) !important;
}

.field-update-indicator, .field-focus-indicator {
    animation: slideIn 0.3s ease-in-out;
}

/* Collaboration animations */
@keyframes remoteUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    0% { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Collaboration indicator styling */
#collaboration-indicator {
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

#collaboration-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

/* ===== ADVANCED ANALYTICS DASHBOARD STYLES ===== */

/* Chart containers */
.chart-card-medium {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
}

.chart-card-large {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
}

.chart-card-full {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
    margin-top: 20px;
}

.stats-card-large {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
}

/* Mini stat cards */
.mini-stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition-duration), box-shadow var(--transition-duration);
}

.mini-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mini-stat-card .stat-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
}

.mini-stat-card .stat-info {
    flex: 1;
}

.mini-stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.mini-stat-card .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Activity timeline */
.activity-timeline {
    max-height: 200px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: start;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color var(--transition-duration);
}

.timeline-item:hover {
    background: var(--bg-secondary);
}

.timeline-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.timeline-icon.success { background: var(--success); color: white; }
.timeline-icon.warning { background: var(--warning); color: white; }
.timeline-icon.info { background: var(--info); color: white; }

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.timeline-description {
    font-size: 12px;
    color: var(--text-secondary);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Analytics table enhancements */
#detailedAnalyticsTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#detailedAnalyticsTable th {
    background: var(--bg-secondary);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color-new);
}

#detailedAnalyticsTable td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color-new);
    vertical-align: middle;
}

#detailedAnalyticsTable tr:hover {
    background: var(--bg-secondary);
}

/* Progress indicators */
.progress-bar-small {
    width: 60px;
    height: 6px;
    background: var(--border-color-new);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width var(--animation-duration);
}

.progress-fill.good { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.poor { background: var(--danger); }

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.complete {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-badge.incomplete {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.status-badge.attention {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Button variations */
.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
}

/* Loading animations */
.analytics-loading,
.timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

.analytics-loading::before,
.timeline-loading::before {
    content: '⏳';
    margin-right: 8px;
    animation: pulse 2s infinite;
}

/* Chart containers sizing */
.chart-container-medium,
.chart-container-large {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-container-small {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 200px;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-container-medium {
    height: 250px;
}

.chart-container-large {
    height: 300px;
}

/* Ensure proper canvas sizing */
.chart-container-medium canvas,
.chart-container-large canvas,
.chart-container-small canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    display: block;
    box-sizing: border-box;
}

/* Fix for Chart.js responsive issues */
.chart-card-medium,
.chart-card-large,
.chart-card-small {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Prevent chart overflow */
.chart-card-medium .chart-container-medium,
.chart-card-large .chart-container-large,
.chart-card-small .chart-container-small {
    max-width: calc(100% - 40px); /* Account for padding */
    margin: 0 auto;
}

/* Responsive adjustments */

/* Sekolah info grid - perapihan tampilan ringkas profil sekolah */
.sekolah-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 16px;
  align-items: center;
  margin: 8px 0 16px;
}
/* Generic styling - overridden by specific #profilSiswaSection rules */
.sekolah-info-grid > div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
}
.sekolah-info-grid strong {
  color: #0f172a;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  margin-right: 10px;
}
.sekolah-info-grid span {
  color: #1f2937;
  font-weight: 500;
}
.sekolah-info-grid span.is-missing {
  color: #b45309; /* amber-700 */
  font-style: italic;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* --- HALAMAN LOGIN --- */
#loginPage {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.top-bar {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 50px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 20px 50px;
    gap: 60px;
}

.login-panel {
    flex: 1;
    max-width: 480px;
    animation: slideInFromLeft 0.7s ease-out;
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.login-panel h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--dark-green);
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 25px;
}

.login-panel .form-group { margin-bottom: 20px; }

.login-panel label {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--dark-green);
    display: block;
    margin-bottom: 8px;
}

#appCode {
    width: 100% !important;
    padding: 0 !important;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background-color: #e9ecef;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#appCode:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.radio-group {
    margin-top: 25px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 25px;
}

.radio-option { display: flex; align-items: center; cursor: pointer; }

.radio-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.3);
    accent-color: var(--dark-green);
}

.button-group { margin-top: 30px; display: flex; gap: 15px; }

.btn {
    padding: 10px 25px;
    border: none;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn:disabled {
    background-color: #ccc !important;
    background-image: none !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #666;
}

.btn-large {
     padding: 12px 40px;
     font-size: 1em;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8em;
}

.btn-action {
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.btn-login { background: linear-gradient(45deg, #1a73e8, #4285f4); }
.btn-cancel { background: linear-gradient(45deg, var(--danger-red), #e5483b); }
.btn-import { background: linear-gradient(45deg, var(--success-green), #34a853); }
/* Enhanced button gradients dengan efek modern */
.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border: 1px solid #bd2130 !important;
}
.btn-edit {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #212529 !important;
    border: 1px solid #d39e00 !important;
}
.btn-view {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    border: 1px solid #117a8b !important;
}
.btn-pdf {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border: 1px solid #bd2130 !important;
}
.btn-upload {
    background: linear-gradient(135deg, #6f42c1, #5a32a3) !important;
    border: 1px solid #4e2a84 !important;
}

/* Enhanced hover effects untuk tombol aksi */
.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a) !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3) !important;
}
.btn-edit:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00) !important;
    box-shadow: 0 3px 8px rgba(255, 193, 7, 0.3) !important;
}
.btn-view:hover {
    background: linear-gradient(135deg, #138496, #0f6674) !important;
    box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3) !important;
}
.btn-pdf:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a) !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3) !important;
}
.btn-upload:hover {
    background: linear-gradient(135deg, #5a32a3, #4e2a84) !important;
    box-shadow: 0 3px 8px rgba(111, 66, 193, 0.3) !important;
}
.btn-nav { background-color: var(--primary-blue); }
.btn-warning { background: linear-gradient(45deg, var(--warning-orange), #ffb74d); }
.btn-primary { background: linear-gradient(45deg, var(--success-green), #34a853); }

.illustration-panel {
    flex: 1;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.illustration-panel img, .illustration-panel svg {
    max-width: 100%;
    height: auto;
}

footer {
    padding: 15px 50px;
    color: var(--text-light);
    font-size: 0.9em;
    text-align: left;
}

/* --- DASBOR --- */
.dashboard {
    display: none; /* Sembunyikan semua dasbor secara default */
    flex-direction: row;
    height: 100vh;
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%); /* Background biru sama dengan header */
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
    position: relative;
}

/* Force blue sidebar styling */
#adminSidebar,
#sekolahSidebar,
.dashboard .sidebar,
.dashboard aside.sidebar {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    background-color: #2c5aa0 !important;
}

/* Ensure sidebar header is white text on blue */
#adminSidebar .sidebar-header,
#sekolahSidebar .sidebar-header,
.sidebar .sidebar-header {
    color: #ffffff !important;
    background: rgba(255,255,255,0.05) !important;
}

/* Ensure menu items are white text */
#adminSidebar .sidebar-menu li a,
#sekolahSidebar .sidebar-menu li a,
.sidebar .sidebar-menu li a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-header {
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 25px 20px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    word-wrap: break-word;
    text-align: center;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 14px;
    border-radius: 0;
    margin: 0;
    transition: all 0.3s ease;
    position: relative;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.5);
}

.sidebar-menu li a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
    border-left-color: #ffffff;
}

.sidebar-menu li a.active:before {
    background: #ffffff;
}

.sidebar-menu li a svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-menu li a:hover svg,
.sidebar-menu li a.active svg {
    opacity: 1;
}

/* Sidebar section headers */
.sidebar-section {
    padding: 20px 25px 10px 25px;
    margin: 10px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section:first-child {
    border-top: none;
    margin-top: 0;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
}

/* Content wrapper */
.content-wrapper {
    flex-grow: 1;
    padding: 30px 30px 30px 50px; /* Tambah spacing kiri untuk jarak dari sidebar */
    background-color: #f5f7fa;
}

/* Task List Styles */
.task-list-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.profile-info-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.profile-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-profile {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-profile:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.profile-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2c5aa0;
    margin: 0 0 8px 0;
}

.profile-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.tasks-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: #2c5aa0;
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.1);
}

.task-item.completed {
    background: #f8f9fa;
    border-color: #28a745;
}

.task-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #1976d2;
    flex-shrink: 0;
    margin-top: 2px;
}

.task-item.completed .task-icon {
    background: #e8f5e8;
    color: #28a745;
}

.task-content {
    flex-grow: 1;
}

.task-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.task-date {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-info {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #e0e6ed;
    margin-top: 30px;
}

.footer-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }

    .dashboard-header {
        padding: 15px 20px;
    }

    .content-wrapper {
        padding: 20px 20px 20px 30px; /* Jarak sidebar lebih kecil di tablet */
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        position: fixed;
        top: 0;
        left: -100%;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .dashboard-header {
        padding: 10px 15px;
    }

    .dashboard-header .header-left h1 {
        font-size: 18px;
    }

    .user-profile {
        padding: 6px 12px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .user-info h3 {
        font-size: 13px;
    }

    .user-info p {
        font-size: 11px;
    }

    .content-wrapper {
        padding: 15px; /* Mobile tetap normal karena sidebar overlay */
    }

    .task-item {
        flex-direction: column;
        gap: 10px;
    }

    .task-date {
        align-self: flex-end;
    }

    .profile-info-card {
        padding: 20px;
    }

    .tasks-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-header .header-left h1 {
        font-size: 16px;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-profile {
        align-self: flex-start;
    }

    .task-item {
        padding: 12px;
    }

    .profile-info-card,
    .tasks-section {
        padding: 15px;
    }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Menu toggle button for mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #2c5aa0;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

.submenu {
    list-style: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu.open {
    max-height: 500px; /* Adjust as needed */
}

.submenu a {
    padding: 10px 15px;
    font-size: 0.9em;
    gap: 10px;
}

.menu-item.has-submenu::after {
    content: '▶';
    margin-left: auto;
    font-size: 0.7em;
    transition: transform 0.3s;
}
.menu-item.has-submenu.open::after {
    transform: rotate(90deg);
}

#logoutBtn, #sekolahLogoutBtn {
    background: none;
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}
#logoutBtn:hover, #sekolahLogoutBtn:hover {
     background: var(--danger-red);
     color: white;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e3c72;
    position: sticky;
    margin-left: -20px; /* Extend header ke kiri untuk mengisi gap */
    padding-left: 50px; /* Kompensasi padding */
    top: 0;
    z-index: 10;
}

.dashboard-header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-header .header-left h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c5aa0;
}

.dashboard-header .header-greeting {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.dashboard-header .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Dashboard header user profile styling */
.dashboard-header .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 25px;
    border: 1px solid #e0e6ed;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5aa0, #1e3c72);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.main-content {
    flex: 1;
    background-color: #f5f7fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px; /* Tambah spacing kiri dari sidebar */
    margin-top: 0; /* Pastikan konten langsung menempel ke header */
}

/* --- DASBOR SEKOLAH --- */
.sekolah-info-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.sekolah-info-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e8e3e, #28a745, #34a853);
}

.header-title {
    text-align: center;
    margin-bottom: 20px;
}

/* Elegant Header Title Styling */
.header-title-elegant {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 10px;
}

.title-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e8e3e, #28a745);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(30, 142, 62, 0.2);
}

.title-badge svg {
    width: 18px;
    height: 18px;
}

.school-name {
    font-size: 1.8em;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0 15px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.academic-year {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.year-badge, .region-badge {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.year-badge {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-color: #90caf9;
    color: #1565c0;
}

.region-badge {
    background: linear-gradient(135deg, #f3e5f5, #fce4ec);
    border-color: #ce93d8;
    color: #7b1fa2;
}

.header-title h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 8px 0;
    font-family: 'Times New Roman', serif;
    color: #1a73e8;
    letter-spacing: 0.5px;
}

.header-title h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 6px 0;
    font-family: 'Times New Roman', serif;
    color: #333;
}

.header-title h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    font-family: 'Times New Roman', serif;
    color: #555;
}

.header-line {
    border: none;
    border-top: 3px solid #1a73e8;
    margin: 12px 0 20px 0;
    box-shadow: 0 1px 2px rgba(26, 115, 232, 0.2);
}

.kop-clean {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 11px;
    line-height: 1.5;
}

.kop-row-clean {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1px;
    gap: 30px;
    min-height: 14px;
}

.kop-row-clean:last-child {
    margin-bottom: 0;
}

.kop-item-clean {
    flex: 1;
    white-space: nowrap;
    color: #495057;
}

.kop-item-right-clean {
    flex: 1;
    text-align: right;
    white-space: nowrap;
    color: #495057;
}

.kop-item-full-clean {
    width: 100%;
    color: #495057;
}

.kop-item-clean strong,
.kop-item-right-clean strong,
.kop-item-full-clean strong {
    color: #2c3e50;
    font-weight: bold;
}

/* Elegant Kop Styling */
.kop-elegant {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.kop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.kop-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #1e8e3e, #28a745);
    transition: width 0.3s ease;
}

.kop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kop-card:hover::before {
    width: 5px;
}

.kop-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kop-value {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.kop-school-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.school-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.school-detail .kop-label {
    color: #1e8e3e;
}

.school-detail .kop-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.school-code {
    font-size: 13px;
    font-weight: 700;
    color: #1e8e3e;
    background: rgba(30, 142, 62, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.school-name-detail {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 4px;
}

.kop-summary {
    text-align: center;
    margin-top: 20px;
}

.student-count {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 25px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.count-icon {
    background: rgba(255, 193, 7, 0.2);
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.count-icon svg {
    color: #e67e22;
}

.count-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.count-number {
    font-size: 20px;
    font-weight: 700;
    color: #d68910;
    line-height: 1;
}

.count-label {
    font-size: 11px;
    font-weight: 600;
    color: #b7950b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design for Elegant Kop */

/* Simple Header Styling */
.simple-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.simple-header h2 {
    font-size: 1.6em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.header-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide NO PESERTA column completely - both header and data */
.profil-siswa-table th:nth-child(4),
.profil-siswa-table td:nth-child(4),
.profil-siswa-table .col-nopes,
.profil-siswa-table tbody tr td:nth-child(4),
th[data-key-index="6"],
td[data-key-index="6"],
.table-fixed th:nth-child(4),
.table-fixed td:nth-child(4) {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Autofit table layout untuk profil siswa - kolom menyesuaikan konten */
.profil-siswa-table {
    table-layout: auto !important;
    width: 100% !important;
}

.profil-siswa-autofit {
    table-layout: auto !important;
    width: 100% !important;
    min-width: max-content; /* Minimum width berdasarkan konten */
}

/* Force hide any content in the 4th column */
.profil-siswa-table tr > *:nth-child(4) {
    display: none !important;
}

/* Hide NOPES column in admin student table */
.admin-nopes-col,
#adminSiswaTableBody tr td:nth-child(7),
[data-table-id="siswa"] th[data-key-index="6"],
[data-table-id="siswa"] td:nth-child(7) {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* CRUD Action Buttons */
.btn-export {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 1px solid #28a745;
}

.btn-export:hover {
    background: linear-gradient(135deg, #218838, #1ea87a);
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.col-aksi-admin {
    min-width: 80px; /* Reduced minimum width untuk autofit yang lebih fleksibel */
    width: auto; /* Allow autofit based on content */
    text-align: center;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.admin-action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.btn-edit-admin, .btn-delete-admin {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit-admin {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    color: #212529;
}

.btn-edit-admin:hover {
    background: linear-gradient(135deg, #e0a800, #ffb300);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.btn-delete-admin {
    background: linear-gradient(135deg, #dc3545, #e15460);
    color: white;
}

.btn-delete-admin:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}
.sekolah-info-header h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.4em;
}
/* Generic grid layout - overridden by specific sections */
.sekolah-info-grid strong {
    font-weight: 600;
    white-space: nowrap;
}
/* Removed default colon from generic span to avoid duplication */

/* --- KONTEN & TABEL --- */
.content-section { 
    display: none;
    flex-grow: 1; 
    flex-direction: column; 
}
.content-section.active { 
    display: flex;
}

.content-header {
    display: flex;
    justify-content: flex-start; /* Mengubah dari space-between */
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* SEARCH: Styling for search bar */
.search-bar {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
}

.content-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: var(--text-dark);
    margin-right: auto; /* Mendorong item lain ke kanan */
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* PENAMBAHAN: Styling untuk Indikator Autosave */
.autosave-indicator {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-light);
    margin-left: auto; /* Posisikan ke kanan */
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.autosave-indicator.saving {
    opacity: 1;
    color: var(--info-blue);
}

.autosave-indicator.saved {
    opacity: 1;
    color: var(--success-green);
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-grow: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    table-layout: auto; /* Autofit columns based on content */
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    /* Remove white-space: nowrap untuk autofit - let content determine width */
}

/* Autofit table layout untuk profil siswa - Kolom menyesuaikan konten */
#profilSiswaSection .table-container table {
    table-layout: auto !important;
    width: 100% !important;
    min-width: max-content; /* Ubah kembali ke max-content untuk autofit berdasarkan konten */
    font-size: 14px; /* Perbesar font tabel dari default */
}

/* Autofit - hapus fixed width constraints, biarkan kolom menyesuaikan konten */
.profil-siswa-autofit th,
.profil-siswa-autofit td {
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
}

/* Autofit - tetapi pertahankan lebar minimum untuk kolom tertentu */
.profil-siswa-autofit .col-no {
    min-width: 60px !important; /* Kolom NO tetap minimal */
    width: auto !important;
}

.profil-siswa-autofit .col-nisn {
    min-width: 150px !important; /* NISN perlu ruang untuk angka */
    width: auto !important;
}

.profil-siswa-autofit .col-nis {
    min-width: 80px !important; /* NIS lebih pendek */
    width: auto !important;
}

.profil-siswa-autofit .col-nama {
    min-width: 200px !important; /* Nama perlu ruang lebih */
    width: auto !important;
}

.profil-siswa-autofit .col-lahir {
    min-width: 180px !important; /* TTL perlu ruang */
    width: auto !important;
}

.profil-siswa-autofit .col-ortu {
    min-width: 120px !important; /* Nama ortu dikurangi untuk beri ruang NO IJAZAH */
    width: 120px !important;
    max-width: 120px !important;
}

.profil-siswa-autofit .col-ijazah {
    min-width: 200px !important; /* NO IJAZAH diperbesar */
    width: 200px !important;
}

.profil-siswa-autofit .col-aksi {
    min-width: 400px !important; /* Kolom AKSI tetap lebar untuk tombol */
    width: 400px !important; /* Fixed width untuk konsistensi tombol */
}

#profilSiswaSection th,
#profilSiswaSection td {
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    padding: 15px 12px; /* Perbesar padding dari 10px 8px ke 15px 12px */
    font-size: 14px; /* Perbesar font dari 13px ke 14px */
    line-height: 1.4; /* Perbesar line-height dari 1.3 ke 1.4 */
}

/* Autofit column styling untuk profil siswa - Hapus fixed widths */
#profilSiswaSection th:nth-child(1), /* NO */
#profilSiswaSection td:nth-child(1) {
    text-align: center;
    white-space: nowrap; /* Prevent wrapping for number column */
}

#profilSiswaSection th:nth-child(2), /* NISN */
#profilSiswaSection td:nth-child(2) {
    font-family: monospace;
    white-space: nowrap; /* Prevent wrapping for NISN */
}

#profilSiswaSection th:nth-child(3), /* NIS */
#profilSiswaSection td:nth-child(3) {
    text-align: left;
    white-space: nowrap; /* Prevent wrapping for NIS */
}

#profilSiswaSection th:nth-child(4), /* NO PESERTA */
#profilSiswaSection td:nth-child(4) {
    font-family: monospace;
    font-size: 12px;
    white-space: nowrap; /* Prevent wrapping for exam number */
}

#profilSiswaSection th:nth-child(5), /* NAMA PESERTA */
#profilSiswaSection td:nth-child(5) {
    font-weight: 500;
    min-width: 180px; /* Minimum width for names */
}

#profilSiswaSection th:nth-child(6), /* TEMPAT, TANGGAL LAHIR */
#profilSiswaSection td:nth-child(6) {
    font-size: 12px;
    min-width: 180px; /* Minimum width for birth info */
}

#profilSiswaSection th:nth-child(7), /* NAMA ORANG TUA */
#profilSiswaSection td:nth-child(7) {
    min-width: 120px; /* Dikurangi untuk beri ruang NO IJAZAH */
    max-width: 120px;
    width: 120px;
}

#profilSiswaSection table.has-photo-col th:nth-child(8), /* FOTO */
#profilSiswaSection table.has-photo-col td:nth-child(8) {
    width: 80px; /* Keep fixed width for photo column */
    text-align: center;
    vertical-align: middle !important;
    padding: 8px 4px;
}

/* Foto dengan ukuran maksimal yang konsisten - Opsi 2 */
#profilSiswaSection table.has-photo-col td:nth-child(8) img {
    max-width: 65px;
    max-height: 65px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

/* Flexible Height dengan Better Spacing - Opsi 2 */
#profilSiswaSection tbody tr {
    min-height: 75px;
    height: auto;
}

/* Cells dengan consistent padding dan flexible height */
#profilSiswaSection tbody td {
    min-height: 75px;
    height: auto;
    box-sizing: border-box;
    vertical-align: top;
    padding: 12px 8px;
}

#profilSiswaSection table.has-photo-col th:nth-child(9), /* NO IJAZAH */
#profilSiswaSection table.has-photo-col td:nth-child(9) {
    width: 180px; /* Increased width untuk NO IJAZAH */
    text-align: center;
    vertical-align: middle !important;
    padding: 8px 4px;
}

#profilSiswaSection table.has-photo-col th:nth-child(10), /* AKSI */
#profilSiswaSection table.has-photo-col td:nth-child(10) {
    width: 400px; /* Perbesar dari 280px ke 400px untuk ruang yang lebih luas */
    text-align: center;
    white-space: nowrap;
    vertical-align: top;
    padding: 15px 10px; /* Perbesar padding */
}

/* Mapping untuk NON-PRO (tanpa kolom FOTO) */
#profilSiswaSection table:not(.has-photo-col) th:nth-child(8), /* NO IJAZAH */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(8) {
    width: 250px !important;
    min-width: 250px !important;
    text-align: center;
}

#profilSiswaSection table:not(.has-photo-col) th:nth-child(9), /* AKSI */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(9) {
    width: 400px; /* Perbesar dari 280px ke 400px */
    text-align: center;
    white-space: nowrap;
    vertical-align: top;
    padding: 15px 10px; /* Perbesar padding */
}

/* Ensure horizontal scroll always works */
#profilSiswaSection .table-container {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}


/* Enhanced styling for better readability */
#profilSiswaSection .table-container table tr:hover {
    background-color: #f8f9fa;
}

#profilSiswaSection .table-container thead th {
    background-color: #f1f3f4;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Consistent spacing untuk semua kolom - Opsi 2 */
#profilSiswaSection table.has-photo-col th:nth-child(9),
#profilSiswaSection table.has-photo-col td:nth-child(9),
#profilSiswaSection table.has-photo-col th:nth-child(10),
#profilSiswaSection table.has-photo-col td:nth-child(10),
#profilSiswaSection table:not(.has-photo-col) th:nth-child(8),
#profilSiswaSection table:not(.has-photo-col) td:nth-child(8),
#profilSiswaSection table:not(.has-photo-col) th:nth-child(9),
#profilSiswaSection table:not(.has-photo-col) td:nth-child(9) {
    vertical-align: top !important;
    min-height: 75px;
    padding: 12px 8px;
    text-align: center;
}

/* Better button spacing dan alignment dalam kolom AKSI */
#profilSiswaSection td .btn {
    margin: 2px 3px;
    display: inline-block;
    vertical-align: top;
    height: 34px;
    line-height: 22px;
    padding: 6px 10px;
    box-sizing: border-box;
    font-size: 13px;
    min-width: 60px;
}

/* Better spaced button styling - Opsi 2 */
#profilSiswaSection .btn {
    height: 32px !important;
    line-height: 20px !important;
    padding: 6px 12px !important;
    margin: 3px 4px !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
    font-size: 13px !important;
    border-radius: 5px;
    min-width: 70px !important;
    display: inline-block !important;
}

#profilSiswaSection .btn-edit {
    background-color: #ffc107;
    color: #000;
}

#profilSiswaSection .btn-delete {
    background-color: #8b5cf6;
    color: #fff;
}

/* Text handling improvements */
#profilSiswaSection td {
    /* Override via more specific rules later for action/photo cells */
    max-width: 0; /* default, akan di-override di bawah */
    overflow: hidden;
    text-overflow: ellipsis;
}

#profilSiswaSection td:nth-child(5), /* NAMA PESERTA - allow full text */
#profilSiswaSection td:nth-child(6), /* TEMPAT, TANGGAL LAHIR - allow full text */
#profilSiswaSection td:nth-child(7) { /* NAMA ORANG TUA - allow full text */
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

/* Better header styling */
#profilSiswaSection .sekolah-info-header h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center; /* Pusatkan judul daftar profil siswa */
}

/* === Kop Profil Siswa: rapikan label:value tiap baris === */
#profilSiswaSection .sekolah-info-grid {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr)); /* kiri: PROV/KAB/KEC, kanan: NPSN/SEKOLAH/TOTAL */
    gap: 8px 16px;
    font-size: 14px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Remove duplicate styling - handled in grid > div section below */

/* Better styling untuk setiap item info */
#profilSiswaSection .sekolah-info-grid > div {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

/* Tempatkan pasangan item agar kanan: NPSN/SEKOLAH/TOTAL */
/* Urutan DOM: 1=PROPINSI, 2=KECAMATAN, 3=KABUPATEN, 4=NPSN, 5=SEKOLAH, 6=TOTAL */
#profilSiswaSection .sekolah-info-grid > div:nth-child(1) { grid-column: 1; grid-row: 1; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(4) { grid-column: 2; grid-row: 1; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(3) { grid-column: 1; grid-row: 2; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(5) { grid-column: 2; grid-row: 2; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(2) { grid-column: 1; grid-row: 3; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(6) { grid-column: 2; grid-row: 3; }

/* Responsif: kembali satu kolom di layar kecil */

#profilSiswaSection .sekolah-info-grid > div:last-child {
    border-bottom: none;
}

/* Label dengan colon dan width tetap untuk alignment */
#profilSiswaSection .sekolah-info-grid strong {
    display: inline-block;
    width: 180px;
    color: #444;
    font-weight: 600;
    text-align: left;
}

#profilSiswaSection .sekolah-info-grid strong::after {
    content: ' : ';
}

/* Hilangkan ':' otomatis dari span di area ini */
#profilSiswaSection .sekolah-info-grid span::before {
    content: none !important;
}

#profilSiswaSection .sekolah-info-grid span {
    color: #111;
    font-weight: 500;
    display: inline;
}

/* Responsive header grid */

/* Fallback styling jika grid items tidak dalam div */
#profilSiswaSection .sekolah-info-grid strong:not(.sekolah-info-grid > div strong) {
    display: inline-block;
    width: 180px;
    color: #666;
    font-weight: 600;
    vertical-align: top;
}

#profilSiswaSection .sekolah-info-grid span:not(.sekolah-info-grid > div span) {
    color: #333;
    font-weight: 500;
    margin-right: 20px;
}

/* Better grid container */
#profilSiswaSection .sekolah-info-grid {
    line-height: 1.8;
    overflow: hidden;
}

/* Icon status foto */
#profilSiswaSection .photo-status {
    font-size: 18px;
    display: inline-block;
}

#profilSiswaSection .photo-status.has-photo {
    color: #28a745;
}

#profilSiswaSection .photo-status.no-photo {
    color: #dc3545;
}

td .btn {
    margin-right: 5px;
}


/* Input NO IJAZAH styling */
.editable-ijazah {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px; /* Perbaiki font-size default untuk konsistensi */
    font-weight: normal; /* Konsisten dengan teks tabel */
    text-align: center;
    background-color: #fff;
    font-family: monospace;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editable-ijazah:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 4px rgba(26, 115, 232, 0.3);
}

.editable-ijazah:hover {
    border-color: #999;
}

.editable-ijazah.invalid-input {
    border-color: var(--danger-red);
    background-color: #fff0f0;
    box-shadow: 0 0 3px rgba(217, 48, 37, 0.5);
}

/* Specific styling for profil siswa table */
#profilSiswaSection .editable-ijazah {
    max-width: 190px; /* Diperbesar untuk menyesuaikan kolom NO IJAZAH yang lebih lebar */
    width: 95%; /* Menggunakan hampir seluruh lebar kolom */
    font-size: 13px; /* Samakan dengan font-size kolom lain di profil siswa */
    padding: 6px 8px; /* Sedikit diperbesar padding */
    font-weight: normal; /* Samakan dengan font-weight kolom lain */
    line-height: 1.3; /* Samakan dengan line-height kolom lain */
}

thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: center;
}

thead th input {
    font-weight: 600;
    background-color: transparent;
    border: none;
    text-align: center;
    width: 100px;
}

tbody tr:hover {
    background-color: #f1f3f5;
}

.file-input {
    display: none;
}

/* PENAMBAHAN: Styling untuk header tabel yang bisa diurutkan */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}
th.sortable:hover {
    background-color: #e9ecef;
}
th.sortable::after {
    content: ' ';
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -8px;
    border: 5px solid transparent;
    opacity: 0.3;
}
th.sortable.sort-asc::after {
    border-bottom-color: var(--text-dark);
    opacity: 1;
}
th.sortable.sort-desc::after {
    border-top-color: var(--text-dark);
    opacity: 1;
}

/* --- KARTU STATISTIK & GRAFIK DASBOR --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* GANTI SELURUH BLOK INI */
/* GANTI SELURUH BLOK INI */
/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px 0;
    min-height: 600px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Small dashboard cards */
.stat-card-small, .chart-card-small, .progress-card-small, .action-card-small {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.stat-card-small {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
}

.stat-card-small .icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.stat-card-small .info h4 {
    font-size: 12px;
    color: #666;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.stat-card-small .info p {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.chart-card-small h4,
.progress-card-small h4,
.action-card-small h4 {
    font-size: 14px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.chart-container-small {
    height: 200px;
    position: relative;
}

.chart-container-small canvas {
    max-height: 200px;
}

.progress-card-small,
.action-card-small {
    max-height: 300px;
    overflow-y: auto;
}

/* Large ranking card */
.ranking-card-large {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    height: fit-content;
    min-height: 500px;
}

.ranking-card-large h3 {
    font-size: 20px;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.stat-card, .chart-card, .quick-progress-card, .action-items-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* AFTER (tile berwarna seperti gambar 1) */
.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 10px;
  border: none;                 /* tidak pakai border-left lagi */
  color: #fff;                  /* teks default putih */
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  overflow: hidden;
  background: #0d6efd;          /* fallback; tiap kartu diwarnai oleh varian di bawah */
}

.stat-card .icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18); /* lingkaran semi transparan */
  color: #fff;
  font-size: 26px;
}

.stat-card .info h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: .3px;
}

.stat-card .info p {
  margin: 0;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  color: #fff;
}
/* Varian warna & posisi grid */
.stat-card.total-siswa{
  background: #0d6efd;          /* biru */
  grid-area: stat1;
}
.stat-card.kurikulum-info{
  background: #2e7d32;          /* hijau */
  grid-area: stat2;
}

/* (opsional contoh lain)
.stat-card.danger  { background:#d32f2f; }
.stat-card.warning { background:#f59e0b; }
*/

.chart-card h3, .quick-progress-card h3, .action-items-card h3 {
    margin-top: 0;
    text-align: center;
    font-size: 1.1em;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* TAMBAHKAN BLOK KODE BARU INI */
.stat-card.total-siswa { grid-area: stat1; }
.stat-card.kurikulum-info { grid-area: stat2; }
.chart-card:has(#completionChart) { grid-area: chart; }
.chart-card:has(#averageGradeChart) { grid-area: barchart; }
.quick-progress-card { grid-area: progress; }
.action-items-card { grid-area: actions; }

/* PENAMBAHAN: Styling untuk Progres Cepat */
.progress-item {
    margin-bottom: 15px;
}
.progress-item:last-child {
    margin-bottom: 0;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}
.progress-label span {
    font-weight: 500;
}
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background-color: var(--success-green);
    border-radius: 20px;
    transition: width 0.5s ease-in-out;
}
.progress-item .btn-action {
    margin-top: 8px;
}

/* PENAMBAHAN: Styling untuk Daftar Aksi */
.action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.action-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}
.action-item:last-child {
    border-bottom: none;
}
.action-item .icon {
    font-size: 1.5em;
    color: var(--warning-orange);
}
.action-item .text {
    flex-grow: 1;
    font-size: 0.95em;
}
.action-item .btn {
    flex-shrink: 0;
}

.version-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8em !important;
}
.version-badge.pro {
    background-color: var(--warning-orange);
    color: white;
}
.version-badge.biasa {
    background-color: #6c757d;
    color: white;
}

/* #version-info-badge ruleset removed because it was empty */

/* --- PAGINATION CONTROLS --- */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px;
    margin-top: 15px;
}

.pagination-info {
    font-size: 0.9em;
    color: var(--text-light);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-nav select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

/* --- MODAL --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

#editSiswaForm .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
}

#editSiswaForm .form-group, #settingsForm .form-group {
    display: flex;
    flex-direction: column;
}

#editSiswaForm label, #settingsForm label {
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

#editSiswaForm input, #settingsForm input, #settingsForm textarea, #settingsForm select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
}

.form-group.full-width {
grid-column: 1 / 3;
}

.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}

.form-group {
margin-bottom: 15px;
}

.form-group input {
width: calc(100% - 12px); /* Mengurangi padding */
padding: 6px;
border: 1px solid var(--border-color);
border-radius: 4px;
box-sizing: border-box;
}
.settings-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#settingsForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 30px;
}

.settings-logo-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.logo-upload-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logo-upload-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border: 1px dashed #ccc;
    object-fit: contain;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.settings-footer {
    grid-column: 1 / -1;
    text-align: right;
    margin-top: 20px;
}

.settings-backup-group {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}
.backup-controls {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

.settings-subjects-group {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.settings-subjects-naming-group {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.subjects-naming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 20px;
}
.settings-subjects-group h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}
.subject-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.subject-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}
.subject-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--dark-green);
}

/* --- STYLING BARU UNTUK TRANSKRIP & SKL --- */
#transkripModal .modal-content, #sklModal .modal-content, #skkbModal .modal-content {
    max-width: 900px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Ensure modal containers don't overflow */
#transkripModal, #sklModal, #skkbModal {
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* === PAGE BOX PREVIEW & PDF (UNIFIKASI) === */
/* === PAGE BOX PREVIEW & PDF (LOCKED DPI in px) === */
#pdf-content,
#transkripContent,
#sklContent,
#skkbContent {
  width: 793.7008px;      /* = 210mm × 96/25.4 */
  min-height: 1240.1575px;/* = 330mm × 96/25.4 */
  padding: 45.3543px;     /* =  12mm × 96/25.4 */
  background: #fff;
  color: #000;
  position: relative;
  box-sizing: border-box;
  margin: 0 auto;
  font-family: 'Times New Roman', Times, serif;
  overflow: hidden;       /* Prevent content overflow */
  max-width: 100%;        /* Ensure responsiveness */
}

.transkrip-full-header {
    position: relative; /* Ini penting */
    text-align: center;
    margin-bottom: 10px;
    height: 120px; /* Beri ketinggian tetap untuk area header */
}
.transkrip-logo {
    width: 80px;
    height: auto;
    justify-self: center;
}
.transkrip-header-text {
    font-weight: bold;
    text-align: center;
}
.transkrip-header-text p {
    margin: 0;
    line-height: 1.4;
    font-size: 1.2em;
}
.transkrip-hr {
    border: 0;
    border-top: 3px double #000;
    margin: 10px 0 20px 0;
}
.transkrip-title {
    text-align: center;
    font-weight: bold;
    font-size: 1.2em; 
    text-decoration: underline;
    margin-bottom: 5px;
}
/* Mengimpor font dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Times+New+Roman&display=swap');

/* Reset dan Pengaturan Dasar Body */
:root {
    /* Legacy colors (keep for compatibility) */
    --primary-blue: #1a73e8;
    --dark-green: #006400;
    --light-gray: #ffffff;
    --text-dark: #333;
    --text-light: #555555;
    --border-color: #2522226c;
    --danger-red: #d93025;
    --success-green: #1e8e3e;
    --info-blue: #17a2b8;
    --warning-orange: #ff9800;
    
    /* New Theme System Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border-color-new: #e0e0e0;
    --shadow: rgba(0,0,0,0.1);
    --accent-primary: #1e8e3e;
    --accent-secondary: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --success: #28a745;
    
    /* Animation variables */
    --animation-duration: 0.3s;
    --transition-duration: 0.2s;
}

/* ===== ACCESSIBILITY & FONT SIZE SUPPORT ===== */
/* Support untuk ukuran font yang dapat disesuaikan */

/* Focus indicators untuk aksesibilitas */
button:focus, input:focus, select:focus, textarea:focus, a:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== REAL-TIME COLLABORATION STYLES ===== */

/* Field update indicators */
.remote-updated {
    border: 2px solid #28a745 !important;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3) !important;
    animation: remoteUpdate 0.3s ease-in-out;
}

.remote-focused {
    border: 2px solid #17a2b8 !important;
    box-shadow: 0 0 5px rgba(23, 162, 184, 0.3) !important;
}

.field-update-indicator, .field-focus-indicator {
    animation: slideIn 0.3s ease-in-out;
}

/* Collaboration animations */
@keyframes remoteUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes slideIn {
    0% { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Collaboration indicator styling */
#collaboration-indicator {
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

#collaboration-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

/* ===== ADVANCED ANALYTICS DASHBOARD STYLES ===== */

/* Chart containers */
.chart-card-medium {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
}

.chart-card-large {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
}

.chart-card-full {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
    margin-top: 20px;
}

.stats-card-large {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
}

/* Mini stat cards */
.mini-stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition-duration), box-shadow var(--transition-duration);
}

.mini-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mini-stat-card .stat-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
}

.mini-stat-card .stat-info {
    flex: 1;
}

.mini-stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.mini-stat-card .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Activity timeline */
.activity-timeline {
    max-height: 200px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: start;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color var(--transition-duration);
}

.timeline-item:hover {
    background: var(--bg-secondary);
}

.timeline-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.timeline-icon.success { background: var(--success); color: white; }
.timeline-icon.warning { background: var(--warning); color: white; }
.timeline-icon.info { background: var(--info); color: white; }

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.timeline-description {
    font-size: 12px;
    color: var(--text-secondary);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Analytics table enhancements */
#detailedAnalyticsTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#detailedAnalyticsTable th {
    background: var(--bg-secondary);
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color-new);
}

#detailedAnalyticsTable td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color-new);
    vertical-align: middle;
}

#detailedAnalyticsTable tr:hover {
    background: var(--bg-secondary);
}

/* Progress indicators */
.progress-bar-small {
    width: 60px;
    height: 6px;
    background: var(--border-color-new);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width var(--animation-duration);
}

.progress-fill.good { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.poor { background: var(--danger); }

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.complete {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-badge.incomplete {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.status-badge.attention {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Button variations */
.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
}

/* Loading animations */
.analytics-loading,
.timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

.analytics-loading::before,
.timeline-loading::before {
    content: '⏳';
    margin-right: 8px;
    animation: pulse 2s infinite;
}

/* Chart containers sizing */
.chart-container-medium,
.chart-container-large {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-container-small {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 200px;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-container-medium {
    height: 250px;
}

.chart-container-large {
    height: 300px;
}

/* Ensure proper canvas sizing */
.chart-container-medium canvas,
.chart-container-large canvas,
.chart-container-small canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    display: block;
    box-sizing: border-box;
}

/* Fix for Chart.js responsive issues */
.chart-card-medium,
.chart-card-large,
.chart-card-small {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Prevent chart overflow */
.chart-card-medium .chart-container-medium,
.chart-card-large .chart-container-large,
.chart-card-small .chart-container-small {
    max-width: calc(100% - 40px); /* Account for padding */
    margin: 0 auto;
}

/* Responsive adjustments */

/* Sekolah info grid - perapihan tampilan ringkas profil sekolah */
.sekolah-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 16px;
  align-items: center;
  margin: 8px 0 16px;
}
/* Generic styling - overridden by specific #profilSiswaSection rules */
.sekolah-info-grid > div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
}
.sekolah-info-grid strong {
  color: #0f172a;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  margin-right: 10px;
}
.sekolah-info-grid span {
  color: #1f2937;
  font-weight: 500;
}
.sekolah-info-grid span.is-missing {
  color: #b45309; /* amber-700 */
  font-style: italic;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* --- HALAMAN LOGIN --- */
#loginPage {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.top-bar {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 50px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 20px 50px;
    gap: 60px;
}

.login-panel {
    flex: 1;
    max-width: 480px;
    animation: slideInFromLeft 0.7s ease-out;
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.login-panel h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--dark-green);
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 25px;
}

.login-panel .form-group { margin-bottom: 20px; }

.login-panel label {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--dark-green);
    display: block;
    margin-bottom: 8px;
}

#appCode {
    width: 100% !important;
    padding: 0 !important;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background-color: #e9ecef;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#appCode:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.radio-group {
    margin-top: 25px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 25px;
}

.radio-option { display: flex; align-items: center; cursor: pointer; }

.radio-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.3);
    accent-color: var(--dark-green);
}

.button-group { margin-top: 30px; display: flex; gap: 15px; }

.btn {
    padding: 10px 25px;
    border: none;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn:disabled {
    background-color: #ccc !important;
    background-image: none !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #666;
}

.btn-large {
     padding: 12px 40px;
     font-size: 1em;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8em;
}

.btn-action {
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.btn-login { background: linear-gradient(45deg, #1a73e8, #4285f4); }
.btn-cancel { background: linear-gradient(45deg, var(--danger-red), #e5483b); }
.btn-import { background: linear-gradient(45deg, var(--success-green), #34a853); }
/* Enhanced button gradients dengan efek modern */
.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border: 1px solid #bd2130 !important;
}
.btn-edit {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #212529 !important;
    border: 1px solid #d39e00 !important;
}
.btn-view {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    border: 1px solid #117a8b !important;
}
.btn-pdf {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border: 1px solid #bd2130 !important;
}
.btn-upload {
    background: linear-gradient(135deg, #6f42c1, #5a32a3) !important;
    border: 1px solid #4e2a84 !important;
}

/* Enhanced hover effects untuk tombol aksi */
.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a) !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3) !important;
}
.btn-edit:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00) !important;
    box-shadow: 0 3px 8px rgba(255, 193, 7, 0.3) !important;
}
.btn-view:hover {
    background: linear-gradient(135deg, #138496, #0f6674) !important;
    box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3) !important;
}
.btn-pdf:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a) !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3) !important;
}
.btn-upload:hover {
    background: linear-gradient(135deg, #5a32a3, #4e2a84) !important;
    box-shadow: 0 3px 8px rgba(111, 66, 193, 0.3) !important;
}
.btn-nav { background-color: var(--primary-blue); }
.btn-warning { background: linear-gradient(45deg, var(--warning-orange), #ffb74d); }
.btn-primary { background: linear-gradient(45deg, var(--success-green), #34a853); }

.illustration-panel {
    flex: 1;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.illustration-panel img, .illustration-panel svg {
    max-width: 100%;
    height: auto;
}

footer {
    padding: 15px 50px;
    color: var(--text-light);
    font-size: 0.9em;
    text-align: left;
}

/* --- DASBOR --- */
.dashboard {
    display: none; /* Sembunyikan semua dasbor secara default */
    flex-direction: row;
    height: 100vh;
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%); /* Background biru sama dengan header */
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
    position: relative;
}

/* Force blue sidebar styling */
#adminSidebar,
#sekolahSidebar,
.dashboard .sidebar,
.dashboard aside.sidebar {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    background-color: #2c5aa0 !important;
}

/* Ensure sidebar header is white text on blue */
#adminSidebar .sidebar-header,
#sekolahSidebar .sidebar-header,
.sidebar .sidebar-header {
    color: #ffffff !important;
    background: rgba(255,255,255,0.05) !important;
}

/* Ensure menu items are white text */
#adminSidebar .sidebar-menu li a,
#sekolahSidebar .sidebar-menu li a,
.sidebar .sidebar-menu li a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-header {
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 25px 20px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    word-wrap: break-word;
    text-align: center;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 14px;
    border-radius: 0;
    margin: 0;
    transition: all 0.3s ease;
    position: relative;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.5);
}

.sidebar-menu li a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
    border-left-color: #ffffff;
}

.sidebar-menu li a.active:before {
    background: #ffffff;
}

.sidebar-menu li a svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-menu li a:hover svg,
.sidebar-menu li a.active svg {
    opacity: 1;
}

/* Sidebar section headers */
.sidebar-section {
    padding: 20px 25px 10px 25px;
    margin: 10px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section:first-child {
    border-top: none;
    margin-top: 0;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
}

/* Content wrapper */
.content-wrapper {
    flex-grow: 1;
    padding: 30px 30px 30px 50px; /* Tambah spacing kiri untuk jarak dari sidebar */
    background-color: #f5f7fa;
}

/* Task List Styles */
.task-list-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.profile-info-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.profile-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-profile {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-profile:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.profile-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2c5aa0;
    margin: 0 0 8px 0;
}

.profile-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.tasks-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: #2c5aa0;
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.1);
}

.task-item.completed {
    background: #f8f9fa;
    border-color: #28a745;
}

.task-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #1976d2;
    flex-shrink: 0;
    margin-top: 2px;
}

.task-item.completed .task-icon {
    background: #e8f5e8;
    color: #28a745;
}

.task-content {
    flex-grow: 1;
}

.task-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.task-date {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-info {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #e0e6ed;
    margin-top: 30px;
}

.footer-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }

    .dashboard-header {
        padding: 15px 20px;
    }

    .content-wrapper {
        padding: 20px 20px 20px 30px; /* Jarak sidebar lebih kecil di tablet */
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        position: fixed;
        top: 0;
        left: -100%;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .dashboard-header {
        padding: 10px 15px;
    }

    .dashboard-header .header-left h1 {
        font-size: 18px;
    }

    .user-profile {
        padding: 6px 12px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .user-info h3 {
        font-size: 13px;
    }

    .user-info p {
        font-size: 11px;
    }

    .content-wrapper {
        padding: 15px; /* Mobile tetap normal karena sidebar overlay */
    }

    .task-item {
        flex-direction: column;
        gap: 10px;
    }

    .task-date {
        align-self: flex-end;
    }

    .profile-info-card {
        padding: 20px;
    }

    .tasks-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-header .header-left h1 {
        font-size: 16px;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-profile {
        align-self: flex-start;
    }

    .task-item {
        padding: 12px;
    }

    .profile-info-card,
    .tasks-section {
        padding: 15px;
    }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Menu toggle button for mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #2c5aa0;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

.submenu {
    list-style: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu.open {
    max-height: 500px; /* Adjust as needed */
}

.submenu a {
    padding: 10px 15px;
    font-size: 0.9em;
    gap: 10px;
}

.menu-item.has-submenu::after {
    content: '▶';
    margin-left: auto;
    font-size: 0.7em;
    transition: transform 0.3s;
}
.menu-item.has-submenu.open::after {
    transform: rotate(90deg);
}

#logoutBtn, #sekolahLogoutBtn {
    background: none;
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}
#logoutBtn:hover, #sekolahLogoutBtn:hover {
     background: var(--danger-red);
     color: white;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e3c72;
    position: sticky;
    margin-left: -20px; /* Extend header ke kiri untuk mengisi gap */
    padding-left: 50px; /* Kompensasi padding */
    top: 0;
    z-index: 10;
}

.dashboard-header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-header .header-left h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c5aa0;
}

.dashboard-header .header-greeting {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.dashboard-header .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Dashboard header user profile styling */
.dashboard-header .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 25px;
    border: 1px solid #e0e6ed;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5aa0, #1e3c72);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.main-content {
    flex: 1;
    background-color: #f5f7fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px; /* Tambah spacing kiri dari sidebar */
    margin-top: 0; /* Pastikan konten langsung menempel ke header */
}

/* --- DASBOR SEKOLAH --- */
.sekolah-info-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.sekolah-info-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e8e3e, #28a745, #34a853);
}

.header-title {
    text-align: center;
    margin-bottom: 20px;
}

/* Elegant Header Title Styling */
.header-title-elegant {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 10px;
}

.title-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e8e3e, #28a745);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(30, 142, 62, 0.2);
}

.title-badge svg {
    width: 18px;
    height: 18px;
}

.school-name {
    font-size: 1.8em;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0 15px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.academic-year {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.year-badge, .region-badge {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.year-badge {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-color: #90caf9;
    color: #1565c0;
}

.region-badge {
    background: linear-gradient(135deg, #f3e5f5, #fce4ec);
    border-color: #ce93d8;
    color: #7b1fa2;
}

.header-title h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 8px 0;
    font-family: 'Times New Roman', serif;
    color: #1a73e8;
    letter-spacing: 0.5px;
}

.header-title h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 6px 0;
    font-family: 'Times New Roman', serif;
    color: #333;
}

.header-title h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    font-family: 'Times New Roman', serif;
    color: #555;
}

.header-line {
    border: none;
    border-top: 3px solid #1a73e8;
    margin: 12px 0 20px 0;
    box-shadow: 0 1px 2px rgba(26, 115, 232, 0.2);
}

.kop-clean {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 11px;
    line-height: 1.5;
}

.kop-row-clean {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1px;
    gap: 30px;
    min-height: 14px;
}

.kop-row-clean:last-child {
    margin-bottom: 0;
}

.kop-item-clean {
    flex: 1;
    white-space: nowrap;
    color: #495057;
}

.kop-item-right-clean {
    flex: 1;
    text-align: right;
    white-space: nowrap;
    color: #495057;
}

.kop-item-full-clean {
    width: 100%;
    color: #495057;
}

.kop-item-clean strong,
.kop-item-right-clean strong,
.kop-item-full-clean strong {
    color: #2c3e50;
    font-weight: bold;
}

/* Elegant Kop Styling */
.kop-elegant {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.kop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.kop-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #1e8e3e, #28a745);
    transition: width 0.3s ease;
}

.kop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kop-card:hover::before {
    width: 5px;
}

.kop-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kop-value {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.kop-school-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.school-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.school-detail .kop-label {
    color: #1e8e3e;
}

.school-detail .kop-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.school-code {
    font-size: 13px;
    font-weight: 700;
    color: #1e8e3e;
    background: rgba(30, 142, 62, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.school-name-detail {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 4px;
}

.kop-summary {
    text-align: center;
    margin-top: 20px;
}

.student-count {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 25px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.count-icon {
    background: rgba(255, 193, 7, 0.2);
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.count-icon svg {
    color: #e67e22;
}

.count-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.count-number {
    font-size: 20px;
    font-weight: 700;
    color: #d68910;
    line-height: 1;
}

.count-label {
    font-size: 11px;
    font-weight: 600;
    color: #b7950b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design for Elegant Kop */

/* Simple Header Styling */
.simple-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.simple-header h2 {
    font-size: 1.6em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.header-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide NO PESERTA column completely - both header and data */
.profil-siswa-table th:nth-child(4),
.profil-siswa-table td:nth-child(4),
.profil-siswa-table .col-nopes,
.profil-siswa-table tbody tr td:nth-child(4),
th[data-key-index="6"],
td[data-key-index="6"],
.table-fixed th:nth-child(4),
.table-fixed td:nth-child(4) {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Autofit table layout untuk profil siswa - kolom menyesuaikan konten */
.profil-siswa-table {
    table-layout: auto !important;
    width: 100% !important;
}

.profil-siswa-autofit {
    table-layout: auto !important;
    width: 100% !important;
    min-width: max-content; /* Minimum width berdasarkan konten */
}

/* Force hide any content in the 4th column */
.profil-siswa-table tr > *:nth-child(4) {
    display: none !important;
}

/* Hide NOPES column in admin student table */
.admin-nopes-col,
#adminSiswaTableBody tr td:nth-child(7),
[data-table-id="siswa"] th[data-key-index="6"],
[data-table-id="siswa"] td:nth-child(7) {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* CRUD Action Buttons */
.btn-export {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 1px solid #28a745;
}

.btn-export:hover {
    background: linear-gradient(135deg, #218838, #1ea87a);
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.col-aksi-admin {
    min-width: 80px; /* Reduced minimum width untuk autofit yang lebih fleksibel */
    width: auto; /* Allow autofit based on content */
    text-align: center;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.admin-action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.btn-edit-admin, .btn-delete-admin {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit-admin {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    color: #212529;
}

.btn-edit-admin:hover {
    background: linear-gradient(135deg, #e0a800, #ffb300);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.btn-delete-admin {
    background: linear-gradient(135deg, #dc3545, #e15460);
    color: white;
}

.btn-delete-admin:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}
.sekolah-info-header h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.4em;
}
/* Generic grid layout - overridden by specific sections */
.sekolah-info-grid strong {
    font-weight: 600;
    white-space: nowrap;
}
/* Removed default colon from generic span to avoid duplication */

/* --- KONTEN & TABEL --- */
.content-section { 
    display: none;
    flex-grow: 1; 
    flex-direction: column; 
}
.content-section.active { 
    display: flex;
}

.content-header {
    display: flex;
    justify-content: flex-start; /* Mengubah dari space-between */
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* SEARCH: Styling for search bar */
.search-bar {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
}

.content-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: var(--text-dark);
    margin-right: auto; /* Mendorong item lain ke kanan */
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* PENAMBAHAN: Styling untuk Indikator Autosave */
.autosave-indicator {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-light);
    margin-left: auto; /* Posisikan ke kanan */
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.autosave-indicator.saving {
    opacity: 1;
    color: var(--info-blue);
}

.autosave-indicator.saved {
    opacity: 1;
    color: var(--success-green);
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-grow: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    table-layout: auto; /* Autofit columns based on content */
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    /* Remove white-space: nowrap untuk autofit - let content determine width */
}

/* Autofit table layout untuk profil siswa - Kolom menyesuaikan konten */
#profilSiswaSection .table-container table {
    table-layout: auto !important;
    width: 100% !important;
    min-width: max-content; /* Ubah kembali ke max-content untuk autofit berdasarkan konten */
    font-size: 14px; /* Perbesar font tabel dari default */
}

/* Autofit - hapus fixed width constraints, biarkan kolom menyesuaikan konten */
.profil-siswa-autofit th,
.profil-siswa-autofit td {
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
}

/* Autofit - tetapi pertahankan lebar minimum untuk kolom tertentu */
.profil-siswa-autofit .col-no {
    min-width: 60px !important; /* Kolom NO tetap minimal */
    width: auto !important;
}

.profil-siswa-autofit .col-nisn {
    min-width: 150px !important; /* NISN perlu ruang untuk angka */
    width: auto !important;
}

.profil-siswa-autofit .col-nis {
    min-width: 80px !important; /* NIS lebih pendek */
    width: auto !important;
}

.profil-siswa-autofit .col-nama {
    min-width: 200px !important; /* Nama perlu ruang lebih */
    width: auto !important;
}

.profil-siswa-autofit .col-lahir {
    min-width: 180px !important; /* TTL perlu ruang */
    width: auto !important;
}

.profil-siswa-autofit .col-ortu {
    min-width: 120px !important; /* Nama ortu dikurangi untuk beri ruang NO IJAZAH */
    width: 120px !important;
    max-width: 120px !important;
}

.profil-siswa-autofit .col-ijazah {
    min-width: 200px !important; /* NO IJAZAH diperbesar */
    width: 200px !important;
}

.profil-siswa-autofit .col-aksi {
    min-width: 400px !important; /* Kolom AKSI tetap lebar untuk tombol */
    width: 400px !important; /* Fixed width untuk konsistensi tombol */
}

#profilSiswaSection th,
#profilSiswaSection td {
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
    padding: 15px 12px; /* Perbesar padding dari 10px 8px ke 15px 12px */
    font-size: 14px; /* Perbesar font dari 13px ke 14px */
    line-height: 1.4; /* Perbesar line-height dari 1.3 ke 1.4 */
}

/* Autofit column styling untuk profil siswa - Hapus fixed widths */
#profilSiswaSection th:nth-child(1), /* NO */
#profilSiswaSection td:nth-child(1) {
    text-align: center;
    white-space: nowrap; /* Prevent wrapping for number column */
}

#profilSiswaSection th:nth-child(2), /* NISN */
#profilSiswaSection td:nth-child(2) {
    font-family: monospace;
    white-space: nowrap; /* Prevent wrapping for NISN */
}

#profilSiswaSection th:nth-child(3), /* NIS */
#profilSiswaSection td:nth-child(3) {
    text-align: left;
    white-space: nowrap; /* Prevent wrapping for NIS */
}

#profilSiswaSection th:nth-child(4), /* NO PESERTA */
#profilSiswaSection td:nth-child(4) {
    font-family: monospace;
    font-size: 12px;
    white-space: nowrap; /* Prevent wrapping for exam number */
}

#profilSiswaSection th:nth-child(5), /* NAMA PESERTA */
#profilSiswaSection td:nth-child(5) {
    font-weight: 500;
    min-width: 180px; /* Minimum width for names */
}

#profilSiswaSection th:nth-child(6), /* TEMPAT, TANGGAL LAHIR */
#profilSiswaSection td:nth-child(6) {
    font-size: 12px;
    min-width: 180px; /* Minimum width for birth info */
}

#profilSiswaSection th:nth-child(7), /* NAMA ORANG TUA */
#profilSiswaSection td:nth-child(7) {
    min-width: 120px; /* Dikurangi untuk beri ruang NO IJAZAH */
    max-width: 120px;
    width: 120px;
}

#profilSiswaSection table.has-photo-col th:nth-child(8), /* FOTO */
#profilSiswaSection table.has-photo-col td:nth-child(8) {
    width: 80px; /* Keep fixed width for photo column */
    text-align: center;
    vertical-align: middle !important;
    padding: 8px 4px;
}

/* Foto dengan ukuran maksimal yang konsisten - Opsi 2 */
#profilSiswaSection table.has-photo-col td:nth-child(8) img {
    max-width: 65px;
    max-height: 65px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

/* Flexible Height dengan Better Spacing - Opsi 2 */
#profilSiswaSection tbody tr {
    min-height: 75px;
    height: auto;
}

/* Cells dengan consistent padding dan flexible height */
#profilSiswaSection tbody td {
    min-height: 75px;
    height: auto;
    box-sizing: border-box;
    vertical-align: top;
    padding: 12px 8px;
}

#profilSiswaSection table.has-photo-col th:nth-child(9), /* NO IJAZAH */
#profilSiswaSection table.has-photo-col td:nth-child(9) {
    width: 180px; /* Increased width untuk NO IJAZAH */
    text-align: center;
    vertical-align: middle !important;
    padding: 8px 4px;
}

#profilSiswaSection table.has-photo-col th:nth-child(10), /* AKSI */
#profilSiswaSection table.has-photo-col td:nth-child(10) {
    width: 400px; /* Perbesar dari 280px ke 400px untuk ruang yang lebih luas */
    text-align: center;
    white-space: nowrap;
    vertical-align: top;
    padding: 15px 10px; /* Perbesar padding */
}

/* Mapping untuk NON-PRO (tanpa kolom FOTO) */
#profilSiswaSection table:not(.has-photo-col) th:nth-child(8), /* NO IJAZAH */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(8) {
    width: 250px !important;
    min-width: 250px !important;
    text-align: center;
}

#profilSiswaSection table:not(.has-photo-col) th:nth-child(9), /* AKSI */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(9) {
    width: 400px; /* Perbesar dari 280px ke 400px */
    text-align: center;
    white-space: nowrap;
    vertical-align: top;
    padding: 15px 10px; /* Perbesar padding */
}

/* Ensure horizontal scroll always works */
#profilSiswaSection .table-container {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}


/* Enhanced styling for better readability */
#profilSiswaSection .table-container table tr:hover {
    background-color: #f8f9fa;
}

#profilSiswaSection .table-container thead th {
    background-color: #f1f3f4;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Consistent spacing untuk semua kolom - Opsi 2 */
#profilSiswaSection table.has-photo-col th:nth-child(9),
#profilSiswaSection table.has-photo-col td:nth-child(9),
#profilSiswaSection table.has-photo-col th:nth-child(10),
#profilSiswaSection table.has-photo-col td:nth-child(10),
#profilSiswaSection table:not(.has-photo-col) th:nth-child(8),
#profilSiswaSection table:not(.has-photo-col) td:nth-child(8),
#profilSiswaSection table:not(.has-photo-col) th:nth-child(9),
#profilSiswaSection table:not(.has-photo-col) td:nth-child(9) {
    vertical-align: top !important;
    min-height: 75px;
    padding: 12px 8px;
    text-align: center;
}

/* Better button spacing dan alignment dalam kolom AKSI */
#profilSiswaSection td .btn {
    margin: 2px 3px;
    display: inline-block;
    vertical-align: top;
    height: 34px;
    line-height: 22px;
    padding: 6px 10px;
    box-sizing: border-box;
    font-size: 13px;
    min-width: 60px;
}

/* Better spaced button styling - Opsi 2 */
#profilSiswaSection .btn {
    height: 32px !important;
    line-height: 20px !important;
    padding: 6px 12px !important;
    margin: 3px 4px !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
    font-size: 13px !important;
    border-radius: 5px;
    min-width: 70px !important;
    display: inline-block !important;
}

#profilSiswaSection .btn-edit {
    background-color: #ffc107;
    color: #000;
}

#profilSiswaSection .btn-delete {
    background-color: #8b5cf6;
    color: #fff;
}

/* Text handling improvements */
#profilSiswaSection td {
    /* Override via more specific rules later for action/photo cells */
    max-width: 0; /* default, akan di-override di bawah */
    overflow: hidden;
    text-overflow: ellipsis;
}

#profilSiswaSection td:nth-child(5), /* NAMA PESERTA - allow full text */
#profilSiswaSection td:nth-child(6), /* TEMPAT, TANGGAL LAHIR - allow full text */
#profilSiswaSection td:nth-child(7) { /* NAMA ORANG TUA - allow full text */
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

/* Better header styling */
#profilSiswaSection .sekolah-info-header h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center; /* Pusatkan judul daftar profil siswa */
}

/* === Kop Profil Siswa: rapikan label:value tiap baris === */
#profilSiswaSection .sekolah-info-grid {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr)); /* kiri: PROV/KAB/KEC, kanan: NPSN/SEKOLAH/TOTAL */
    gap: 8px 16px;
    font-size: 14px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Remove duplicate styling - handled in grid > div section below */

/* Better styling untuk setiap item info */
#profilSiswaSection .sekolah-info-grid > div {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

/* Tempatkan pasangan item agar kanan: NPSN/SEKOLAH/TOTAL */
/* Urutan DOM: 1=PROPINSI, 2=KECAMATAN, 3=KABUPATEN, 4=NPSN, 5=SEKOLAH, 6=TOTAL */
#profilSiswaSection .sekolah-info-grid > div:nth-child(1) { grid-column: 1; grid-row: 1; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(4) { grid-column: 2; grid-row: 1; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(3) { grid-column: 1; grid-row: 2; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(5) { grid-column: 2; grid-row: 2; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(2) { grid-column: 1; grid-row: 3; }
#profilSiswaSection .sekolah-info-grid > div:nth-child(6) { grid-column: 2; grid-row: 3; }

/* Responsif: kembali satu kolom di layar kecil */

#profilSiswaSection .sekolah-info-grid > div:last-child {
    border-bottom: none;
}

/* Label dengan colon dan width tetap untuk alignment */
#profilSiswaSection .sekolah-info-grid strong {
    display: inline-block;
    width: 180px;
    color: #444;
    font-weight: 600;
    text-align: left;
}

#profilSiswaSection .sekolah-info-grid strong::after {
    content: ' : ';
}

/* Hilangkan ':' otomatis dari span di area ini */
#profilSiswaSection .sekolah-info-grid span::before {
    content: none !important;
}

#profilSiswaSection .sekolah-info-grid span {
    color: #111;
    font-weight: 500;
    display: inline;
}

/* Responsive header grid */

/* Fallback styling jika grid items tidak dalam div */
#profilSiswaSection .sekolah-info-grid strong:not(.sekolah-info-grid > div strong) {
    display: inline-block;
    width: 180px;
    color: #666;
    font-weight: 600;
    vertical-align: top;
}

#profilSiswaSection .sekolah-info-grid span:not(.sekolah-info-grid > div span) {
    color: #333;
    font-weight: 500;
    margin-right: 20px;
}

/* Better grid container */
#profilSiswaSection .sekolah-info-grid {
    line-height: 1.8;
    overflow: hidden;
}

/* Icon status foto */
#profilSiswaSection .photo-status {
    font-size: 18px;
    display: inline-block;
}

#profilSiswaSection .photo-status.has-photo {
    color: #28a745;
}

#profilSiswaSection .photo-status.no-photo {
    color: #dc3545;
}

td .btn {
    margin-right: 5px;
}


/* Input NO IJAZAH styling */
.editable-ijazah {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px; /* Perbaiki font-size default untuk konsistensi */
    font-weight: normal; /* Konsisten dengan teks tabel */
    text-align: center;
    background-color: #fff;
    font-family: monospace;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editable-ijazah:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 4px rgba(26, 115, 232, 0.3);
}

.editable-ijazah:hover {
    border-color: #999;
}

.editable-ijazah.invalid-input {
    border-color: var(--danger-red);
    background-color: #fff0f0;
    box-shadow: 0 0 3px rgba(217, 48, 37, 0.5);
}

/* Specific styling for profil siswa table */
#profilSiswaSection .editable-ijazah {
    max-width: 190px; /* Diperbesar untuk menyesuaikan kolom NO IJAZAH yang lebih lebar */
    width: 95%; /* Menggunakan hampir seluruh lebar kolom */
    font-size: 13px; /* Samakan dengan font-size kolom lain di profil siswa */
    padding: 6px 8px; /* Sedikit diperbesar padding */
    font-weight: normal; /* Samakan dengan font-weight kolom lain */
    line-height: 1.3; /* Samakan dengan line-height kolom lain */
}

thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: center;
}

thead th input {
    font-weight: 600;
    background-color: transparent;
    border: none;
    text-align: center;
    width: 100px;
}

tbody tr:hover {
    background-color: #f1f3f5;
}

.file-input {
    display: none;
}

/* PENAMBAHAN: Styling untuk header tabel yang bisa diurutkan */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}
th.sortable:hover {
    background-color: #e9ecef;
}
th.sortable::after {
    content: ' ';
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -8px;
    border: 5px solid transparent;
    opacity: 0.3;
}
th.sortable.sort-asc::after {
    border-bottom-color: var(--text-dark);
    opacity: 1;
}
th.sortable.sort-desc::after {
    border-top-color: var(--text-dark);
    opacity: 1;
}

/* --- KARTU STATISTIK & GRAFIK DASBOR --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* GANTI SELURUH BLOK INI */
/* GANTI SELURUH BLOK INI */
/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px 0;
    min-height: 600px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Small dashboard cards */
.stat-card-small, .chart-card-small, .progress-card-small, .action-card-small {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.stat-card-small {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
}

.stat-card-small .icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.stat-card-small .info h4 {
    font-size: 12px;
    color: #666;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.stat-card-small .info p {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.chart-card-small h4,
.progress-card-small h4,
.action-card-small h4 {
    font-size: 14px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.chart-container-small {
    height: 200px;
    position: relative;
}

.chart-container-small canvas {
    max-height: 200px;
}

.progress-card-small,
.action-card-small {
    max-height: 300px;
    overflow-y: auto;
}

/* Large ranking card */
.ranking-card-large {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    height: fit-content;
    min-height: 500px;
}

.ranking-card-large h3 {
    font-size: 20px;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.stat-card, .chart-card, .quick-progress-card, .action-items-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* AFTER (tile berwarna seperti gambar 1) */
.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 10px;
  border: none;                 /* tidak pakai border-left lagi */
  color: #fff;                  /* teks default putih */
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  overflow: hidden;
  background: #0d6efd;          /* fallback; tiap kartu diwarnai oleh varian di bawah */
}

.stat-card .icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18); /* lingkaran semi transparan */
  color: #fff;
  font-size: 26px;
}

.stat-card .info h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: .3px;
}

.stat-card .info p {
  margin: 0;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  color: #fff;
}
/* Varian warna & posisi grid */
.stat-card.total-siswa{
  background: #0d6efd;          /* biru */
  grid-area: stat1;
}
.stat-card.kurikulum-info{
  background: #2e7d32;          /* hijau */
  grid-area: stat2;
}

/* (opsional contoh lain)
.stat-card.danger  { background:#d32f2f; }
.stat-card.warning { background:#f59e0b; }
*/

.chart-card h3, .quick-progress-card h3, .action-items-card h3 {
    margin-top: 0;
    text-align: center;
    font-size: 1.1em;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* TAMBAHKAN BLOK KODE BARU INI */
.stat-card.total-siswa { grid-area: stat1; }
.stat-card.kurikulum-info { grid-area: stat2; }
.chart-card:has(#completionChart) { grid-area: chart; }
.chart-card:has(#averageGradeChart) { grid-area: barchart; }
.quick-progress-card { grid-area: progress; }
.action-items-card { grid-area: actions; }

/* PENAMBAHAN: Styling untuk Progres Cepat */
.progress-item {
    margin-bottom: 15px;
}
.progress-item:last-child {
    margin-bottom: 0;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}
.progress-label span {
    font-weight: 500;
}
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background-color: var(--success-green);
    border-radius: 20px;
    transition: width 0.5s ease-in-out;
}
.progress-item .btn-action {
    margin-top: 8px;
}

/* PENAMBAHAN: Styling untuk Daftar Aksi */
.action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.action-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}
.action-item:last-child {
    border-bottom: none;
}
.action-item .icon {
    font-size: 1.5em;
    color: var(--warning-orange);
}
.action-item .text {
    flex-grow: 1;
    font-size: 0.95em;
}
.action-item .btn {
    flex-shrink: 0;
}

.version-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
}

/* =============================================== */
/* ===== PENINGKATAN SIDEBAR (GEMINI) - override ===== */
/* =============================================== */

.sidebar-menu li a {
    border-left: 3px solid transparent !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease !important;
}

.sidebar-menu li a:hover {
    background-color: #f4f6f9 !important; 
    color: var(--primary-blue) !important;
}

.sidebar-menu li a.active {
    background-color: #e8f0fe !important; 
    color: var(--primary-blue) !important; 
    font-weight: 600 !important;
    border-left-color: var(--primary-blue) !important;
}

.sidebar-menu li a:hover svg,
.sidebar-menu li a.active svg {
    color: var(--primary-blue) !important;
}

/* =================================================================== */
/* ===== PENINGKATAN VISUAL BACKUP & RESTORE (GEMINI) ===== */
/* =================================================================== */

/* --- Kartu Backup (Aksi Aman - Biru) --- */

.backup-card .backup-icon {
    background-color: rgba(26, 115, 232, 0.1);
    color: var(--primary-blue, #1a73e8);
    border-radius: 8px;
}

#backupBtn {
    background: var(--primary-blue, #1a73e8);
    border: 1px solid var(--primary-blue, #1a73e8);
    color: white;
}

#backupBtn:hover {
    background: #1868d1;
    border-color: #1868d1;
}


/* --- Kartu Restore (Aksi Berbahaya - Kuning) --- */

.restore-card .restore-icon {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning, #ffc107);
    border-radius: 8px;
}

.drag-drop-zone {
    border: 2px dashed var(--warning, #ffc107);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Efek saat file diseret ke atas area dropzone */
.drag-drop-zone.drag-over {
    background-color: rgba(255, 193, 7, 0.05);
    border-color: var(--warning, #ffc107);
}

#restoreBtn {
    background-color: #cccccc;
    border: 1px solid #cccccc;
    color: #666666;
    cursor: not-allowed;
}

/* Tombol Restore saat aktif (bisa diklik) */
#restoreBtn:not([disabled]) {
    background: var(--warning, #ffc107);
    border: 1px solid var(--warning, #ffc107);
    color: #212529;
    cursor: pointer;
}

#restoreBtn:not([disabled]):hover {
    background: #e0a800;
    border-color: #e0a800;
}

/* =================================================================== */
/* ===== PERBAIKAN TABEL REKAP NILAI ADMIN (GEMINI) ===== */
/* =================================================================== */

/* Target sel tabel di dalam section rekap nilai admin */
#rekapNilaiAdmin table th,
#rekapNilaiAdmin table td {
    white-space: nowrap;      /* Mencegah teks turun ke baris baru */
    overflow: hidden;         /* Sembunyikan teks yang meluap */
    text-overflow: ellipsis;  /* Tampilkan "..." untuk teks yang terpotong */
    vertical-align: middle;   /* Pastikan konten selaras di tengah secara vertikal */
}

/* Beri lebar tetap atau maksimum pada kolom agar 'ellipsis' berfungsi dengan baik */
#rekapNilaiAdmin table th:nth-child(3), /* Kolom 'Nama Siswa' */
#rekapNilaiAdmin table td:nth-child(3) {
    max-width: 250px;
}

#rekapNilaiAdmin table th:nth-child(4), /* Kolom 'Asal Sekolah' */
#rekapNilaiAdmin table td:nth-child(4) {
    max-width: 300px;
}




/* =============================================== */
/* ===== PENINGKATAN VISUAL DASBOR (GEMINI) ==== */
/* =============================================== */

/* 1. Memberi efek 'mengambang' pada kartu utama */
.admin-section-card,
.school-profile-card,
.stat-card-small,
.chart-card-small,
.progress-card-small,
.action-card-small,
.ranking-card-large {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.admin-section-card:hover,
.school-profile-card:hover,
.stat-card-small:hover,
.chart-card-small:hover,
.progress-card-small:hover,
.action-card-small:hover,
.ranking-card-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 2. Meningkatkan keterbacaan tabel */
table th,
table td {
    padding: 14px 18px; /* Menambah padding */
    vertical-align: middle; /* Vertically center content */
}

table thead th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Zebra-striping untuk semua tbody */
table tbody tr:nth-child(even) {
    background-color: var(--bg-secondary, #f8f9fa); /* Menggunakan variabel tema jika ada */
}

/* Efek hover pada baris tabel */
table tbody tr:hover {
    background-color: #e9ecef; /* Warna hover yang sedikit lebih gelap */
}

/* Menghapus beberapa bayangan yang mungkin sudah ada agar tidak tumpang tindih */
.table-container {
    box-shadow: none; /* Hapus bayangan dari container tabel */
    border: 1px solid var(--border-color-new, #e0e0e0);
    border-radius: 10px;
    overflow: hidden; /* Pastikan border-radius diterapkan pada tabel di dalamnya */
}


/* CSS khusus untuk menghilangkan underline dari judul PDF */
.transkrip-title,
.skl-title,
.skkb-title {
    text-decoration: none !important;
}

/* Menghilangkan underline dari semua elemen u di dalam konten PDF */
.transkrip-content u,
.skl-content u,
.skkb-content u {
    text-decoration: none !important;
}

/* ===== QUICK WINS: SETTINGS ENHANCEMENTS ===== */

/* 1. Modern Card Styling untuk Settings Sections */
.settings-logo-group,
.settings-form-layout,
.settings-preview-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e8eaed;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.settings-preview-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1a73e8, #4285f4, #34a853);
    border-radius: 12px 12px 0 0;
}

.settings-preview-container:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    border-color: #4285f4;
}

/* Enhanced preview content styling */
.settings-preview-container h4 {
    color: #202124;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding: 0 0 8px 0;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
}

.settings-preview-container h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    border-radius: 1px;
}

/* Preview table or content area styling */
.settings-preview-container .preview-table,
.settings-preview-container table {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e8eaed;
    background: white;
}

.settings-preview-container .preview-table th,
.settings-preview-container table th {
    background: linear-gradient(135deg, #f8f9fa, #e8eaed);
    color: #3c4043;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid #dadce0;
    text-align: left;
}

.settings-preview-container .preview-table td,
.settings-preview-container table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    color: #5f6368;
    transition: background-color 0.2s ease;
}

.settings-preview-container .preview-table tr:hover td,
.settings-preview-container table tr:hover td {
    background: #f8f9fa;
}

.settings-preview-container .preview-table tr:last-child td,
.settings-preview-container table tr:last-child td {
    border-bottom: none;
}

.settings-logo-group:hover,
.settings-form-layout:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Individual logo upload sections */
.logo-upload-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e8eaed;
    transition: all 0.2s ease;
}

.logo-upload-section:hover {
    background: #f1f3f4;
    border-color: #1a73e8;
}

/* Section titles styling */
.logo-upload-section label:first-child {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
    display: block;
}

/* 2. Enhanced Button Hover Effects */
.btn-upload, .btn-small.btn-upload {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26,115,232,0.2);
    position: relative;
    overflow: hidden;
}

.btn-upload:hover, .btn-small.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,115,232,0.3);
    background: linear-gradient(135deg, #1557b0 0%, #3367d6 100%);
}

.btn-upload:active, .btn-small.btn-upload:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26,115,232,0.2);
}

/* Save button enhancement */
#saveSettingsBtn {
    background: linear-gradient(135deg, #34a853 0%, #4caf50 100%) !important;
    border: none !important;
    border-radius: 8px;
    padding: 12px 32px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52,168,83,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#saveSettingsBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52,168,83,0.3);
    background: linear-gradient(135deg, #2d8f47 0%, #43a047 100%) !important;
}

#saveSettingsBtn:active {
    transform: translateY(0);
}

/* Ripple effect for buttons */
.btn-upload::before, #saveSettingsBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn-upload:active::before, #saveSettingsBtn:active::before {
    width: 180px;
    height: 120px;
}

/* 3. Modern Range Slider Appearance */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e8eaed;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    margin: 8px 0;
}

input[type="range"]:hover {
    background: #dadce0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(26,115,232,0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    width: 22px;
    height: 22px;
    box-shadow: 0 3px 8px rgba(26,115,232,0.4);
    background: #1557b0;
}

input[type="range"]::-webkit-slider-thumb:active {
    width: 24px;
    height: 24px;
    box-shadow: 0 4px 12px rgba(26,115,232,0.5);
}

/* Firefox slider styling */
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(26,115,232,0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #e8eaed;
    border: none;
}

/* Enhanced form labels with value display */
.form-group label {
    font-weight: 500;
    color: #3c4043;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.form-group label span {
    background: #1a73e8;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(26,115,232,0.2);
}

/* Logo preview enhancements */
.logo-preview {
    border-radius: 8px;
    border: 2px dashed #dadce0;
    transition: all 0.3s ease;
    padding: 4px;
    background: white;
}

.logo-preview:hover {
    border-color: #1a73e8;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(26,115,232,0.1);
}

/* Upload controls layout */
.logo-upload-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Pro warning message */
.pro-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #f39c12;
    color: #8b6914;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(243,156,18,0.1);
}

.pro-warning small {
    display: block;
    font-weight: 500;
}

/* ===== MEDIUM IMPACT: ADVANCED ENHANCEMENTS ===== */

/* 1. Loading States untuk Upload Buttons */
.btn-upload.loading, #saveSettingsBtn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-upload.loading::after, #saveSettingsBtn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Upload progress indicator */
.upload-progress {
    width: 100%;
    height: 4px;
    background: #e8eaed;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-progress.active {
    opacity: 1;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Success state animation */
.btn-upload.success {
    background: linear-gradient(135deg, #34a853 0%, #4caf50 100%) !important;
}

.btn-upload.success::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
    0%, 20%, 60%, 100% { transform: translate(-50%, -50%) scale(1); }
    40% { transform: translate(-50%, -50%) scale(1.2); }
    80% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Upload status messages */
.upload-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.upload-status.show {
    opacity: 1;
    transform: translateY(0);
}

.upload-status.success {
    background: rgba(52,168,83,0.1);
    color: #2d7d32;
    border: 1px solid rgba(52,168,83,0.2);
}

.upload-status.error {
    background: rgba(244,67,54,0.1);
    color: #c62828;
    border: 1px solid rgba(244,67,54,0.2);
}

.upload-status.info {
    background: rgba(26,115,232,0.1);
    color: #1565c0;
    border: 1px solid rgba(26,115,232,0.2);
}
.transkrip-signature {
    margin-top: 40px;
    display: flex;
    justify-content: flex-end;
}
.transkrip-signature-block {
    text-align: left;
    width: 300px;
}
.transkrip-signature-block p {
    margin: 0;
}
.principal-name {
    margin-top: 60px;
    font-weight: bold;
    text-decoration: none !important;
}

/* SKL & SKKB Specific Styles */
.skl-body-text, .skkb-body-text {
    text-align: justify;
    margin-bottom: 20px;
    line-height: 1.5;
}
.skl-lulus-text {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}
.skl-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    align-items: end;
}
.skl-pasfoto {
    width: 113px; /* 3cm */
    height: 151px; /* 4cm */
    border: 1px solid black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.75em;
    flex-shrink: 0;
    padding: 5px;
    box-sizing: border-box;
    /* Menambahkan aturan untuk anak elemen */
    line-height: 1.2; /* Mengatur jarak antar baris */
}
.skl-pasfoto.no-photo {
     border: 1px solid black;
}
.skl-pasfoto.has-photo {
    border: none;
}
.skl-pasfoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PERBAIKAN: CSS untuk PDF Generation F4 */
#pdf-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 210mm; /* F4 width */
    min-height: 330mm; /* F4 height */
    box-sizing: border-box;
    padding: 0mm 15mm 15mm 15mm; /* Margin atas 0mm, sisi lain 15mm */
    background: white;
    font-family: 'Times New Roman', Times, serif;
    color: black;
}

/* Pesan untuk fitur PRO */
.pro-feature-message {
    display: none; /* Sembunyikan secara default */
    text-align: center;
    padding: 40px 20px;
    background-color: #fff8e1;
    border: 1px solid var(--warning-orange);
    color: #6d4c41;
    border-radius: 8px;
    margin: 20px;
    font-size: 1.2em;
    font-weight: 500;
}
.pro-feature-message svg {
    width: 48px;
    height: 48px;
    color: var(--warning-orange);
    margin-bottom: 15px;
}

/* NOTIFIKASI: Styling untuk notifikasi */
#notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s, bottom 0.5s;
    min-width: 300px;
    text-align: center;
    font-size: 14px;
}
#notification.show {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
}
#notification.success { background-color: var(--success-green); }
#notification.warning { background-color: var(--warning-orange); }
#notification.error { background-color: var(--danger-red); }
#notification.info { background-color: var(--info-blue); color: white; }

/* ====== SUCCESS MODAL - MODERN DESIGN ====== */

/* Success Modal Content */
.success-modal-content {
    max-width: 480px;
    padding: 0;
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.2);
    overflow: hidden;
    text-align: center;
    background: white;
    position: relative;
    animation: successModalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Success Header with Gradient */
.modal-success-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

.modal-success-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

/* Success Icon */
.success-icon {
    margin: 0 auto 20px;
    width: 64px;
    height: 64px;
    animation: successPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.success-icon svg {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* Typography */
.success-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px;
    position: relative;
    z-index: 2;
}

.success-subtitle {
    opacity: 0.9;
    font-size: 1rem;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    z-index: 3;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* School Info Cards */
.school-info-cards {
    padding: 30px;
}

.primary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.primary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.school-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #1a202c 0%, #4a5568 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.school-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

/* Stats Cards */
.info-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.stat-item {
    flex: 1;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: left 0.5s ease;
}

.stat-item:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.stat-item:hover::before {
    left: 100%;
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
    animation: iconFloat 3s ease-in-out infinite;
}

.stat-item:nth-child(1) .stat-icon {
    animation-delay: 0s;
}

.stat-item:nth-child(2) .stat-icon {
    animation-delay: 0.5s;
}

.stat-number, .stat-value {
    display: block;
    font-weight: 700;
    font-size: 1.3rem;
    color: #1a202c;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    display: block;
    font-weight: 500;
}

/* Action Button */
.modal-actions {
    padding: 0 30px 30px;
}

.btn-success-continue {
    width: 100%;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 18px 24px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-success-continue::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-success-continue:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.3);
}

.btn-success-continue:hover::before {
    left: 100%;
}

.btn-success-continue:active {
    transform: translateY(-1px);
}

/* Animations */
@keyframes successModalIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .success-modal-content {
        max-width: 340px;
        margin: 20px;
    }

    .modal-success-header {
        padding: 30px 25px 25px;
    }

    .success-title {
        font-size: 1.5rem;
    }

    .school-info-cards {
        padding: 25px 20px;
    }

    .info-stats {
        flex-direction: column;
        gap: 12px;
    }

    .primary-card {
        padding: 20px;
    }

    .modal-actions {
        padding: 0 20px 25px;
    }
}

/* PENAMBAHAN: Styling untuk Indikator Proses (Loading) */
.loading-overlay {
    display: none; /* Sembunyikan secara default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid var(--primary-blue); /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desain Responsif */

/* Styling untuk thumbnail foto di tabel Profil Siswa */
.photo-cell {
    text-align: center;
    width: 60px;
}
.photo-thumbnail-container {
    width: 40px;
    height: 50px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}
.photo-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.no-photo-placeholder {
    font-size: 1.5em;
    color: #dc3545; /* Red color untuk ❌ icon */
    position: relative;
    text-align: center;
    display: block;
}
/* Removed ::before content untuk no-photo-placeholder */

.filter-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-controls select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
}

/* === PAGINATION BUTTONS (OVERRIDE) === */
.pagination-controls .btn.btn-nav {
  background: var(--primary-blue) !important; /* warna dasar tombol */
  color: #fff !important;                     /* teks selalu putih & terbaca */
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(26,115,232,.25);
  transition: background .2s ease, transform .05s ease, box-shadow .2s ease;
}

.pagination-controls .btn.btn-nav:hover:not(:disabled) {
  background: #0b5ed7 !important;             /* darken saat hover */
  box-shadow: 0 4px 10px rgba(26,115,232,.35);
  transform: translateY(-1px);
}

.pagination-controls .btn.btn-nav:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(26,115,232,.25);
}

/* State disabled: abu-abu konsisten, tidak “putih” */
.pagination-controls .btn.btn-nav:disabled {
  background: #e9ecef !important;
  color: #6c757d !important;
  box-shadow: none !important;
  opacity: 1 !important; /* override aturan umum yang menurunkan opacity */
}

/* === Pagination button theme === */
:root{
  --pg-bg: #1a73e8;           /* normal */
  --pg-bg-hover: #0b5ed7;     /* hover */
  --pg-text: #fff;            /* teks */
  --pg-disabled-bg: #e9ecef;  /* disabled */
  --pg-disabled-text: #6c757d;
}

/* state normal */
.pagination-controls .pagination-nav .btn.btn-nav,
.pagination-controls .prev-page,
.pagination-controls .next-page{
  background: var(--pg-bg) !important;
  color: var(--pg-text) !important;
  border: 1px solid transparent !important;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(26,115,232,.25);
  transition: background .2s ease, box-shadow .2s ease, transform .05s ease;
}

/* hover & active (hanya untuk yang tidak disabled) */
.pagination-controls .pagination-nav .btn.btn-nav:hover:not(:disabled),
.pagination-controls .prev-page:hover:not(:disabled),
.pagination-controls .next-page:hover:not(:disabled){
  background: var(--pg-bg-hover) !important;
  box-shadow: 0 4px 10px rgba(11,94,215,.28);
  transform: translateY(-1px);
}

/* disabled */
.pagination-controls .pagination-nav .btn.btn-nav:disabled,
.pagination-controls .prev-page:disabled,
.pagination-controls .next-page:disabled{
  background: var(--pg-disabled-bg) !important;
  color: var(--pg-disabled-text) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ========================================================== */
/* == CSS UNTUK MENU SETTING (VERSI FINAL) == */
/* ========================================================== */

/* --- ENHANCED TAB STYLING --- */
.tab-nav {
    display: flex;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px 12px 0 0;
    padding: 8px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8eaed;
    border-bottom: none;
    overflow: hidden;
    position: relative;
}

.tab-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #e8eaed;
}

.tab-button {
    position: relative;
    padding: 14px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #5f6368;
    border-radius: 8px;
    margin-right: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-width: fit-content;
    flex: 1;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26,115,232,0.08), rgba(66,133,244,0.08));
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-button:hover {
    color: #1a73e8;
    background: rgba(26,115,232,0.04);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26,115,232,0.15);
}

.tab-button:hover::before {
    opacity: 1;
}

.tab-button.active {
    color: #1a73e8;
    background: white;
    box-shadow: 0 2px 12px rgba(26,115,232,0.2);
    border: 1px solid rgba(26,115,232,0.2);
    font-weight: 700;
    z-index: 2;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #1a73e8, #4285f4);
    border-radius: 2px 2px 0 0;
}

.tab-pane {
    display: none;
    background: white;
    border-radius: 0 0 12px 12px;
    border: 1px solid #e8eaed;
    border-top: none;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    animation: fadeInUp 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced tab icons (if any exist) */
.tab-button svg {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

.tab-button:hover svg,
.tab-button.active svg {
    transform: scale(1.1);
}

/* Responsive tab styling */
@media (max-width: 768px) {
    .tab-nav {
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab-button {
        flex: 1 1 auto;
        min-width: 180px;
        font-size: 13px;
        padding: 12px 16px;
    }
}
.settings-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* --- TATA LETAK GRUP LOGO --- */
.settings-logo-group {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.logo-upload-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- TATA LETAK GRUP MULOK (INI PERBAIKANNYA) --- */
/* GANTI BLOK CSS UNTUK .settings-mulok-group DAN #subjectSelectionContainer */

/* Aturan ini akan dipakai oleh semua form di menu setting */
.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

/* Aturan tambahan untuk elemen yang butuh lebar penuh */
.settings-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}
/* Aturan untuk menata checkbox mapel */
#subjectSelectionContainer {
    grid-column: 1 / -1; /* Membuat wadah checkbox mengambil lebar penuh */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.subject-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--light-gray);
    padding: 8px 12px;
    border-radius: 6px;
}
.subject-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* --- PERBAIKAN WARNA TOMBOL --- */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}
.btn-primary:hover {
    background-color: #1a62c7;
}

.btn-secondary {
    background-color: var(--warning-orange);
    color: white;
}
.btn-secondary:hover {
    background-color: #e68900;
}

/* Tambahkan ini di dalam <style> */
.action-cell {
    text-align: center;
}
.action-cell .btn {
    margin: 0 4px;
    padding: 5px 10px; /* Tambahkan ini untuk ukuran tombol yang pas */
    font-size: 0.85em; /* Sedikit perkecil font agar sesuai */
}

/* Tambahkan ini di dalam <style> */
/* Add your existing styles here */

/* Styles for the modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    animation: fadeIn 0.3s;
}

.modal-content {
    margin: 10% auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}


/* Memastikan elemen full-width di dalam grid berfungsi */
.settings-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.btn-edit {
    background-color: var(--primary-orange);
}
.btn-edit:hover {
    background-color: #e67e22; /* Oranye sedikit lebih gelap */
}

.btn-delete {
    background-color: var(--primary-red);
}
.btn-delete:hover {
    background-color: #c0392b; /* Merah sedikit lebih gelap */
}
/* ====== LOGIN NEW ====== */
.login-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column; /* Change to column untuk header di atas */
}
.login-topbar {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3c72 100%);
    position: relative;
    z-index: 10;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 50px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    top: 0;
    animation: slideInDown 0.5s ease-out; /* Entrance animation untuk header */
}

/* Header entrance animation */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.login-bg { 
  position: absolute; 
  inset: 0; 
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom/cover no-repeat;
}

/* Sembunyikan elemen yang tidak diperlukan */
.login-brand,
.bg-gradient,
.bg-shape {
  display: none !important;
}

.login-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1; /* Mengisi sisa ruang setelah header */
  padding: 20px;
}

.login-brand { display: grid; place-items: center; }
.brand-card {
  width: min(620px, 95%); padding: clamp(20px, 3vw, 32px);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  color: #e7eefb; backdrop-filter: blur(6px);
}
.brand-logo { font-size: 42px; line-height: 1; margin-bottom: 12px; }
.brand-title { margin: 0 0 6px; font-weight: 700; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: .3px; }
.brand-sub { margin: 0 0 16px; color: #c9d7ff; font-weight: 500; }
.brand-points { margin: 0; padding-left: 18px; color: #d9e6ff; }

.login-panel-new {
  width: min(480px, 90%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.2);
  padding: 45px 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease; /* Smooth transition */
  animation: fadeInUp 0.6s ease-out; /* Entrance animation */
}

/* Hover effect untuk card */
.login-panel-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 90px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.3);
}

/* Entrance animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== LOGIN BRANDING HEADER ====== */
.login-brand-header {
  text-align: center;
  margin-bottom: 35px;
  animation: slideInDown 0.8s ease-out;
}

.app-logo {
  margin-bottom: 20px;
}

.logo-circle {
  width: 80px;
  height: 80px;
  margin: 0 auto 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  animation: logoFloat 3s ease-in-out infinite;
  position: relative;
}

.logo-circle::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.logo-circle:hover::before {
  opacity: 0.3;
  animation: rotate 2s linear infinite;
}

.logo-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.logo-circle svg {
  width: 45px;
  height: 45px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.app-title {
  margin: 0 0 8px;
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-subtitle {
  margin: 0 0 25px;
  color: #64748b;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.8;
}

/* Logo floating animation */
@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Rotating border animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ====== BACKGROUND PARTICLES (YANG BAGUS!) ====== */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 15%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  width: 60px;
  height: 60px;
  top: 60%;
  left: 80%;
  animation-delay: 2s;
}

.particle:nth-child(3) {
  width: 100px;
  height: 100px;
  top: 80%;
  left: 10%;
  animation-delay: 4s;
}

.particle:nth-child(4) {
  width: 40px;
  height: 40px;
  top: 30%;
  left: 70%;
  animation-delay: 1s;
}

.particle:nth-child(5) {
  width: 120px;
  height: 120px;
  top: 10%;
  left: 50%;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

/* Make sure login content is above particles */
.login-main {
  position: relative;
  z-index: 2;
}

/* Responsive branding header */
@media (max-width: 768px) {
  .login-brand-header {
    margin-bottom: 25px;
  }

  .logo-circle {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
  }

  .logo-circle svg {
    width: 38px;
    height: 38px;
  }

  .app-title {
    font-size: 1.8rem;
    margin-bottom: 6px;
  }

  .app-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  /* Smaller particles on mobile */
  .particle:nth-child(1) { width: 60px; height: 60px; }
  .particle:nth-child(2) { width: 45px; height: 45px; }
  .particle:nth-child(3) { width: 80px; height: 80px; }
  .particle:nth-child(4) { width: 30px; height: 30px; }
  .particle:nth-child(5) { width: 90px; height: 90px; }
}
.panel-title {
  margin: 0 0 35px;
  font-size: 2.2rem; /* Perbesar ukuran */
  font-weight: 800;
  color: #1a202c; /* Warna lebih gelap untuk kontras */
  text-align: center;
  position: relative;
  letter-spacing: -0.5px; /* Slight negative letter spacing untuk modern look */
}

.panel-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

.login-form { display: grid; gap: 28px; /* Tambah spacing antar elemen */ }
.form-label { 
  font-weight: 600; 
  color: #34495e;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.input-wrap {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: stretch;
  gap: 16px;
  border: 2px solid #e8ecf4;
  border-radius: 12px;
  padding: 16px 20px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-height: 70px;
  width: 100%;
  box-sizing: border-box;
}

.input-wrap:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0,0,0,0.08);
  background: #ffffff;
}
.input-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #667eea;
  font-size: 22px;
}

.input-wrap input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 18px !important;
  color: #2c3e50 !important;
  padding: 20px 0 !important;
  font-weight: 500 !important;
  min-height: 28px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  flex: 1 !important;
}

.input-wrap input::placeholder {
  color: #95a5a6;
  font-weight: 400;
}
.input-wrap input::placeholder { color: #8aa0c3; }
.btn-ghost {
  appearance: none;
  border: 1px solid #e8ecf4;
  background: #f8fafc;
  color: #667eea;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  white-space: nowrap;
  min-width: max-content;
  flex-shrink: 0;
}

.btn-ghost:hover {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.btn-ghost:hover { background: #eef4ff; }

.hint { 
  margin: 8px 0 0 0; 
  color: #7f8c8d; 
  font-size: 14px;
  font-style: italic;
}

.segmented {
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 6px;
  background: #f8fafc; 
  padding: 6px; 
  border-radius: 12px; 
  border: 2px solid #e8ecf4;
  margin: 10px 0;
}
.segmented input[type="radio"] { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.segmented label {
  display: block; 
  text-align: center; 
  padding: 12px 16px; 
  font-weight: 600; 
  border-radius: 8px;
  color: #34495e; 
  background: #ffffff; 
  border: 1px solid #e8ecf4; 
  cursor: pointer; 
  user-select: none;
  transition: all 0.3s ease;
  font-size: 15px;
}

.segmented label:hover {
  background: #f8fafc;
  border-color: #667eea;
}

.segmented input#kurikulumMerdeka:checked + label,
.segmented input#kurikulum13:checked + label {
  background: linear-gradient(135deg, #2c5aa0, #1e3c72); /* Gunakan warna tema */
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(44, 90, 160, 0.4);
  transform: translateY(-1px); /* Subtle lift effect */
}

.btn-row {
  display: flex;
  gap: 16px; /* Tambah gap antar tombol */
  margin-top: 30px; /* Tambah margin dari form */
}

.btn-login {
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3c72 100%) !important; /* Gunakan warna tema */
  color: white !important;
  border: none !important;
  padding: 18px 32px !important; /* Padding lebih besar */
  font-size: 17px !important; /* Font sedikit lebih besar */
  font-weight: 700 !important; /* Font weight lebih bold */
  border-radius: 14px !important; /* Corner radius lebih besar */
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  flex: 1 !important;
  min-height: 60px !important; /* Tinggi lebih besar */
  letter-spacing: 0.5px !important; /* Letter spacing untuk elegance */
  text-transform: uppercase !important; /* Uppercase untuk emphasis */
  box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3) !important; /* Shadow dengan warna tema */
}

.btn-login:hover {
  transform: translateY(-3px) !important; /* Sedikit lebih tinggi */
  box-shadow: 0 8px 25px rgba(44, 90, 160, 0.5) !important; /* Shadow lebih kuat */
  background: linear-gradient(135deg, #3464b3 0%, #1f4084 100%) !important; /* Warna hover lebih terang */
}

.btn-cancel {
  background: #f8fafc !important;
  color: #6c757d !important;
  border: 2px solid #e8ecf4 !important;
  padding: 14px 24px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  flex: 1 !important;
}

.btn-cancel:hover {
  background: #e9ecef !important;
  border-color: #dee2e6 !important;
}
.login-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.meta-pill {
  font-size: .8rem; font-weight: 600; color: #2c4479; background: #eef4ff; border: 1px solid #cfe0ff;
  padding: 6px 10px; border-radius: 999px;
}

.login-footer { 
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2; 
  color: rgba(255, 255, 255, 0.8); 
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Responsif */

/* === LOGIN BACKGROUND: pakai gambar (RELATIF dari backend/public/style.css) === */
:root {
  --login-bg-url: url('./assets/bg_pdm_2026.png'); /* jalur relatif dari public/ */
}

/* pastikan kontainer ada & menutup layar */
.login-shell { position: relative; min-height: 100vh; background: #0b1526; }
.login-bg { position: absolute; inset: 0; }

/* matikan dekorasi lama kalau ada */
.login-bg .bg-gradient,
.login-bg .bg-shape { display: none; }

/* pasang background */
.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(11,21,38,.60) 0%, rgba(11,21,38,.55) 40%, rgba(11,21,38,.60) 100%),
    var(--login-bg-url) center / cover no-repeat; /* jangan pakai url() lagi di sini */
  will-change: transform;
  transform: translateZ(0);
  filter: saturate(1.05);
}

/* konten tetap di atas background */
.login-topbar,
.login-main,
.login-footer { position: relative; z-index: 2; }

/* Version info di bawah form login */
.version-info {
    margin-top: 25px;
    text-align: center;
    padding: 14px 18px;
    background: rgba(44, 90, 160, 0.08); /* Background dengan tema warna */
    border-radius: 10px;
    border: 1px solid rgba(44, 90, 160, 0.15);
}

.version-text {
    color: #2c5aa0; /* Gunakan warna tema */
    font-size: 13px; /* Sedikit lebih besar */
    font-weight: 600; /* Font weight lebih bold */
    text-transform: uppercase;
    letter-spacing: 0.8px; /* Lebih banyak letter spacing */
}

/* ====== [ADD] Polishing Menu Dashboard (Aman, tidak merombak struktur) ====== */

/* Warna fallback bila --primary-blue belum terdefinisi */
:root {
  --primary-blue: var(--primary-blue, #4776e6);
}

/* Basis item menu: rapi, konsisten ukuran ikon & label */
#adminDashboard .sidebar .sidebar-menu .menu-item,
#sekolahDashboard .sidebar .sidebar-menu .menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;                 /* spasi ikon-label */
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.2;
  transition: background 0.2s ease, color 0.2s ease, transform 0.08s ease;
}

/* Hover lembut */
#adminDashboard .sidebar .sidebar-menu .menu-item:hover,
#sekolahDashboard .sidebar .sidebar-menu .menu-item:hover {
  background: rgba(71, 118, 230, 0.06);
}

/* Aktif: gradient halus + warna aksen konsisten */
#adminDashboard .sidebar .sidebar-menu .menu-item.active,
#sekolahDashboard .sidebar .sidebar-menu .menu-item.active {
  background: linear-gradient(135deg, rgba(71,118,230,.12), rgba(142,84,233,.12));
  color: var(--primary-blue);
}

/* Indikator bar kiri pada item aktif (elegan & tidak mengubah layout) */
#adminDashboard .sidebar .sidebar-menu .menu-item.active::before,
#sekolahDashboard .sidebar .sidebar-menu .menu-item.active::before {
  content: '';
  position: absolute;
  left: -20px;               /* sejajar dengan padding sidebar default Anda */
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--primary-blue);
  border-radius: 0 4px 4px 0;
}

/* Konsistensi ukuran ikon SVG */
#adminDashboard .sidebar .sidebar-menu .menu-item svg,
#sekolahDashboard .sidebar .sidebar-menu .menu-item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  opacity: .9;
}

/* Tekan saat di-klik (feedback kecil, tidak menggeser layout) */
#adminDashboard .sidebar .sidebar-menu .menu-item:active,
#sekolahDashboard .sidebar .sidebar-menu .menu-item:active {
  transform: translateY(1px);
}

/* Header sidebar jadi terlihat sebagai section-title */
#adminDashboard .sidebar .sidebar-header,
#sekolahDashboard .sidebar .sidebar-header {
  font-weight: 700;
  letter-spacing: .3px;
  color: #1d2939;
  margin-bottom: 8px;
  opacity: .9;
}

/* Submenu (bila ada) – jaga jarak & indikator buka/tutup */
#sekolahDashboard .submenu {
  margin: 4px 0 10px 28px;   /* agak masuk ke kanan dari menu induk */
  border-left: 2px dashed rgba(0,0,0,.06);
  padding-left: 10px;
}

#sekolahDashboard .submenu .submenu-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #000000;
}

#sekolahDashboard .submenu .submenu-item:hover {
  background: rgba(71, 118, 230, 0.06);
}

/* [Opsional] Mode compact (tambahkan class .compact pada <aside class="sidebar"> bila diperlukan) */
.dashboard .sidebar.compact .sidebar-menu .menu-item {
  padding: 8px 10px;
  gap: 8px;
}
.dashboard .sidebar.compact .sidebar-menu .menu-item svg {
  width: 16px; height: 16px;
}

/* Netralisir wrapper <nav class="pagination-nav" ...> yang membungkus .pagination-controls */
nav.pagination-nav[data-table-id] { 
  display: contents; /* hilangkan pengaruh layout dari wrapper */
}

/* Pastikan layout konsisten */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.pagination-controls .pagination-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== NEW EDIT FORM LAYOUT ===== */
.edit-form-layout {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.photo-display-section {
  flex: 0 0 140px; /* Fixed width for photo section */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-display-section label {
  font-weight: 600;
  color: var(--text-color);
  font-size: 14px;
  text-align: center;
}

.data-fields-section {
  flex: 1; /* Take remaining space */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
}

.data-fields-section .form-group.full-width {
  grid-column: 1 / -1; /* Full width for nama orang tua */
}

/* ===== FOTO SISWA SECTION (Legacy) ===== */
.form-group.photo-section {
  grid-column: 1 / -1; /* Mengambil seluruh lebar grid */
  margin-bottom: 20px;
}

.photo-upload-container {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 15px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #fafafa;
}

.photo-preview {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #ddd;
  background: #f5f5f5;
}

.photo-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.photo-upload-controls .btn {
  width: 140px;
  padding: 8px 12px;
  font-size: 13px;
}

.photo-note {
  display: block;
  margin-top: 8px;
  color: #666;
  font-size: 12px;
  font-style: italic;
}

.file-input {
  display: none;
}

/* Style untuk foto preview yang sudah diupload */
.photo-preview.uploaded {
  border-color: var(--success-green);
  box-shadow: 0 2px 4px rgba(30, 142, 62, 0.2);
}

/* ===== AKTIVASI KODE PRO SECTION ===== */
.aktivasi-kode-pro-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.aktivasi-header {
  text-align: center;
  margin-bottom: 30px;
}

.aktivasi-header h2 {
  color: var(--primary-blue);
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 600;
}

.aktivasi-header p {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
}

.aktivasi-form-group {
  margin-bottom: 25px;
  text-align: center;
}

.aktivasi-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
  font-size: 16px;
  text-align: center;
}

.kode-pro-input {
  max-width: 300px;
  width: 100%;
  margin: 0 auto 20px auto;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #f9f9f9;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-height: 50px;
  display: block;
}

.kode-pro-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  background: white;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.2);
}

.btn.aktivasi-button,
#aktivasiButton {
  max-width: 300px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 12px 24px !important;
  background: #1a73e8 !important;
  background-image: none !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: block !important;
}

.btn.aktivasi-button:disabled,
#aktivasiButton:disabled {
  background: #ccc !important;
  background-image: none !important;
  color: #666 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.btn.aktivasi-button:hover:not(:disabled),
#aktivasiButton:hover:not(:disabled) {
  background: #3a7bc8 !important;
  background-image: none !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3) !important;
}

.btn.aktivasi-button:active:not(:disabled),
#aktivasiButton:active:not(:disabled) {
  transform: translateY(0) !important;
}

/* Progress Modal Styles */
.progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.progress-modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  min-width: 400px;
  max-width: 500px;
  text-align: center;
  animation: progressModalFadeIn 0.3s ease-out;
}

@keyframes progressModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.progress-modal-content h3 {
  margin: 0 0 25px 0;
  color: var(--primary-blue);
  font-size: 20px;
  font-weight: 600;
}

.progress-container {
  margin: 20px 0;
  position: relative;
}

/* Removed conflicting progress-bar definition */

/* Performance optimization: Smooth pagination and loading */
.pagination-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-size: 14px;
    color: #666;
}

.pagination-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #666;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.table-container {
    contain: layout style; /* CSS containment for better performance */
}

/* Optimized table rendering */
.table-container table {
    table-layout: auto; /* Better performance for large tables */
}

.table-container tbody {
    contain: layout style;
}

/* Virtual scrolling support */
.virtual-scroll-container {
    overflow: auto;
    position: relative;
    contain: strict;
}

.virtual-scroll-content {
    position: relative;
}

.virtual-scroll-items {
    position: absolute;
    top: 0;
    width: 100%;
    will-change: transform;
}

/* Enhanced loading states */
.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.table-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Override glyph korup untuk submenu arrow */
.menu-item.has-submenu::after {
  content: '▸';
}

/* ===== Admin Table Spacing & Readability Improvements ===== */
/* Membuat tabel pada panel admin lebih renggang dan rapi */
.dashboard .table-container {
  padding: 8px; /* ruang dalam container agar tidak mepet tepi */
}

.dashboard .table-container table {
  table-layout: auto; /* konsisten dengan performa dan lebar kolom */
}

/* Header tetap rapi (tetap nowrap), isi sel dapat membungkus */
.dashboard .table-container thead th {
  white-space: nowrap;
  line-height: 1.5;
}

.dashboard .table-container tbody td {
  white-space: normal;            /* biarkan teks panjang membungkus */
  overflow-wrap: anywhere;        /* pecah kata bila perlu */
  word-break: break-word;
  line-height: 1.5;               /* tinggi baris lebih lega */
  vertical-align: middle;         /* isi sel sejajar tengah vertikal */
}

/* Zebra stripes untuk keterbacaan baris */
.dashboard .table-container tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

/* Spasi yang nyaman untuk sel umum di admin */
.dashboard .table-container th,
.dashboard .table-container td {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Tata letak tombol aksi agar tidak berhimpitan */
.dashboard .table-container td.action-cell {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard .table-container td.action-cell .btn {
  margin: 0;            /* karena sudah pakai gap */
  padding: 6px 10px;    /* ukuran tombol proporsional */
  font-size: 0.85em;
}

/* ===== Admin Table Compact Adjustments (No Wrap) ===== */
/* Permintaan: jarak diperkecil, header tidak terpotong, tanpa wrap */
.dashboard .table-container table {
  table-layout: auto;        /* biarkan kolom menyesuaikan konten */
  min-width: 1200px;         /* paksa scroll horizontal ketimbang memotong teks */
}

.dashboard .table-container thead th {
  white-space: nowrap;       /* header selalu satu baris */
  line-height: 1.35;
}

.dashboard .table-container th,
.dashboard .table-container td {
  white-space: nowrap;       /* non-wrap untuk seluruh sel */
  padding: 8px 12px;         /* kompak: vertikal 8px */
  line-height: 1.35;         /* sedikit lebih rapat */
}

.dashboard .table-container td.action-cell {
  flex-wrap: nowrap;         /* tombol aksi tetap satu baris */
  gap: 6px;                  /* jarak tombol lebih rapat */
}

/* ===== Khusus: Tabel Admin Siswa ===== */
#siswa .table-container td.action-cell {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 140px;
  min-width: 140px;
}

#siswa .table-container td.action-cell .btn {
  margin: 0;
  padding: 6px 12px;
  font-size: 0.85em;
  border-radius: 4px;
  font-weight: 500;
}

/* ===== Khusus: Tabel Siswa (tanpa wrap sama sekali) ===== */
#siswa .table-container thead th,
#siswa .table-container tbody td {
  white-space: nowrap;      /* cegah pembungkusan teks */
  word-break: normal;
  overflow-wrap: normal;
}

/* ===== Profil Siswa: non-wrap + pastikan kolom aksi/foto terlihat ===== */
#profilSiswaSection .table-container thead th,
#profilSiswaSection .table-container tbody td {
  white-space: nowrap;
  line-height: 1.35;
}

/* Override sifat memotong pada sel di profil siswa */
#profilSiswaSection .table-container tbody td {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

#profilSiswaSection td.action-cell,
#profilSiswaSection td.photo-cell {
  max-width: none !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

#profilSiswaSection th.action-column,
#profilSiswaSection td.action-cell {
  width: 160px;              /* pastikan lebar kolom konsisten */
  text-align: center;        /* konten sejajar dengan header */
  box-sizing: border-box;
}

#profilSiswaSection td.action-cell .btn {
  margin: 0 4px;
  padding: 5px 10px;
  font-size: 0.85em;
}

.loading-message {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Button loading states */
.btn-spinner {
    display: inline-block !important;
    animation: spin 1s linear infinite !important;
    margin-right: 5px !important;
}

/* Enhanced notification styles */
#notification {
    max-width: 400px;
    word-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#notification.error {
    border-left: 4px solid #dc3545;
}

#notification.success {
    border-left: 4px solid var(--success-green);
}

#notification.warning {
    border-left: 4px solid #ffc107;
}

/* Loading overlay enhancements */
.loading-overlay {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.5);
}

.loading-overlay .spinner {
    border-width: 4px;
    border-color: #f3f3f3;
    border-top-color: #ffffff;
    width: 40px;
    height: 40px;
}

.loading-text {
    margin-top: 15px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500;
    text-align: center;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), #4285f4);
  border-radius: 6px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 11px;
  color: var(--primary-blue);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.progress-status {
  margin-top: 15px;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
}

.aktivasi-success {
  display: none;
  text-align: center;
  padding: 25px;
  background: #e8f5e8;
  border: 2px solid var(--success-green);
  border-radius: 8px;
  margin-top: 20px;
}

.aktivasi-success.show {
  display: block;
}

.aktivasi-success .success-icon {
  font-size: 48px;
  color: var(--success-green);
  margin-bottom: 15px;
}

.aktivasi-success h3 {
  color: var(--success-green);
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 600;
}

.aktivasi-success p {
  color: #4a4a4a;
  font-size: 16px;
  line-height: 1.5;
}

/* Style untuk menu yang disabled */
.menu-item.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.menu-item.disabled svg {
  opacity: 0.5;
}

/* === ENHANCED BACKUP & RESTORE SECTION === */
.backup-restore-main {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.backup-restore-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .backup-restore-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Backup & Restore Cards */
.backup-card, .restore-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s ease;
}

.backup-card:hover, .restore-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.backup-card-header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.backup-icon, .restore-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.backup-icon {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-blue);
}

.restore-icon {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning-orange);
}

.backup-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.backup-card-content {
  padding: 20px;
}

.backup-card-content p {
  margin: 0 0 15px 0;
  color: var(--text-light);
  line-height: 1.5;
}

.backup-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.backup-features li {
  padding: 6px 0;
  color: var(--text-light);
  font-size: 14px;
}

.backup-features.warning li {
  color: var(--warning-orange);
}

.backup-card-actions {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.backup-card-actions .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
}

/* Info Card */
.backup-info {
  margin-top: 30px;
}

.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid var(--info-blue);
}

.info-card h4 {
  margin: 0 0 15px 0;
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 600;
}

.info-card ul {
  margin: 0;
  padding-left: 20px;
}

/* ===== ENHANCED BACKUP & RESTORE FEATURES ===== */

/* Header Content Enhancement */
.backup-header-content,
.restore-header-content {
  flex: 1;
}

.backup-header-content h3,
.restore-header-content h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Status Indicators */
.backup-status,
.restore-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #5f6368;
}

.status-indicator {
  font-size: 10px;
  line-height: 1;
}

.status-text {
  font-weight: 500;
}

/* Backup Statistics */
.backup-stats {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f9fa, #e8f0fe);
  border-top: 1px solid #e8eaed;
  border-bottom: 1px solid #e8eaed;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-number,
.stat-size {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #1a73e8;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: #5f6368;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== ADMIN DASHBOARD STYLES ===== */
/* Fix untuk container adminDashboard */
#adminDashboard.dashboard {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden;
}

#dashboardContent {
  padding: 2rem;
  background: var(--bg-secondary);
  min-height: calc(100vh - 80px);
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.dashboard-section h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Enhanced Stats Grid for Dashboard */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Admin Dashboard Stats Grid - untuk menggunakan struktur existing */
#dashboardContent .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px var(--shadow);
  border: 1px solid var(--border-color-new);
  transition: all var(--transition-duration);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 1.2rem;
}

.stat-card-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1;
}

/* Style untuk struktur HTML yang ada */
#dashboardContent .stat-card .stat-content {
  text-align: center;
}

#dashboardContent .stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  line-height: 1;
  display: block;
}

#dashboardContent .stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Kecamatan Section */
.kecamatan-section {
  margin-top: 2rem;
}

.kecamatan-section h3 {
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.kecamatan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.kecamatan-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border-color-new);
  transition: all var(--transition-duration);
  text-align: center;
}

.kecamatan-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: var(--accent-primary);
}

.kecamatan-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kecamatan-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: block;
}

.kecamatan-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
  #dashboardContent {
    padding: 1rem;
  }

  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .kecamatan-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-value {
    font-size: 1.8rem;
  }
}

/* Progress Bars */
.backup-progress {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8eaed;
}

.backup-progress-bar {
  width: 100%;
  height: 8px;
  background: #e8eaed;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a73e8, #4285f4);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

.restore-fill {
  background: linear-gradient(90deg, #f57c00, #ff9800);
}

.progress-text {
  font-size: 12px;
  color: #5f6368;
  font-weight: 500;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Enhanced Button Styling */
.btn-backup {
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}

.btn-backup:hover {
  background: linear-gradient(135deg, #1557b0, #3367d6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,115,232,0.4);
}

.btn-backup:disabled {
  background: #e8eaed;
  color: #9aa0a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-restore {
  background: linear-gradient(135deg, #f57c00, #ff9800);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(245,124,0,0.3);
}

.btn-restore:hover:not(:disabled) {
  background: linear-gradient(135deg, #e65100, #f57c00);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,124,0,0.4);
}

.btn-restore:disabled {
  background: #e8eaed;
  color: #9aa0a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Drag & Drop Zone */
.drag-drop-zone {
  margin: 20px;
  padding: 32px 20px;
  border: 2px dashed #e8eaed;
  border-radius: 12px;
  background: #fafbfc;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-drop-zone:hover {
  border-color: #4285f4;
  background: #f8f9fa;
}

.drag-drop-zone.drag-over {
  border-color: #1a73e8;
  background: linear-gradient(135deg, rgba(26,115,232,0.05), rgba(66,133,244,0.05));
  transform: scale(1.02);
}

.drag-drop-content {
  color: #5f6368;
}

.drag-drop-content svg {
  color: #9aa0a6;
  margin-bottom: 16px;
}

.drag-drop-content p {
  margin: 8px 0;
  font-size: 14px;
}

.drag-drop-content strong {
  color: #1a73e8;
}

.browse-link {
  color: #1a73e8;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 500;
}

.browse-link:hover {
  color: #1557b0;
}

.drag-drop-content small {
  color: #9aa0a6;
  font-size: 12px;
}

/* File Info Display */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e8eaed;
  margin: 0;
  width: 100%;
}

.file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  text-align: left;
}

.file-name {
  font-weight: 600;
  color: #202124;
  font-size: 14px;
  margin-bottom: 4px;
}

.file-size {
  font-size: 12px;
  color: #5f6368;
  margin-bottom: 4px;
}

.file-validation {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.file-validation.valid {
  background: #e8f5e8;
  color: #137333;
}

.file-validation.invalid {
  background: #fce8e6;
  color: #d93025;
}

.remove-file {
  background: #f1f3f4;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 16px;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.remove-file:hover {
  background: #e8eaed;
  color: #d93025;
}

/* Loading States for Buttons */
.btn-backup.loading,
.btn-restore.loading {
  position: relative;
  pointer-events: none;
}

.btn-backup.loading::after,
.btn-restore.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Success/Error States */
.btn-backup.success {
  background: linear-gradient(135deg, #137333, #34a853);
}

.btn-backup.error {
  background: linear-gradient(135deg, #d93025, #ea4335);
}

.btn-restore.success {
  background: linear-gradient(135deg, #137333, #34a853);
}

.btn-restore.error {
  background: linear-gradient(135deg, #d93025, #ea4335);
}

/* ===== FINAL OVERRIDE - BLUE SIDEBAR DESIGN ===== */
/* Memastikan sidebar biru diterapkan dengan prioritas tertinggi */
.dashboard .sidebar,
.dashboard aside.sidebar,
#adminDashboard .sidebar,
#adminDashboard aside.sidebar,
#sekolahDashboard .sidebar,
#sekolahDashboard aside.sidebar,
#adminSidebar,
#sekolahSidebar {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3c72 100%) !important;
    background-color: #2c5aa0 !important;
    width: 280px !important;
    padding: 0 !important;
}

.dashboard .sidebar-header,
#adminSidebar .sidebar-header,
#sekolahSidebar .sidebar-header {
    color: #ffffff !important;
    background: rgba(255,255,255,0.05) !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 25px 20px 20px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

.dashboard .sidebar-menu li a,
#adminSidebar .sidebar-menu li a,
#sekolahSidebar .sidebar-menu li a {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 15px 25px !important;
    border-left: 4px solid transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.dashboard .sidebar-menu li a:hover,
#adminSidebar .sidebar-menu li a:hover,
#sekolahSidebar .sidebar-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-left-color: rgba(255, 255, 255, 0.5) !important;
}

.dashboard .sidebar-menu li a.active,
#adminSidebar .sidebar-menu li a.active,
#sekolahSidebar .sidebar-menu li a.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-left-color: #ffffff !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-number,
  .stat-size {
    font-size: 16px;
  }

  .drag-drop-zone {
    margin: 16px;
    padding: 24px 16px;
    min-height: 120px;
  }

  .drag-drop-content svg {
    width: 40px;
    height: 40px;
  }
}

.info-card li {
  margin: 8px 0;
  color: var(--text-light);
  line-height: 1.5;
}

/* Responsive */

/* === RANKING WIDGET === */
.ranking-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid #ffd700;
}

.ranking-card h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.ranking-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.ranking-header span {
  font-size: 14px;
  color: var(--text-light);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ranking-item:hover {
  background: #e9ecef;
  transform: translateX(2px);
}

.ranking-item.top-3 {
  background: linear-gradient(135deg, #fff9c4, #fef3c7);
  border: 1px solid #fbbf24;
}

.ranking-item.rank-1 {
  background: linear-gradient(135deg, #fef3c7, #f59e0b);
  color: #78350f;
  font-weight: 600;
}

.ranking-item.rank-2 {
  background: linear-gradient(135deg, #f3f4f6, #d1d5db);
  border: 1px solid #9ca3af;
}

.ranking-item.rank-3 {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border: 1px solid #f87171;
}

.ranking-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  margin-right: 15px;
  flex-shrink: 0;
}

.ranking-number.rank-1 {
  background: #fbbf24;
  color: white;
}

.ranking-number.rank-2 {
  background: #9ca3af;
  color: white;
}

.ranking-number.rank-3 {
  background: #f87171;
  color: white;
}

.ranking-number.rank-other {
  background: var(--primary-blue) !important;
  color: white !important;
}

/* Fallback jika CSS variable tidak bekerja */
.ranking-number.rank-other {
  background: #1a73e8 !important;
  color: white !important;
}

.ranking-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranking-name {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 14px;
}

.ranking-average {
  font-weight: 600;
  color: var(--success-green);
  font-size: 14px;
}

.ranking-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-style: italic;
}

.ranking-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
}

/* Responsive ranking */

/* Dashboard Layout - Keep Original Simple Style */

/* Custom styles for Admin Panel tables: no-wrap and autofit */
#sekolah .table-container table th,
#sekolah .table-container table td,
#siswa .table-container table th,
#siswa .table-container table td {
    white-space: nowrap;
    width: auto;
}

#sekolah .table-container table,
#siswa .table-container table {
    table-layout: auto;
}

/* ===== SCHOOL PROFILE CARD STYLES ===== */
/* Modern Card System */
.school-profile-card,
.admin-section-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color-new);
    transition: box-shadow var(--transition-duration) ease;
}

.school-profile-card:hover,
.admin-section-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.school-profile-card .card-header {
    margin-bottom: 20px;
}

.school-profile-card .title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.school-profile-card .page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.school-profile-card .page-title svg {
    color: var(--accent-primary);
    stroke-width: 2.5px;
}

.student-count-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(30, 142, 62, 0.3);
}

.school-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color-new);
    transition: all var(--transition-duration);
}

.info-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.info-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
    line-height: 1.4;
}

/* ===== ADMIN SECTION CARD STYLES ===== */
/* Card header styling for both profile and admin cards */
.school-profile-card .card-header,
.admin-section-card .card-header {
    margin-bottom: 20px;
}

.school-profile-card .title-section,
.admin-section-card .title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.school-profile-card .page-title,
.admin-section-card .page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.school-profile-card .page-title svg,
.admin-section-card .page-title svg {
    color: var(--accent-primary);
    stroke-width: 2.5px;
}

/* Section badges for admin sections */
.section-badge {
    background: linear-gradient(135deg, var(--info), #17a2b8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* Card actions container */
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Card content area */
.card-content {
    margin-top: 20px;
}

/* ===== MODERN MODAL STYLES ===== */
.modern-modal-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: none;
    overflow: hidden;
    max-width: 600px;
    width: 90%;
}

.modal-card-header {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    padding: 24px;
    border-bottom: 1px solid var(--border-color-new);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-section {
    flex: 1;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-title svg {
    color: var(--accent-primary);
    stroke-width: 2.5px;
}

.modal-close-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-duration);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-card-body {
    padding: 24px;
}

.modal-card-footer {
    background: var(--bg-secondary);
    padding: 20px 24px;
    border-top: 1px solid var(--border-color-new);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== MODERN FORM STYLES ===== */
.modern-form-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.modern-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.modern-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.modern-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color-new);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-duration);
    outline: none;
}

.modern-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(30, 142, 62, 0.1);
    transform: translateY(-1px);
}

.modern-input:hover {
    border-color: var(--text-secondary);
}

.modern-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.modern-btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-duration);
    box-shadow: 0 2px 8px rgba(30, 142, 62, 0.3);
}

.modern-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 142, 62, 0.4);
}

/* ===== MODERN FILTER CONTROLS ===== */
.filter-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-controls select.form-control {
    padding: 10px 16px;
    border: 2px solid var(--border-color-new);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 160px;
    transition: all var(--transition-duration);
    outline: none;
}

.filter-controls select.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(30, 142, 62, 0.1);
}

.filter-controls select.form-control:hover {
    border-color: var(--text-secondary);
}

.filter-controls .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-duration);
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.filter-controls .btn-action.btn-login {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 6px rgba(30, 142, 62, 0.3);
}

.filter-controls .btn-action.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(30, 142, 62, 0.4);
}

/* ===== MODERN BUTTON SYSTEM ===== */
/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-duration);
    outline: none;
    white-space: nowrap;
    min-height: 40px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary button - main actions */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 6px rgba(30, 142, 62, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(30, 142, 62, 0.4);
}

/* Secondary button - alternative actions */
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color-new);
}

.btn-secondary:hover {
    background: var(--border-color-new);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px var(--shadow);
}

/* Danger/Delete button */
.btn-delete {
    background: linear-gradient(135deg, var(--danger), #e74c3c);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

/* Import/Upload button */
.btn-import {
    background: linear-gradient(135deg, var(--info), #138496);
    color: white;
    border-color: var(--info);
    box-shadow: 0 2px 6px rgba(23, 162, 184, 0.3);
}

.btn-import:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(23, 162, 184, 0.4);
}

/* Export/Download button */
.btn-export,
.btn-pdf {
    background: linear-gradient(135deg, var(--warning), #e0a800);
    color: white;
    border-color: var(--warning);
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
}

.btn-export:hover,
.btn-pdf:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.4);
}

/* Refresh button */
.btn-refresh {
    background: linear-gradient(135deg, var(--success), #1e7e34);
    color: white;
    border-color: var(--success);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

/* Navigation buttons */
.btn-nav {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color-new);
    font-size: 0.9rem;
    padding: 8px 14px;
}

.btn-nav:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Large buttons for important actions */
.btn-large {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 48px;
}

/* Login button */
.btn-login {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 3px 8px rgba(30, 142, 62, 0.3);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(30, 142, 62, 0.4);
}

/* Cancel/Reset buttons */
.btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color-new);
}

.btn-cancel:hover {
    background: var(--border-color-new);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Ghost button - minimal style */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color-new);
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Button groups */
.btn-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-row .btn {
    flex: 1;
    min-width: 180px;
}

/* ===== MODERN NAVIGATION STYLES ===== */
/* Sidebar enhancements */
.sidebar {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-secondary));
    border-right: 1px solid var(--border-color-new);
    box-shadow: 2px 0 8px var(--shadow);
}

.sidebar-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-duration);
    border-left: 4px solid transparent;
    font-weight: 500;
}

.sidebar-menu .menu-item:hover {
    background: var(--bg-secondary);
    border-left-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateX(4px);
}

.sidebar-menu .menu-item.active {
    background: linear-gradient(90deg, rgba(30, 142, 62, 0.1), transparent);
    border-left-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-menu .menu-item svg {
    transition: all var(--transition-duration);
}

.sidebar-menu .menu-item:hover svg,
.sidebar-menu .menu-item.active svg {
    transform: scale(1.1);
    color: var(--accent-primary);
}

/* Sidebar logout button */
.sidebar #logoutBtn {
    margin: 20px;
    width: calc(100% - 40px);
    background: linear-gradient(135deg, var(--danger), #e74c3c);
    color: white;
    border: none;
    transition: all var(--transition-duration);
}

.sidebar #logoutBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* ===== MODERN TYPOGRAPHY SYSTEM ===== */
/* Enhanced typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 16px;
}

h1 { 
    font-size: 2.25rem; 
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2 { 
    font-size: 1.875rem; 
    font-weight: 650;
    letter-spacing: -0.3px;
}

h3 { 
    font-size: 1.5rem; 
    font-weight: 600;
}

h4 { 
    font-size: 1.25rem; 
    font-weight: 600;
}

h5 { 
    font-size: 1.1rem; 
    font-weight: 600;
}

h6 { 
    font-size: 1rem; 
    font-weight: 600;
}

/* Body text and paragraphs */
p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Enhanced text utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-weight-light { font-weight: 300; }
.font-weight-normal { font-weight: 400; }
.font-weight-medium { font-weight: 500; }
.font-weight-semibold { font-weight: 600; }
.font-weight-bold { font-weight: 700; }

.font-size-sm { font-size: 0.875rem; }
.font-size-base { font-size: 1rem; }
.font-size-lg { font-size: 1.125rem; }
.font-size-xl { font-size: 1.25rem; }

/* Enhanced table typography */
table {
    font-size: 0.95rem;
    color: var(--text-primary);
}

th {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

td {
    color: var(--text-primary);
}

/* Labels and form text */
label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Enhanced link styling */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-duration);
}

a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ===== ENHANCED COLOR SCHEME UTILITIES ===== */
/* Background utilities */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-card { background-color: var(--bg-card); }

.bg-success { 
    background: linear-gradient(135deg, var(--success), #1e7e34);
    color: white;
}

.bg-danger { 
    background: linear-gradient(135deg, var(--danger), #c82333);
    color: white;
}

.bg-warning { 
    background: linear-gradient(135deg, var(--warning), #e0a800);
    color: white;
}

.bg-info { 
    background: linear-gradient(135deg, var(--info), #117a8b);
    color: white;
}

/* Border utilities */
.border { border: 1px solid var(--border-color-new); }
.border-top { border-top: 1px solid var(--border-color-new); }
.border-bottom { border-bottom: 1px solid var(--border-color-new); }
.border-left { border-left: 1px solid var(--border-color-new); }
.border-right { border-right: 1px solid var(--border-color-new); }

.border-success { border-color: var(--success); }
.border-danger { border-color: var(--danger); }
.border-warning { border-color: var(--warning); }
.border-info { border-color: var(--info); }

/* Shadow utilities */
.shadow-sm { box-shadow: 0 1px 3px var(--shadow); }
.shadow { box-shadow: 0 2px 8px var(--shadow); }
.shadow-lg { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.shadow-xl { box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* Spacing utilities for modern design */
.m-0 { margin: 0; }
.m-1 { margin: 8px; }
.m-2 { margin: 16px; }
.m-3 { margin: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }
.rounded-full { border-radius: 50%; }

/* Override: fix corrupted loading indicator characters */
.analytics-loading::before,
.timeline-loading::before {
  content: '…' !important;
}

/* School name top row styling - hidden since we use dashboard header now */
.school-name-top-row {
    display: none !important;
}

/* ===== TABLE AUTOFIT & ALIGNMENT GLOBAL SETTINGS ===== */
/* Semua tabel menggunakan autofit layout */
.table-container table {
    table-layout: auto !important;
    width: 100% !important;
}

/* Set semua kolom tabel menggunakan align left sebagai default */
.table-container table th,
.table-container table td {
    text-align: left !important;
}

/* Kolom nomor urut tetap center untuk konsistensi */
.table-container table th:first-child,
.table-container table td:first-child {
    text-align: center !important;
}

/* Kolom foto tetap center karena masuk akal untuk gambar */
.table-container table th:nth-child(8),
.table-container table td:nth-child(8),
table.has-photo-col th:nth-child(8),
table.has-photo-col td:nth-child(8) {
    text-align: center !important;
}

/* Override semua text-align center yang sudah ada kecuali untuk kolom khusus */
.table-container table th:not(:first-child):not(:last-child):not(:nth-child(8)),
.table-container table td:not(:first-child):not(:last-child):not(:nth-child(8)) {
    text-align: left !important;
}

/* Pastikan semua tabel di semua menu menggunakan alignment yang benar */
#sekolahSection .table-container table th:not(:first-child):not(:last-child),
#sekolahSection .table-container table td:not(:first-child):not(:last-child),
#siswaSection .table-container table th:not(:first-child):not(:last-child),
#siswaSection .table-container table td:not(:first-child):not(:last-child),
#profilSiswaSection .table-container table th:not(:first-child):not(:last-child):not(:nth-child(8)),
#profilSiswaSection .table-container table td:not(:first-child):not(:last-child):not(:nth-child(8)),
#isiNilaiSection .table-container table th:not(:first-child):not(:last-child),
#isiNilaiSection .table-container table td:not(:first-child):not(:last-child),
#transkripNilaiSection .table-container table th:not(:first-child):not(:last-child),
#transkripNilaiSection .table-container table td:not(:first-child):not(:last-child),
#sklSection .table-container table th:not(:first-child):not(:last-child):not(:nth-child(8)),
#sklSection .table-container table td:not(:first-child):not(:last-child):not(:nth-child(8)),
#skkbSection .table-container table th:not(:first-child):not(:last-child):not(:nth-child(8)),
#skkbSection .table-container table td:not(:first-child):not(:last-child):not(:nth-child(8)),
#rekapNilaiSection .table-container table th:not(:first-child):not(:last-child),
#rekapNilaiSection .table-container table td:not(:first-child):not(:last-child),
#rekapNilaiAdminSection .table-container table th:not(:first-child):not(:last-child),
#rekapNilaiAdminSection .table-container table td:not(:first-child):not(:last-child),
#cetakGabunganSection .table-container table th:not(:first-child):not(:last-child):not(:nth-child(8)),
#cetakGabunganSection .table-container table td:not(:first-child):not(:last-child):not(:nth-child(8)) {
    text-align: left !important;
}

/* FINAL Fix untuk alignment tombol aksi di tabel - Autofit dengan minimum width */
/* Kolom aksi (last-child) tetap center dengan ukuran autofit yang fleksibel */
.table-container table th:last-child {
    min-width: 80px; /* Minimum width yang lebih kecil untuk autofit */
    width: auto; /* Allow autofit based on content */
    text-align: center !important;
    padding: 8px 6px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.table-container table td.action-cell,
.table-container table td:last-child {
    min-width: 80px; /* Minimum width yang lebih kecil untuk autofit */
    width: auto; /* Allow autofit based on content */
    text-align: center !important;
    white-space: nowrap !important;
    padding: 8px 6px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.table-container table td.action-cell .btn {
    margin: 0 1px !important; /* Reduced margin for tighter spacing */
    padding: 4px 6px !important; /* Reduced horizontal padding */
    font-size: 11px !important; /* Slightly smaller font for compact buttons */
    min-width: 40px !important; /* Reduced minimum width */
    display: inline-block !important;
    line-height: 1.2 !important; /* Better line height for compact design */
}

/* Enhanced styling untuk tombol di kolom aksi - Modern & Konsisten */
.table-container table td:last-child .btn,
.table-container table td.action-cell .btn {
    margin: 0 2px !important; /* Spacing yang optimal */
    padding: 4px 8px !important; /* Padding yang nyaman */
    font-size: 11px !important; /* Font size yang terbaca */
    min-width: 40px !important; /* Minimum width yang proporsional */
    border-radius: 4px !important; /* Rounded corners yang modern */
    border: none !important;
    color: white !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
}

/* Hover effects untuk tombol aksi */
.table-container table td:last-child .btn:hover,
.table-container table td.action-cell .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25) !important;
}

/* Active state untuk tombol aksi */
.table-container table td:last-child .btn:active,
.table-container table td.action-cell .btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

/* Disabled state untuk tombol aksi */
.table-container table td:last-child .btn:disabled,
.table-container table td.action-cell .btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.table-container table td:last-child .btn:disabled:hover,
.table-container table td.action-cell .btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ===== AUTOFIT TABLE RESPONSIVE RULES ===== */
/* Preserve nowrap for specific content types that should not wrap */
.table-container table th:first-child,
.table-container table td:first-child,
.table-container table th:last-child,
.table-container table td:last-child {
    white-space: nowrap !important; /* Kolom nomor dan aksi tidak wrap */
}

/* NISN, NIS, dan nomor peserta tetap nowrap untuk format yang konsisten */
.table-container table td[data-type="nisn"],
.table-container table td[data-type="nis"],
.table-container table td[data-type="noPeserta"],
th:contains("NISN"), th:contains("NIS"), th:contains("NO PESERTA"),
td:nth-child(2), /* NISN column typically */
td:nth-child(3), /* NIS column typically */
td:nth-child(4)  /* NO PESERTA column typically */ {
    white-space: nowrap !important;
    font-family: monospace; /* Better for numbers */
}

/* Allow text wrapping for content columns that can benefit from it */
.table-container table td:nth-child(5), /* NAMA - typically */
.table-container table td:nth-child(6), /* TTL - typically */
.table-container table td:nth-child(7)  /* NAMA ORTU - typically */ {
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===== PHOTO MODAL POPUP STYLING ===== */
.photo-modal {
    z-index: 10000; /* Higher than other modals */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.show {
    opacity: 1;
}

.photo-modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

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

.photo-modal-body {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.photo-modal-body img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.photo-modal-body img:hover {
    transform: scale(1.02);
}

.photo-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #495057;
}

.photo-info strong {
    color: #212529;
    font-weight: 600;
}

/* Click cursor untuk foto thumbnail */
.photo-thumbnail-container {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
    overflow: hidden;
}

.photo-thumbnail-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.photo-thumbnail {
    transition: opacity 0.2s ease;
}

.photo-thumbnail-container:hover .photo-thumbnail {
    opacity: 0.9;
}

/* Force consistent table layout with proper minimum width */
.table-container table {
    table-layout: auto !important;
    min-width: 1400px !important;
    width: 100% !important;
}

/* Specific column width controls for admin siswa table */
.table-container table th:nth-child(1),  /* KODE BIASA */
.table-container table td:nth-child(1) {
    min-width: 80px !important;
}

.table-container table th:nth-child(2),  /* KODE PRO */
.table-container table td:nth-child(2) {
    min-width: 80px !important;
}

.table-container table th:nth-child(3),  /* NAMA SEKOLAH */
.table-container table td:nth-child(3) {
    min-width: 200px !important;
}

.table-container table th:nth-child(4),  /* KECAMATAN */
.table-container table td:nth-child(4) {
    min-width: 150px !important;
}

.table-container table th:nth-child(5),  /* NO URUT */
.table-container table td:nth-child(5) {
    min-width: 60px !important;
    text-align: center !important;
}

.table-container table th:nth-child(6),  /* NO INDUK */
.table-container table td:nth-child(6) {
    min-width: 80px !important;
}

.table-container table th:nth-child(7),  /* NOPES */
.table-container table td:nth-child(7) {
    min-width: 80px !important;
}

.table-container table th:nth-child(8),  /* NISN */
.table-container table td:nth-child(8) {
    min-width: 100px !important;
}

.table-container table th:nth-child(9),  /* NAMA PESERTA */
.table-container table td:nth-child(9) {
    min-width: 150px !important;
}

.table-container table th:nth-child(10), /* TEMPAT & TGL LAHIR */
.table-container table td:nth-child(10) {
    min-width: 180px !important;
}

.table-container table th:nth-child(11), /* NAMA ORANG TUA */
.table-container table td:nth-child(11) {
    min-width: 150px !important;
}

.table-container table th:nth-child(12), /* NO IJAZAH */
.table-container table td:nth-child(12) {
    min-width: 100px !important;
}

/* Make table container horizontally scrollable to ensure all columns are visible */
.table-container {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* Additional dashboard header text styling */
.dashboard-header .user-info h3 {
    color: white !important;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.dashboard-header .user-info p {
    color: rgba(255, 255, 255, 0.8) !important;
    margin: 0;
    font-size: 12px;
}

/* SKL Specific Styling - Enhanced to match official format */
#sklNilaiTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    font-family: 'Times New Roman', serif !important;
}

#sklNilaiTable th,
#sklNilaiTable td {
    border: 1px solid black !important;
    padding: 8px !important;
}

#sklNilaiTable th {
    background-color: white !important;
    font-weight: bold !important;
    text-align: center !important;
}

.skl-student-info-table table {
    border: none !important;
    font-family: 'Times New Roman', serif !important;
}

.skl-student-info-table table td {
    border: none !important;
    padding: 3px 0 !important;
    vertical-align: top !important;
}

.skl-lulus-text {
    text-align: center !important;
    font-size: 24px !important;
    font-weight: bold !important;
    margin: 30px 0 !important;
}

.skl-pasfoto {
    border: 1px solid black !important;
    width: 3cm !important;
    height: 4cm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    font-size: 12px !important;
    text-align: center !important;
}

.skl-pasfoto img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Fix SKL footer overflow issues */
.skl-footer {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 30px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.skl-footer .transkrip-signature-block {
    max-width: 280px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Transkrip Nilai Specific Styling */
#transkripNilaiTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 30px !important;
    font-family: 'Times New Roman', serif !important;
}

#transkripNilaiTable th,
#transkripNilaiTable td {
    border: 1px solid black !important;
    padding: 8px !important;
}

#transkripNilaiTable th {
    background-color: white !important;
    font-weight: bold !important;
    text-align: center !important;
}

.transkrip-student-info-table table {
    border: none !important;
    font-family: 'Times New Roman', serif !important;
    font-size: 14px !important;
}

.transkrip-student-info-table table td {
    border: none !important;
    padding: 3px 0 !important;
    vertical-align: top !important;
}

/* Version badge styling in header */
.dashboard-header #version-info-badge {
    margin-right: 20px;
}

.dashboard-header .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Add scroll indicator for horizontal scroll */
.table-container::after {
    content: "← Scroll untuk melihat semua kolom →" !important;
    position: absolute !important;
    bottom: 5px !important;
    right: 10px !important;
    background: rgba(44, 90, 160, 0.8) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    pointer-events: none !important;
    z-index: 10 !important;
    opacity: 0.8 !important;
}

/* Hide scroll indicator when table is fully visible */
@media (min-width: 1500px) {
    .table-container::after {
        display: none !important;
    }
}

/* Ensure table takes full available width but stays scrollable */
.table-container table {
    min-width: 1400px !important; /* Force minimum width so AKSI column is always visible */
    width: 100% !important;
}

/* Optimize column widths for better visibility */
.table-container table th,
.table-container table td {
    white-space: nowrap !important;
    padding: 8px 6px !important;
    font-size: 13px !important;
}

/* Specific width adjustments for key columns */
.table-container table th:nth-child(1), /* KODE BIASA */
.table-container table td:nth-child(1) {
    width: 80px !important;
    min-width: 80px !important;
}

.table-container table th:nth-child(2), /* KODE PRO */
.table-container table td:nth-child(2) {
    width: 80px !important;
    min-width: 80px !important;
}

.table-container table th:nth-child(3), /* NAMA SEKOLAH */
.table-container table td:nth-child(3) {
    width: 200px !important;
    min-width: 200px !important;
}

.table-container table th:nth-child(4), /* KECAMATAN */
.table-container table td:nth-child(4) {
    width: 120px !important;
    min-width: 150px !important;
}

.table-container table th:nth-child(8), /* NISN */
.table-container table td:nth-child(8) {
    width: 100px !important;
    min-width: 100px !important;
}

.table-container table th:nth-child(9), /* NAMA PESERTA */
.table-container table td:nth-child(9) {
    width: 150px !important;
    min-width: 150px !important;
}

.table-container table th:nth-child(10), /* TEMPAT & TGL LAHIR */
.table-container table td:nth-child(10) {
    width: 180px !important;
    min-width: 180px !important;
}

.table-container table th:nth-child(11), /* NAMA ORANG TUA */
.table-container table td:nth-child(11) {
    width: 150px !important;
    min-width: 150px !important;
}

.table-container table th:nth-child(12), /* NO IJAZAH */
.table-container table td:nth-child(12) {
    width: 100px !important;
    min-width: 100px !important;
}

/* Modal responsiveness - make sure modal content fits in viewport */
.modal-content.modern-modal-card {
    max-height: 85vh !important;
    max-width: 600px !important;
    margin: 5vh auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-card-header {
    flex-shrink: 0 !important;
}

.modal-card-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 20px !important;
    max-height: calc(85vh - 140px) !important;
}

/* Ensure modal footer is always visible and at bottom */
.modal-card-footer {
    flex-shrink: 0 !important;
    background: white !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 15px 20px !important;
    z-index: 1000 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1) !important;
}

/* Form layout adjustments for better space usage */
.modern-form-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
}

.modern-form-group.form-group-full {
    grid-column: 1 / -1 !important;
}

/* Smaller form inputs in modal */
.modern-input {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.modern-label {
    font-size: 13px !important;
    margin-bottom: 5px !important;
}

/* Responsive modal untuk layar kecil */
@media (max-width: 768px) {
    .modal-content.modern-modal-card {
        max-height: 95vh !important;
        margin: 2vh auto !important;
        max-width: 95vw !important;
    }

    .modern-form-layout {
        grid-template-columns: 1fr !important;
    }
}


/* ===== MODERN AKTIVASI KODE PRO REDESIGN ===== */
.aktivasi-modern-container {
  display: grid;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Status Card */
.pro-status-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.status-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-icon {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-content h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 2s infinite;
}

.badge-dot.active {
  background: #22c55e;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main Activation Section */
.activation-main-section {
  display: grid;
  gap: 20px;
}

.activation-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

.card-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.card-header h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.card-description {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.card-body {
  padding: 24px;
}

/* Modern Input Group */
.input-group-modern {
  margin-bottom: 24px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.required-star {
  color: #ef4444;
  margin-left: 2px;
}

.input-hint {
  font-weight: 400;
  color: #9ca3af;
  margin-left: 4px;
}

.input-wrapper {
  position: relative;
}

.modern-input {
  width: 100%;
  padding: 16px 50px 16px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  background: #fafafa;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.modern-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Modern Button */
.modern-button {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.modern-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.modern-button:active {
  transform: translateY(0);
}

.modern-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Success State Modern */
.success-state-modern {
  display: none;
  margin-top: 24px;
}

.success-state-modern.show {
  display: block;
}

.success-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #22c55e;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

.success-icon-large {
  background: white;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.2);
}

.success-card h3 {
  color: #15803d;
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 700;
}

.success-details {
  margin-bottom: 24px;
}

.success-details p {
  color: #374151;
  font-size: 16px;
  line-height: 1.6;
  margin: 8px 0;
}

.success-features {
  display: grid;
  gap: 12px;

/* === CSS FIX: Modal Input Fields Not Showing Text === */
/* Force visibility for modern-input fields with values set by JavaScript */
#editModal .modern-input,
.modal .modern-input,
input.modern-input,
input[id*="edit"].modern-input {
    color: #000000 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-indent: 0 !important;
    text-align: left !important;
    font-size: 14px !important;
    font-weight: normal !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #000000 !important;
    height: auto !important;
    min-height: 40px !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    clip: auto !important;
    clip-path: none !important;
}

#editModal .modern-input:focus,
.modal .modern-input:focus,
input.modern-input:focus,
input[id*="edit"].modern-input:focus {
    color: #000000 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #000000 !important;
}

/* === SPECIFIC FIX: Force visibility for problematic fields === */
/* Fix parent containers */
#editModal .modern-form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    height: auto !important;
    min-height: auto !important;
    width: 100% !important;
    overflow: visible !important;
    flex: 1 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

/* Fix the input fields themselves */
#editNisn, #editNoPeserta, #editNamaPeserta, #editNamaOrtu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 40px !important;
    width: 100% !important;
    position: relative !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 1px solid #ddd !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: normal !important;
    z-index: 1 !important;
    flex: none !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* === EMERGENCY FIX: Force specific fields to use working class styling === */
#editNisn, #editNoPeserta, #editNamaPeserta, #editNamaOrtu {
    /* Copy exact styling from working editNis field */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 40px !important;
    max-height: none !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 12px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: #000000 !important;
    text-indent: 0 !important;
    line-height: normal !important;
    transition: border-color 0.2s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    vertical-align: baseline !important;
    z-index: 999 !important;
    -webkit-text-fill-color: #000000 !important;
}
  max-width: 300px;
  margin: 0 auto;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feature-item span {
  color: #374151;
  font-weight: 500;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .aktivasi-modern-container {
    padding: 16px;
    gap: 16px;
  }

  .pro-status-card,
  .activation-card {
    border-radius: 12px;
  }

  .card-header,
  .card-body {
    padding: 20px;
  }

  .success-card {
    padding: 24px;
  }
}


/* ===== E-IJAZAH LOGO STYLING ===== */
.e-ijazah-logo-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.e-ijazah-logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text h1 {
    font-family: "Poppins", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a73e8;
    margin: 0;
    letter-spacing: 1px;
}

.logo-text p {
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin: 2px 0 0 0;
    letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-wrapper {
        gap: 12px;
    }
    
    .e-ijazah-logo {
        height: 40px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .logo-text p {
        font-size: 11px;
    }
    
    .e-ijazah-logo-container {
        padding: 12px 16px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .logo-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .e-ijazah-logo {
        height: 36px;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .logo-text p {
        font-size: 10px;
    }
}


/* Khusus untuk tombol Tempel di input-wrap */
.input-wrap .btn-ghost {
  appearance: none;
  border: 1px solid #e8ecf4;
  background: #f8fafc;
  color: #667eea;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  white-space: nowrap;
  min-width: auto;
  width: auto;
  flex-shrink: 0;
  max-width: 80px;
}

.input-wrap .btn-ghost:hover {
  border-color: #667eea;
  background: #667eea;
  color: white;
}


/* Pastikan form dan container menggunakan full width */
.login-form {
  display: grid;
  gap: 20px;
  width: 100%;
}

.login-form .input-wrap {
  width: 100% !important;
  max-width: none !important;
}

.input-wrap .input-icon {
  align-self: center;
  justify-self: center;
}

/* Pastikan tidak ada styling yang membatasi lebar input */
#appCode {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}


/* FORCE FULL WIDTH untuk appCode input */
.login-panel-new #appCode,
.login-form #appCode,
.input-wrap #appCode {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  flex: 1 !important;
  grid-column: auto !important;
}

/* FORCE container input-wrap untuk full width */
.login-panel-new .input-wrap,
.login-form .input-wrap {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 50px 1fr !important;
  align-items: stretch !important;
  gap: 16px !important;
}


/* CSS untuk input-wrap-simple - tanpa icon, full width */
.input-wrap-simple {
  width: 100%;
  border: 2px solid #e8ecf4;
  border-radius: 12px;
  padding: 20px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-height: 70px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.input-wrap-simple:focus-within {
  border-color: #2c5aa0; /* Gunakan warna tema */
  box-shadow: 0 0 0 4px rgba(44, 90, 160, 0.15), 0 6px 20px rgba(0,0,0,0.1);
  background: #ffffff;
  transform: translateY(-1px); /* Subtle lift effect */
}

.input-wrap-simple input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 18px !important;
  color: #2c3e50 !important;
  padding: 0 !important;
  font-weight: 500 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  flex: 1 !important;
}

.input-wrap-simple input::placeholder {
  color: #8aa0c3;
  font-weight: 400;
}


/* UPDATE: Perbesar tinggi textbox */
.input-wrap-simple {
  width: 100% !important;
  border: 2px solid #e8ecf4 !important;
  border-radius: 12px !important;
  padding: 28px 24px !important;
  background: #ffffff !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
  min-height: 90px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
}

.input-wrap-simple input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 20px !important;
  color: #2c3e50 !important;
  padding: 16px 0 !important;
  font-weight: 500 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  flex: 1 !important;
  line-height: 1.4 !important;
  min-height: 32px !important;
}

/* Make K13 curriculum value entry table more compact */
#isiNilaiTable th,
#isiNilaiTable td {
    padding: 4px 3px !important;
    font-size: 0.85em;
    height: 26px;
    min-height: 26px;
    box-sizing: border-box;
}

#isiNilaiTable tr {
    height: auto;
    min-height: 26px;
}

#isiNilaiTable input[type="number"] {
    width: 1.5cm !important;
    padding: 3px !important;
    margin: 0 !important;
}

/* Set column widths based on content length with minimum 66x25 */
#isiNilaiTable {
    table-layout: auto !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

/* Reset all column widths to autofit */
#isiNilaiTable th,
#isiNilaiTable td {
    width: auto !important;
    min-width: 66px !important;
    max-width: none !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* NO column - smaller for numbers */
#isiNilaiTable th:nth-child(1),
#isiNilaiTable td:nth-child(1) {
    width: auto !important;
    min-width: 50px !important;
    max-width: 60px !important;
}

/* Name column - wider for student names */
#isiNilaiTable th:nth-child(2),
#isiNilaiTable td:nth-child(2) {
    width: auto !important;
    min-width: 150px !important;
    max-width: none !important;
    text-align: left !important;
}

/* VALIDATION: Style for invalid input */
#isiNilaiTable input.invalid-input {
    border-color: var(--danger-red);
    background-color: #fff0f0;
}

#isiNilaiTable input[type="number"]::-webkit-outer-spin-button,
#isiNilaiTable input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Fix spacing antara kolom NO IJAZAH dan AKSI pada profil siswa */
#profilSiswaSection .col-ijazah {
    min-width: 180px;
    padding-right: 25px !important; /* Tambah jarak kanan pada kolom NO IJAZAH */
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

#profilSiswaSection .col-aksi {
    min-width: 350px; /* Perbesar dari 280px ke 350px untuk ruang lebih luas */
    width: 350px; /* Set fixed width untuk konsistensi */
    padding-left: 25px !important; /* Tambah jarak kiri pada kolom AKSI */
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

/* Styling untuk sel data di kolom NO IJAZAH */
#profilSiswaSection tbody td.col-ijazah,
#profilSiswaSection tbody tr > td:nth-child(7) {
    padding-right: 25px !important;
    text-align: center;
    font-size: 13px;
    min-width: 180px;
}

/* Styling untuk sel data di kolom AKSI */
#profilSiswaSection tbody td.col-aksi,
#profilSiswaSection tbody tr > td:nth-child(8) {
    padding-left: 25px !important;
    text-align: center;
    min-width: 350px; /* Perbesar dari 280px ke 350px untuk ruang lebih luas */
    width: 350px; /* Set fixed width untuk konsistensi */
    white-space: nowrap; /* Mencegah tombol terpotong ke baris baru */
}

/* Styling untuk tombol-tombol dalam profil siswa - pastikan tidak terpotong */
#profilSiswaSection .btn-small {
    margin: 3px; /* Perbesar jarak antar tombol */
    display: inline-block;
    min-width: 100px; /* Perbesar dari 80px ke 100px untuk menampung teks yang lebih panjang */
    padding: 8px 15px; /* Perbesar padding horizontal dari 12px ke 15px */
    font-size: 13px; /* Perbesar font dari 12px ke 13px */
    font-weight: 500;
    text-align: center;
    border-radius: 5px; /* Perbesar border radius */
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap; /* Mencegah teks terpotong ke baris baru */
}

/* Khusus untuk tombol upload foto yang memiliki teks lebih panjang */
#profilSiswaSection .btn-upload {
    min-width: 110px !important; /* Lebar khusus untuk tombol "Ubah Foto"/"Unggah Foto" */
    padding: 8px 16px !important; /* Padding lebih besar untuk tombol upload */
}

/* Container untuk tombol aksi dalam profil siswa */
#profilSiswaSection .action-cell {
    display: flex;
    flex-wrap: nowrap; /* Jangan wrap ke baris baru */
    justify-content: center;
    align-items: center;
    gap: 8px; /* Perbesar jarak antar tombol dari 4px ke 8px */
    min-width: 350px;
    width: 350px;
}

/* Styling untuk tombol Download Template */
.btn-template {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    color: white !important;
    border: 1px solid #117a8b !important;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.btn-template:hover {
    background: linear-gradient(135deg, #138496, #0f6674) !important;
    border-color: #0f6674 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3) !important;
    color: white !important;
}

.btn-template:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2) !important;
}

.btn-template svg {
    width: 18px;
    height: 18px;
}

/* Styling untuk Statistik Wilayah */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-content h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-content p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    .stats-summary-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-summary-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-content h3 {
        font-size: 24px;
    }
}

/* Rich Text Editor Styles */


/* ===== PENGATURAN AKUN STYLES ===== */

/* Settings Sections */
.settings-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 12px;
}

/* Account Info */
.account-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    font-weight: 600;
    color: #4b5563;
    min-width: 140px;
}

.info-row span {
    color: #1f2937;
    font-weight: 500;
}

/* Password Form */
.password-form {
    max-width: 500px;
}

.password-form .form-group {
    margin-bottom: 20px;
}

.password-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Activity Log */
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.log-time {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.log-action {
    color: #1f2937;
    font-weight: 500;
}

/* Responsive Design untuk Pengaturan */
@media (max-width: 768px) {
    .settings-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-row label {
        min-width: auto;
        font-size: 13px;
    }

    .password-form {
        max-width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .log-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* PRIORITY FIX: Proporsi kolom untuk user biasa yang optimal - NO WRAP TEXT */
#profilSiswaSection table:not(.has-photo-col) th:nth-child(5), /* NAMA PESERTA */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(5) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table:not(.has-photo-col) th:nth-child(6), /* TEMPAT, TANGGAL LAHIR */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(6) {
    width: 180px !important;
    min-width: 180px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table:not(.has-photo-col) th:nth-child(7), /* NAMA ORANG TUA */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(7) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table:not(.has-photo-col) th:nth-child(8), /* NO IJAZAH */
#profilSiswaSection table:not(.has-photo-col) td:nth-child(8) {
    width: 200px !important;
    min-width: 200px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* PRIORITY FIX: Proporsi kolom untuk user PRO - dengan kolom FOTO - NO WRAP TEXT */
#profilSiswaSection table.has-photo-col th:nth-child(5), /* NAMA PESERTA */
#profilSiswaSection table.has-photo-col td:nth-child(5) {
    width: 180px !important;
    min-width: 180px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table.has-photo-col th:nth-child(6), /* TEMPAT, TANGGAL LAHIR */
#profilSiswaSection table.has-photo-col td:nth-child(6) {
    width: 200px !important;
    min-width: 200px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table.has-photo-col th:nth-child(7), /* NAMA ORANG TUA */
#profilSiswaSection table.has-photo-col td:nth-child(7) {
    width: 160px !important;
    min-width: 160px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table.has-photo-col th:nth-child(8), /* FOTO */
#profilSiswaSection table.has-photo-col td:nth-child(8) {
    width: 80px !important;
    min-width: 80px !important;
    text-align: center !important;
}

#profilSiswaSection table.has-photo-col th:nth-child(9), /* NO IJAZAH */
#profilSiswaSection table.has-photo-col td:nth-child(9) {
    width: 220px !important;
    min-width: 220px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#profilSiswaSection table.has-photo-col th:nth-child(10), /* AKSI */
#profilSiswaSection table.has-photo-col td:nth-child(10) {
    width: 350px !important;
    min-width: 350px !important;
    text-align: center !important;
    white-space: nowrap !important;
    padding: 8px 10px !important;
}

/* ===== LOGIN TYPE CARD STYLING ===== */
.login-type-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e3f2fd;
    border-left: 4px solid #2196f3;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2196f3, #64b5f6);
}

.login-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.15);
    border-color: #bbdefb;
}

.login-type-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.login-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border-radius: 12px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.login-type-content {
    flex: 1;
    min-width: 0;
}

.login-type-title {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.login-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
}

.login-type-badge-icon {
    flex-shrink: 0;
}

.login-type-badge.pro {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f57f17;
    border-color: #ffcc02;
    box-shadow: 0 2px 4px rgba(245, 127, 23, 0.2);
}

.login-type-badge.biasa {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    border-color: #90caf9;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.login-type-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
    padding-left: 4px;
    border-left: 2px solid #e3f2fd;
    background: rgba(33, 150, 243, 0.02);
    padding: 8px 12px;
    border-radius: 6px;
}

/* Mobile responsive adjustments - DISABLED: Desktop only app */
/*
@media (max-width: 768px) {
    .login-type-header {
        gap: 12px;
    }

    .login-type-icon {
        width: 36px;
        height: 36px;
    }

    .login-type-title {
        font-size: 0.9rem;
    }

    .login-type-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .login-type-description {
        font-size: 0.8rem;
    }
}
*/
