/* ==========================================
   SCHOOL ADMIN DASHBOARD - STYLES
   SIBLINK School Management Dashboard
   ========================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F3F4F6;
    color: #374151;
    line-height: 1.5;
}

/* ==========================================
   LOGIN SCREEN
   ========================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 50%, #1E3A8A 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #2563EB, #1E40AF);
    color: white;
    padding: 40px 32px;
    text-align: center;
}

.login-logo {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    padding: 32px;
}

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

.login-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.login-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
}

.login-error {
    color: #DC2626;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
}

/* ==========================================
   APP LAYOUT
   ========================================== */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2563EB 0%, #1E40AF 100%);
    color: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

.nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 4px;
    margin-bottom: 2px;
}

.nav-group-icon {
    font-size: 14px;
}

.nav-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.5);
}

.nav-group-bottom {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Settings tab content */
.settings-tab-content {
    /* same as spp-tab-content */
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.school-info {
    margin-bottom: 12px;
}

.school-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: white;
    margin-bottom: 4px;
}

.school-code {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-family: monospace;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FCD34D;
}

.status-dot.connected {
    background: #10B981;
}

.status-dot.error {
    background: #EF4444;
}

.status-dot.offline {
    background: #F59E0B;
    animation: pulse-offline 2s infinite;
}

@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.btn-logout {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-width: 0;
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.subtitle {
    color: #6B7280;
    font-size: 14px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #2563EB, #1E40AF);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: #F3F4F6;
    color: #374151;
}

.btn-secondary:hover {
    background: #E5E7EB;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #D97706, #B45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-warning:disabled {
    background: #9CA3AF;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: white;
    color: #3B82F6;
    border: 1px solid #3B82F6;
}

.btn-outline:hover {
    background: #EFF6FF;
}

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

.btn-icon {
    padding: 8px;
    border-radius: 8px;
    background: transparent;
}

.btn-icon:hover {
    background: #F3F4F6;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.card-subtitle {
    font-size: 14px;
    color: #6B7280;
}

.card-body {
    padding: 24px;
}

/* Stats Cards (legacy) */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border-radius: 12px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.stat-label {
    font-size: 14px;
    color: #6B7280;
}

/* ==========================================
   DASHBOARD SUMMARY ROW (Symmetric Design)
   ========================================== */

.dashboard-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Left: 2x2 Stats Grid */
.stats-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card-compact {
    background: white;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stat-icon-compact {
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 10px;
}

.stat-info-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value-compact {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.stat-label-compact {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
}

.stat-detail-compact {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
}

/* Center & Right: Dashboard Pie Cards */
.dashboard-pie-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.dashboard-pie-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.dashboard-pie-icon {
    font-size: 20px;
}

.dashboard-pie-title {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
}

.dashboard-pie-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.dashboard-pie-chart {
    width: 140px;
    height: 140px;
    margin-bottom: 16px;
}

.dashboard-pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #374151;
    padding: 6px 10px;
    background: #F9FAFB;
    border-radius: 8px;
}

.pie-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pie-legend-value {
    font-weight: 600;
    margin-left: auto;
    font-size: 14px;
}

/* Clickable Cards */
.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.clickable-card:active {
    transform: translateY(-1px);
}

/* SPP Dashboard Cards */
.spp-dash-card {
    position: relative !important;
    transition: transform 0.15s, box-shadow 0.15s;
}

.spp-dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Trend Range Buttons */
.trend-range-btn {
    background: #fff;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.trend-range-btn:hover {
    background: #F3F4F6;
    color: #374151;
}

.trend-range-active {
    background: #1D4ED8 !important;
    color: #fff !important;
}

/* Dashboard Detail Modal */
.dashboard-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.dashboard-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.dashboard-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-modal-icon {
    font-size: 28px;
}

.dashboard-modal-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
}

.dashboard-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #F3F4F6;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.2s;
}

.dashboard-modal-close:hover {
    background: #E5E7EB;
    color: #1F2937;
}

.dashboard-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.dashboard-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: flex-end;
}

