/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-text: #f8fafc;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Attendance Colors */
    --status-hadir: #10b981;
    --status-hadir-light: #d1fae5;
    --status-sakit: #f59e0b;
    --status-sakit-light: #fef3c7;
    --status-izin: #3b82f6;
    --status-izin-light: #dbeafe;
    --status-alpa: #ef4444;
    --status-alpa-light: #fee2e2;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-all);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

.brand-name {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    transition: var(--transition-all);
}

.menu-item a:hover {
    color: #ffffff;
    background-color: var(--sidebar-active-bg);
    transform: translateX(4px);
}

.menu-item.active a {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.menu-item-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: calc(100% - 280px);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #ffffff;
    box-shadow: var(--shadow-sm);
}

/* Flash Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: var(--status-hadir-light);
    color: #065f46;
    border-left: 4px solid var(--status-hadir);
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Cards & Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-all);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.stat-card.primary::before { background-color: var(--primary); }
.stat-card.hadir::before { background-color: var(--status-hadir); }
.stat-card.sakit::before { background-color: var(--status-sakit); }
.stat-card.izin::before { background-color: var(--status-izin); }
.stat-card.alpa::before { background-color: var(--status-alpa); }

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

.stat-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.primary .stat-icon { background-color: var(--primary-light); color: var(--primary); }
.hadir .stat-icon { background-color: var(--status-hadir-light); color: var(--status-hadir); }
.sakit .stat-icon { background-color: var(--status-sakit-light); color: var(--status-sakit); }
.izin .stat-icon { background-color: var(--status-izin-light); color: var(--status-izin); }
.alpa .stat-icon { background-color: var(--status-alpa-light); color: var(--status-alpa); }

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

/* Sections & Dashboard Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.75rem;
}

.card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-all);
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

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

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-danger {
    background-color: var(--status-alpa);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

th {
    background-color: #f8fafc;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-hadir { background-color: var(--status-hadir-light); color: #065f46; }
.badge-sakit { background-color: var(--status-sakit-light); color: #92400e; }
.badge-izin { background-color: var(--status-izin-light); color: #1e40af; }
.badge-alpa { background-color: var(--status-alpa-light); color: #991b1b; }

/* Forms and Filters */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.875rem;
    background-color: #ffffff;
    outline: none;
    transition: var(--transition-all);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Daily Attendance Logger Grid */
.attendance-grid-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.attendance-row-item {
    display: grid;
    grid-template-columns: 2fr 3fr 2fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem;
    background-color: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-all);
}

.attendance-row-item:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.student-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.student-name {
    font-weight: 600;
    font-size: 1rem;
}

.student-nis {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Custom Radio Button Styling */
.status-selector {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.status-radio {
    position: relative;
    flex: 1;
}

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

.status-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.825rem;
    text-align: center;
    transition: var(--transition-all);
}

.status-label:hover {
    background-color: #f1f5f9;
}

/* Radio Checked Styles */
.status-radio.hadir input[type="radio"]:checked + .status-label {
    background-color: var(--status-hadir);
    color: white;
    border-color: var(--status-hadir);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25);
}

.status-radio.sakit input[type="radio"]:checked + .status-label {
    background-color: var(--status-sakit);
    color: white;
    border-color: var(--status-sakit);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.25);
}

.status-radio.izin input[type="radio"]:checked + .status-label {
    background-color: var(--status-izin);
    color: white;
    border-color: var(--status-izin);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.25);
}

.status-radio.alpa input[type="radio"]:checked + .status-label {
    background-color: var(--status-alpa);
    color: white;
    border-color: var(--status-alpa);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
}

/* Report Calendar Grid */
.report-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.report-table {
    min-width: 900px;
    border-collapse: collapse;
}

.report-table th, .report-table td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

.report-table th.student-col, .report-table td.student-col {
    text-align: left;
    padding-left: 1rem;
    position: sticky;
    left: 0;
    background-color: #ffffff;
    z-index: 10;
    min-width: 180px;
    font-weight: 600;
}

.report-table th.student-col {
    background-color: #f8fafc;
}

