/* Custom Styles for Sistem Pengelolaan Nilai Sekolah */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #06b6d4;
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
}

* { font-family: 'Inter', sans-serif; }

body {
    background-color: #f1f5f9;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    color: #fff;
    z-index: 900;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-brand img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.sidebar-brand h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.sidebar-brand small {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

.sidebar-menu { padding: 15px 0; }

.menu-header {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 2px 10px;
    border-radius: 0 8px 8px 0;
}

.menu-item:hover, .menu-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--secondary-color);
}

.menu-item i {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.menu-item span { font-size: 14px; font-weight: 500; }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* Make sure content area has proper spacing and is not overlapped */
.content-area {
    padding: 25px;
    position: relative;
    z-index: 1;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 950;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 22px;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
}

.toggle-sidebar:hover { color: var(--primary-color); }

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

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.notification-btn:hover { background: #f1f5f9; color: var(--primary-color); }

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 10px;
    transition: all 0.2s;
}

.user-dropdown:hover { background: #f1f5f9; }

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.user-info { text-align: left; }
.user-info .name { font-size: 14px; font-weight: 600; color: #1e293b; }
.user-info .role { font-size: 12px; color: #64748b; }

/* Content Area */
.content-area { padding: 25px; }

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s;
    height: 100%;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
}

.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #d1fae5; color: #10b981; }
.stat-icon.orange { background: #ffedd5; color: #f97316; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-icon.red { background: #fee2e2; color: #ef4444; }
.stat-icon.cyan { background: #cffafe; color: #06b6d4; }

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

.stat-label {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
    font-weight: 500;
}

/* Content Card */
.content-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

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

.content-card-header h5 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.content-card-body { padding: 24px; }

/* Tables */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

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

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

/* Buttons */
.btn-action {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary-custom {
    background: var(--primary-color);
    color: #fff;
}
.btn-primary-custom:hover { background: var(--primary-dark); color: #fff; }

.btn-success-custom {
    background: var(--secondary-color);
    color: #fff;
}
.btn-success-custom:hover { background: #059669; color: #fff; }

.btn-warning-custom {
    background: #f59e0b;
    color: #fff;
}
.btn-warning-custom:hover { background: #d97706; color: #fff; }

.btn-danger-custom {
    background: #ef4444;
    color: #fff;
}
.btn-danger-custom:hover { background: #dc2626; color: #fff; }

.btn-info-custom {
    background: #06b6d4;
    color: #fff;
}
.btn-info-custom:hover { background: #0891b2; color: #fff; }

/* Badges */
.badge-custom {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #ffedd5; color: #c2410c; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #cffafe; color: #0891b2; }
.badge-primary { background: #dbeafe; color: #2563eb; }
.badge-secondary { background: #f1f5f9; color: #64748b; }

/* Progress Bar */
.progress-modern {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-modern .progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Form */
.form-control-modern {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label-modern {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

/* Breadcrumb */
.breadcrumb-modern {
    background: none;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-modern .breadcrumb-item {
    font-size: 13px;
    color: #64748b;
}

.breadcrumb-modern .breadcrumb-item.active { color: #1e293b; font-weight: 600; }

/* Alert */
.alert-modern {
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-modern i { font-size: 20px; }

/* Print Styles */
@media print {
    .sidebar, .top-header, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    .content-card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* Dark Mode */
[data-bs-theme="dark"] {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
}

[data-bs-theme="dark"] body { background-color: #0f172a; }
[data-bs-theme="dark"] .top-header { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .content-card { background: #1e293b; }
[data-bs-theme="dark"] .table-modern thead th { background: #0f172a; color: #94a3b8; border-color: #334155; }
[data-bs-theme="dark"] .table-modern tbody td { color: #cbd5e1; border-color: #334155; }
[data-bs-theme="dark"] .table-modern tbody tr:hover { background: #0f172a; }
[data-bs-theme="dark"] .user-info .name { color: #f1f5f9; }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { 
        transform: translateX(0); 
        z-index: 950;
    }
    .main-content { margin-left: 0 !important; }
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 949;
        display: none;
    }
    .sidebar-overlay.show { display: block; }
}

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

.animate-fade-in { animation: fadeIn 0.4s ease; }

/* QR Code area */
.qr-area {
    width: 100px;
    height: 100px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #94a3b8;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
}

.login-brand {
    background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
    padding: 40px 30px;
    text-align: center;
    color: #fff;
}

.login-brand i {
    font-size: 60px;
    margin-bottom: 15px;
}

.login-brand h3 {
    font-weight: 700;
    margin: 0;
}

.login-brand small {
    opacity: 0.9;
}

.login-body { padding: 40px 35px; }

