:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --border-radius: 1rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    /* Soft, multi-layered professional shadows - REFINED */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --sidebar-width: 280px;
    --header-height: 72px;
}

/* Base UI Adjustments */
body:has(.wrapper) {
    background: #f1f5f9;
    /* Slightly darker background for contrast */
}

/* Professional / Enterprise UI Classes */
.card-pro {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    /* Lighter border */
    box-shadow: var(--shadow-sm) !important;
    border-radius: 0.75rem !important;
    /* Slightly smaller radius for cleaner look */
    transition: all 0.2s ease-in-out !important;
}

.card-pro:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px);
}

/* ... Gradients remain the same ... */
.bg-pro-indigo {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

.bg-pro-sky {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.bg-pro-emerald {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.btn-soft {
    background: #ffffff !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: var(--shadow-sm) !important;
    font-weight: 600 !important;
}

.btn-soft:hover {
    background: #f8fafc !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

/* Badge Precision */
.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    /* Sharper corners */
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
}

/* ... Badge colors remain ... */
.badge-pro-success {
    background: #ecfdf5;
    color: #059669;
    border-color: #d1fae5;
}

.badge-pro-info {
    background: #f0f9ff;
    color: #0284c7;
    border-color: #e0f2fe;
}

.badge-pro-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}

.badge-pro-warning {
    background: #fffbeb;
    color: #d97706;
    border-color: #fef3c7;
}

/* Table Precision - REFINED */
.table-pro th {
    background: #f8fafc !important;
    /* Very subtle grey */
    padding: 1rem 1.25rem !important;
    /* Reduced padding */
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
}

.table-pro td {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
    color: #334155;
    font-size: 0.875rem;
}

.table-pro tr:last-child td {
    border-bottom: none !important;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-toggle-sidebar,
.btn-close-sidebar {
    display: none;
}

.brand-title {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.menu-label {
    padding: 1rem 1rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-bottom: 0.5rem;
    border-radius: 0.75rem;
}

.menu-item:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.menu-item.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.menu-item ion-icon {
    font-size: 1.4rem;
}

.logout-link {
    color: var(--danger-color);
    margin-top: 2rem;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #dc2626;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Top Navbar */
.top-navbar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
    justify-content: space-between;
}

/* Hide Navbar on Desktop as requested */
@media (min-width: 992px) {
    .top-navbar {
        display: none !important;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 99px;
    background: #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover {
    background: #e2e8f0;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stat Cards Premium */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

/* Forms */
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control {
    display: block;
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    color: #1e293b;
}

.form-control:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Buttons */
.btn {
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    letter-spacing: 0.01em;
    transform: translateY(0);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 4px 12px var(--primary-glow);
    border: none;
    color: white !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #3730a3);
    box-shadow: 0 6px 16px var(--primary-glow);
    color: white !important;
}

/* Tables Custom */
.table th {
    background: #f8fafc;
    padding: 1.25rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.table td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Leader Specific (Ketua Kelas) */
.student-choice-card {
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.status-option input:checked+.badge {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideIn 0.4s ease-out forwards;
}

/* Mobile Responsive Premium */
@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        max-width: 300px;
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .btn-toggle-sidebar {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        color: #64748b;
        font-size: 1.5rem;
    }

    .btn-close-sidebar {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        color: #475569;
        font-size: 1.25rem;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 95;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .top-navbar {
        padding: 0 1.25rem;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-profile span {
        display: none;
    }
}

/* Dashboard Redesign 2026 */
/* Dashboard Redesign 2026 */
.hero-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
    z-index: 0;
}

.stat-card-glass {
    position: relative;
    overflow: hidden;
    border: none !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-card-glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.bg-pro-indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
    color: white !important;
}

.bg-pro-emerald {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: white !important;
}

.bg-pro-sky {
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%) !important;
    color: white !important;
}

.bg-pro-rose {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
    color: white !important;
}

.icon-box-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.quick-action-btn:hover {
    background: #ffffff;
    color: #4f46e5;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
}

.quick-action-btn ion-icon {
    font-size: 1.5rem;
    color: inherit;
    transition: transform 0.2s ease;
}

.quick-action-btn:hover ion-icon {
    transform: scale(1.1);
}

.live-feed-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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


/* Utils */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
    display: block;
}

/* Ensure tables inside behave */
.table-responsive table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {

    /* Dashboard 2.0 Mobile */
    .dashboard-container .card {
        padding: 1.25rem !important;
    }

    .dashboard-container h1 {
        font-size: 1.25rem !important;
    }

    .charts-section,
    .dashboard-container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .dashboard-container .card[style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .dashboard-container .card[style*="justify-content: space-between"]>div[style*="display: flex"] {
        width: 100%;
        justify-content: space-between;
    }
}