/* ============================================
   SIPERAT - MI DDI Tonyaman
   Material Admin Pro Inspired Theme
   ============================================ */

:root {
    /* Admin Theme - Clean White Sidebar */
    --admin-sidebar-bg: #ffffff;
    --admin-sidebar-text: #4a5568;
    --admin-sidebar-active: #5c6bc0;
    --admin-sidebar-hover: #f7f8fc;
    --admin-accent: #5c6bc0;
    --admin-accent-light: #e8eaf6;
    
    /* Guru Theme - Green */
    --guru-sidebar-bg: #065f46;
    --guru-sidebar-text: rgba(255,255,255,0.8);
    --guru-sidebar-active: #34d399;
    --guru-accent: #059669;
    
    /* Common */
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --content-bg: #f5f7fb;
    --card-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.06);
    --card-radius: 10px;
    --text-dark: #1a202c;
    --text-muted: #718096;
    --border-color: #e2e8f0;
}

/* ============ GLOBAL ============ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--content-bg);
    overflow-x: hidden;
    font-size: 14px;
    color: var(--text-dark);
}

a { text-decoration: none; }

/* ============ SIDEBAR BASE ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }

/* Sidebar Header */
.sidebar-header {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.sidebar-logo .logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    padding: 3px;
}

.sidebar-header h6 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Sidebar Section Label */
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 15px 20px 6px;
    opacity: 0.5;
}

/* Sidebar Navigation */
.sidebar-nav { padding: 5px 0; }

.sidebar-nav .nav-link {
    padding: 9px 20px;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 0;
    margin: 1px 0;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 15px;
    opacity: 0.7;
}

.sidebar-nav .nav-link span { flex: 1; }

