/* ==========================================================================
   E-SUPERVISI KBM - SD AL-WILDAN ISLAMIC SCHOOL 1 GADING SERPONG
   Modern, Clean, Responsive Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #047857;          /* Emerald Green */
    --primary-hover: #065f46;
    --primary-light: #ecfdf5;
    --primary-border: #a7f3d0;
    
    --secondary: #0f766e;        /* Deep Teal */
    --accent: #d97706;           /* Warm Amber Gold */
    --accent-light: #fffbeb;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-alt: #f1f5f9;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #10b981;
    
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: #064e3b; /* Islamic Deep Emerald */
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    background: #10b981;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.sidebar-title h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-title span {
    font-size: 11px;
    color: #a7f3d0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-profile {
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-name {
    font-weight: 600;
    font-size: 13.5px;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 11px;
    color: #34d399;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-category {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6ee7b7;
    margin: 14px 10px 6px 10px;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #d1fae5;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(3px);
}

.nav-link.active {
    background: #10b981;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11.5px;
    color: #a7f3d0;
    text-align: center;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-toggle-menu {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
}

.page-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Page Content */
.content-body {
    padding: 28px;
    flex: 1;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

/* Stat Cards Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-primary::after { background: var(--primary); }
.stat-success::after { background: var(--success); }
.stat-warning::after { background: var(--warning); }
.stat-info::after { background: var(--info); }

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

.stat-primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-info .stat-icon { background: var(--info-bg); color: var(--info); }

.stat-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 14px 18px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

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

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: #065f46; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger { background: var(--danger-bg); color: #991b1b; }
.badge-info { background: var(--info-bg); color: #1e40af; }
.badge-slate { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(4, 120, 87, 0.25);
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-secondary {
    background: #0f172a;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #1e293b;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 13.5px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-main);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filter-item {
    flex: 1;
    min-width: 180px;
}

/* Rubric Styles */
.rubric-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.rubric-section-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rubric-section-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rubric-item {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.rubric-item:last-child {
    border-bottom: none;
}

.rubric-desc {
    flex: 1;
    font-size: 13.5px;
    color: #1e293b;
    line-height: 1.45;
}

.rubric-score-options {
    display: flex;
    gap: 8px;
    align-items: center;
}

.score-pill {
    position: relative;
}

.score-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.score-pill label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: #ffffff;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.score-pill label:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

.score-pill input[type="radio"]:checked + label {
    background: #047857;
    border-color: #047857;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(4, 120, 87, 0.25);
    transform: scale(1.05);
}

/* Floating Sticky Score Bar */
.sticky-score-bar {
    position: sticky;
    bottom: 20px;
    background: #064e3b;
    color: #ffffff;
    padding: 16px 28px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-xl);
    z-index: 30;
    margin-top: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.score-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.score-stat-box {
    text-align: center;
}

.score-stat-val {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.score-stat-lbl {
    font-size: 11px;
    color: #a7f3d0;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Print Styles */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .sidebar, .topbar, .filter-bar, .sticky-score-bar, .no-print, .btn {
        display: none !important;
    }
    .content-body {
        padding: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        bottom: 0;
    }
    .sidebar.open {
        left: 0;
    }
    .btn-toggle-menu {
        display: block;
    }
    .content-body {
        padding: 18px;
    }
    .topbar {
        padding: 0 18px;
    }
}
