:root {
    /* Colors - Blue-Reddish (Indigo/Violet) Theme */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-dark: #4f46e5;
    /* Indigo 600 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */
    --secondary: #64748b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;

    /* Text */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Sizes */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius: 12px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --primary-light: #312e81;
    /* Indigo 900 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background 0.3s ease;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    height: 90px;
    /* Taller header */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-bottom: none;
    /* No border in image */
    margin-bottom: 1rem;
}

.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    text-align: center;
}

.logo-icon {
    font-size: 40px;
    /* Big Logo */
    color: var(--warning);
    /* Goldish logo color from image */
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Custom Image Logo instead of Icon if needed, but font awesome used here with style */
.logo-text h1 {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
}

.logo-text span {
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
    /* Padding for buttons container */
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

/* Sidebar Buttons matching image */
.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 8px;
    /* Rounded buttons */
    border-left: none;
    /* Remove previous border style */
}

.nav-item a:hover {
    color: var(--primary);
    background: var(--bg-input);
}

.nav-item.active a {
    color: white;
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    /* Gradient Button */
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.nav-item.active a:hover {
    filter: brightness(1.1);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.user-info h4 {
    font-size: 14px;
    color: var(--text-main);
}

.user-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 99;
}

.header-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.datetime {
    text-align: right;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.datetime .time {
    font-weight: 700;
    font-size: 14px;
}

.datetime .date {
    font-size: 12px;
    color: var(--text-muted);
}

.theme-toggle,
.menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.theme-toggle:hover {
    color: var(--text-main);
    transform: rotate(15deg);
}

.menu-toggle {
    display: none;
}

/* Content Body */
.content-body {
    flex: 1;
    padding: 2rem;
}

/* Animations */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    /* Blue to Reddish Pink Gradient */
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-text h2 {
    margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--border);
}

.icon-bg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-bg.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.icon-bg.purple {
    background: #f3e8ff;
    color: #a855f7;
}

.icon-bg.orange {
    background: #ffedd5;
    color: #f97316;
}

.icon-bg.green {
    background: #d1fae5;
    color: #10b981;
}

.stat-info span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Dashboard Bottom Grid */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    height: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.card-header-simple {
    margin-bottom: 1rem;
}

.card-header-simple h4 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body-centered {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px;
}

.text-muted-light {
    color: #94a3b8;
    font-style: italic;
}

/* Action Items */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-item:hover {
    border-color: var(--primary);
    background: var(--bg-input);
    transform: translateY(-2px);
}

.action-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.green-soft {
    background: #d1fae5;
    color: #10b981;
}

.blue-soft {
    background: #dbeafe;
    color: #3b82f6;
}

.action-text h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.action-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Stat Card Green Border Accent */
.border-green-left {
    position: relative;
    overflow: hidden;
}

.border-green-left::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    /* Not full height */
    bottom: 15%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}


/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
}

input,
select,
textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: filter 0.2s;
}

.btn:hover {
    filter: brightness(0.9);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 5px;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.p-0 {
    padding: 0 !important;
}

.card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bg-gray {
    background-color: #e2e8f0;
    cursor: not-allowed;
}

/* Data Siswa View Styles */
.filter-card {
    padding: 1rem 1.5rem;
}

.filter-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-wrapper {
    flex: 1;
    position: relative;
    min-width: 250px;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    /* Space for icon */
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-selects {
    display: flex;
    gap: 1rem;
}

.form-select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-card);
    cursor: pointer;
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    color: var(--text-main);
}

/* Custom Table */
.custom-table th {
    background-color: var(--bg-input);
    /* Light gray header */
    color: var(--text-muted);
    font-weight: 600;
    text-transform: capitalize;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
}

.custom-table td {
    padding: 1.2rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
    vertical-align: middle;
}

.table-card {
    min-height: 400px;
    /* Ensure height for empty state */
    display: flex;
    flex-direction: column;
}

.table-responsive {
    flex: 1;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon-bg {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    /* Very light gray */
    font-size: 3rem;
}

.empty-icon-bg .x-mark {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2rem;
    background: var(--bg-card);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

/* Footer Info */
.table-footer-info {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-input);
    /* Slight background for footer area like image? Image looks white but distinct */
    background: transparent;
}

@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-selects {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .datetime {
        display: none;
        /* Simplify header on mobile */
    }
}