/* Modal Content Styles */
.modal-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.modal-stat-item {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.modal-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1;
}

.modal-stat-label {
    font-size: 13px;
    color: #6B7280;
    margin-top: 6px;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 10px;
    margin-bottom: 8px;
}

.modal-list-item:last-child {
    margin-bottom: 0;
}

.modal-list-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.modal-list-name {
    font-weight: 500;
    color: #1F2937;
}

.modal-list-subtitle {
    font-size: 12px;
    color: #6B7280;
}

.modal-list-value {
    font-weight: 600;
    color: #10B981;
}

.modal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
}

.modal-section-title:first-child {
    margin-top: 0;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.modal-badge.success {
    background: #D1FAE5;
    color: #065F46;
}

.modal-badge.warning {
    background: #FEF3C7;
    color: #92400E;
}

.modal-badge.danger {
    background: #FEE2E2;
    color: #991B1B;
}

.modal-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6B7280;
}

.modal-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Not Completed List - Tab sections */
.not-completed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
}

.not-completed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    min-width: 180px;
}

.not-completed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #FEE2E2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.not-completed-info {
    flex: 1;
}

.not-completed-name {
    font-weight: 500;
    color: #991B1B;
    font-size: 14px;
}

.not-completed-grade {
    font-size: 12px;
    color: #DC2626;
}

.not-completed-empty {
    width: 100%;
    text-align: center;
    padding: 24px;
    color: #059669;
    background: #D1FAE5;
    border-radius: 10px;
}

