@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    
    --color-primary: #00B8D4; /* Deep Cyan for Light Mode readability */
    --color-primary-hover: #0097A7;
    --color-primary-light: rgba(0, 184, 212, 0.08);
    --color-secondary: #B026FF; /* Neon Purple */
    
    --color-success-bg: #ecfdf5;
    --color-success-border: #10b981;
    --color-success-text: #065f46;
    
    --color-info-bg: #f0f9ff;
    --color-info-border: #0ea5e9;
    --color-info-text: #0369a1;
    
    --color-warning-bg: #fffbeb;
    --color-warning-border: #f59e0b;
    --color-warning-text: #78350f;
    
    --color-danger-bg: #fff5f5;
    --color-danger-border: #f43f5e;
    --color-danger-text: #991b1b;
    
    --color-sakit-bg: #faf5ff;
    --color-sakit-border: #B026FF;
    --color-sakit-text: #581c87;

    --color-success: #10b981;
    --color-info: #0ea5e9;
    --color-warning: #f59e0b;
    --color-danger: #f43f5e;
    --color-sakit: #B026FF;

    --bg-hover: rgba(15, 23, 42, 0.04);
    --shadow-premium: 0 10px 25px -5px rgba(0, 184, 212, 0.15), 0 8px 16px -6px rgba(0, 184, 212, 0.1);
    --shadow-card: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 10px 10px -5px rgba(15, 23, 42, 0.02);
}

html.dark-mode {
    --bg-main: #0a0a0b;        /* Elegant dark gray */
    --bg-surface: #141415;     /* Slightly lighter for cards */
    --bg-card: #141415;
    --border-color: rgba(255, 255, 255, 0.06); /* Very subtle borders */
    --text-primary: #ededed;   /* Soft white, easier on eyes */
    --text-secondary: #a1a1aa; /* Zinc 400 */
    
    --color-primary: #00F0FF;  /* Keep Cyan for accents */
    --color-primary-hover: #52FFFF;
    --color-primary-light: rgba(0, 240, 255, 0.1);
    --color-secondary: #B026FF; 
    
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-success-border: rgba(16, 185, 129, 0.3);
    --color-success-text: #34d399;
    
    --color-info-bg: rgba(14, 165, 233, 0.1);
    --color-info-border: rgba(14, 165, 233, 0.3);
    --color-info-text: #38bdf8;
    
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-warning-border: rgba(245, 158, 11, 0.3);
    --color-warning-text: #fbbf24;
    
    --color-danger-bg: rgba(244, 63, 94, 0.1);
    --color-danger-border: rgba(244, 63, 94, 0.3);
    --color-danger-text: #fb7185;
    
    --color-sakit-bg: rgba(176, 38, 255, 0.1);
    --color-sakit-border: rgba(176, 38, 255, 0.3);
    --color-sakit-text: #c084fc;

    --color-success: #34d399;
    --color-info: #38bdf8;
    --color-warning: #fbbf24;
    --color-danger: #fb7185;
    --color-sakit: #c084fc;

    --bg-hover: rgba(255, 255, 255, 0.03);
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.5); /* Soft, wide shadow */
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

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

/* Smooth Transitions for Layout and Components */
body, .sidebar, .top-header, .card, .main-absensi-container, .btn, .form-input, .user-profile-badge, .mobile-nav, .slip-container, .modal-container, .table, .table td, .table th, .sidebar-link, .btn-logout {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Theme Toggle Icon Control */
.theme-toggle-btn .light-mode-icon {
    display: none !important;
}
.theme-toggle-btn .dark-mode-icon {
    display: block !important;
}

html.dark-mode .theme-toggle-btn .light-mode-icon {
    display: block !important;
}
html.dark-mode .theme-toggle-btn .dark-mode-icon {
    display: none !important;
}

/* Authentication Page */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--bg-main);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1.5px solid transparent;
    border-radius: 14px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light);
    background-color: var(--bg-surface);
}

select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px !important;
    cursor: pointer;
}

html.dark-mode select.form-input {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
}

select.form-input option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--color-danger-border);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Layout Sidebar Navigation */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-main);
}

.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    box-shadow: var(--shadow-premium);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 70px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.sidebar-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.menu-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.7;
    letter-spacing: 0.05em;
    margin: 20px 8px 10px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 4px;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--color-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 14px;
}

