/* =========================================
   1. VARIABLES & THEME SETUP (PREMIUM LIRBOYO STYLE)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Brand Colors - Premium Dark Blue & Gold */
    --primary: #1e3a8a;
    /* Deep Royal Blue */
    --primary-dark: #0f172a;
    /* Darker Navy */
    --primary-light: #eff6ff;

    --gold: #d4af37;
    /* Metallic Gold */
    --gold-hover: #b45309;
    --gold-light: #fffbeb;

    --secondary: #64748b;
    /* Cool Gray */
    --secondary-hover: #475569;
    --secondary-light: #f8fafc;

    /* Functional Colors */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    /* Backgrounds */
    --bg-body: #f1f5f9;
    /* Light Gray Background */
    --bg-card: #ffffff;
    --bg-sidebar: #1e3a8a;
    /* Sidebar is now Blue, not White */

    /* Text */
    --text-main: #0f172a;
    /* Dark Slate */
    --text-muted: #64748b;
    --text-light: #f8fafc;
    /* Text for dark backgrounds */

    /* Modern Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(30, 58, 138, 0.15);

    /* Dimensions & Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --sidebar-width: 280px;
    --header-height: 80px;
    --transition-speed: 0.3s;
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-speed);
}

ul {
    list-style: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================
   3. LAYOUT STRUCTURE
   ========================================= */
#app {
    display: flex;
    min-height: 100vh;
}

#dashboard-main {
    display: flex;
    width: 100%;
    position: relative;
}

/* --- SIDEBAR (NEW ELEGANT STYLE) --- */
#sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    /* Dark Blue Background */
    color: white;
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

/* Sidebar Header / Brand */
.brand {
    height: var(--header-height);
    /* Match header height (80px) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    background: rgba(0, 0, 0, 0.1);
    /* Slightly darker for contrast */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo img {
    max-height: 100%;
    /* Fill the container height */
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Keep aspect ratio */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 5px 0;
    /* Breathing room */
}

.brand-logo img:hover {
    transform: scale(1.05);
    /* Subtle zoom */
    filter: drop-shadow(0 8px 15px rgba(212, 175, 55, 0.25));
}

/* Sidebar Navigation */
#sidebar nav {
    padding: 1rem;
    flex: 1;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    /* Faded white */
    margin: 1.5rem 0 0.5rem 1rem;
    letter-spacing: 0.08em;
}

.nav-item {
    margin-bottom: 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

/* Active State - Gold Accent */
.nav-link.active {
    background: linear-gradient(90deg, var(--gold) 0%, #b45309 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    font-weight: 600;
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* --- SUBMENU STYLES --- */
.nav-item-submenu {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
    margin: 0 0.8rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    opacity: 0;
}

.nav-item-submenu.open {
    max-height: 1000px;
    opacity: 1;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.nav-sub-link {
    padding: 0.6rem 1rem 0.6rem 3.2rem !important;
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    border-radius: var(--radius-md) !important;
}

.nav-sub-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.dropdown-arrow.rotate {
    transform: rotate(180deg);
    opacity: 1;
}

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--transition-speed) ease;
    background-color: var(--bg-body);
}

/* Header (Glassmorphism) */
main header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    /* Frosty white */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
}

.header-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

/* View Container & Animations */
#views-container {
    padding: 2.5rem;
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.view {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   4. COMPONENTS: CARDS & STATS
   ========================================= */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary-light);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}

.card-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* Stat Cards (Modern) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.stat-blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-green {
    background: #dcfce7;
    color: #16a34a;
}

.stat-purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-yellow {
    background: #fef3c7;
    color: #d97706;
}

.stat-red {
    background: #fee2e2;
    color: #dc2626;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   5. TABLES
   ========================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: #f8fafc;
    padding: 1.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    font-weight: 500;
}

tr:hover td {
    background-color: #f8fafc;
}

/* =========================================
   6. BUTTONS & INPUTS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(30, 58, 138, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--info);
    color: var(--info);
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* =========================================
   6.5 KAMAR MODULE SPECIFIC STYLES
   ========================================= */
.kamar-top-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kamar-stat-mini-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

.mini-card-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mini-card-info h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.mini-card-info .value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.kamar-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.kamar-summary-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
}

.kamar-summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.kamar-block-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kamar-block-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.kamar-block-name {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.kamar-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.kamar-stat-cell {
    display: flex;
    flex-direction: column;
}

.kamar-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.kamar-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.kamar-occupancy-info {
    margin-top: 1rem;
}

.kamar-occupancy-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.kamar-progress-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.kamar-progress-bar {
    height: 100%;
    transition: width 1s ease-in-out;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
}

/* Action Buttons & Badges */
/* Vibrant Action Buttons (As per request) */
.btn-vibrant {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-vibrant:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

.btn-vibrant-blue {
    background: #0ea5e9;
}

.btn-vibrant-yellow {
    background: #eab308;
}

.btn-vibrant-orange {
    background: #f97316;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    justify-content: center;
    border-radius: 8px;
}

.btn-yellow {
    background: #fbbf24;
    color: white;
}

.btn-yellow:hover {
    background: #d97706;
}

.btn-blue {
    background: #3b82f6;
    color: white;
}

.btn-blue:hover {
    background: #2563eb;
}

.btn-red {
    background: #ef4444;
    color: white;
}

.btn-red:hover {
    background: #dc2626;
}

.th-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }

    #sidebar {
        width: 280px;
        transform: translateX(-100%);
    }

    body.sidebar-open #sidebar {
        transform: translateX(0);
    }
}