.report-table td.cell-h { background-color: var(--status-hadir-light); color: #065f46; font-weight: 700; }
.report-table td.cell-s { background-color: var(--status-sakit-light); color: #92400e; font-weight: 700; }
.report-table td.cell-i { background-color: var(--status-izin-light); color: #1e40af; font-weight: 700; }
.report-table td.cell-a { background-color: var(--status-alpa-light); color: #991b1b; font-weight: 700; }
.report-table td.cell-empty { color: #cbd5e1; }

.report-table th.summary-col, .report-table td.summary-col {
    background-color: #f8fafc;
    font-weight: 600;
}

.report-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Pagination container */
.pagination-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
        align-items: center;
    }
    
    .brand-name {
        display: none;
    }
    
    .brand {
        margin-bottom: 2rem;
        padding: 0;
    }
    
    .menu-item a {
        justify-content: center;
        padding: 0.75rem;
    }
    
    .menu-item a span:not(.menu-item-icon) {
        display: none;
    }
    
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .attendance-row-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Authentication Page Styles */
.login-container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
                #0f172a;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
    top: -150px;
    left: -150px;
    pointer-events: none;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    pointer-events: none;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
    animation: authFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-brand-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: bold;
    color: white;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.4);
}

.login-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 0.875rem;
}

.login-form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-label {
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 600;
}

.login-input {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    width: 100%;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition-all);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
    background-color: rgba(15, 23, 42, 0.8);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.login-btn-submit {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    width: 100%;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.login-btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-hover), #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.login-error-alert {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--status-alpa);
    color: #fca5a5;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Minimalist Pagination Styling */
.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0 0 0;
    border-top: 1px solid var(--border-color);
}

.pagination-container nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide mobile-specific buttons in desktop */
.pagination-container nav > div:first-child {
    display: none;
}

@media (max-width: 640px) {
    .pagination-container nav {
        flex-direction: column;
        gap: 1rem;
    }
    .pagination-container nav > div:first-child {
        display: flex;
        gap: 0.5rem;
    }
    .pagination-container nav > div:last-child {
        display: none !important;
    }
}

.pagination-container nav > div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Page results description */
.pagination-container nav p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-container nav p span {
    font-weight: 600;
    color: var(--text-main);
}

/* Page numbers wrapper block */
.pagination-container nav span.relative,
.pagination-container nav div.hidden div {
    display: inline-flex;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Pagination Link buttons */
.pagination-container nav a,
.pagination-container nav span[aria-current="page"] > span,
.pagination-container nav span[aria-disabled="true"] > span {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition-all);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-container nav a:last-child,
.pagination-container nav span:last-child > span {
    border-right: none;
}

.pagination-container nav a:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

/* Active Page number state */
.pagination-container nav span[aria-current="page"] > span {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    cursor: default;
}

/* Disabled buttons */
.pagination-container nav span[aria-disabled="true"] > span {
    color: #cbd5e1;
    background-color: #f8fafc;
    cursor: not-allowed;
}

/* Fix default giant SVG icon sizes */
.pagination-container nav svg {
    width: 1rem !important;
    height: 1rem !important;
    display: inline-block;
    vertical-align: middle;
}

/* Tabs Layout for Dashboard Charts */
.tabs-container {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.tabs-headers {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition-all);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px; /* aligns with the border-bottom */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 9999px;
    animation: tabFadeIn 0.3s ease-out;
}

@keyframes tabFadeIn {
    from { transform: scaleX(0); opacity: 0; }
    to { transform: scaleX(1); opacity: 1; }
}

.tab-content {
    width: 100%;
}

.tab-pane {
    display: none;
    animation: chartFadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes chartFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-wrapper {
    min-height: 350px;
    width: 100%;
}

/* Minimalist Icon Button for Rankings Notification */
.btn-icon-notify {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary);
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
}

.btn-icon-notify:hover:not(:disabled) {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.15);
}