.not-completed-summary {
    width: 100%;
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.not-completed-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.not-completed-stat.completed {
    background: #D1FAE5;
    color: #059669;
}

.not-completed-stat.not-completed {
    background: #FEE2E2;
    color: #DC2626;
}

.not-completed-stat strong {
    font-size: 18px;
    font-weight: 700;
}

/* Trending Charts Grid */
.trending-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* Dashboard Summary Responsive */
@media (max-width: 1100px) {
    .dashboard-summary-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .stats-grid-2x2 {
        grid-column: span 2;
        grid-template-columns: repeat(4, 1fr);
    }

    .trending-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-charts-grid .chart-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard-summary-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-grid-2x2 {
        grid-column: span 1;
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-charts-grid {
        grid-template-columns: 1fr;
    }

    .trending-charts-grid .chart-card:last-child {
        grid-column: span 1;
    }
}

/* Dashboard Summary Responsive */
@media (max-width: 1100px) {
    .dashboard-summary-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .stats-cards-vertical {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .stat-card-mini {
        flex: 1;
        min-width: 140px;
    }

    .completion-rate-card {
        grid-column: span 2;
        flex-direction: row;
        justify-content: center;
        gap: 24px;
    }

    .completion-rate-desc {
        margin: 0;
    }

    .trending-charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-charts-grid .chart-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard-summary-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-cards-vertical {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .pie-chart-content {
        flex-direction: column;
        gap: 20px;
    }

    .pie-chart-legend {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    .completion-rate-card {
        grid-column: span 1;
        flex-direction: column;
    }

    .trending-charts-grid {
        grid-template-columns: 1fr;
    }

    .trending-charts-grid .chart-card:last-child {
        grid-column: span 1;
    }
}

/* ==========================================
   TABLES
   ========================================== */
.table-container {
    background: white;
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card .table-container {
    box-shadow: none;
    border-radius: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
    vertical-align: middle;
}

.data-table th {
    background: #F9FAFB;
    font-weight: 600;
    color: #6B7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #F9FAFB;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   FILTERS
   ========================================== */
.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #2563EB;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group select {
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.filter-group select:focus {
    outline: none;
    border-color: #2563EB;
}

/* ==========================================
   BADGES
   ========================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.linked,
.status-badge.active {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.inactive {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.graduated {
    background: #DBEAFE;
    color: #1E40AF;
}

.grade-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #EFF6FF;
    color: #2563EB;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.invite-code {
    font-family: monospace;
    font-size: 13px;
    background: #F3F4F6;
    padding: 4px 8px;
    border-radius: 6px;
    color: #374151;
}

/* ==========================================
   SECTION TABS
   ========================================== */
.section-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: white;
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6B7280;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #F3F4F6;
    color: #374151;
}

.tab-btn.active {
    background: #DBEAFE;
    color: #2563EB;
}

/* ==========================================
   FORMS
   ========================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563EB;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: #F9FAFB;
    color: #6B7280;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-hint {
    display: block;
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563EB;
}

.days-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.days-checkboxes .checkbox-label {
    background: #F3F4F6;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.days-checkboxes .checkbox-label:has(input:checked) {
    background: #DBEAFE;
    color: #2563EB;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    background: #F3F4F6;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.radio-label:hover {
    background: #E5E7EB;
}

.radio-label:has(input:checked) {
    background: #DBEAFE;
    border-color: #2563EB;
    color: #2563EB;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-label span {
    font-weight: 500;
}

/* Form Hint */
.form-hint {
    font-size: 12px;
    color: #6B7280;
    margin-top: 6px;
    font-style: italic;
}

/* Code Display */
.code-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F3F4F6;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 16px;
    font-weight: 600;
}

.code-display span {
    flex: 1;
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex !important;
}

.modal {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal.modal-small {
    max-width: 450px;
}

.modal.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #E5E7EB;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: #EF4444;
    color: white;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-body p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #374151;
    font-size: 15px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body p strong {
    color: #111827;
    font-weight: 600;
}

.modal-body p.text-muted {
    color: #6B7280;
    font-size: 14px;
    margin-top: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
    flex-shrink: 0;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

/* ==========================================
   LOADING & EMPTY STATES
   ========================================== */
.loading-cell {
    text-align: center;
    padding: 48px !important;
    color: #6B7280;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E5E7EB;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

.empty-state {
    text-align: center;
    padding: 64px 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p {
    color: #6B7280;
    font-size: 14px;
}

/* ==========================================
   TOAST
   ========================================== */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: #374151;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 999999;
    font-size: 15px;
    font-weight: 500;
    max-width: 420px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #059669;
}

.toast.error {
    background: #DC2626;
}

.toast.warning {
    background: #D97706;
}

/* Offline payment banner */
.offline-banner {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    color: #92400E;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pending payment badge */
.pending-badge {
    background: #F59E0B;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

.toast-icon {
    font-size: 20px;
}

/* ==========================================
   SETTINGS PAGE
   ========================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.bulk-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 12px;
    margin-bottom: 12px;
}

.bulk-action-item:last-child {
    margin-bottom: 0;
}

.bulk-action-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.bulk-action-info p {
    font-size: 13px;
    color: #6B7280;
}

/* ==========================================
   STUDENT DETAIL
   ========================================== */
.student-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.student-detail-info h3,
.student-detail-stats h3,
.student-detail-activities h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
}

.detail-item {
    display: flex;
    margin-bottom: 12px;
}

.detail-label {
    font-weight: 500;
    color: #6B7280;
    width: 100px;
    flex-shrink: 0;
}

.mini-stats {
    display: flex;
    gap: 16px;
}

.mini-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 12px;
}

.mini-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #2563EB;
    margin-bottom: 4px;
}

.mini-stat-label {
    font-size: 12px;
    color: #6B7280;
}

/* ==========================================
   PREVIEW BOX
   ========================================== */
.preview-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.preview-box p {
    color: #6B7280;
    font-size: 14px;
}

/* ==========================================
   ACTION BUTTONS
   ========================================== */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.action-btn.view {
    background: #DBEAFE;
    color: #2563EB;
}

.action-btn.view:hover {
    background: #BFDBFE;
}

.action-btn.edit {
    background: #FEF3C7;
    color: #D97706;
}

.action-btn.edit:hover {
    background: #FDE68A;
}

.action-btn.delete {
    background: #FEE2E2;
    color: #DC2626;
}

.action-btn.delete:hover {
    background: #FECACA;
}

/* ==========================================
   TEXT UTILITIES
   ========================================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6B7280;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 16px;
    }

    .logo-text,
    .nav-item span:not(.nav-icon),
    .school-info,
    .connection-status span:not(.status-dot) {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: 80px;
    }

    .btn-logout span {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-group {
        flex-direction: column;
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    .stats-cards {
        grid-template-columns: 1fr 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .student-detail-grid {
        grid-template-columns: 1fr;
    }

    .section-tabs {
        flex-wrap: wrap;
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        min-width: calc(33.33% - 8px);
        text-align: center;
    }
}

/* ==========================================
   LOGIN TABS & REGISTRATION
   ========================================== */
.login-tabs {
    display: flex;
    border-bottom: 2px solid #E5E7EB;
}

.login-tab {
    flex: 1;
    padding: 16px;
    background: #F9FAFB;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.login-tab:first-child {
    border-top-left-radius: 0;
}

.login-tab:last-child {
    border-top-right-radius: 0;
}

.login-tab:hover {
    background: #F3F4F6;
    color: #374151;
}

.login-tab.active {
    background: white;
    color: #2563EB;
    border-bottom: 2px solid #2563EB;
    margin-bottom: -2px;
}

/* Invite Code Section */
.invite-code-section {
    margin-bottom: 20px;
}

.invite-info-box {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    border: 1px solid #10B981;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.input-hint {
    font-size: 12px;
    color: #6B7280;
    margin-top: 6px;
}

/* Registration Fields Animation */
#registrationFields {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   WALI KELAS LINK STYLES
   ========================================== */
.link-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.link-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 12px;
    background: #F9FAFB;
    color: #374151;
    min-width: 0;
}

.link-input:focus {
    outline: none;
    border-color: #2563EB;
}

/* Responsive adjustments for wali kelas table */
@media (max-width: 768px) {
    .link-input {
        max-width: 150px;
    }
}

/* ==========================================
   SEMESTER-AWARE REPORTING STYLES
   ========================================== */

/* Report Tabs */
.report-tabs {
    display: flex;
    gap: 8px;
    margin: 24px 0 16px 0;
    border-bottom: 2px solid #E5E7EB;
}

.report-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.report-tab:hover {
    color: #1F2937;
    background: #F9FAFB;
}

.report-tab.active {
    color: #10B981;
    border-bottom-color: #10B981;
}

.report-tab-content {
    margin-top: 16px;
}

/* Custom Date Range */
#customDateRange {
    display: flex;
    align-items: center;
}

#customDateRange input {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

#customDateRange input:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399);
    transition: width 0.3s ease;
}

/* Activity Badge */
.activity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-badge.high {
    background: #D1FAE5;
    color: #065F46;
}

.activity-badge.medium {
    background: #FEF3C7;
    color: #92400E;
}

.activity-badge.low {
    background: #FEE2E2;
    color: #991B1B;
}

/* Student Report Modal */
.student-report-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
}

.student-report-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.report-item {
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
}

.report-item-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}

.report-item-value {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
}

/* Modal content wrapper (if needed for specific modals) */
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Responsive Design for Reports */
@media (max-width: 768px) {
    .report-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .report-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 13px;
    }

    .filter-group {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group select,
    .filter-group button {
        width: 100%;
    }

    #customDateRange {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    #customDateRange input {
        width: 100%;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

/* ==========================================
   INFO ICON - Tooltip for explanations
   ========================================== */
.info-icon {
    display: inline-block;
    margin-left: 6px;
    cursor: help;
    font-size: 14px;
    color: #6B7280;
    transition: color 0.2s;
}

.info-icon:hover {
    color: #2563EB;
}

/* Tooltip wrapper */
.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

/* Info icon styling */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
    cursor: help;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.info-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

/* Tooltip text box */
.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 340px;
    background: white;
    color: #1F2937;
    text-align: left;
    border-radius: 12px;
    padding: 16px 20px;
    position: fixed;
    z-index: 99999;
    top: auto;
    left: auto;
    font-size: 14px;
    line-height: 1.8;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    transform: translateY(-10px);
    pointer-events: none;
    white-space: normal;
    border: 2px solid #3B82F6;
}

.tooltip-text strong {
    color: #3B82F6;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.tooltip-text br {
    display: block;
    content: "";
    margin: 4px 0;
}

/* Remove arrow since using fixed positioning */
.tooltip-text::after {
    display: none;
}

/* Show tooltip on hover with better positioning */
.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Position tooltip to the left of the icon */
.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.info-tooltip:hover .tooltip-text {
    /* Position relative to viewport, centered horizontally */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================================
   FULLSCREEN RAPORT MODAL
   ========================================== */
.raport-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    overflow: hidden;
}

.raport-modal-fullscreen {
    width: 100%;
    height: 100%;
    background: #F3F4F6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.raport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: linear-gradient(135deg, #1E40AF, #3B82F6);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.raport-header-left h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.raport-header-left p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.raport-header-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.raport-header-right .btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.raport-header-right .btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.raport-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.raport-close-btn:hover {
    background: #EF4444;
    transform: scale(1.1);
}

.raport-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Raport Sections */
.raport-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.raport-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.raport-section.full-width {
    grid-column: 1 / -1;
}

.raport-section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background: linear-gradient(to bottom, #FAFAFA, #F3F4F6);
}

.raport-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.raport-section-body {
    padding: 20px;
}

/* Student Info Card */
.raport-student-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.raport-info-item {
    text-align: center;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 12px;
}

.raport-info-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}

.raport-info-value {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
}

/* Comparison Stats */
.raport-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.raport-stat-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border: 1px solid #BAE6FD;
}

