:root {
    --bg-primary: #f4f7f5;
    --bg-secondary: #ffffff;
    --text-primary: #15291e;
    --text-secondary: #566a5e;
    --border-color: #e2ede5;
    --primary-color: #0c3e26;
    --primary-light: #e6f4ea;
    --accent-gold: #aa841c;
    --accent-gold-light: #fef9c3;
    --accent-teal: #0d9488;
    --accent-orange: #d97706;
    --card-shadow: 0 10px 20px -5px rgba(12, 62, 38, 0.05), 0 4px 6px -2px rgba(12, 62, 38, 0.03);
    --card-shadow-hover: 0 20px 25px -5px rgba(12, 62, 38, 0.1), 0 8px 10px -6px rgba(12, 62, 38, 0.07);
}

body.dark-mode {
    --bg-primary: #07150e;
    --bg-secondary: #0c2016;
    --text-primary: #f1f7f4;
    --text-secondary: #a3b8ad;
    --border-color: #1a3a2a;
    --primary-color: #34d399;
    --primary-light: rgba(52, 211, 153, 0.1);
    --accent-gold: #eab308;
    --accent-gold-light: rgba(234, 179, 8, 0.1);
    --card-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Base Layout */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar Styling - Emerald Dark Gradient */
#sidebar {
    min-width: 270px;
    max-width: 270px;
    background: linear-gradient(180deg, #09311d 0%, #03140c 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    z-index: 1000;
    position: relative;
    display: flex;
    flex-direction: column;
}

body.dark-mode #sidebar {
    background: linear-gradient(180deg, #051a10 0%, #020b06 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.3);
}

#sidebar .sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: transparent;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 12px 24px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #a3b8ad;
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 500;
}

#sidebar ul li a i {
    font-size: 1.2rem;
    color: #829a8f;
    transition: color 0.25s ease;
}

#sidebar ul li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
    padding-left: 28px;
}

#sidebar ul li a:hover i {
    color: #34d399;
}

#sidebar ul.components > li.active > a {
    color: #04180e !important;
    background: linear-gradient(90deg, #d4af37 0%, #f3cd5a 100%) !important;
    font-weight: 600;
    border-radius: 0 50px 50px 0;
    margin-right: 15px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

#sidebar ul.components > li.active > a i {
    color: #04180e !important;
}

/* Submenu Styling */
#sidebar ul.submenu-list {
    padding: 0;
    margin: 0;
}
#sidebar ul.submenu-list li a {
    padding: 8px 25px 8px 52px !important;
    font-size: 0.9rem !important;
    border-radius: 0;
}
#sidebar ul.submenu-list li a:hover {
    padding-left: 56px !important;
}
#sidebar ul.submenu-list li.active a {
    font-weight: 600;
    color: #d4af37 !important;
    background-color: rgba(212, 175, 55, 0.08) !important;
    border-left: 3px solid #d4af37 !important;
}


#sidebar ul li a[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* Content Area */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Navbar */
.navbar-custom {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
}


/* Premium Card Styles */
.premium-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.premium-card-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.premium-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.icon-box-primary {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.icon-box-teal {
    background-color: #e6f7f4;
    color: var(--accent-teal);
}

.icon-box-orange {
    background-color: #fef3c7;
    color: var(--accent-orange);
}

/* Forms & Tables */
.table-custom {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-custom th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .table-custom th {
    background-color: #334155;
    color: #cbd5e1;
}

.table-custom td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control-custom {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(11, 42, 73, 0.15);
    color: var(--text-primary);
}

body.dark-mode .form-control-custom {
    background-color: #1e293b;
}

/* Custom Badges */
.badge-custom {
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Gateway Landing Page Styles */
.gateway-bg {
    background: radial-gradient(circle at top, #0c3e26 0%, #04180e 100%) no-repeat fixed !important;
    font-family: 'Outfit', sans-serif !important;
    min-height: 100vh;
    color: #ffffff;
    position: relative;
    overflow-x: hidden;
}

/* Decorative Background Orbs for Gateway Pages */
.gateway-bg .orb {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}
.gateway-bg .orb-1 {
    top: -100px;
    left: -100px;
    background: #10b981;
}
.gateway-bg .orb-2 {
    bottom: -150px;
    right: -100px;
    background: #d4af37;
}

.gateway-bg > div:not(.orb), 
.gateway-bg .container {
    position: relative;
    z-index: 10;
}

/* Public Absensi Card Styles */
.absensi-container {
    max-width: 650px;
    margin: 50px auto;
    position: relative;
    z-index: 10;
}

.absensi-header-card {
    background: linear-gradient(135deg, #0c3e26 0%, #175e3c 100%) !important;
    color: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.absensi-header-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.absensi-body-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 20px 20px;
    padding: 40px;
    box-shadow: var(--card-shadow);
}

/* Unified Footer Styling for Gateway Pages */
.footer-text {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-top: 30px !important;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    text-align: center;
}

/* Sidebar Overlay for Mobile Off-Canvas */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Touch-friendly Scrollable Tables */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

/* Mobile responsive sidebar, table, & admin panel overrides */
@media (max-width: 991.98px) {
    #wrapper {
        overflow-x: hidden;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        width: 270px;
        min-width: 270px;
        max-width: 270px;
        margin-left: -270px;
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    #sidebar.active {
        margin-left: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.45);
    }

    #content {
        width: 100%;
        min-width: 100%;
    }

    .navbar-custom {
        padding: 10px 16px;
    }

    .admin-content-container {
        padding: 16px !important;
    }
}

@media (max-width: 576px) {
    .premium-card {
        padding: 16px !important;
    }

    .premium-card-title {
        font-size: 0.78rem;
    }

    .premium-card-value {
        font-size: 1.45rem;
    }

    .icon-box {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
        border-radius: 10px;
    }

    .table-custom th,
    .table-custom td {
        padding: 10px 12px;
        font-size: 0.84rem;
    }

    .card-header, 
    .card-body, 
    .card-footer {
        padding: 16px !important;
    }

    .btn {
        font-size: 0.85rem;
    }

    /* Responsive Footer */
    .footer-text {
        font-size: 0.74rem;
        margin-top: 25px !important;
        padding-top: 12px;
        line-height: 1.5;
        padding-left: 10px;
        padding-right: 10px;
        max-width: 90%;
        white-space: normal;
    }

    /* Extra Mobile Responsive Helpers */
    .badge {
        font-size: 0.75rem;
        white-space: normal;
        text-align: left;
    }

    .badge-pill, .rounded-pill {
        white-space: nowrap;
    }

    .table-responsive {
        margin-bottom: 0;
        border: 0;
    }

    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .btn-group-responsive .btn {
        width: 100%;
    }
}