.user-details {
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.btn-logout:hover {
    background: var(--bg-hover);
}

/* Main Workspace Area */
.main-workspace {
    margin-left: 300px; /* 260px width + 20px left + 20px gap */
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-header {
    height: 70px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 20px;
    margin-right: 20px;
    margin-top: 20px;
    z-index: 999;
    box-shadow: var(--shadow-premium);
}

html.dark-mode .top-header {
    background: rgba(30, 41, 59, 0.75);
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.breadcrumb .active {
    color: var(--text-primary);
    font-weight: 700;
}

.main-content {
    padding: 32px 20px 40px 0;
    width: 100%;
    flex-grow: 1;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-profile-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Main Absensi Card Container */
.main-absensi-container {
    background: var(--bg-surface);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-premium);
}

.main-absensi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.main-absensi-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.main-absensi-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Pastel Cards Grid */
.absensi-pastel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .absensi-pastel-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.pastel-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid transparent;
}

.pastel-card.hadir {
    background: var(--color-success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success-text);
}

.pastel-card.izin {
    background: var(--color-info-bg);
    border-color: rgba(14, 165, 233, 0.2);
    color: var(--color-info-text);
}

.pastel-card.sakit {
    background: var(--color-sakit-bg);
    border-color: rgba(168, 85, 247, 0.2);
    color: var(--color-sakit-text);
}

.pastel-card.alpa {
    background: var(--color-danger-bg);
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--color-danger-text);
}

.pastel-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.pastel-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.85;
}

/* Layout Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: rgba(var(--bg-surface-rgb, 255, 255, 255), 0.75); /* Fallback */
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-premium);
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

html.dark-mode .card {
    background: rgba(18, 18, 18, 0.65); /* Glass effect on pitch dark */
}

.card:hover, .pastel-card:hover, .metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.metric-card, .pastel-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    text-align: left;
}

.table th {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    border-bottom: none;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    vertical-align: middle;
}

.table td {
    padding: 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: none;
    vertical-align: middle;
    background: var(--bg-surface);
}

.table td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.table td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.table tr {
    animation: fadeIn 0.5s ease-out forwards;
    transition: background-color 0.2s ease;
}

.table tr:hover td {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-success-border); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning-border); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger-border); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--color-info-border); }

/* QR Generator Container */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-align: center;
}

#qrcode img, #qrcode canvas {
    margin: 0 auto;
    border: 8px solid white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.timer-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    width: 100%;
    background: var(--color-primary);
    transition: width 1s linear;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--color-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-success-text);
}

.alert-error {
    background: var(--color-danger-bg);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--color-danger-text);
}

/* Sidebar Collapsed State */
html.sidebar-collapsed .sidebar {
    width: 88px;
}
html.sidebar-collapsed .sidebar-brand-text,
html.sidebar-collapsed .sidebar-menu span {
    display: none;
}
html.sidebar-collapsed .main-workspace {
    margin-left: 128px; /* 88px + 20px + 20px */
}
html.sidebar-collapsed .sidebar-logo {
    width: 36px;
    height: 36px;
}
html.sidebar-collapsed .user-details {
    display: none;
}
html.sidebar-collapsed .btn-logout span {
    display: none;
}
html.sidebar-collapsed .sidebar-footer {
    padding: 20px 10px;
    align-items: center;
}
html.sidebar-collapsed .user-info {
    justify-content: center;
}
html.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 12px;
}
html.sidebar-collapsed .sidebar-link svg {
    margin-right: 0;
}
html.sidebar-collapsed .menu-header {
    text-align: center;
    font-size: 9px;
}

/* Tablet Layout Resets (1024px) */
@media (max-width: 1024px) {
    .sidebar {
        top: 0;
        bottom: 0;
        left: -300px;
        border-radius: 0;
        transition: left 0.3s ease;
        z-index: 1050;
    }
    
    .sidebar.open {
        left: 0;
    }

    .main-workspace {
        margin-left: 0 !important;
    }

    .top-header {
        top: 0;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        padding: 0 20px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .sidebar-toggle {
        display: flex !important;
    }
}


/* Bottom Navigation Bar for Mobile */
@media (max-width: 768px) {
    .header-nav {
        padding: 0 16px;
        height: 60px;
    }
    
    .nav-menu {
        display: none !important;
    }
    
    .main-content {
        padding: 20px 16px 80px 16px;
    }

    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 10px;
        font-weight: 600;
    }

    .mobile-nav-item.active {
        color: var(--color-primary);
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
        margin-bottom: 4px;
    }
}

.mobile-nav {
    display: none;
}

/* Maps */
.map-container {
    height: 350px;
    width: 100%;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Slip Gaji Stylings */
.slip-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}

.slip-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 30px;
    margin-bottom: 30px;
}

.slip-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.slip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.slip-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.slip-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 12px;
}

.slip-item-label {
    color: var(--text-secondary);
}