.raport-stat-card.highlight {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    border-color: #86EFAC;
}

.raport-stat-card.warning {
    background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
    border-color: #FCD34D;
}

.raport-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 4px;
}

.raport-stat-label {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 8px;
}

.raport-stat-comparison {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-block;
}

.raport-stat-comparison.above {
    background: #D1FAE5;
    color: #065F46;
}

.raport-stat-comparison.below {
    background: #FEE2E2;
    color: #991B1B;
}

.raport-stat-comparison.equal {
    background: #E5E7EB;
    color: #374151;
}

/* Chart Container in Raport */
.raport-chart-container {
    height: 250px;
    position: relative;
}

/* Ranking Badge */
.raport-ranking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-radius: 12px;
    margin-top: 16px;
}

.raport-ranking-badge {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.raport-ranking-text h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #92400E;
}

.raport-ranking-text p {
    margin: 0;
    font-size: 13px;
    color: #B45309;
}

/* Forum Link in Raport */
.raport-forum-cta {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    border: 1px solid #86EFAC;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 16px;
}

.raport-forum-cta p {
    margin: 0 0 12px 0;
    color: #166534;
    font-size: 14px;
}

.raport-forum-cta a {
    display: inline-block;
    padding: 10px 24px;
    background: #16A34A;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.raport-forum-cta a:hover {
    background: #15803D;
}