/* --- TABS NAVIGATION (PREMIUM) --- */
.tabs-nav {
    display: flex;
    gap: 8px;
    background: #e2e8f0;
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.tab-btn i {
    font-size: 1rem;
    opacity: 0.7;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.tab-btn.active i {
    opacity: 1;
    color: var(--primary);
}

/* --- SORTABLE HEADERS --- */
.sortable-header {
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    white-space: nowrap;
}

.sortable-header:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

.sort-btn {
    margin-left: 5px;
    opacity: 0.3;
}

.sort-btn.active {
    opacity: 1;
    color: var(--primary);
}

/* =========================================
   8. MODALS & FORMS
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.close-modal {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: none;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #fee2e2;
    color: var(--danger);
    transform: rotate(90deg);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Form Grid for Modals */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-input,
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* =========================================
   8. PRINT STYLES (EXECUTIVE REPORT)
   ========================================= */
@media print {

    #sidebar,
    .btn,
    .search-wrapper,
    .table-controls,
    .nav-tabs,
    .tabs-nav,
    .card-actions,
    .header-actions,
    ::-webkit-scrollbar {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    main header {
        position: static !important;
        border-bottom: 2px solid #000 !important;
        margin-bottom: 20px !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    body {
        background: white !important;
        font-size: 12pt;
    }

    #laporan-view {
        display: block !important;
    }

    /* Keep Month Display but plain */
    #laporan-month {
        appearance: none;
        border: none;
        background: none;
        font-weight: bold;
        color: black;
        display: inline-block !important;
        padding: 0;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    #laporan-view,
    #laporan-view * {
        visibility: visible;
    }

    #laporan-view {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .sidebar,
    .header-shadow,
    .card-actions,
    button {
        display: none !important;
    }
}

/* PDF Compact Mode for html2pdf */
.pdf-mode {
    padding: 10px !important;
    background: white !important;
    width: 1200px !important;
    /* Force fixed width for consistency */
}

.pdf-mode .card {
    padding: 10px !important;
    margin-bottom: 10px !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
}

.pdf-mode h2 {
    font-size: 1.4rem !important;
    margin-bottom: 0.2rem !important;
}

.pdf-mode p {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
}

.pdf-mode .stat-card {
    padding: 10px !important;
}

.pdf-mode .stat-value {
    font-size: 1.2rem !important;
}

.pdf-mode .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
}

.pdf-mode #laporan-summary-grid {
    gap: 10px !important;
    margin-bottom: 1rem !important;
}

.pdf-mode .card h4 {
    margin-bottom: 0.5rem !important;
    font-size: 1rem !important;
}

.pdf-mode table td {
    padding: 4px 0 !important;
}

.pdf-mode .approval-section {
    margin-top: 2rem !important;
}

.pdf-mode .hide-on-pdf {
    display: none !important;
}

/* =========================================
   14. GATEKEEPER PIN SCREEN (PREMIUM)
   ========================================= */
#gatekeeper-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    /* Pastikan di atas segalanya */
    background: radial-gradient(circle at center, #1e3a8a 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.5s ease;
    overflow: hidden;
}

.gatekeeper-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3.5rem;
    border-radius: 40px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    animation: gatekeeperSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gatekeeper-logo {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #d4af37 0%, #b45309 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2.5rem;
    font-size: 3.5rem;
    color: white;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.4);
}

.gatekeeper-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: #fff;
}

.gatekeeper-desc {
    font-size: 0.95rem;
    opacity: 0.6;
    margin-bottom: 3rem;
}

#gatekeeper-pin {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #d4af37;
    width: 100%;
    height: 80px;
    text-align: center;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 20px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 20px;
}

#gatekeeper-pin:focus {
    border-color: #d4af37;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    transform: scale(1.02);
}

#gatekeeper-feedback {
    margin-top: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes gatekeeperSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes error-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-15px);
    }

    75% {
        transform: translateX(15px);
    }
}

.error-shake {
    animation: error-shake 0.15s ease-in-out 0s 2;
    border-color: #ff4444 !important;
}

.gatekeeper-footer {
    position: absolute;
    bottom: 3rem;
    font-size: 0.8rem;
    opacity: 0.4;
    text-align: center;
    letter-spacing: 1px;
}

.btn-logout {
    margin-top: 15px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
}

/* View Only Mode Enforcements */
.view-only-mode .btn-add-data,
.view-only-mode .btn-import,
.view-only-mode .btn-yellow,
.view-only-mode .btn-red,
.view-only-mode .btn-orange,
.view-only-mode .btn-green,
.view-only-mode .btn-mutasi {
    display: none !important;
}

/* Also specifically for table action buttons that might not use standard classes */
.view-only-mode button[title="Edit"],
.view-only-mode button[title="Hapus Permanen"],
.view-only-mode button[title="Mutasi Status"],
.view-only-mode button[title="Demisioner / Selesai"],
.view-only-mode button[title="Aktifkan Kembali"],
.view-only-mode button[title="Angkat Jadi Staf"] {
    display: none !important;
}

/* --- Searchable Select (Santri) --- */
.search-select-wrapper {
    position: relative;
    width: 100%;
}

.search-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.search-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    color: var(--primary-dark);
}

.search-dropdown-item i {
    color: var(--gold);
}

.search-dropdown-item:hover {
    background: #f1f5f9;
    padding-left: 20px;
}

.search-dropdown-item.empty {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.search-dropdown-item.empty:hover {
    background: transparent;
    padding-left: 16px;
}

/* Custom scrollbar for search dropdown */
.search-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}