.slip-item-value {
    font-weight: 600;
}

.slip-item.negative .slip-item-value {
    color: var(--color-danger-border);
}

.slip-item.positive .slip-item-value {
    color: var(--color-success-border);
}

.slip-total {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
}

.slip-total-value {
    font-size: 22px;
    color: var(--color-success-text);
}

.print-btn {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .slip-container {
        border: none !important;
        background: white !important;
        color: black !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    .top-bar, .header-nav, .btn, .print-btn, .mobile-nav {
        display: none !important;
    }
    .slip-total {
        background: #f3f4f6 !important;
        border: 1px solid #d1d5db !important;
        color: black !important;
    }
    .slip-total-value {
        color: black !important;
    }
    .slip-section-title {
        color: black !important;
        border-bottom-color: black !important;
    }
    .slip-item-label {
        color: #4b5563 !important;
    }
}

/* Sidebar Responsive Styles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-workspace {
        margin-left: 0;
    }
    
    .top-header {
        padding: 0 20px;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-main);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   COLLAPSIBLE SIDEBAR STYLES (DESKTOP ONLY)
   ========================================== */
@media (min-width: 1025px) {
    /* Sidebar & Main Workspace Transitions */
    .sidebar {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, border-color 0.3s, box-shadow 0.3s !important;
    }
    
    .main-workspace {
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .sidebar-brand-text, 
    .sidebar-link span, 
    .menu-header, 
    .user-details, 
    .btn-logout span {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    /* Collapsed Layout State */
    .sidebar-collapsed .sidebar {
        width: 74px;
    }

    .sidebar-collapsed .main-workspace {
        margin-left: 74px;
    }

    /* Brand Header Collapsed */
    .sidebar-collapsed .sidebar-brand {
        padding: 0 8px;
        justify-content: center;
    }

    .sidebar-collapsed .sidebar-brand-text {
        opacity: 0;
        visibility: hidden;
        width: 0;
        height: 0;
        overflow: hidden;
        margin: 0;
        display: none;
    }

    .sidebar-collapsed #sidebar-collapse-btn {
        margin-left: 0 !important;
    }

    .sidebar-collapsed #sidebar-collapse-btn svg {
        transform: rotate(180deg);
    }

    /* Menu & Links Collapsed */
    .sidebar-collapsed .sidebar-menu {
        padding: 24px 8px;
        overflow-x: hidden;
    }

    .sidebar-collapsed .menu-header {
        height: 1px;
        background: var(--border-color);
        margin: 16px 8px;
        padding: 0;
        font-size: 0;
        opacity: 0.5;
        overflow: hidden;
    }

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

    .sidebar-collapsed .sidebar-link span {
        opacity: 0;
        visibility: hidden;
        width: 0;
        height: 0;
        overflow: hidden;
        display: none;
    }

    .sidebar-collapsed .sidebar-link svg {
        margin: 0;
        width: 20px;
        height: 20px;
    }

    /* Footer Collapsed */
    .sidebar-collapsed .sidebar-footer {
        padding: 16px 8px;
    }

    .sidebar-collapsed .user-info {
        justify-content: center;
        margin-bottom: 12px;
        gap: 0;
    }

    .sidebar-collapsed .user-details {
        opacity: 0;
        visibility: hidden;
        width: 0;
        height: 0;
        overflow: hidden;
        display: none;
    }

    .sidebar-collapsed .btn-logout {
        padding: 10px 0;
        justify-content: center;
        gap: 0;
    }

    .sidebar-collapsed .btn-logout span {
        opacity: 0;
        visibility: hidden;
        width: 0;
        height: 0;
        overflow: hidden;
        display: none;
    }
}

.collapse-toggle-btn:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

@media (max-width: 1024px) {
    #sidebar-collapse-btn {
        display: none !important;
    }
}

/* ==========================================
   PREMIUM DASHBOARD OVERHAUL STYLES
   ========================================== */

/* Glassmorphism & Custom Surfaces */
.glass-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Welcome Card Premium Backdrop Glow */
.welcome-card-premium {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-main));
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.welcome-card-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary-light) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    animation: floatGlow 12s ease-in-out infinite alternate;
}

/* Animations */
@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 20px) scale(1.2); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 var(--color-primary-light); }
    70% { box-shadow: 0 0 0 10px rgba(95, 90, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(95, 90, 246, 0); }
}

.pulse-glow-indicator {
    position: relative;
}
.pulse-glow-indicator::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--color-success-border);
    border-radius: 50%;
    right: -2px;
    top: -2px;
    border: 2px solid var(--bg-surface);
    animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Digital Ticking Clock */