/* Raport Filter Bar */
.raport-filter-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.raport-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.raport-filter-group.raport-filter-right {
    margin-left: auto;
}

.raport-filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.raport-filter-group select,
.raport-filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: #374151;
    cursor: pointer;
}

.raport-filter-group select:focus,
.raport-filter-group input[type="date"]:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.raport-filter-group .btn {
    margin-left: 4px;
}

/* Raport stat detail text */
.raport-stat-detail {
    font-size: 11px;
    color: #6B7280;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .raport-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .raport-filter-group {
        flex-wrap: wrap;
    }

    .raport-filter-group .btn {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
}

/* Print Styles - Single Page Layout */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        margin: 0;
        padding: 0;
    }

    .raport-modal-overlay {
        position: static;
        background: white;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .raport-modal-fullscreen {
        height: auto;
        overflow: visible;
    }

    .raport-header {
        padding: 12px 20px;
        background: #1E40AF !important;
        -webkit-print-color-adjust: exact;
    }

    .raport-header-right {
        display: none !important;
    }

    .raport-close-btn {
        display: none !important;
    }

    .raport-content {
        overflow: visible;
        padding: 12px;
        height: auto;
    }

    .raport-grid {
        gap: 10px;
    }

    .raport-section {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 8px;
    }

    .raport-section-header {
        padding: 8px 12px;
    }

    .raport-section-header h3 {
        font-size: 14px;
    }

    .raport-section-body {
        padding: 10px;
    }

    .raport-student-info {
        gap: 8px;
    }

    .raport-info-item {
        padding: 10px;
    }

    .raport-info-value {
        font-size: 14px;
    }

    .raport-comparison {
        gap: 8px;
    }

    .raport-stat-card {
        padding: 12px;
    }

    .raport-stat-value {
        font-size: 24px;
    }

    .raport-stat-label {
        font-size: 11px;
    }

    .raport-ranking {
        padding: 10px 16px;
        margin-top: 8px;
    }

    .raport-chart-container {
        height: 180px !important;
    }

    .raport-filter-bar {
        display: none !important;
    }

    /* Hide non-essential elements */
    .sidebar,
    .navbar,
    .main-content > *:not(.raport-modal-overlay) {
        display: none !important;
    }

    /* Receipt print: hide everything except receipt area */
    body.printing-receipt > *:not(#receiptPrintArea) {
        display: none !important;
    }
    body.printing-receipt #receiptPrintArea {
        display: block !important;
    }

    @page {
        size: A4;
        margin: 10mm;
    }

    /* Receipt-specific page size */
    body.printing-receipt {
        margin: 0;
        padding: 0;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .raport-grid {
        grid-template-columns: 1fr;
    }

    .raport-student-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .raport-comparison {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .raport-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .raport-header-left {
        text-align: center;
    }

    .raport-content {
        padding: 16px;
    }

    .raport-student-info {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   TRENDING CHARTS SECTION
   ========================================== */
.trending-charts-section {
    margin-bottom: 24px;
}

.chart-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.chart-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-filters .filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.chart-filters .filter-group select {
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #374151;
    min-width: 160px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chart-filters .filter-group select:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chart-filters .filter-group select:hover {
    border-color: #D1D5DB;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.chart-card .card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 4px 0;
}

.chart-card .card-header .subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

.chart-card .card-body {
    padding: 20px 24px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
    border-radius: 8px;
    font-size: 13px;
    color: #166534;
    text-align: center;
}

.forum-link {
    color: #16A34A;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.forum-link:hover {
    color: #15803D;
    text-decoration: underline;
}

/* Chart Loading State */
.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #6B7280;
}

.chart-loading .loading-spinner {
    margin-bottom: 12px;
}

/* Responsive for charts */
@media (max-width: 1280px) {
    .charts-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .chart-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-filters .filter-group {
        flex: 1;
    }

    .chart-filters .filter-group select {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 220px;
    }

    .chart-card .card-header,
    .chart-card .card-body {
        padding: 16px;
    }
}

/* ==========================================
   REMINDER MODAL STYLES
   ========================================== */
.reminder-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border: 1px solid #93C5FD;
    border-radius: 12px;
}

.reminder-info-icon {
    font-size: 28px;
}

.reminder-info-box strong {
    font-size: 20px;
    color: #1D4ED8;
}

.reminder-preview-box {
    padding: 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    margin-top: 12px;
}

.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.radio-label input[type="radio"] {
    accent-color: #3B82F6;
}

/* ==========================================
   SCHEDULED REMINDER STYLES
   ========================================== */
.scheduled-reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scheduled-reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    transition: all 0.2s;
}

.scheduled-reminder-item:hover {
    border-color: #93C5FD;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.scheduled-reminder-item.inactive {
    opacity: 0.6;
    background: #F9FAFB;
}

.scheduled-reminder-info {
    flex: 1;
}

.scheduled-reminder-title {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 4px;
}

.scheduled-reminder-detail {
    font-size: 13px;
    color: #6B7280;
}

.scheduled-reminder-last {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 4px;
}

.scheduled-reminder-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 16px;
}