/* ============ ADMIN SIDEBAR - Green Gradient (selaras dengan Guru) ============ */
.sidebar-admin {
    background: linear-gradient(180deg, #1a4731 0%, #14532d 50%, #0f3d21 100%);
    border-right: none;
}

.sidebar-admin .sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-admin .sidebar-header h6 { color: #fff; }
.sidebar-admin .sidebar-header small { color: rgba(255,255,255,0.6); }

.sidebar-admin .sidebar-section-label { color: rgba(255,255,255,0.4); }

.sidebar-admin .sidebar-logo .logo-img {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-admin .nav-link {
    color: rgba(255,255,255,0.75);
}

.sidebar-admin .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-admin .nav-link.active {
    color: #fff;
    background: rgba(74, 222, 128, 0.15);
    border-right: 3px solid #4ade80;
    font-weight: 600;
}

.sidebar-admin .nav-link.active i { opacity: 1; color: #4ade80; }
.sidebar-admin .nav-link.text-danger { color: #fca5a5 !important; }
.sidebar-admin .nav-link.text-danger:hover { background: rgba(252,165,165,0.1); }

/* ============ GURU SIDEBAR - White with Green Accent ============ */
.sidebar-guru {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 8px rgba(5, 150, 105, 0.06);
}

.sidebar-guru .sidebar-header {
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, rgba(5,150,105,0.04) 0%, rgba(52,211,153,0.06) 100%);
}

.sidebar-guru .sidebar-header h6 { color: #059669; }
.sidebar-guru .sidebar-header small { color: #6b7280; }

.sidebar-guru .sidebar-section-label { color: #9ca3af; }

.sidebar-guru .sidebar-logo .logo-img {
    background: #fff;
    border: 2px solid #d1fae5;
    box-shadow: 0 2px 6px rgba(5,150,105,0.1);
}

.sidebar-guru .nav-link {
    color: #4b5563;
}

.sidebar-guru .nav-link i {
    color: #9ca3af;
}

.sidebar-guru .nav-link:hover {
    color: #059669;
    background: #f0fdf4;
}

.sidebar-guru .nav-link:hover i {
    color: #059669;
}

.sidebar-guru .nav-link.active {
    color: #059669;
    background: linear-gradient(90deg, #ecfdf5 0%, #d1fae5 100%);
    border-right: 3px solid #059669;
    font-weight: 600;
}

.sidebar-guru .nav-link.active i { opacity: 1; color: #059669; }
.sidebar-guru .nav-link.text-danger { color: #dc2626 !important; }
.sidebar-guru .nav-link.text-danger:hover { background: #fef2f2; }

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* ============ NAVBAR - Material Style ============ */
.main-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--navbar-height);
    background: #fff !important;
    border-bottom: 1px solid var(--border-color);
}

.main-navbar .navbar-brand-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

/* ============ CONTENT WRAPPER ============ */
.content-wrapper {
    padding: 24px 28px;
}

.content-header {
    margin-bottom: 24px;
}

.content-header h4 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.content-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 0;
}

/* ============ STAT CARDS - Material Style ============ */
.stat-card-material {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.stat-card-material:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.stat-card-material .stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.stat-card-material .stat-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 500;
}

.stat-card-material .stat-info .stat-change {
    font-size: 11px;
    margin-top: 4px;
}

.stat-card-material .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Stat icon colors */
.stat-icon-blue { background: #e3f2fd; color: #1976d2; }
.stat-icon-green { background: #e8f5e9; color: #388e3c; }
.stat-icon-orange { background: #fff3e0; color: #f57c00; }
.stat-icon-teal { background: #e0f2f1; color: #00897b; }
.stat-icon-purple { background: #ede7f6; color: #5c6bc0; }
.stat-icon-red { background: #fce4ec; color: #e53935; }

/* ============ CARDS ============ */
.card-custom {
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    background: #fff;
}

.card-custom .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-custom .card-header h5,
.card-custom .card-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

.card-custom .card-body { padding: 20px; }

/* ============ INFO BOX (Guru Dashboard) ============ */
.info-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 0;
    transition: all 0.2s;
}

.info-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.info-box-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    margin-right: 14px;
    flex-shrink: 0;
}

.info-box-content .info-box-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 3px;
}

.info-box-content .info-box-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Info box icon colors */
.bg-guru-primary { background: linear-gradient(135deg, #059669, #047857); }
.bg-guru-info { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.bg-guru-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-guru-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* ============ QUICK ACTION CARDS ============ */
.quick-action-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px 10px;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-dark);
}

.quick-action-card:hover {
    border-color: var(--guru-accent);
    background: #ecfdf5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5,150,105,0.12);
    color: var(--guru-accent);
}

.quick-action-card i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.quick-action-card h6 {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
}

/* ============ TABLES ============ */
.table th {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 14px;
    background: #fafbfc;
}

.table td {
    padding: 12px 14px;
    vertical-align: middle;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ============ BADGES ============ */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
}

/* ============ BUTTONS ============ */
.btn {
    font-size: 13px;
    font-weight: 500;
    border-radius: 7px;
    transition: all 0.15s ease;
}

.btn-sm { font-size: 12px; padding: 5px 10px; border-radius: 6px; }

.btn-admin { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-admin:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-guru { background: #059669; border-color: #059669; color: #fff; }
.btn-guru:hover { background: #047857; border-color: #047857; color: #fff; }

/* ============ FORMS ============ */
.form-control, .form-select {
    border-radius: 7px;
    font-size: 13px;
    border-color: var(--border-color);
    padding: 9px 14px;
    transition: all 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}

.form-label {
    font-weight: 600;
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #065f46 0%, #064e3b 50%, #1f2937 100%);
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.login-card .card-body { padding: 40px; }

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* ============ NAV PILLS (Login) ============ */
.nav-pills .nav-link {
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    padding: 10px 16px;
}

.nav-pills .nav-link.active {
    background: #059669;
    color: #fff;
}

/* ============ AVATAR ============ */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show { display: block; }
    .content-wrapper { padding: 16px; }
}

@media (max-width: 575.98px) {
    .stat-card-material .stat-info h3 { font-size: 20px; }
    .content-header h4 { font-size: 18px; }
}

/* ============ PRINT ============ */
@media print {
    .sidebar, .main-navbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
}

/* ============ DATATABLES ============ */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 7px;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 7px;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f8f9fa; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ============ CARD FOOTER LINK ============ */
.card-footer-link {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    border-top: 1px solid var(--border-color);
    transition: all 0.15s;
}

.card-footer-link:hover {
    background: #f0fdf4;
    color: #15803d;
}
