/* Fonts loaded via <link rel="preconnect"> + <link rel="stylesheet"> in each page's <head> */

:root {
    /* Sleek Carbon Dark Theme (ScholarTrack Hub reference) */
    --bg-main: #0b0c10;
    --bg-card: #13151a;
    --bg-card-hover: #191b22;
    --sidebar-bg: #08090d;
    --border-color: rgba(255, 255, 255, 0.05);
    
    /* Neon Glow Accent Colors */
    --border-glow-blue: rgba(59, 130, 246, 0.35);
    --border-glow-purple: rgba(139, 92, 246, 0.35);
    
    --text-primary: #ffffff;
    --text-secondary: #8a8f98;
    --text-muted: #54575f;
    
    /* Core Gradients & Colors */
    --purple: #8b5cf6;
    --indigo: #6366f1;
    --blue: #2563eb;
    --primary-gradient: linear-gradient(135deg, #2563eb, #6366f1);
    --primary-gradient-hover: linear-gradient(135deg, #3b82f6, #4f46e5);
    
    /* Status Colors (ScholarTrack Style Pills) */
    --hadir: #10b981;
    --hadir-bg: rgba(16, 185, 129, 0.12);
    --sakit: #a855f7;
    --sakit-bg: rgba(168, 85, 247, 0.12);
    --izin: #eab308;
    --izin-bg: rgba(234, 179, 8, 0.12);
    --terlambat: #f97316;
    --terlambat-bg: rgba(249, 115, 22, 0.12);
    --alpha: #ef4444;
    --alpha-bg: rgba(239, 68, 68, 0.12);
    
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
    --glass-blur: blur(20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #1f222b;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--blue);
}

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

/* Sidebar Styling - Solid Slate Black */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 30px 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1d193d 0%, #2f103d 100%);
    border: 1.5px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px; /* Stylish square-ish with rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: #c084fc; /* Violet purple text */
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

.brand-text h2 {
    font-size: 15px;
    letter-spacing: 0.5px;
    color: #fff;
    font-weight: 700;
}

.brand-text span {
    font-size: 10px;
    color: var(--text-secondary);
}

/* User Profile in Sidebar */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 24px;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    color: #fff;
}

.sidebar-profile-info h4 {
    font-size: 12px;
    color: #fff;
}

.sidebar-profile-info span {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Sidebar Menus - Sleek & Flat */
.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.02);
}

.sidebar-link.active {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Elegant checkmark badge inside active sidebar links (ScholarTrack Hub style) */
.sidebar-link.active::after {
    content: '\f00c'; /* FontAwesome check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    color: #6366f1; /* Matches the active primary blue/purple */
    background: white;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.sidebar-info-cepat {
    margin-top: auto;
    padding: 14px 12px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
    margin-bottom: 12px;
}

.sidebar-info-cepat h5 {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.info-cepat-row {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    margin-bottom: 4px;
}

.info-cepat-row span:first-child {
    color: var(--text-secondary);
}

.info-cepat-row span:last-child {
    font-weight: 600;
    color: #fff;
}

.info-badge-waiting {
    background-color: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
}

/* Topbar Header - ScholarTrack Style */
.main-content {
    flex-grow: 1;
    margin-left: 250px;
    padding: 24px 32px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.topbar-title h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 600;
}

.topbar-title p {
    font-size: 13px;
    color: var(--text-secondary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Live Clock */
.live-clock {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue);
}

/* Search Box in Topbar */
.topbar-search {
    position: relative;
    width: 240px;
}

.topbar-search input {
    background-color: #16181f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    color: #fff;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}

.topbar-search input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.15);
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
}

/* Notification Bell Dropdown */
.notif-wrapper {
    position: relative;
}

.notif-bell {
    width: 38px;
    height: 38px;
    background: #13151a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.notif-bell:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
}

.notif-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 320px;
    background: rgba(19, 21, 26, 0.96);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    display: none;
    z-index: 200;
    overflow: hidden;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.notif-header h4 {
    font-size: 13.5px;
    font-weight: 600;
}

.notif-header span {
    font-size: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    padding: 2px 8px;
    border-radius: 10px;
}

.notif-list {
    max-height: 280px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.notif-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
}

.notif-info {
    flex-grow: 1;
}

.notif-name {
    font-size: 12.5px;
    font-weight: 600;
}

.notif-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 2px 0 6px 0;
    line-height: 1.4;
}

.notif-actions {
    display: flex;
    gap: 6px;
}

.btn-notif {
    padding: 3px 8px;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn-notif-approve {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.btn-notif-reject {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-notif:hover {
    opacity: 0.8;
}

.notif-empty {
    padding: 30px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* User Profile Pill */
.profile-pill {
    background: #13151a;
    border: 1px solid var(--border-color);
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.profile-pill:hover {
    background: var(--bg-card-hover);
}

.profile-pill-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
}

.profile-pill-name {
    font-size: 12px;
    font-weight: 600;
}

/* --- STATS KPI CARDS - Sleek Border Glows --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

/* Elegant full glowing borders on specific cards (ScholarTrack Hub style) */
.stat-card.hadir { border: 1.5px solid rgba(16, 185, 129, 0.25); box-shadow: 0 0 15px rgba(16, 185, 129, 0.04); }
.stat-card.sakit { border: 1.5px solid rgba(168, 85, 247, 0.25); box-shadow: 0 0 15px rgba(168, 85, 247, 0.04); }
.stat-card.izin { border: 1.5px solid rgba(234, 179, 8, 0.25); box-shadow: 0 0 15px rgba(234, 179, 8, 0.04); }
.stat-card.terlambat { border: 1.5px solid rgba(249, 115, 22, 0.25); box-shadow: 0 0 15px rgba(249, 115, 22, 0.04); }
.stat-card.alpha { border: 1.5px solid rgba(239, 68, 68, 0.25); box-shadow: 0 0 15px rgba(239, 68, 68, 0.04); }

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

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.stat-card.hadir .stat-icon { background: var(--hadir-bg); color: var(--hadir); }
.stat-card.sakit .stat-icon { background: var(--sakit-bg); color: var(--sakit); }
.stat-card.izin .stat-icon { background: var(--izin-bg); color: var(--izin); }
.stat-card.terlambat .stat-icon { background: var(--terlambat-bg); color: var(--terlambat); }
.stat-card.alpha .stat-icon { background: var(--alpha-bg); color: var(--alpha); }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-footer.green { color: var(--hadir); }
.stat-footer.red { color: var(--alpha); }

/* --- TWO COLUMN DASHBOARD --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

/* Highlighted Border Glow for Special Config Cards */
.card.highlighted-blue {
    border: 1px solid var(--border-glow-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.08);
}
.card.highlighted-purple {
    border: 1px solid var(--border-glow-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.08);
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: capitalize;
}

/* Charts Wrapper */
.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

/* Donut percentage in center styling */
.donut-percent-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-percentage {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.donut-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Legend items */
.donut-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-val {
    margin-left: auto;
    font-weight: 600;
    color: white;
}

/* Activity Logs List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
}

.activity-body {
    flex-grow: 1;
}

.activity-text {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.activity-text strong {
    color: #fff;
}

.activity-text span.badge-role {
    font-size: 9px;
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.activity-time {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- TABEL DAN FORM DATA (ScholarTrack Premium Grid Style) --- */
.table-responsive {
    overflow-x: auto;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-custom th {
    background: rgba(255, 255, 255, 0.005);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-custom td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table-custom tr:hover td {
    background: rgba(255, 255, 255, 0.008);
    color: white;
}

/* Table Badges - Elegant Capsule Pills (ScholarTrack Hub style) */
.badge-custom {
    padding: 4px 12px;
    border-radius: 20px; /* Modern capsule shape */
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.badge-custom.hadir { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-custom.sakit { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-custom.izin { background: rgba(234, 179, 8, 0.15); color: #fbbf24; }
.badge-custom.terlambat { background: rgba(249, 115, 22, 0.15); color: #fdba74; }
.badge-custom.alpha { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.badge-custom.pending { background: rgba(234, 179, 8, 0.15); color: #fbbf24; }
.badge-custom.approved { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-custom.rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.badge-custom.dibayar { background: rgba(16, 185, 129, 0.15); color: #34d399; }

/* Custom Inputs & Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-custom {
    width: 100%;
    background-color: #16181f;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: white;
    outline: none;
    transition: all 0.2s;
}

.input-custom:focus {
    border-color: var(--blue);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.15);
    background-color: #191b24;
}

.input-custom::placeholder {
    color: var(--text-muted);
}

select.input-custom option {
    background-color: var(--bg-card);
    color: white;
}

/* Button Custom Styles - Sleek Flat Gradients */
.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-custom-primary {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-custom-primary:hover {
    background: #3b82f6;
    transform: translateY(-0.5px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-custom-secondary {
    background: rgba(255, 255, 255, 0.02);
    color: white;
    border: 1px solid var(--border-color);
}

.btn-custom-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-custom-danger {
    background: var(--alpha);
    color: white;
}

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

.btn-custom-success {
    background: var(--hadir);
    color: white;
}

.btn-custom-success:hover {
    background: #059669;
}

.btn-custom-warning {
    background: var(--terlambat);
    color: white;
}

.btn-custom-warning:hover {
    background: #ea580c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11.5px;
    border-radius: 4px;
}

.btn-block {
    width: 100%;
}

/* Quick attendance area (employee dashboard) */
.absen-area {
    background: rgba(255, 255, 255, 0.005);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.absen-status-pill {
    padding: 6px 14px;
    border-radius: 4px;
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Geolocalisation Map Placeholder */
#map-preview {
    width: 100%;
    height: 160px;
    background: rgba(255, 255, 255, 0.003);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 11.5px;
    gap: 8px;
    margin-bottom: 16px;
}

.geolocation-pulse {
    width: 10px;
    height: 10px;
    background-color: var(--blue);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* Alerts and Messages */
.alert-custom {
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-custom.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.alert-custom.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Pagination & Search Row */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 240px;
}

.search-box input {
    padding-left: 36px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
}

/* Grid layout for cards / forms */
.equal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Hamburger Menu Button (hidden by default) */
.hamburger-menu {
    display: none;
    background: #13151a;
    border: 1px solid var(--border-color);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    position: relative; /* Required for absolute positioning of badge */
}

.hamburger-menu:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Hamburger Badge in Top-Left Corner on Mobile */
.hamburger-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--alpha); /* Glowing premium red */
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid #13151a;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    font-family: 'Inter', sans-serif;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 24px 8px;
    }
    
    .sidebar .brand-text, 
    .sidebar .sidebar-profile-info,
    .sidebar .sidebar-info-cepat,
    .sidebar-link span {
        display: none;
    }
    
    .sidebar-profile {
        justify-content: center;
        padding: 8px 0;
    }
    
    .brand-section {
        justify-content: center;
        padding-bottom: 16px;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .equal-grid, .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Hamburger becomes visible */
    .hamburger-menu {
        display: flex;
        margin-right: 12px;
    }

    /* Transform Sidebar into an Off-canvas sliding Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        z-index: 100;
        transform: translateX(-260px);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Make sidebar elements visible inside sliding drawer */
    .sidebar .brand-text, 
    .sidebar .sidebar-profile-info,
    .sidebar-link span {
        display: block !important;
    }
    
    .sidebar .sidebar-info-cepat {
        display: block !important;
        margin-top: auto;
    }
    
    .sidebar-profile {
        justify-content: flex-start !important;
        padding: 12px !important;
    }
    
    .brand-section {
        justify-content: flex-start !important;
        padding-bottom: 30px !important;
    }
    
    /* Main Content adjustment */
    .main-content {
        margin-left: 0 !important;
        padding: 16px 20px !important;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Topbar mobile styling */
    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: nowrap; /* Force single line on mobile */
    }
    
    .topbar-title {
        flex-grow: 1;
        min-width: 0;
    }
    
    .topbar-title h1 {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .topbar-actions {
        width: auto;
        justify-content: flex-end;
        gap: 10px;
        flex-shrink: 0; /* Prevent actions from squishing */
    }

    .profile-pill-name {
        display: none !important; /* Hide long name on mobile to save space */
    }

    .profile-pill {
        padding: 4px !important; /* Shrink to a circular avatar */
    }

    /* Adjust charts and card styling for small screens */
    .chart-container {
        height: 220px;
    }
    
    .donut-percent-wrapper {
        width: 140px;
        height: 140px;
    }
    
    .donut-percentage {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }

    /* Forms responsive */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    /* Specific payslip mobile fixes */
    .payslip-container {
        padding: 20px 15px !important;
        border-radius: 12px !important;
    }
    
    .payslip-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .payslip-meta-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .payslip-meta-item {
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Prevent notification dropdown overflow on small phones */
    .notif-dropdown {
        width: 290px !important;
        right: -30px !important;
    }
}


/* --- PRINT PAYSLIP STYLING --- */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .sidebar, .topbar, .btn-custom, .alert-custom, .table-toolbar {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .card {
        border: none !important;
        background-color: white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .payslip-print-container {
        color: black !important;
        background: white !important;
        font-size: 12px !important;
        border: 2px solid #000 !important;
        padding: 30px !important;
        border-radius: 0 !important;
    }
    
    .payslip-print-container table {
        border-color: #000 !important;
    }
    
    .payslip-print-container th, 
    .payslip-print-container td {
        color: black !important;
        border-bottom: 1px solid #ddd !important;
    }
}

/* --- SALARY OBFUSCATION STYLE --- */
.salary-amount {
    font-family: 'Inter', monospace;
    letter-spacing: 0.5px;
    transition: opacity 0.2s ease-in-out;
}

.salary-toggle-global {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 3px;
    border-radius: 4px;
}

/* Responsive untuk layar kecil */
@media (max-width: 500px) {
    .salary-amount {
        font-size: 12px;
    }
}


/* ==========================================================================
   RESPONSIVE ENHANCEMENTS — FULLY RESPONSIVE UI
   Breakpoints: 1200 | 992 | 768 | 480 | 360
   ========================================================================== */

/* --- 1200px: Laptop kecil / medium desktop --- */
@media (max-width: 1200px) {
    .main-content {
        padding: 20px 24px;
    }

    .topbar-search {
        width: 180px;
    }

    .dashboard-grid {
        grid-template-columns: 3fr 2fr;
    }

    .notif-dropdown {
        width: 290px;
    }
}

/* --- 992px: Tablet landscape, sidebar menjadi icon-only --- */
@media (max-width: 992px) {
    .sidebar {
        width: 68px;
        padding: 20px 6px;
        overflow: hidden;
    }

    .sidebar .brand-text,
    .sidebar .sidebar-profile-info,
    .sidebar .sidebar-info-cepat,
    .sidebar-link span {
        display: none !important;
    }

    .sidebar-profile {
        justify-content: center;
        padding: 8px 0;
    }

    .brand-section {
        justify-content: center;
        padding-bottom: 16px;
    }

    .sidebar-link {
        justify-content: center;
        padding: 12px 8px;
        gap: 0;
    }

    .sidebar-link.active::after {
        display: none;
    }

    .main-content {
        margin-left: 68px;
        padding: 20px;
    }

    .equal-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    /* Force monitoring stats to wrap on tablet */
    section.stats-grid[style*="repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .topbar-search {
        width: 150px;
    }
}

/* --- 768px: Mobile & tablet portrait — sidebar jadi drawer --- */
@media (max-width: 768px) {
    /* === SIDEBAR DRAWER === */
    .hamburger-menu {
        display: flex;
        margin-right: 8px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -270px;
        width: 260px;
        height: 100vh;
        z-index: 100;
        padding: 24px 16px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar .brand-text,
    .sidebar .sidebar-profile-info,
    .sidebar-link span {
        display: block !important;
    }

    .sidebar .sidebar-info-cepat {
        display: block !important;
        margin-top: auto;
    }

    .sidebar-profile {
        justify-content: flex-start !important;
        padding: 12px !important;
    }

    .brand-section {
        justify-content: flex-start !important;
        padding-bottom: 24px !important;
    }

    .sidebar-link {
        justify-content: flex-start !important;
        padding: 11px 16px !important;
        gap: 14px !important;
    }

    .sidebar-link.active::after {
        display: flex;
    }

    /* === MAIN CONTENT === */
    .main-content {
        margin-left: 0 !important;
        padding: 14px 16px !important;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* === TOPBAR === */
    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
        margin-bottom: 16px;
    }

    .topbar-title {
        flex: 1;
        min-width: 0;
    }

    .topbar-title h1 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-title p {
        display: none;
    }

    .topbar-actions {
        flex-shrink: 0;
        gap: 8px;
    }

    /* Hide search bar on mobile — saves space */
    .topbar-search {
        display: none;
    }

    /* Shrink live clock */
    .live-clock {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* Shrink profile pill */
    .profile-pill-name {
        display: none !important;
    }

    .profile-pill {
        padding: 4px !important;
    }

    /* === STATS GRID === */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Force monitoring 4-col stats to 2 cols */
    section.stats-grid[style*="repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stat-card {
        padding: 14px 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* === DASHBOARD GRID === */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* === EQUAL GRID (Profil 2 kolom) === */
    .equal-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    /* === CARDS === */
    .card {
        padding: 16px;
    }

    /* === CHARTS === */
    .chart-container {
        height: 200px;
    }

    .donut-percent-wrapper {
        width: 130px;
        height: 130px;
    }

    .donut-percentage {
        font-size: 18px;
    }

    .donut-legend {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* === FORMS === */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* === TABLE TOOLBAR === */
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .table-toolbar > * {
        width: 100%;
    }

    .search-box {
        min-width: unset;
        width: 100%;
    }

    /* Buttons in toolbar wrap */
    .table-toolbar .btn-custom {
        width: 100%;
        justify-content: center;
    }

    /* === TABLES === */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .table-custom {
        min-width: 560px;
        font-size: 12px;
    }

    .table-custom th,
    .table-custom td {
        padding: 10px 10px;
        white-space: nowrap;
    }

    /* === MODALS === */
    .modal-custom {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-content-custom {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 90vh;
        overflow-y: auto;
        animation: modalSlideUp 0.3s ease !important;
    }

    /* Inline grid in modal detail karyawan */
    #detailModal .modal-content-custom > div[style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    /* Docs grid in modal */
    #detailDocsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* === NOTIFICATION DROPDOWN === */
    .notif-dropdown {
        width: calc(100vw - 24px) !important;
        right: -50px !important;
        max-width: 340px;
    }

    /* === PROFILE PAGE FORM GRIDS (inline style override) === */
    /* Two-column document upload grid in profil pegawai */
    .card [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* === FORM IZIN 2 COL === */
    .form-izin-grid,
    [style*="grid-template-columns: 1fr 1fr; gap: 24px"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* === BUTTON GROUPS === */
    .btn-group-mobile {
        flex-direction: column;
        gap: 8px;
    }

    /* === ABSEN AREA === */
    .absen-area {
        padding: 12px;
    }

    /* === LIVE CLOCK hide on very small topbar === */
    .live-clock span:last-child {
        display: none;
    }
}

/* --- 480px: HP kecil (Android kelas bawah, iPhone 8) --- */
@media (max-width: 480px) {
    .main-content {
        padding: 12px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    /* Modal slide up animation */
    @keyframes modalSlideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* Notification dropdown takes full width */
    .notif-dropdown {
        width: calc(100vw - 16px) !important;
        right: -60px !important;
    }

    .table-custom {
        font-size: 11px;
    }

    .badge-custom {
        padding: 3px 8px;
        font-size: 9px;
    }

    .btn-custom {
        padding: 9px 14px;
        font-size: 12px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }

    .card-title {
        font-size: 13.5px;
    }

    .topbar-title h1 {
        font-size: 15px;
    }

    /* Docs grid 1 col on very small */
    #detailDocsGrid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* --- 360px: HP sangat kecil (iPhone SE, Galaxy A) --- */
@media (max-width: 360px) {
    .main-content {
        padding: 10px 10px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar-title h1 {
        font-size: 13px;
    }

    .live-clock {
        display: none;
    }

    .notif-dropdown {
        width: calc(100vw - 12px) !important;
        right: -40px !important;
    }

    .hamburger-menu {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-value {
        font-size: 16px;
    }

    .card {
        padding: 12px 10px;
    }

    .login-card {
        padding: 24px 16px !important;
    }
}

/* --- LOGIN PAGE RESPONSIVE --- */
@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px !important;
        border-radius: 16px !important;
    }

    .login-logo-circle {
        width: 60px !important;
        height: 60px !important;
    }

    .login-logo-circle i {
        font-size: 24px !important;
    }

    .login-logo-container h2 {
        font-size: 18px !important;
    }
}

/* --- PRINT FIXES (ensure no sidebar on print) --- */
@media print {
    .sidebar,
    .topbar,
    .hamburger-menu,
    .sidebar-overlay,
    .btn-custom,
    .alert-custom,
    .table-toolbar {
        display: none !important;
    }

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

    .card {
        border: none !important;
        background-color: white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/* --- UTILITY HELPERS --- */
/* Ensure images don't overflow their containers */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent text overflow in table cells */
.table-custom td,
.table-custom th {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure select elements don't overflow */
select.input-custom {
    max-width: 100%;
}





    
    /* Pure CSS high-fidelity representation of the blurred workspace desk & dual monitors in reference image */
    background-image: 
        /* Glow from monitors on left & right */
        radial-gradient(circle at 12% 45%, rgba(0, 180, 216, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 88% 45%, rgba(99, 102, 241, 0.18) 0%, transparent 45%),
        /* Ambient room aura light */
        radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.1) 0%, transparent 60%),
        /* Soft base room shadows */
        radial-gradient(circle at 50% 100%, #1c2333 0%, #060913 100%);
    background-attachment: fixed;
    background-size: cover;
}

/* Glassmorphic Panes with edge-refraction border styling & dark smoked glass filter */
body.theme-liquid-glass .card,
body.theme-liquid-glass .sidebar-profile,
body.theme-liquid-glass .payslip-container,
body.theme-liquid-glass .modal-content-custom {
    background: rgba(10, 15, 30, 0.52);
    backdrop-filter: var(--glass-blur) saturate(220%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(220%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.45), 
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: visible; /* To allow realistic water droplets to highlight beautifully */
}

/* Global Text Legibility overrides for Smoked Glass viewports */
body.theme-liquid-glass label {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    font-weight: 600 !important;
}

body.theme-liquid-glass p,
body.theme-liquid-glass small {
    color: #e2e8f0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

body.theme-liquid-glass .sidebar-link {
    color: #cbd5e1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

body.theme-liquid-glass .sidebar-link:hover {
    color: #ffffff;
}

body.theme-liquid-glass .text-muted,
body.theme-liquid-glass span[style*="color: var(--text-muted)"],
body.theme-liquid-glass span[style*="color: var(--text-secondary)"] {
    color: #cbd5e1 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Ultra-realistic CSS-Generated Condensation/Water Droplets on Glass cards */
body.theme-liquid-glass .card::before,
body.theme-liquid-glass .payslip-container::before {
    content: '';
    position: absolute;
    top: 30px;
    right: 40px;
    width: 10px;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50% 60% 70% 50%;
    box-shadow: 
        inset -2px -2px 3px rgba(0,0,0,0.4), 
        inset 2px 2px 2px rgba(255,255,255,0.75),
        2px 3px 5px rgba(0,0,0,0.25);
    filter: blur(0.2px);
    opacity: 0.8;
    pointer-events: none;
    z-index: 10;
}

body.theme-liquid-glass .card::after,
body.theme-liquid-glass .payslip-container::after {
    content: '';
    position: absolute;
    bottom: 40px;
    left: 30%;
    width: 7px;
    height: 9px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 60% 40% 50% 55%;
    box-shadow: 
        inset -1px -1px 2px rgba(0,0,0,0.45), 
        inset 1px 1px 1px rgba(255,255,255,0.65),
        1px 2px 4px rgba(0,0,0,0.2);
    filter: blur(0.1px);
    opacity: 0.75;
    pointer-events: none;
    z-index: 10;
}

/* Glass Sidebar Override */
body.theme-liquid-glass .sidebar {
    background: rgba(4, 7, 20, 0.35);
    backdrop-filter: blur(40px) saturate(210%);
    -webkit-backdrop-filter: blur(40px) saturate(210%);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

body.theme-liquid-glass .profile-pill,
body.theme-liquid-glass .notif-bell {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

body.theme-liquid-glass .profile-pill:hover,
body.theme-liquid-glass .notif-bell:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Glass Input controls */
body.theme-liquid-glass .input-custom,
body.theme-liquid-glass select.input-custom {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-liquid-glass .input-custom:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00f2fe;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Active navigation link with glowing outline capsule */
body.theme-liquid-glass .sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

body.theme-liquid-glass .sidebar-link.active {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: #00f2fe;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
    box-shadow: 
        0 10px 25px rgba(0, 242, 254, 0.25), 
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Header Text / DEVORYN Cyan Neon Glow */
body.theme-liquid-glass .brand-logo {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: #00f2fe;
    text-shadow: 0 0 12px rgba(0, 242, 254, 0.85);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

body.theme-liquid-glass .brand-text h2 {
    color: #00f2fe;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.45);
}

/* Tables style in Glass Theme */
body.theme-liquid-glass .table-custom th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

body.theme-liquid-glass .table-custom td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-liquid-glass .table-custom tr:hover td {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Glass Theme interactive option cards in profile settings */
body.theme-liquid-glass .theme-option-card[data-theme="glass"] {
    border-color: #00f2fe !important;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

body.theme-liquid-glass .theme-option-card[data-theme="carbon"] {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.01) !important;
}

body:not(.theme-liquid-glass) .theme-option-card[data-theme="carbon"] {
    border-color: var(--purple) !important;
    background: #13151a !important;
}

body:not(.theme-liquid-glass) .theme-option-card[data-theme="glass"] {
    border-color: var(--border-color) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}


/* ==========================================================================
   TARGETED RESPONSIVE FIXES — Komponen dengan inline style
   ========================================================================== */

/* Laporan.php — filter form flex wraps on mobile */
@media (max-width: 768px) {
    #filterForm {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #filterForm .form-group {
        width: 100% !important;
        min-width: unset !important;
    }

    #filterForm .form-group input[type="date"],
    #filterForm .form-group select {
        width: 100% !important;
    }

    #filterForm > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }

    #filterForm .btn-custom {
        width: 100% !important;
        justify-content: center !important;
    }

    /* form_izin.php — 2-col layout to 1 col */
    div[style*="grid-template-columns: 1fr 1fr; gap: 24px"] {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* Monitoring 4-col stats grid to 2 cols */
    .stats-grid[style*="repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Karyawan modal detail grid: 1fr 2fr → 1 col */
    div[style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Docs grid in modal: 4 col → 2 col */
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Karyawan card inline 2-col info grid */
    div[style*="grid-template-columns: 1fr 1fr; gap: 12px"] {
        grid-template-columns: 1fr !important;
    }

    /* Profil pegawai doc upload 2-col */
    div[style*="grid-template-columns: 1fr 1fr; gap: 16px"] {
        grid-template-columns: 1fr !important;
    }

    /* Input date / select on mobile: always full width */
    input[type="date"].input-custom,
    input[type="date"],
    select.input-custom {
        width: 100% !important;
        min-width: unset !important;
    }

    /* Fix any element with min-width that causes overflow */
    [style*="min-width: 200px"] {
        min-width: unset !important;
        width: 100% !important;
    }

    /* Topbar action buttons wrap */
    .topbar-actions {
        flex-wrap: nowrap;
        overflow: visible;
    }

    /* Card header — title and action wrap */
    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-header .btn-custom {
        font-size: 12px;
        padding: 7px 12px;
    }

    /* Table action buttons (edit/hapus) wrap on mobile */
    .table-custom td .btn-custom {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* Absensi filter toolbar */
    .table-toolbar form {
        flex-direction: column;
        gap: 8px;
    }

    .table-toolbar form > * {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* All 2-col grids collapse on small phones */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Docs grid to 1 col */
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Modal full width */
    .modal-content-custom {
        padding: 16px !important;
    }

    /* Profile photo in modal centered */
    div[style*="grid-template-columns: 1fr 2fr"] > div {
        text-align: center;
    }
}

/* ==========================================================================
   RESPONSIVE UTILITY CLASSES
   ========================================================================== */

/* Hide on mobile */
.hidden-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

/* Smooth transitions for all layout changes */
.sidebar,
.main-content,
.hamburger-menu {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure app container doesn't overflow horizontally */
.app-container {
    overflow-x: hidden;
    width: 100%;
}

/* Safe area for notched phones (iPhone X+) */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .sidebar {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* Class-based responsive overrides (cleaner targeting) */
.form-izin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.responsive-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .form-izin-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .responsive-upload-grid {
        grid-template-columns: 1fr !important;
    }

    /* Notif dropdown position fix when near edge */
    .notif-wrapper {
        position: relative;
    }

    /* Ensure modal overlay always centered on mobile */
    .modal-custom {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .form-izin-grid {
        grid-template-columns: 1fr !important;
    }

    .responsive-upload-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ================================================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   - Disable heavy backdrop-filter on phones (biggest lag source)
   - Simplify shadows, enable GPU compositing hints
   ================================================================ */
@media (max-width: 768px) {
    /* Disable backdrop-filter blur — renders on CPU on many Android phones */
    .notif-dropdown,
    .modal-content-custom,
    .card,
    .sidebar,
    .profile-pill,
    .notif-bell {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    /* Simplify card shadows for faster paint */
    .card {
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    }

    /* Use content-visibility for off-screen table sections */
    .table-wrapper,
    .card:not(:first-child) {
        content-visibility: auto;
        contain-intrinsic-size: 0 300px;
    }

    /* Reduce repaints on scroll in tables */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }

    /* Prevent animation-induced reflow on stats */
    .stat-card,
    .stat-value {
        will-change: auto;
    }
}

@media (max-width: 480px) {
    /* Even simpler rendering on smallest phones */
    .card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
        border-radius: 14px !important;
    }

    /* Liquid-glass theme: disable fixed bg attachment (kills iOS performance) */
    body.theme-liquid-glass {
        background-attachment: scroll !important;
    }
}