@media (max-width: 640px) {
    .scheduled-reminder-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .scheduled-reminder-actions {
        margin-left: 0;
        width: 100%;
    }

    .scheduled-reminder-actions .btn {
        flex: 1;
    }
}

/* ==========================================
   SPP MODULE STYLES
   ========================================== */

/* SPP Tab Content */
.spp-tab-content {
    animation: fadeIn 0.2s ease-in-out;
}

/* SPP Status Badges */
.spp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.spp-badge-unpaid {
    background: #F3F4F6;
    color: #374151;
}

.spp-badge-partial {
    background: #FEF3C7;
    color: #92400E;
}

.spp-badge-paid {
    background: #D1FAE5;
    color: #065F46;
}

.spp-badge-overdue {
    background: #FEE2E2;
    color: #991B1B;
}

.spp-badge-cancelled {
    background: #F3F4F6;
    color: #9CA3AF;
    text-decoration: line-through;
}

.spp-badge-waived {
    background: #DBEAFE;
    color: #1E40AF;
}

/* SPP Filters */
.spp-filters select,
.spp-filters input[type="text"],
.spp-filters input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
}

.spp-filters select:focus,
.spp-filters input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button sizes */
.btn-sm {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

/* Icon action buttons */
.action-icons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}
.icon-btn:hover {
    transform: scale(1.1);
}
.icon-btn svg {
    width: 16px;
    height: 16px;
}
.icon-btn.edit { color: #3B82F6; }
.icon-btn.edit:hover { background: #EFF6FF; border-color: #3B82F6; }
.icon-btn.toggle-off { color: #F59E0B; }
.icon-btn.toggle-off:hover { background: #FFFBEB; border-color: #F59E0B; }
.icon-btn.toggle-on { color: #10B981; }
.icon-btn.toggle-on:hover { background: #ECFDF5; border-color: #10B981; }
.icon-btn.delete { color: #EF4444; }
.icon-btn.delete:hover { background: #FEF2F2; border-color: #EF4444; }

.btn-danger {
    background: #EF4444 !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    background: #DC2626 !important;
}

/* Stat detail text */
.stat-detail {
    display: block;
    font-size: 12px;
    color: #6B7280;
    margin-top: 2px;
}

/* SPP Dashboard Chart Grid responsive */
@media (max-width: 900px) {
    #sppDashboardTab > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* RBAC Role badges */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.role-super_admin { background: #FEF3C7; color: #92400E; }
.role-admin { background: #DBEAFE; color: #1E40AF; }
.role-teacher { background: #D1FAE5; color: #065F46; }
.role-viewer { background: #E5E7EB; color: #374151; }

/* RBAC Status badges (prefixed to avoid conflict with student status badges) */
.rbac-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.rbac-status-active { background: #D1FAE5; color: #065F46; }
.rbac-status-inactive { background: #FEE2E2; color: #991B1B; }

/* ==========================================
   RECEIPT / KWITANSI PRINT STYLES
   ========================================== */
#receiptPrintArea {
    display: none;
}

.receipt {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    color: #111;
    line-height: 1.5;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid #111;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.receipt-header-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 4px;
}

.receipt-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipt-header p {
    margin: 2px 0;
    font-size: 11px;
    color: #444;
}

.receipt-title {
    text-align: center;
    margin: 16px 0;
    padding: 8px 0;
    border-top: 1px dashed #999;
    border-bottom: 1px dashed #999;
}

.receipt-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}

.receipt-title .receipt-number {
    margin: 4px 0 0;
    font-size: 12px;
    color: #555;
}

.receipt-student {
    margin-bottom: 12px;
}

.receipt-student p {
    margin: 2px 0;
    font-size: 13px;
}

.receipt-student .label {
    display: inline-block;
    width: 80px;
    color: #555;
}

.receipt-amount-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.receipt-amount-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.receipt-amount-row.total {
    border-top: 1px solid #D1D5DB;
    margin-top: 4px;
    padding-top: 6px;
    font-weight: 700;
}

.receipt-amount-row.paid {
    color: #059669;
}

.receipt-amount-row.remaining {
    font-weight: 700;
}

.receipt-amount-row.discount {
    color: #059669;
}

.receipt-amount-row.surcharge {
    color: #D97706;
}

.receipt-meta {
    margin-bottom: 16px;
}

.receipt-meta p {
    margin: 2px 0;
    font-size: 13px;
}

.receipt-meta .label {
    display: inline-block;
    width: 80px;
    color: #555;
}

.receipt-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.receipt-signature {
    text-align: center;
    min-width: 150px;
}

.receipt-signature .sig-line {
    border-top: 1px solid #111;
    margin-top: 50px;
    padding-top: 4px;
    font-size: 12px;
    font-weight: 600;
}

.receipt-signature .sig-role {
    font-size: 11px;
    color: #555;
}

.receipt-print-date {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px dashed #CCC;
}

.receipt-watermark {
    font-size: 10px;
    color: #CCC;
    text-align: center;
    margin-top: 4px;
}

.receipt-footer-note {
    font-size: 11px;
    color: #555;
    text-align: center;
    margin-top: 12px;
    padding: 8px;
    border-top: 1px dashed #CCC;
    font-style: italic;
}

/* Receipt logo watermark (background) */
.receipt {
    position: relative;
}

.receipt-logo-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.receipt-logo-watermark img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    opacity: 0.06;
    filter: grayscale(100%);
}

.receipt > *:not(.receipt-logo-watermark) {
    position: relative;
    z-index: 1;
}

/* Logo upload area in Settings */
.logo-upload-area {
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-upload-area:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
}

/* ==========================================
   DONASI MODULE STYLES
   ========================================== */

/* Donation name badge in table */
.donasi-name-badge {
    display: inline-block;
    background: #D1FAE5;
    color: #065F46;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Method badge */
.donasi-method-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.donasi-method-cash     { background: #FEF3C7; color: #92400E; }
.donasi-method-transfer { background: #DBEAFE; color: #1E40AF; }
.donasi-method-va       { background: #EDE9FE; color: #5B21B6; }
.donasi-method-other    { background: #F3F4F6; color: #374151; }

/* Donation name card in summary */
.donasi-name-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #F0FDF4;
    border-radius: 8px;
    border: 1px solid #D1FAE5;
}
.donasi-name-card-icon  { font-size: 18px; flex-shrink: 0; }
.donasi-name-card-info  { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.donasi-name-card-label { font-size: 12px; font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donasi-name-card-amount{ font-size: 13px; font-weight: 700; color: #059669; }

/* Method card in summary */
.donasi-method-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}
.donasi-method-icon   { font-size: 16px; flex-shrink: 0; }
.donasi-method-label  { font-size: 12px; color: #374151; flex: 1; font-weight: 500; }
.donasi-method-amount { font-size: 13px; font-weight: 700; color: #1D4ED8; }

/* btn-success */
.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-success:hover { opacity: 0.85; }