.btn-icon-notify:disabled {
    background-color: #f8fafc;
    color: #cbd5e1;
    border: 1px solid var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Sidebar Dropdown Menu (Details/Summary) */
.menu-group {
    display: block;
    width: 100%;
    margin-bottom: 0.25rem;
}

.menu-group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    transition: var(--transition-all);
}

.menu-group-header::-webkit-details-marker {
    display: none;
}

.menu-group-header:hover {
    color: #ffffff;
    background-color: var(--sidebar-active-bg);
}

.menu-group-header-active {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.menu-group-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

details[open] .menu-group-arrow {
    transform: rotate(180deg);
}

.submenu-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 2.25rem;
}

.submenu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-all);
}

.submenu-item a:hover {
    color: #ffffff;
    background-color: var(--sidebar-active-bg);
    transform: translateX(4px);
}

.submenu-item.active a {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 600;
}

/* KPI Card Clickable cursor */
.stat-card:not(.primary) {
    cursor: pointer;
}

/* Modal Popup Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: #ffffff;
    width: 90%;
    max-width: 750px;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-all);
}

.modal-close:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    background-color: #f8fafc;
}

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

.modal-table th, .modal-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

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

.modal-table tr:hover td {
    background-color: #f8fafc;
}

/* Heatmap Kehadiran Calendar Styles */
.heatmap-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.heatmap-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-grid-container {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.heatmap-day {
    aspect-ratio: 1;
    min-height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition-all);
}

.heatmap-day:hover {
    transform: scale(1.08);
    z-index: 5;
    box-shadow: var(--shadow-md);
}

/* Day status color classes */
.day-hadir {
    background-color: var(--status-hadir) !important;
    border-color: var(--status-hadir) !important;
    color: #ffffff !important;
}

.day-terlambat {
    background-color: #eab308 !important; /* yellow-500 */
    border-color: #eab308 !important;
    color: #1e293b !important;
}

.day-sakit {
    background-color: var(--status-sakit) !important;
    border-color: var(--status-sakit) !important;
    color: #ffffff !important;
}

.day-izin {
    background-color: var(--status-izin) !important;
    border-color: var(--status-izin) !important;
    color: #ffffff !important;
}

.day-alpa {
    background-color: var(--status-alpa) !important;
    border-color: var(--status-alpa) !important;
    color: #ffffff !important;
}

.day-padding {
    background-color: #f1f5f9 !important;
    border-color: var(--border-color) !important;
    color: #94a3b8 !important;
    opacity: 0.5;
    cursor: not-allowed;
}

.day-padding:hover {
    transform: none;
    box-shadow: none;
}

.day-empty {
    background-color: #ffffff;
    color: var(--text-muted);
}

/* Tooltip Styles */
.heatmap-day .tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: #1e293b;
    color: #ffffff;
    text-align: left;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    position: absolute;
    z-index: 50;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: var(--shadow-lg);
    font-size: 0.75rem;
    font-weight: 400;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.heatmap-day:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.heatmap-day .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Alignment fixes for tooltips near edges */
.calendar-grid > div:nth-child(7n) .tooltip-text,
.calendar-grid > div:nth-child(7n-1) .tooltip-text {
    left: auto;
    right: 0%;
    transform: translateX(0);
}
.calendar-grid > div:nth-child(7n) .tooltip-text::after,
.calendar-grid > div:nth-child(7n-1) .tooltip-text::after {
    left: auto;
    right: 15px;
    margin-left: 0;
}

.calendar-grid > div:nth-child(7n+1) .tooltip-text,
.calendar-grid > div:nth-child(7n+2) .tooltip-text {
    left: 0%;
    transform: translateX(0);
}
.calendar-grid > div:nth-child(7n+1) .tooltip-text::after,
.calendar-grid > div:nth-child(7n+2) .tooltip-text::after {
    left: 15px;
    margin-left: 0;
}

/* Legend styling */
.heatmap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Detail panel styling */
.detail-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    height: 100%;
}

.detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.detail-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.detail-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.detail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.detail-subject {
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-notes {
    font-size: 0.8rem;
    color: var(--text-muted);
    background-color: var(--bg-primary);
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.35rem;
}

.stats-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

.stat-box-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-box-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}