.digital-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 16px;
    color: var(--color-primary);
    background: var(--color-primary-light);
    padding: 6px 16px;
    border-radius: 12px;
    border: 1.5px solid rgba(95, 90, 246, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.quick-action-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.quick-action-btn:hover svg {
    transform: scale(1.15);
}

.quick-action-btn.qa-primary svg { color: var(--color-primary); }
.quick-action-btn.qa-success svg { color: var(--color-success-border); }
.quick-action-btn.qa-info svg { color: var(--color-info-border); }
.quick-action-btn.qa-warning svg { color: var(--color-warning-border); }
.quick-action-btn.qa-danger svg { color: var(--color-danger-border); }
.quick-action-btn.qa-sakit svg { color: var(--color-sakit-border); }

/* Progress Rings and Inline Visual Bars */
.progress-container-inline {
    width: 100%;
    background: var(--bg-main);
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 10px;
    border: 1.5px solid var(--border-color);
}

.progress-bar-inline {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-inline.success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar-inline.info { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.progress-bar-inline.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar-inline.danger { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.progress-bar-inline.primary { background: linear-gradient(90deg, #5f5af6, #818cf8); }

/* Avatar Name Initials Gradient */
.avatar-initials-gradient {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 2px solid var(--bg-surface);
}

.avatar-g1 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.avatar-g2 { background: linear-gradient(135deg, #10b981, #059669); }
.avatar-g3 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar-g4 { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.avatar-g5 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }

/* Visual Attendance Stacked Bar */
.ratio-stacked-bar {
    display: flex;
    width: 100%;
    height: 14px;
    background: var(--bg-main);
    border-radius: 99px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.ratio-bar-segment {
    height: 100%;
    transition: width 0.5s ease;
}
.ratio-bar-segment.hadir { background: #10b981; }
.ratio-bar-segment.terlambat { background: #f59e0b; }
.ratio-bar-segment.izin { background: #0ea5e9; }
.ratio-bar-segment.alpa { background: #f43f5e; }

/* Timeline Step Visuals (Karyawan Dashboard) */
.timeline-steps-container {
    position: relative;
    padding-left: 28px;
    margin: 20px 0;
}

.timeline-steps-container::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: var(--border-color);
    z-index: 0;
}

.timeline-step-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-step-item:last-child {
    margin-bottom: 0;
}

.timeline-step-bullet {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-step-item.active .timeline-step-bullet {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.timeline-step-item.completed .timeline-step-bullet {
    border-color: var(--color-success-border);
    background: var(--color-success-border);
}

.timeline-step-content {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.timeline-step-item.active .timeline-step-content {
    background: var(--bg-surface);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-premium);
}

.timeline-step-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.timeline-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.4;
}

/* Live Shift Timer Circle/Visual */
.live-shift-tracker-card {
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-main));
    border: 1.5px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.live-shift-tracker-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary-light) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.live-shift-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.live-shift-time-bubble {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-premium);
}

.live-shift-timer-display {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    margin: 4px 0;
}

/* Premium Responsive Grid for Statistics on Mobile */
.stats-grid-responsive {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    text-align: center;
}

@media (max-width: 576px) {
    .stats-grid-responsive {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
}

/* Premium Responsive Cabang Info Card */
.cabang-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-premium);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cabang-info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium-hover, 0 10px 30px rgba(0, 0, 0, 0.15));
}

@media (max-width: 480px) {
    .cabang-info-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .cabang-info-card > div:last-child {
        text-align: left !important;
        width: 100%;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
    }
}

/* Premium Collapsible History Dropdown */
.history-collapse-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
}

.history-collapse-container.open {
    max-height: 1000px;
    opacity: 1;
}

.history-toggle-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.history-toggle-trigger:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: rgba(95, 90, 246, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

html.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.modal-overlay.active, .modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--bg-surface);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-container, .modal-overlay.open .modal-container {
    transform: translateY(0) scale(1);
}

.modal-container form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    margin: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    flex-shrink: 0;
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE FIXES)
========================================= */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    /* Header layout */
    .top-header {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .header-title-container {
        font-size: 14px;
        line-height: 1.2;
    }
    
    .user-profile-badge {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .role-badge-label {
        display: none; /* Hide "Tipe Akses:" on mobile to save space */
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    table.table {
        min-width: 600px;
    }

    /* Forms */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

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

    /* General Layout */
    .main-content {
        padding: 16px;
        padding-bottom: 90px;
    }

    /* Modals */
    .modal-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 16px;
    }

    /* Text */
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
}
