:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #475569;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --border: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #dbeafe 100%);
}

.auth-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

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

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

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

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.25rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: #eff6ff;
    color: var(--primary);
}

/* ===== SIDEBAR DROPDOWN GROUPS ===== */
.nav-group { list-style: none; }

.nav-group-toggle {
    width: 100%;
    background: #2563eb;
    border: none;
    cursor: pointer;
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    border-radius: 8px;
    color: #fff;
    margin: 4px 0;
    transition: opacity 0.15s, transform 0.1s;
    display: block;
}
.nav-group-toggle:hover {
    opacity: 0.88;
    transform: scale(0.98);
}

/* INDIVIDU — red */
.nav-group-individu {
    background: #dc2626;
    border-left: none;
    color: #fff;
}

/* KELOMPOK — amber */
.nav-group-kelompok {
    background: #d97706;
    border-left: none;
    color: #fff;
}

/* MONEV — teal */
.nav-group-monev {
    background: #0d9488;
    border-left: none;
    color: #fff;
}

/* PENGATURAN — slate */
.nav-group-pengaturan {
    background: #475569;
    border-left: none;
    color: #fff;
}

/* Sub-menu items */
.nav-group-items {
    list-style: none;
    padding: 0;
    margin: 0 0 4px 0;
}
.nav-group-items li a {
    display: block;
    padding: 0.48rem 1rem 0.48rem 1.8rem;
    font-size: 0.83rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.nav-group-items li a:hover {
    background: #eff6ff;
    color: var(--primary);
}
.nav-group-items li a.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 2rem;
    background-color: var(--background);
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-main);
}

.page-header .btn {
    width: auto;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.table th, .table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #f8fafc;
}

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

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* Responsive Design Media Queries */
@media screen and (max-width: 768px) {
    /* Make Dashboard Stacked */
    .dashboard-wrapper {
        flex-direction: column;
    }
    
    /* Make Sidebar full width and sticky to top */
    .sidebar {
        width: 100%;
        min-height: auto;
        padding: 1rem;
        box-sizing: border-box;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .sidebar-nav li {
        margin-bottom: 0;
        flex: 1 1 auto;
    }
    
    .sidebar-nav a {
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Main Content adjustments */
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* auth form adjustments */
    .auth-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Form Grids (admin_posko.php / manajemen_akun.php) */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Make sure table is scrollable sideways */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
}

/* Radio Button Cards for Session Selection */
.session-selector {
    display: flex;
    gap: 1rem;
}
.session-selector label {
    flex: 1;
    position: relative;
    cursor: pointer;
}
.session-selector input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.session-selector span {
    display: block;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-muted);
}
/* Hover effect */
.session-selector label:hover span {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Checked States with Different Colors */
.session-selector .siang input[type="radio"]:checked + span {
    border-color: #f59e0b;
    background-color: #fffbeb;
    color: #b45309;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
}
.session-selector .malam input[type="radio"]:checked + span {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

@media screen and (max-width: 768px) {
    .session-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
}
