/* ============================================================
   CUSTOM GLOBAL STYLES (PT CPI)
   Stored in assets/dist/css/custom-style.css
   ============================================================ */

:root {
    /* Login Page Variables */
    --primary-red: #dc3545;
    --secondary-red: #c82333;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border-login: rgba(255, 255, 255, 0.6);

    /* Dashboard Glassmorphism Variables */
    --glass-light: rgba(255, 255, 255, 0.65);
    --glass-dark: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(16px);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    /* Theme Toggle Animation */
    --theme-anim-timing: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Soft Background Colors */
    --bg-soft: #f8f9fa;
    --bg-gradient: radial-gradient(at 0% 0%, rgba(220, 53, 69, 0.05) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 123, 255, 0.05) 0, transparent 50%),
        #f4f7fa;
}

/* Theme Toggle Animation */
.theme-animate {
    display: inline-block !important;
    animation: themeToggleAnim 0.6s var(--theme-anim-timing) forwards !important;
}

@keyframes themeToggleAnim {
    0% {
        transform: scale(1) rotate(0deg);
    }

    30% {
        transform: scale(1.4) rotate(25deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* --- LOGIN PAGE STYLES --- */
.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Source Sans Pro', -apple-system, sans-serif;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(220, 53, 69, 0.3) 100%),
        url('../../img/login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    animation: premiumBg 30s infinite alternate ease-in-out;
}

@keyframes premiumBg {
    0% {
        background-position: center center;
        filter: contrast(100%) brightness(100%);
    }

    50% {
        background-position: 51% 51%;
        filter: contrast(105%) brightness(110%);
    }

    100% {
        background-position: center center;
        filter: contrast(100%) brightness(100%);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border-login);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes shine {
    0% {
        left: -50%;
    }

    20% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-logo {
    width: 130px;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.brand-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-container h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.login-container h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: var(--primary-red);
    font-weight: 500;
    margin-bottom: 35px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.9;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    text-align: left;
}

.form-control-login~i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    transition: all 0.3s;
    z-index: 5;
}

.form-control-login~label {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    background: transparent;
    padding: 0 4px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 4;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.form-control-login {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-control-login:focus,
.form-control-login:not(:placeholder-shown) {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    background: #fff;
}

/* Floating Animation */
.form-control-login:focus~label,
.form-control-login:not(:placeholder-shown)~label {
    top: -5px;
    left: 12px;
    font-size: 0.75rem;
    color: var(--primary-red);
    font-weight: 700;
    background: #fff;
    z-index: 10;
    padding: 0 8px;
    border-radius: 4px;
}

.form-control-login:focus~i,
.form-control-login:not(:placeholder-shown)~i {
    color: var(--primary-red);
}

.loading-spinner {
    margin-right: 8px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    z-index: 10;
    transition: color 0.3s;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-red), #82242aff);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    filter: brightness(1.1);
}

.remember-me {
    display: flex;
    align-items: center;
    margin-top: 15px;
    font-size: 0.88rem;
    color: #555;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.footer-text {
    margin-top: 30px;
    font-size: 0.85rem;
    color: #444;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* --- PHOSPHOR ANIMATIONS --- */
.ph-spin {
    animation: ph-spin 2s infinite linear;
    display: inline-block;
}

@keyframes ph-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(359deg);
    }
}

.ph-beat {
    animation: ph-beat 1s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    display: inline-block;
}

@keyframes ph-beat {
    0% {
        transform: scale(0.95);
    }

    5% {
        transform: scale(1.1);
    }

    39% {
        transform: scale(0.85);
    }

    45% {
        transform: scale(1);
    }

    60% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* --- DYNAMIC VALIDATION STYLES --- */
.shake-anim {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.dynamic-toast {
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.dynamic-icon {
    font-size: 1.2rem;
    color: #ffc107;
    filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.5));
}

/* --- DASHBOARD STYLES (from topbar.php) --- */

/* --- GLASS SIDEBAR --- */

.main-sidebar,
.main-sidebar::before {
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border-right: 1px solid var(--glass-border) !important;
    /* Only transition specific properties to avoid breaking AdminLTE width logic */
    transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease !important;
}

/* Light Mode Sidebar */
.main-sidebar .sidebar {
    flex: 1 !important;
}

body:not(.dark-mode) .main-sidebar {
    background-color: var(--glass-light) !important;
}

body:not(.dark-mode) .main-sidebar .nav-link,
body:not(.dark-mode) .main-sidebar .nav-link p,
body:not(.dark-mode) .main-sidebar .nav-link i {
    color: #333333 !important;
}

body:not(.dark-mode) .main-sidebar .brand-text {
    color: #b71c1c !important;
}

/* Dark Mode Sidebar */
body.dark-mode .main-sidebar {
    background-color: var(--glass-dark) !important;
}

body.dark-mode .main-sidebar .nav-link,
body.dark-mode .main-sidebar .nav-link p,
body.dark-mode .main-sidebar .nav-link i {
    color: #eeeeee !important;
}

body.dark-mode .main-sidebar .brand-text {
    color: #ffffff !important;
}

/* --- GLASS NAVBAR (Fixed Top) --- */
.main-header {
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    transition: background-color 0.3s ease !important;
}

body:not(.dark-mode) .main-header {
    background-color: rgba(255, 255, 255, 0.5) !important;
}

body.dark-mode .main-header {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

/* --- MENU HIGHLIGHTS --- */
.nav-sidebar .nav-item>.nav-link {
    border-radius: 12px !important;
    margin-bottom: 3px !important;
    position: relative !important;
    /* Anchor for the arrow */
    display: flex !important;
    align-items: center !important;
    /* Use more specific transitions */
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* Fix for Sidebar Mini Hover: Ensure text and arrows don't wrap */
.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .nav-sidebar .nav-link p {
    width: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
    margin-left: 0.8rem !important;
    flex: 1;
}

.nav-sidebar .nav-link p .right {
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: transform 0.3s ease !important;
    margin: 0 !important;
}

/* Restore rotation when menu is open */
.nav-item.menu-open>.nav-link p .right,
.nav-item.menu-is-opening>.nav-link p .right {
    transform: translateY(-50%) rotate(-90deg) !important;
}

.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover .nav-sidebar .nav-item .nav-link i.right {
    opacity: 1 !important;
    display: block !important;
}

/* Active Item Styling */
.nav-sidebar .nav-link.active {
    background: linear-gradient(135deg, #dc3545, #ff4d5a) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3) !important;
}

.nav-sidebar .nav-link.active p,
.nav-sidebar .nav-link.active i {
    color: #fff !important;
}

/* Hover Effect */
.nav-sidebar .nav-item:hover>.nav-link:not(.active) {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .nav-sidebar .nav-item:hover>.nav-link:not(.active) {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Brand Red for Light Mode */
body:not(.dark-mode) .brand-text {
    color: #dc3545 !important;
    font-weight: 800 !important;
}

/* --- LIQUID GLASS ICON EFFECT --- */
/* Transform solid icons into 3D/Liquid gradient crystals */
.nav-sidebar .nav-icon,
.nav-sidebar .nav-link p .right {
    display: inline-block;
}

/* Liquid look for normal unselected icons (Light Mode) */
body:not(.dark-mode) .nav-sidebar .nav-link:not(.active) .nav-icon,
body:not(.dark-mode) .nav-sidebar .nav-link:not(.active) p .right {
    background: linear-gradient(135deg, #ff4c5b 0%, #8b101c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(220, 53, 69, 0.3));
    transition: all 0.3s ease;
}

/* Hover liquid glow effect */
body:not(.dark-mode) .nav-sidebar .nav-item:hover>.nav-link:not(.active) .nav-icon {
    background: linear-gradient(135deg, #ff1a2b 0%, #dc3545 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(220, 53, 69, 0.5));
    transform: scale(1.1);
}

/* Liquid look for selected icons (Light & Dark Mode) */
.nav-sidebar .nav-link.active .nav-icon,
.nav-sidebar .nav-link.active p .right {
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.4));
}

/* Dark Mode Unselected icons */
body.dark-mode .nav-sidebar .nav-link:not(.active) .nav-icon,
body.dark-mode .nav-sidebar .nav-link:not(.active) p .right {
    background: linear-gradient(135deg, #e0e0e0 0%, #888888 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

/* --- ROLE BASED ACCESS CONTROL (RBAC) --- */
/* Hide add/delete buttons for general users */
body.role-user [id^="btn-tambah"],
body.role-user [data-target^="#modal-tambah"],
body.role-user #btn-capture-photo,
body.role-user #btn-remove-captured,
body.role-user .btn-delete-ba,
body.role-user .btn-delete-lk,
body.role-user .btn-hapus-sam,
body.role-user .btn-hapus-gs,
body.role-user .btn-delete-tm,
body.role-user .btn-hapus-akt,
body.role-user .btn-hapus,
body.role-user .btn-delete {
    display: none !important;
    pointer-events: none !important;
}

/* Hide edit functionality for general users (except in users.php / profile page) */
body.role-user:not(.page-users) .btn-edit,
body.role-user:not(.page-users) .btn-edit-ba,
body.role-user:not(.page-users) .btn-edit-lk,
body.role-user:not(.page-users) .btn-update-lk,
body.role-user:not(.page-users) .btn-edit-sam,
body.role-user:not(.page-users) .btn-edit-gs,
body.role-user:not(.page-users) .btn-edit-tm,
body.role-user:not(.page-users) .btn-edit-akt,
body.role-user:not(.page-users) .modal-footer button[type="submit"],
body.role-user:not(.page-users) button[type="submit"].btn-warning {
    display: none !important;
    pointer-events: none !important;
}

/* --- MODAL GRADIENT HEADERS --- */
.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0960b 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1a6e2e 100%) !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #9b1a25 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #0d7a8a 100%) !important;
}

/* Modal header border-radius align with modal */
.modal-header.bg-gradient-primary,
.modal-header.bg-gradient-warning,
.modal-header.bg-gradient-success,
.modal-header.bg-gradient-danger,
.modal-header.bg-gradient-info {
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
    border-bottom: none;
}

/* Keep modal close button visible on gradient headers */
.modal-header .close {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.modal-header .close:hover {
    opacity: 1;
}

/* --- SIDEBAR ENHANCEMENTS --- */
/* Nav header section label */
.main-sidebar .nav-header {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.45;
    user-select: none;
    padding-bottom: 4px;
}

body:not(.dark-mode) .main-sidebar .nav-header {
    color: #333 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.dark-mode .main-sidebar .nav-header {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Logout link hover in sidebar */
.main-sidebar .logout-link {
    transition: all 0.25s ease !important;
}

.main-sidebar .logout-link:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2) !important;
    transform: translateX(2px);
}

/* Override icon liquid gradient for logout (keep red color) */
body:not(.dark-mode) .main-sidebar .logout-link .nav-icon {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 2px 3px rgba(220, 53, 69, 0.4)) !important;
}

body.dark-mode .main-sidebar .logout-link .nav-icon {
    background: linear-gradient(135deg, #ff6b7a 0%, #dc3545 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Sidebar collapsed: hide nav-header */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-header {
    display: none !important;
}

/* --- SUB-MENU ICON INDENT FIX --- */
.nav-sidebar .nav-treeview .nav-link.pl-4 {
    padding-left: 1.5rem !important;
}

/* Smaller sub-menu icons */
.nav-sidebar .nav-treeview .nav-icon {
    font-size: 1rem !important;
    width: 1.5rem;
}

/* --- DATATABLES SCROLL FIX (sidebar mini) --- */
/* .dataTables_wrapper .dataTables_scrollHead table,
.dataTables_wrapper .dataTables_scrollBody table {
    width: 100% !important;
} */

/* CSS fixes removed as they caused layout issues on small screens */

/* --- MODAL FOOTER CLEAN BORDER --- */
.modal-footer.bg-light {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: calc(0.3rem - 1px);
    border-bottom-right-radius: calc(0.3rem - 1px);
}

/* --- CARD GRADIENT HEADERS --- */
.card-header.bg-gradient-primary,
.card-header.bg-gradient-warning,
.card-header.bg-gradient-success,
.card-header.bg-gradient-danger {
    color: #fff !important;
    border-bottom: none;
}

/* --- BTN GLOW EFFECT --- */
.btn-primary.shadow-sm {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.btn-primary.shadow-sm:hover {
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4) !important;
    transform: translateY(-1px) !important;
}

.btn-warning.shadow-sm {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.btn-warning.shadow-sm:hover {
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.45) !important;
    transform: translateY(-1px) !important;
}

.btn-danger.shadow-sm {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.btn-danger.shadow-sm:hover {
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4) !important;
    transform: translateY(-1px) !important;
}


/* --- SIDEBAR TOGGLE ARROW BUTTON --- */
.sidebar-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px !important;
    padding: 0 !important;
    margin: 0 4px !important;
    transition: background 0.2s ease, box-shadow 0.2s ease !important;
}

.sidebar-toggle-btn:hover {
    background: rgba(220, 53, 69, 0.1) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15) !important;
}

body.dark-mode .sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-toggle-icon {
    font-size: 1.4rem !important;
    line-height: 1 !important;
    color: #dc3545 !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.2s ease !important;
    filter: drop-shadow(0 1px 3px rgba(220, 53, 69, 0.25));
}

body.dark-mode .sidebar-toggle-icon {
    color: #e0e0e0 !important;
    filter: drop-shadow(0 1px 3px rgba(255, 255, 255, 0.15));
}

.sidebar-toggle-btn:hover .sidebar-toggle-icon {
    transform: scale(1.25) !important;
    filter: drop-shadow(0 2px 6px rgba(220, 53, 69, 0.5));
}

body.dark-mode .sidebar-toggle-btn:hover .sidebar-toggle-icon {
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.3));
}

/* --- SIDEBAR BRAND TEXT --- */
/* Light mode: teks gelap agar kontras di atas sidebar transparan */
body:not(.dark-mode) .main-sidebar .brand-infrastruktur {
    color: #b71c1c !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

body:not(.dark-mode) .main-sidebar .brand-subtitle {
    color: #444 !important;
    opacity: 0.7;
}

/* Dark mode: teks putih dengan shadow */
body.dark-mode .main-sidebar .brand-infrastruktur {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .main-sidebar .brand-subtitle {
    color: #dddddd !important;
    opacity: 0.7;
}


/* --- ROBUST SIDEBAR TOGGLE ICON SYSTEM --- */
/* Hide/Show based on body classes for instant feedback & zero flicker */
.toggle-collapsed {
    display: none !important;
}

body.sidebar-collapse .toggle-expanded {
    display: none !important;
}

body.sidebar-collapse .toggle-collapsed {
    display: inline-block !important;
}

body:not(.sidebar-collapse) .toggle-expanded {
    display: inline-block !important;
}

/* Ensure icons rotate or animate smoothly if desired */
.sidebar-toggle-icon {
    transition: transform 0.2s ease !important;
}


/* Sidebar Logout link specific styling */
.main-sidebar .logout-link {
    margin-top: 10px;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(220, 53, 69, 0.1);
}

.main-sidebar .logout-link:hover {
    background: rgba(220, 53, 69, 0.15) !important;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2) !important;
}

.dark-mode .main-sidebar .logout-link:hover {
    background: rgba(220, 53, 69, 0.25) !important;
}

body:not(.dark-mode) .main-sidebar .logout-link .nav-icon {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 2px 3px rgba(220, 53, 69, 0.4)) !important;
}

body.dark-mode .main-sidebar .logout-link .nav-icon {
    background: linear-gradient(135deg, #ff6b7a 0%, #dc3545 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Sidebar collapsed: hide nav-header */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-header {
    display: none !important;
}

/* --- SUB-MENU ICON INDENT FIX --- */
.nav-sidebar .nav-treeview .nav-link.pl-4 {
    padding-left: 1.5rem !important;
}

/* Smaller sub-menu icons */
.nav-sidebar .nav-treeview .nav-icon {
    font-size: 1rem !important;
    width: 1.5rem;
}

/* --- DATATABLES SCROLL FIX (sidebar mini) --- */
.dataTables_wrapper .dataTables_scrollHead table,
.dataTables_wrapper .dataTables_scrollBody table {
    width: 100% !important;
}

/* --- MODAL FOOTER CLEAN BORDER --- */
.modal-footer.bg-light {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: calc(0.3rem - 1px);
    border-bottom-right-radius: calc(0.3rem - 1px);
}

/* --- CARD GRADIENT HEADERS --- */
.card-header.bg-gradient-primary,
.card-header.bg-gradient-warning,
.card-header.bg-gradient-success,
.card-header.bg-gradient-danger {
    color: #fff !important;
    border-bottom: none;
}

/* --- BTN GLOW EFFECT --- */
.btn-primary.shadow-sm {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.btn-primary.shadow-sm:hover {
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4) !important;
    transform: translateY(-1px) !important;
}

.btn-warning.shadow-sm {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.btn-warning.shadow-sm:hover {
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.45) !important;
    transform: translateY(-1px) !important;
}

.btn-danger.shadow-sm {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25) !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.btn-danger.shadow-sm:hover {
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4) !important;
    transform: translateY(-1px) !important;
}


/* --- SIDEBAR TOGGLE ARROW BUTTON --- */
.sidebar-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px !important;
    padding: 0 !important;
    margin: 0 4px !important;
    transition: background 0.2s ease, box-shadow 0.2s ease !important;
}

.sidebar-toggle-btn:hover {
    background: rgba(220, 53, 69, 0.1) !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15) !important;
}

body.dark-mode .sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-toggle-icon {
    font-size: 1.4rem !important;
    line-height: 1 !important;
    color: #dc3545 !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.2s ease !important;
    filter: drop-shadow(0 1px 3px rgba(220, 53, 69, 0.25));
}

body.dark-mode .sidebar-toggle-icon {
    color: #e0e0e0 !important;
    filter: drop-shadow(0 1px 3px rgba(255, 255, 255, 0.15));
}

.sidebar-toggle-btn:hover .sidebar-toggle-icon {
    transform: scale(1.25) !important;
    filter: drop-shadow(0 2px 6px rgba(220, 53, 69, 0.5));
}

body.dark-mode .sidebar-toggle-btn:hover .sidebar-toggle-icon {
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.3));
}

/* --- SIDEBAR BRAND TEXT --- */
/* Light mode: teks gelap agar kontras di atas sidebar transparan */
body:not(.dark-mode) .main-sidebar .brand-infrastruktur {
    color: #b71c1c !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

body:not(.dark-mode) .main-sidebar .brand-subtitle {
    color: #444 !important;
    opacity: 0.7;
}

/* Dark mode: teks putih dengan shadow */
body.dark-mode .main-sidebar .brand-infrastruktur {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .main-sidebar .brand-subtitle {
    color: #dddddd !important;
    opacity: 0.7;
}


/* --- ROBUST SIDEBAR TOGGLE ICON SYSTEM --- */
/* Hide/Show based on body classes for instant feedback & zero flicker */
.toggle-collapsed {
    display: none !important;
}

body.sidebar-collapse .toggle-expanded {
    display: none !important;
}

body.sidebar-collapse .toggle-collapsed {
    display: inline-block !important;
}

body:not(.sidebar-collapse) .toggle-expanded {
    display: inline-block !important;
}

/* Ensure icons rotate or animate smoothly if desired */
.sidebar-toggle-icon {
    transition: transform 0.2s ease !important;
}


/* Sidebar Logout link specific styling */
.main-sidebar .logout-link {
    margin-top: 10px;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(220, 53, 69, 0.1);
}

.main-sidebar .logout-link:hover {
    background: rgba(220, 53, 69, 0.15) !important;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2) !important;
}

.dark-mode .main-sidebar .logout-link:hover {
    background: rgba(220, 53, 69, 0.25) !important;
}


/* --- KONEKSI PAGE STYLES --- */
.login-container-wide {
    width: 100%;
    max-width: 900px;
}

/* Theme Toggle Animation */
.theme-animate {
    display: inline-block;
    animation: themeToggleAnim 0.6s var(--theme-anim-timing) forwards;
}

@keyframes themeToggleAnim {
    0% {
        transform: scale(1) rotate(0deg);
    }

    30% {
        transform: scale(1.4) rotate(25deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* --- LOGIN PAGE STYLES --- */
.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Source Sans Pro', -apple-system, sans-serif;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(220, 53, 69, 0.3) 100%),
        url('../../img/login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    animation: premiumBg 30s infinite alternate ease-in-out;
}

@keyframes premiumBg {
    0% {
        background-position: center center;
        filter: contrast(100%) brightness(100%);
    }

    50% {
        background-position: 51% 51%;
        filter: contrast(105%) brightness(110%);
    }

    100% {
        background-position: center center;
        filter: contrast(100%) brightness(100%);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
    margin: 0 auto;
}

.inner-glass-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.inner-glass-card h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(220, 53, 69, 0.3);
    padding-bottom: 10px;
}

.koneksi-page .form-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
    display: block;
}

.custom-input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 15px;
    color: #333;
    transition: all 0.3s;
}

.custom-input:focus {
    background: #fff;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.btn-glass {
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 10px 15px;
    transition: all 0.3s;
}

.btn-test {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.btn-test:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-save-main {
    background: linear-gradient(135deg, var(--primary-red), #82242aff);
    border: none;
    color: white;
    padding: 15px;
    font-size: 1.1rem;
    border-radius: 12px;
    margin-top: 10px;
}

.btn-save-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    filter: brightness(1.1);
    color: white;
}



/* --- GLASS DROPDOWNS --- */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

body.dark-mode .dropdown-menu {
    background: rgba(30, 30, 30, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dropdown-item {
    border-radius: 8px !important;
    margin: 2px 8px !important;
    width: calc(100% - 16px) !important;
    transition: all 0.2s ease !important;
}

.dropdown-item:hover {
    background: rgba(220, 53, 69, 0.1) !important;
    transform: translateX(3px);
}

/* --- GLOBAL GLASS OVERRIDES --- */
/* Only transparent in dark mode or if no specific bg class */
.bg-light,
.bg-white,
.card-header,
.card-footer,
.modal-body,
.modal-footer {
    background: transparent !important;
}

body.dark-mode .modal-header:not([class*="bg-gradient-"]) {
    background: transparent !important;
}

body.dark-mode .bg-gradient-primary,
body.dark-mode .bg-gradient-warning,
body.dark-mode .bg-gradient-success,
body.dark-mode .bg-gradient-info,
body.dark-mode .bg-gradient-danger {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Ensure visibility in light mode */
body:not(.dark-mode) .bg-gradient-primary {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
}

body:not(.dark-mode) .bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107, #e0960b) !important;
}

body:not(.dark-mode) .bg-gradient-success {
    background: linear-gradient(135deg, #28a745, #1a6e2e) !important;
}

body:not(.dark-mode) .bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545, #9b1a25) !important;
}

body:not(.dark-mode) .bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8, #0d7a8a) !important;
}

/* Hide Breadcrumbs Globally */
.breadcrumb,
.content-header .breadcrumb {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* Page Headers */
.content-header .row>.col-sm-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.content-header h1 {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .content-header h1 {
    color: #fff;
}

/* Buttons Polish */
.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4) !important;
}

/* --- MOBILE HORIZONTAL SCROLL (DataTables) --- */
/* Aktif di semua tabel yang membutuhkan scroll horizontal di HP */
.dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_scroll,
.dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Card body wrapper dengan touch support */
.card-body.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem;
}

@media (max-width: 768px) {

    /* Pastikan scroll horizontal aktif di mobile */
    .dataTables_wrapper {
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Hint geser hanya tampil di mobile */
    .table-scroll-hint {
        display: block;
        text-align: right;
        color: #999;
        font-size: 0.75rem;
        padding: 4px 8px 2px;
    }
}

@media (min-width: 769px) {
    .table-scroll-hint {
        display: none;
    }
}

/* --- PAGE SPECIFIC & UTILITY STYLES --- */

/* Utility Classes */
.overflow-x-auto {
    overflow-x: auto !important;
}

.overflow-y-auto {
    overflow-y: auto !important;
}

.w-100-forced {
    width: 100% !important;
}

.w-max-content {
    width: max-content !important;
}

.pos-relative {
    position: relative !important;
}

.pos-absolute {
    position: absolute !important;
}

.z-index-1060 {
    z-index: 1060 !important;
}

.max-w-400 {
    max-width: 400px !important;
}

.max-w-200 {
    max-width: 200px !important;
}

.br-15 {
    border-radius: 15px !important;
}

.br-20 {
    border-radius: 20px !important;
}

/* Dashboard & Cards */
.card-glassmorphism {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

/* Grid Images */
.img-thumbnail-grid {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.img-thumbnail-grid:hover {
    transform: scale(2.0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
}


/* DataTables & Select2 Custom */
.select2-bs4-custom .select2-container--bootstrap4 .select2-selection--single {
    height: calc(2.25rem + 2px) !important;
}

.dt-buttons-custom .dt-buttons {
    margin-bottom: 15px;
}

/* Card Header Adjustments */
.card-header-tabs-custom {
    position: relative;
    padding-top: 10px;
    padding-bottom: 0px;
}

.card-header-actions {
    position: absolute;
    right: 1.25rem;
    top: 10px;
    z-index: 10;
}

/* --- JADWAL KERJA STYLES --- */
.bg-gradient-brand {
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%) !important;
}

.card-header.bg-gradient-brand,
.card-header.bg-gradient-brand h5,
.card-header.bg-gradient-brand .card-title,
.card-header.bg-gradient-brand .legend-label,
.card-header.bg-gradient-brand small {
    color: #ffffff !important;
}

.legend-box {
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: bold;
}

.table-responsive-grab {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.schedule-table {
    table-layout: fixed;
    width: 100% !important;
}

.schedule-table th,
.schedule-table td {
    border-color: rgba(0, 0, 0, 0.05) !important;
    vertical-align: middle !important;
}

.th-tanggal-header {
    letter-spacing: 2px;
    font-size: 0.8rem;
    background: #f1f3f5;
}

.day-cell {
    min-width: 36px !important;
    width: 3%;
    padding: 5px 0 !important;
    font-size: 0.7rem;
}

.status-indicator {
    width: 26px;
    height: 26px;
    line-height: 26px;
    margin: auto;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.status-indicator:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.schedule-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.form-control-xs {
    height: calc(1.5em + .5rem + 2px);
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
    border-radius: .2rem;
}

.select-group:focus {
    background: #fff !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
}

/* Scrollbar Styling */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Fixed column for names */
.name-col {
    min-width: 150px;
    width: 150px;
    background: #f8f9fa !important;
    position: sticky;
    left: 0;
    z-index: 100;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.group-col {
    width: 50px;
    min-width: 50px;
    background: #f8f9fa !important;
    position: sticky;
    left: 150px;
    z-index: 99;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.03);
}

/* Sticky Header */
.schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f1f3f5 !important;
}

.schedule-table thead th.name-col {
    z-index: 101;
    top: 0;
}

.schedule-table thead th.group-col {
    z-index: 101;
    top: 0;
}

@media (max-width: 768px) {
    .schedule-table {
        width: max-content !important;
    }

    .name-col {
        min-width: 130px;
        width: 130px;
        font-size: 0.8rem;
    }

    .group-col {
        left: 130px;
    }

    .day-cell {
        min-width: 35px !important;
        max-width: 36px !important;
        width: 36px !important;
    }
}

/* Optimization for Mobile Landscape */
@media (max-width: 991.98px) and (orientation: landscape) {
    .schedule-table {
        width: max-content !important;
        table-layout: auto !important; /* Biarkan sel menentukan lebar agar tidak tumpang tindih */
        min-width: 100%;
    }

    .name-col {
        min-width: 200px !important; /* Tambah sedikit lagi agar lebih lega */
        width: 200px !important;
        font-size: 0.85rem !important;
    }

    .group-col {
        left: 200px !important;
    }

    .day-cell, 
    .schedule-table td[data-date] {
        min-width: 42px !important; /* Ukuran lebih proporsional */
        width: 42px !important;
        font-size: 0.8rem !important;
    }

    .status-indicator {
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        margin: 3px auto !important;
    }

    
    .schedule-table thead th.day-cell {
        padding: 10px 0 !important;
    }

    /* Legenda lebih rapi di landscape */
    .legend-box {
        width: 24px !important;
        height: 24px !important;
        line-height: 24px !important;
    }
    
    .legend-label {
        font-size: 0.75rem !important;
    }
}



/* --- DARK MODE OVERRIDES (Jadwal) --- */
.dark-mode .name-col,
.dark-mode .group-col {
    background: #2d3035 !important;
    color: #e4e6ea !important;
}

.dark-mode .schedule-table thead th {
    background: #343a40 !important;
    color: #e4e6ea !important;
}

.dark-mode .schedule-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

.dark-mode .schedule-table td,
.dark-mode .schedule-table th {
    border-color: #444c56 !important;
    color: #e4e6ea;
}

.dark-mode .select-group {
    background: #3a3f47 !important;
    color: #e4e6ea !important;
}

.dark-mode .select-group:focus {
    background: #454b54 !important;
}

.dark-mode .table-responsive::-webkit-scrollbar-track {
    background: #2d3035;
}

.dark-mode .table-responsive::-webkit-scrollbar-thumb {
    background: #555;
}

.dark-mode .day-cell {
    color: #e4e6ea;
}

.dark-mode .day-cell.text-danger {
    color: #f87171 !important;
}

.dark-mode .card {
    background: #2d3035 !important;
    border-color: #444c56 !important;
}

.dark-mode .card h6,
.dark-mode .card b {
    color: #e4e6ea;
}

/* Camera capture styles (from lk.php) */
#camera-container {
    display: none;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 10px auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

#webcam-preview {
    width: 100%;
    height: auto;
    transform: scaleX(-1);
}

.camera-overlay {
    position: absolute;
    bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#captured-preview-container {
    display: none;
    margin-top: 10px;
    text-align: center;
}

#captured-preview {
    max-width: 200px;
    border-radius: 8px;
    border: 2px solid #007bff;
}

/* --- GANTI RUGI LAKA (33) STYLES --- */
#table-master-peralatan_filter {
    text-align: left !important;
    float: left !important;
    width: 100%;
    margin-bottom: 10px;
}

#table-master-peralatan_filter label {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#table-master-peralatan_filter input {
    width: 100% !important;
    max-width: 120px !important;
    margin-left: 10px !important;
}

#table-master-peralatan {
    font-size: 0.875rem;
}

#table-master-peralatan th,
#table-master-peralatan td {
    padding: 0.25rem 0.5rem;
}

.photo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-photo {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 0 5px;
    cursor: pointer;
    border-bottom-left-radius: 8px;
}

.btn-remove-photo:hover {
    background: rgba(255, 0, 0, 0.8);
}

/* Column Width Utilities */
.w-5-pct {
    width: 5% !important;
}

.w-50px {
    width: 50px !important;
}

.w-60px {
    width: 60px !important;
}

.w-80px {
    width: 80px !important;
}

.w-100px {
    width: 100px !important;
}

.w-150px {
    width: 150px !important;
}

/* --- REVISI SALAH SHIFT & ISOMETRIC LOADER --- */
.alert-isometric-container {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.isometric-loader-container {
    position: relative;
    transform: scale(0.6) rotateX(60deg) rotateZ(-45deg);
    transform-style: preserve-3d;
    width: 120px;
    height: 120px;
}

.cube {
    position: absolute;
    width: 40px;
    height: 40px;
    transform-style: preserve-3d;
    animation: animateCube 2s ease-in-out infinite;
}

.cube::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    transform: translateZ(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.cube::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2a8bc8;
    transform: rotateX(-90deg) translateY(40px);
    transform-origin: bottom;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.cube span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #17669a;
    transform: rotateY(90deg) translateZ(40px);
    transform-origin: left;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

@keyframes animateCube {

    0%,
    10% {
        transform: translateZ(0);
    }

    50% {
        transform: translateZ(60px);
    }

    90%,
    100% {
        transform: translateZ(0);
    }
}

.cube:nth-child(1) {
    top: 0;
    left: 0;
    animation-delay: 0.1s;
}

.cube:nth-child(2) {
    top: 0;
    left: 40px;
    animation-delay: 0.2s;
}

.cube:nth-child(3) {
    top: 0;
    left: 80px;
    animation-delay: 0.3s;
}

.cube:nth-child(4) {
    top: 40px;
    left: 0;
    animation-delay: 0.2s;
}

.cube:nth-child(5) {
    top: 40px;
    left: 40px;
    animation-delay: 0.3s;
}

.cube:nth-child(6) {
    top: 40px;
    left: 80px;
    animation-delay: 0.4s;
}

.cube:nth-child(7) {
    top: 80px;
    left: 0;
    animation-delay: 0.3s;
}

.cube:nth-child(8) {
    top: 80px;
    left: 40px;
    animation-delay: 0.4s;
}

.cube:nth-child(9) {
    top: 80px;
    left: 80px;
    animation-delay: 0.5s;
}

.dt-loader-text {
    color: #2a8bc8;
    letter-spacing: 4px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    animation: pulseText 2s ease-in-out infinite;
    text-shadow: 0px 0px 10px rgba(0, 242, 254, 0.3);
    margin-top: -10px;
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

.dt-loader-overlay {
    background: rgba(255, 255, 255, 0.85);
    z-index: 1050;
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-body-scrollable {
    max-height: 70vh;
    overflow-y: auto;
}

/* --- DASHBOARD & TOPBAR UTILITIES --- */
.fs-1-5 {
    font-size: 1.5rem !important;
}

.opacity-8 {
    opacity: 0.8 !important;
}

.theme-toggle-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#theme-toggle {
    transition: all 0.3s ease !important;
    border-radius: 10px !important;
    width: 38px;
    height: 38px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}

#theme-toggle:hover {
    background-color: transparent !important;
}

#theme-toggle:hover i {
    color: var(--primary-red) !important;
}

body.dark-mode #theme-toggle:hover {
    background-color: transparent !important;
}

body.dark-mode #theme-toggle:hover i {
    color: #fff !important;
}

@keyframes rotateToggle {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

.rotate-animation {
    animation: rotateToggle 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- DASHBOARD ALERTS & MR WARNINGS --- */
.alert-birthday {
    background: linear-gradient(135deg, #17a2b8, #117a8b) !important;
}

.img-birthday {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid white;
}

.alert-mr-expired {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
}

.alert-mr-expiring {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #212529 !important;
}

.mr-warning-icon {
    font-size: 1.8rem;
    opacity: 0.9;
}

.mr-warning-title {
    font-size: 1.1rem;
    line-height: 1.2;
}

.diagnostic-panel {
    display: none;
    font-family: monospace;
    font-size: 12px;
    z-index: 9999;
}

/* More Utility */
.w-30px {
    width: 30px !important;
}

.h-30px {
    height: 30px !important;
}

.w-38px {
    width: 38px !important;
}

.h-38px {
    height: 38px !important;
}

.br-12 {
    border-radius: 12px !important;
}

.border-gray-03 {
    border: 1px solid rgba(128, 128, 128, 0.3) !important;
}

/* --- TOPBAR & DROPDOWN UTILITIES --- */
.w-60px {
    width: 60px !important;
}

.h-60px {
    height: 60px !important;
}

.w-70px {
    width: 70px !important;
}

.h-70px {
    height: 70px !important;
}

.top-110 {
    top: 110% !important;
}

.br-0-75 {
    border-radius: 0.75rem !important;
}

.bg-gradient-logout-header {
    background: linear-gradient(135deg, #dc3545, #f86f5c) !important;
}

.btn-logout-item {
    transition: all 0.2s !important;
}

.btn-logout-item:hover {
    background-color: #ffeaea !important;
}

.object-fit-cover {
    object-fit: cover !important;
}

.border-3-white {
    border: 3px solid #fff !important;
}

.theme-rotate-right {
    display: inline-block !important;
    animation: theme-pop-right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-rotate-left {
    display: inline-block !important;
    animation: theme-pop-left 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes theme-pop-right {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.3) rotate(20deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes theme-pop-left {
    0% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.3) rotate(-20deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* --- REPORT PAGE STYLES (HTML PRINTS) --- */
@page {
    size: A4;
    margin: 0;
}

body.report-page {
    font-family: "Times New Roman", Times, serif !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #eee !important;
    color: #111 !important;
}

.report-page .page {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm 20mm;
    margin: 10mm auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.report-page .page:not(:last-child) {
    page-break-after: always;
}

.report-page .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.report-page .logo-cw {
    width: 140px;
}

.report-page .logo-cpi {
    width: 80px;
}

.report-page .company-title {
    text-align: center;
    flex-grow: 1;
}

.report-page .company-title h1 {
    font-size: 25px !important;
    margin: 0;
    text-decoration: none;
}

.report-page .report-title {
    text-align: center;
    margin-bottom: 15px;
}

.report-page .report-title h2 {
    font-size: 16px;
    margin: 0;
    text-transform: uppercase;
    display: inline-block;
    padding-bottom: 2px;
}

.report-page .report-title p {
    margin: 5px 0 0 0;
    font-weight: bold;
}

.report-page .info-table {
    width: 100%;
    margin-bottom: 15px;
}

.report-page .info-table td {
    font-size: 14px;
    vertical-align: top;
    padding: 2px 0;
}

.report-page .info-table .label {
    width: 120px;
}

.report-page .info-table .colon {
    width: 20px;
    text-align: center;
}

.report-page .content-body {
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
}

.report-page .content-body p {
    margin-bottom: 10px;
}

.report-page .content-body .ref-list {
    padding-left: 20px;
    font-weight: bold;
}

.report-page .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.report-page .data-table th,
.report-page .data-table td {
    border: 1px solid black !important;
    padding: 8px;
    text-align: left;
    font-size: 12px;
    color: #000 !important;
}

.report-page .data-table th {
    background-color: #ddd !important;
    text-align: center;
    text-transform: uppercase;
}

.report-page .data-table td {
    vertical-align: top;
}

.report-page .signature-container {
    width: 100%;
    margin-top: 20px;
}

.report-page .signature-container p,
.report-page .signature-container div {
    margin: 0;
}

.report-page .sign-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.report-page .sign-block {
    width: 30%;
    text-align: center;
    font-size: 14px;
}

.report-page .sign-space {
    height: 60px;
}

.report-page .sign-name {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 0;
}

.report-page .doc-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border: 2px solid #ddd;
    margin-bottom: 2px;
}

.report-page .doc-label {
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-top: 5px;
}

.report-page .doc-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.report-page .doc-item {
    width: 48%;
    text-align: center;
    margin-bottom: 30px;
}

.report-page .doc-item.full-width {
    width: 80%;
    margin: 0 auto;
}

.report-page .doc-item.full-width .doc-image {
    height: 350px;
}

@media print {
    @page {
        margin: 0;
    }

    html,
    body.report-page {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .report-page .page {
        margin: 0 !important;
        box-shadow: none !important;
        width: 210mm;
        height: 293mm;
        page-break-after: always;
        page-break-inside: avoid;
    }

    .report-page .page:last-child {
        page-break-after: avoid !important;
    }

    .no-print {
        display: none !important;
    }

    .print-btn-fixed {
        display: none !important;
    }
}

.print-btn-fixed {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.print-btn-fixed:hover {
    transform: scale(1.1);
    background-color: #0056b3;
}

.report-page .divider {
    border-bottom: 3px solid #000;
    margin-bottom: 10px;
}

.report-page .date-box {
    border: 1px solid #000;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
    margin-bottom: 20px;
}

.report-page .recipient-box {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.report-page .signature-section {
    width: 100%;
}

.report-page .signature-section p,
.report-page .signature-section div {
    margin: 0;
}

.report-page .sign-title {
    font-size: 12px;
    margin: 0;
}

.report-page .note-box {
    width: 100%;
    border: 1px solid black;
    margin-top: 20px;
}

.report-page .note-header {
    background: #ddd;
    text-align: center;
    font-weight: bold;
    padding: 5px;
    border-bottom: 1px solid black;
    font-size: 12px;
}

.report-page .note-body {
    height: 100px;
}

.report-page .p2-header-cpi {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.report-page .p2-header-cpi img {
    position: absolute;
    left: 0;
    width: 50px;
}

.report-page .p2-header-cpi h1 {
    margin: 0;
    text-align: center;
    flex-grow: 1;
}

.report-page .p2-title {
    text-align: center;
    margin-bottom: 20px;
}

.report-page .p2-title h1 {
    font-size: 22px !important;
    text-decoration: underline;
    margin: 0;
}

.report-page .p2-title p {
    margin: 5px 0 0 0;
    font-size: 14px;
}

.report-page .report-narrative {
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
}

.report-page .report-narrative p {
    margin-bottom: 12px;
}

.report-page .footer-address {
    position: absolute;
    bottom: 15mm;
    left: 15mm;
    right: 15mm;
    border-top: 1px solid #000;
    padding-top: 5px;
    text-align: center;
    font-size: 10px;
    font-style: italic;
}

.report-page .doc-title {
    text-align: center;
    margin-bottom: 30px;
}

.report-page .doc-title h1 {
    font-size: 20px !important;
    text-decoration: underline;
    text-transform: uppercase;
}

.report-page .doc-image-container {
    width: 100%;
    text-align: center;
}

.report-page .doc-image-max {
    max-width: 90%;
    max-height: 180mm;
    border: 2px solid #ddd;
    object-fit: contain;
}

.report-page .container-report {
    width: 90%;
    margin: 0 auto;
}

.report-page .header-ba33 h1 {
    font-size: 20pt !important;
    margin: 0;
    color: #000;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.report-page .title-ba33 {
    text-align: center;
    margin-bottom: 25px;
}

.report-page .title-ba33 h2,
.report-page .title-ba33 h3 {
    font-size: 14pt !important;
    margin: 0;
    text-transform: uppercase;
    font-weight: bold;
}

.report-page .footer-sign {
    width: 100%;
    margin-top: 40px;
    border: none !important;
}

.report-page .footer-sign td {
    border: none !important;
    width: 50%;
    vertical-align: top;
    padding: 10px 0;
    text-align: center;
}

.report-page .signature-space {
    height: 90px;
}

.report-page .page-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid #000;
    padding-top: 5px;
    font-size: 8pt;
    font-style: italic;
}

.report-page .doc-section {
    margin-top: 30px;
    page-break-before: always;
}

.report-page .no-border {
    border: none !important;
}

.report-page .font-9pt {
    font-size: 9pt !important;
}

.font-10pt {
    font-size: 10pt !important;
}

/* --- AKTIVITAS UTILITIES --- */
.chart-container-300 {
    position: relative;
    height: 300px;
    width: 100%;
}

.h-80px {
    height: 80px !important;
}

.cursor-pointer {
    cursor: pointer !important;
}

.fs-10px {
    font-size: 10px !important;
}

.top-n5 {
    top: -5px !important;
}

.right-n5 {
    right: -5px !important;
}

.bg-read-only {
    background-color: #e9ecef !important;
    cursor: not-allowed !important;
}

.rounded-circle-forced {
    border-radius: 50% !important;
}

/* --- SETTING UTILITIES --- */
.w-18px {
    width: 18px !important;
}

.fs-1-1rem {
    font-size: 1.1rem !important;
}

.fs-1rem {
    font-size: 1rem !important;
}

.fs-0-85rem {
    font-size: 0.85rem !important;
}

.qr-img-style {
    max-width: 220px !important;
    border: 4px solid #28a745 !important;
    border-radius: 12px !important;
}

.w-70px {
    width: 70px !important;
}

.max-h-500px {
    max-height: 500px !important;
}

.color-inherit {
    color: inherit !important;
}

.opacity-3 {
    opacity: 0.3 !important;
}

/* --- USER PROFILE UTILITIES --- */
.user-avatar-rect {
    width: 100% !important;
    max-width: 90px !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border: 3px solid #fff !important;
}

/* --- MOBILE READER UTILITIES --- */
.br-15 {
    border-radius: 15px !important;
}

.br-20 {
    border-radius: 20px !important;
}

.br-top-20 {
    border-radius: 20px 20px 0 0 !important;
}

.br-bottom-20 {
    border-radius: 0 0 20px 20px !important;
}

.overflow-x-auto-touch {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.badge-mr-style {
    font-size: 0.7rem !important;
    padding: 0.3em 0.6em !important;
    border-radius: 8px !important;
}

.btn-30px {
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.br-8 {
    border-radius: 8px !important;
}

/* --- SAM REPLACEMENT UTILITIES --- */
.border-top-red-4 {
    border-top: 4px solid #dc3545 !important;
}

.border-top-green-4 {
    border-top: 4px solid #28a745 !important;
}

.top-2 {
    top: 2px !important;
}

.right-2 {
    right: 2px !important;
}

.opacity-75 {
    opacity: 0.75 !important;
}

.opacity-3 {
    opacity: 0.3 !important;
}

/* --- KONEKSI UTILITIES --- */
.toggle-password-style {
    cursor: pointer !important;
    position: absolute !important;
    right: 10px !important;
    top: 12px !important;
    color: #666 !important;
}

/* ==========================================================================
   PRINT / REPORT SPECIFIC STYLES (Untuk Laporan BA & LK Cetak)
   ========================================================================== */
@media screen,
print {
    body.report-page {
        font-family: 'Times New Roman', Times, serif;
        background: #eee;
        font-size: 14px;
    }

    body.report-page .page {
        width: 210mm;
        min-height: 297mm;
        padding: 20mm;
        margin: 10mm auto;
        border: 1px #D3D3D3 solid;
        border-radius: 5px;
        background: white;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
        box-sizing: border-box;
        position: relative;
    }

    body.report-page p {
        margin-bottom: 10px;
        line-height: 1.5;
    }

    /* Header Report */
    .p2-header-cpi {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .p2-header-cpi img {
        margin-right: 15px;
    }

    .p2-title {
        text-align: center;
        margin-bottom: 20px;
    }

    .p2-title h1 {
        font-size: 20px;
        font-weight: bold;
        text-decoration: underline;
        margin-bottom: 5px;
    }

    .r-title {
        text-align: center;
        font-size: 16px;
        font-weight: bold;
        text-decoration: underline;
        margin-bottom: 15px;
    }

    /* Tabel Data Report */
    .data-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        border: 1px solid #000;
        padding: 8px;
        text-align: left;
    }

    .data-table th {
        background-color: #f2f2f2;
        text-align: center;
    }

    /* Signature Area */
    .signature-section {
        margin-top: 30px;
        page-break-inside: avoid;
    }

    .sign-row {
        display: flex;
        justify-content: space-between;
        margin-top: 30px;
        align-items: flex-end;
    }

    .sign-block {
        width: 33%;
        text-align: center;
    }

    .sign-name {
        font-weight: bold;
        text-decoration: underline;
    }

    .sign-title {
        font-size: 13px;
        font-weight: bold;
    }

    /* Footer KOP Address */
    .footer-address {
        font-size: 10px;
        text-align: center;
        border-top: 1px solid #000;
        padding-top: 5px;
        margin-top: 20px;
        width: 100%;
    }

    /* Kop Surat BA */
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }

    .logo-cw {
        width: 60px;
    }

    .logo-cpi {
        width: 60px;
    }

    .company-title {
        text-align: center;
        flex-grow: 1;
    }

    .company-title h1 {
        font-size: 20px;
        font-weight: bold;
        margin: 0;
        color: #000000;
    }

    .company-title h2 {
        font-size: 14px;
        font-weight: bold;
        margin: 0;
        text-decoration: underline;
    }

    .divider {
        border-bottom: 3px solid #000;
        margin-bottom: 20px;
    }

    /* Kotak Pelengkap BA */
    .date-box {
        text-align: right;
        margin-bottom: 20px;
        font-weight: bold;
    }

    .recipient-box {
        margin-bottom: 20px;
    }

    .note-box {
        border: 1px solid #000;
        min-height: 100px;
        margin-top: 20px;
    }

    .note-header {
        background: #f2f2f2;
        border-bottom: 1px solid #000;
        padding: 5px;
        font-weight: bold;
        text-align: center;
    }

    .doc-title {
        text-align: center;
        border: 1px solid #000;
        padding: 5px;
        background: #f2f2f2;
        margin-bottom: 20px;
    }

    .doc-title h1 {
        font-size: 16px;
        margin: 0;
    }

    .doc-image-container {
        text-align: center;
        margin: 20px 0;
        min-height: 400px;
    }

    .doc-image {
        max-width: 100%;
        max-height: 600px;
        border: 1px solid #000;
        padding: 5px;
    }

    /* Print Button UI */
    .print-btn-fixed {
        position: fixed;
        bottom: 30px;
        right: 30px;
        border-radius: 50%;
        width: 60px;
        height: 60px;
        background: #007bff;
        color: white;
        border: none;
        font-size: 24px;
        box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        cursor: pointer;
        transition: 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .print-btn-fixed:hover {
        background: #0056b3;
        transform: scale(1.1);
    }
}

@media print {
    body.report-page {
        background: white;
        margin: 0;
        padding: 0;
    }

    body.report-page .page {
        margin: 0;
        padding: 10mm;
        border: none;
        box-shadow: none;
        width: 100%;
        height: auto;
        min-height: fit-content;
        page-break-after: always;
        position: relative;
    }

    body.report-page .page:last-child {
        page-break-after: auto;
    }

    .no-print {
        display: none !important;
    }

    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}

.font-weight-600 {
    font-weight: 600 !important;
}

/* ============================================================
   PIVOT TABLE — Rekap Jenis Aktivitas (Light + Dark Mode)
   ============================================================ */

/* Header utama - gradasi biru premium */
.pivot-header-title {
    background: linear-gradient(135deg, #0d47a1, #1976d2) !important;
    color: #fff !important;
    font-size: 1.1rem;
    padding: 15px !important;
    letter-spacing: 1px;
    border: none !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Sub-header baris (Lokasi, NO, Nama Alat, Jumlah) — Samakan semua */
.pivot-header-col,
.pivot-header-loc,
.pivot-header-total,
thead .pivot-sticky-column-no,
thead .pivot-sticky-column-name {
    background-color: #455a64 !important;
    /* Warna Slate Grey konsisten */
    color: #fff !important;
    font-weight: 700;
}

/* Isi Tabel (Body) menyesuaikan tema */
tbody .pivot-sticky-column-no,
tbody .pivot-sticky-column-name {
    color: inherit !important;
    font-weight: 600;
}

/* Header baris ke-2 (Nama-nama lokasi) */
.pivot-header-loc th {
    background-color: #546e7a !important;
    color: #fff !important;
    font-size: 0.7rem;
}

/* Specific overrides for sticky header cells to keep them consistent */
thead .pivot-sticky-column-no,
thead .pivot-sticky-column-name {
    background-color: #455a64 !important;
    z-index: 25 !important;
}


/* Baris data — modern look */
.pivot-row-even {
    background: #fdfdfe;
}

.pivot-row-odd {
    background: #ffffff;
}

.pivot-row-even:hover,
.pivot-row-odd:hover {
    background-color: #f1f4f9 !important;
}

.pivot-cell-zero {
    color: #d1d1d1;
    font-weight: 300;
}

.pivot-cell-value {
    color: #1a73e8;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Highlight cells with values */
.pivot-cell-value:not(:empty):not(:contains("0")) {
    background-color: rgba(26, 115, 232, 0.05);
}

.pivot-cell-total {
    background: #eceff1;
    font-weight: 800;
    color: #37474f;
    border-left: 2px solid #cfd8dc !important;
}

.pivot-cell-total.has-value {
    background: #e3f2fd !important;
    color: #1565c0 !important;
}

/* Baris total bawah - Dark slate */
.pivot-row-grand {
    background: #263238 !important;
    color: #fff !important;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* Sticky shadow effect */
.pivot-sticky-column-name {
    box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.05);
    border-right: 1px solid #dee2e6 !important;
}

/* ---- DARK MODE enhancements ---- */
body.dark-mode thead th,
body.dark-mode .pivot-header-col,
body.dark-mode .pivot-header-loc,
body.dark-mode .pivot-header-total,
body.dark-mode .pivot-sticky-column-no,
body.dark-mode .pivot-sticky-column-name {
    background-color: #1e2130 !important;
    color: #eee !important;
}

body.dark-mode .pivot-row-even {
    background: #2a2d3e;
}

body.dark-mode .pivot-row-odd {
    background: #242637;
}

body.dark-mode .pivot-row-even:hover,
body.dark-mode .pivot-row-odd:hover {
    background-color: #31344a !important;
}

body.dark-mode .pivot-cell-zero {
    color: #444;
}

body.dark-mode .pivot-cell-value {
    color: #81d4fa;
}

body.dark-mode .pivot-cell-total {
    background: #1e2130;
    border-left-color: #3a3d50 !important;
}

body.dark-mode .pivot-cell-total.has-value {
    background: #0d47a1 !important;
    color: #fff !important;
}

body.dark-mode .pivot-sticky-column-name {
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .pivot-row-grand {
    background: #1a1c2a;
    color: #e0e0e0;
}

body.dark-mode .pivot-row-grand td[style*="sticky"] {
    background: #1a1c2a !important;
}

body.dark-mode .table-bordered td,
body.dark-mode .table-bordered th {
    border-color: #3a3d50 !important;
}


/* Sticky Column for Pivot Table */
.pivot-sticky-wrapper {
    position: relative;
    overflow: auto;
    max-height: 600px;
}

.pivot-sticky-column {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: inherit !important;
}

.pivot-sticky-column-no {
    position: sticky;
    left: 0;
    z-index: 11;
    background-color: inherit !important;
    min-width: 40px;
}

.pivot-sticky-column-name {
    position: sticky;
    left: 40px;
    /* Offset by NO column width */
    z-index: 11;
    background-color: inherit !important;
    min-width: 160px;
}

/* Fix for dark mode sticky backgrounds */
body.dark-mode .pivot-sticky-column-no,
body.dark-mode .pivot-sticky-column-name {
    background-color: #242637 !important;
}

body.dark-mode .pivot-row-even .pivot-sticky-column-name {
    background-color: #2a2d3e !important;
}

/* Fix for light mode sticky backgrounds */
body:not(.dark-mode) tbody .pivot-sticky-column-no,
body:not(.dark-mode) tbody .pivot-sticky-column-name {
    background-color: #ffffff !important;
}

body:not(.dark-mode) tbody .pivot-row-even .pivot-sticky-column-no,
body:not(.dark-mode) tbody .pivot-row-even .pivot-sticky-column-name {
    background-color: #fdfdfe !important;
}




/* --- FIX FOOTER SCROLLING DENGAN LAYOUT-FIXED --- */
body.layout-fixed {
    overflow-y: auto !important;
    height: auto !important;
}

body.layout-fixed .wrapper {
    overflow: visible !important;
    height: auto !important;
}

body.layout-fixed .content-wrapper {
    overflow-y: visible !important;
    height: auto !important;
    min-height: calc(100vh - 114px) !important;
    /* Kurangi tinggi header dan footer agar pas minimal 1 layar penuh tanpa jarak sisa yang lebar */
}

/* Pastikan footer berperilaku normal */
.main-footer {
    display: block !important;
    position: static !important;
    z-index: 10 !important;
    margin-left: 250px;
}

body.sidebar-collapse .main-footer {
    margin-left: 4.6rem;
}

@media (max-width: 991.98px) {
    .main-footer {
        margin-left: 0 !important;
    }
}


/* --- PHOTO DELETION BUTTONS --- */
.top-n5 {
    top: -5px !important;
}

.right-n5 {
    right: -5px !important;
}

.top-n8 {
    top: -8px !important;
}

.right-n8 {
    right: -8px !important;
}

.btn-hapus-foto-pilih {
    z-index: 10;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-hapus-foto-pilih:hover {
    transform: scale(1.2);
}

.foto-item img {
    transition: all 0.3s ease;
}

.foto-item.marked-delete img {
    filter: grayscale(100%) blur(1px);
    border-color: #dc3545 !important;
}
 / *   P e t t y   C a s h   S l i d e a b l e   T a b l e   S t y l i n g   * / 
 # p e t t y c a s h - s c r o l l   { 
         s c r o l l b a r - w i d t h :   t h i n ; 
         s c r o l l b a r - c o l o r :   r g b a ( 0 ,   0 ,   0 ,   0 . 1 )   t r a n s p a r e n t ; 
         t r a n s i t i o n :   a l l   0 . 3 s   e a s e ; 
 } 
 
 # p e t t y c a s h - s c r o l l : : - w e b k i t - s c r o l l b a r   { 
         h e i g h t :   6 p x ; 
 } 
 
 # p e t t y c a s h - s c r o l l : : - w e b k i t - s c r o l l b a r - t r a c k   { 
         b a c k g r o u n d :   t r a n s p a r e n t ; 
 } 
 
 # p e t t y c a s h - s c r o l l : : - w e b k i t - s c r o l l b a r - t h u m b   { 
         b a c k g r o u n d :   r g b a ( 0 ,   0 ,   0 ,   0 . 1 ) ; 
         b o r d e r - r a d i u s :   1 0 p x ; 
 } 
 
 # p e t t y c a s h - s c r o l l : h o v e r : : - w e b k i t - s c r o l l b a r - t h u m b   { 
         b a c k g r o u n d :   r g b a ( 0 ,   0 ,   0 ,   0 . 2 ) ; 
 } 
 
 b o d y . d a r k - m o d e   # p e t t y c a s h - s c r o l l : : - w e b k i t - s c r o l l b a r - t h u m b   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 1 ) ; 
 } 
 
 b o d y . d a r k - m o d e   # p e t t y c a s h - s c r o l l : h o v e r : : - w e b k i t - s c r o l l b a r - t h u m b   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 2 ) ; 
 } 
 
 
 
 / *   S o f t   B a d g e   U t i l i t i e s   f o r   P e t t y   C a s h   * / 
 . b a d g e - i n f o - s o f t   { 
         b a c k g r o u n d - c o l o r :   r g b a ( 2 3 ,   1 6 2 ,   1 8 4 ,   0 . 1 ) ; 
         c o l o r :   # 1 7 a 2 b 8 ; 
         b o r d e r :   1 p x   s o l i d   r g b a ( 2 3 ,   1 6 2 ,   1 8 4 ,   0 . 2 ) ; 
 } 
 . b a d g e - s u c c e s s - s o f t   { 
         b a c k g r o u n d - c o l o r :   r g b a ( 4 0 ,   1 6 7 ,   6 9 ,   0 . 1 ) ; 
         c o l o r :   # 2 8 a 7 4 5 ; 
         b o r d e r :   1 p x   s o l i d   r g b a ( 4 0 ,   1 6 7 ,   6 9 ,   0 . 2 ) ; 
 } 
 . b a d g e - w a r n i n g - s o f t   { 
         b a c k g r o u n d - c o l o r :   r g b a ( 2 5 5 ,   1 9 3 ,   7 ,   0 . 1 ) ; 
         c o l o r :   # 8 5 6 4 0 4 ; 
         b o r d e r :   1 p x   s o l i d   r g b a ( 2 5 5 ,   1 9 3 ,   7 ,   0 . 2 ) ; 
 } 
 . b a d g e - d a n g e r - s o f t   { 
         b a c k g r o u n d - c o l o r :   r g b a ( 2 2 0 ,   5 3 ,   6 9 ,   0 . 1 ) ; 
         c o l o r :   # d c 3 5 4 5 ; 
         b o r d e r :   1 p x   s o l i d   r g b a ( 2 2 0 ,   5 3 ,   6 9 ,   0 . 2 ) ; 
 } 
 
 
 
 . b a d g e - s e c o n d a r y - s o f t   { 
         b a c k g r o u n d - c o l o r :   r g b a ( 1 0 8 ,   1 1 7 ,   1 2 5 ,   0 . 1 ) ; 
         c o l o r :   # 6 c 7 5 7 d ; 
         b o r d e r :   1 p x   s o l i d   r g b a ( 1 0 8 ,   1 1 7 ,   1 2 5 ,   0 . 2 ) ; 
 } 
 
 
 
/* Forced Aspect Ratio 3:4 for Previews */
#captured-preview-container {
    max-width: 300px;
    margin: 10px auto;
    position: relative;
}

#captured-preview {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 2px solid #fff;
}

.img-thumbnail-grid {
    width: 60px;
    height: 80px; /* 3:4 ratio for 60px width is 80px */
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.img-thumbnail-grid:hover {
    transform: scale(1.1);
    z-index: 10;
}

.preview-wrapper {
    position: relative;
    display: inline-block;
    max-width: 250px;
    margin: 10px auto;
}

.btn-remove-captured-corner {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
}

.btn-remove-captured-corner:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-remove-captured-corner i {
    font-size: 1.2rem;
    font-weight: bold;
}

#captured-preview-container {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

.btn-remove-captured-corner {
    top: 8px !important;
    right: 8px !important;
    width: 26px !important;
    height: 26px !important;
    background: #ff4d5a !important; /* Warna merah yang lebih cerah */
    border: 1.5px solid #fff !important;
    opacity: 0.9;
}

.btn-remove-captured-corner:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* --- KONEKSI EXTRA FIXES --- */
#btn-close-koneksi { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.05); border: none; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #777; transition: all 0.2s; z-index: 10; }
#btn-close-koneksi:hover { background: #dc3545; color: #fff; transform: rotate(90deg); }
.separator { display: flex; align-items: center; text-align: center; color: #999; font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; }
.separator::before, .separator::after { content: ''; flex: 1; border-bottom: 1px solid rgba(0,0,0,0.06); }
.separator:not(:empty)::before { margin-right: 1.5em; }
.separator:not(:empty)::after { margin-left: 1.5em; }
.form-control-login~i.bx { font-size: 1.3rem; left: 14px; }

/* --- KONEKSI PREMIUM UI (IMAGE MATCH) --- */
.koneksi-header-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; margin-bottom: 25px; }
.koneksi-title-text { font-size: 1.8rem; font-weight: 600; color: #333; margin-left: 20px; letter-spacing: 1px; }
.koneksi-title-text span { color: #dc3545; }
.btn-close-circle { background: #ff4d5a; color: #fff; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; font-size: 1.8rem; box-shadow: 0 4px 12px rgba(255, 77, 90, 0.3); transition: all 0.3s; cursor: pointer; }
.btn-close-circle:hover { transform: scale(1.1) rotate(90deg); background: #dc3545; }
.koneksi-main-card { background: #fff; border-radius: 15px; padding: 40px; box-shadow: 0 15px 40px rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.05); }
.koneksi-input-group { position: relative; margin-bottom: 20px; }
.koneksi-input-group label { position: absolute; top: -10px; left: 15px; background: #fff; padding: 0 8px; font-size: 0.75rem; font-weight: 700; color: #ff4d5a; z-index: 5; }
.koneksi-input-group input { width: 100%; padding: 12px 20px; border: 1.5px solid #ffccd1; border-radius: 10px; font-size: 1rem; outline: none; transition: all 0.3s; color: #333; font-weight: 500; }
.koneksi-input-group input:focus { border-color: #ff4d5a; box-shadow: 0 0 0 4px rgba(255, 77, 90, 0.1); }
.btn-test-link { display: block; width: 100%; text-align: center; padding: 20px 0 0; font-weight: 600; color: #444; cursor: pointer; transition: color 0.3s; font-size: 1.1rem; }
.btn-test-link:hover { color: #dc3545; }
.btn-save-full { width: 100%; background: linear-gradient(90deg, #ff4d5a, #82242aff); color: #fff; border: none; padding: 20px; border-radius: 15px; font-weight: 700; font-size: 1.25rem; margin-top: 30px; box-shadow: 0 10px 25px rgba(255, 77, 90, 0.3); transition: all 0.3s; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; }
.btn-save-full:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(255, 77, 90, 0.4); filter: brightness(1.1); }


/* Holiday Highlight Classes */
.bg-red-light { background-color: rgba(220, 53, 69, 0.1) !important; border: 1px solid rgba(220, 53, 69, 0.3) !important; }
body.dark-mode .bg-red-light { background-color: rgba(220, 53, 69, 0.25) !important; border: 1px solid rgba(220, 53, 69, 0.4) !important; }

/* Today Highlight Column */
.today-col { 
    background: linear-gradient(to bottom, rgba(0, 123, 255, 0.05), rgba(0, 123, 255, 0.08)) !important;
    border-left: 2px solid #007bff !important;
    border-right: 2px solid #007bff !important;
    position: relative;
}
.today-col::after {
    content: '▼';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #007bff;
    background: transparent;
    padding: 0;
    white-space: nowrap;
    font-weight: 800;
    z-index: 10;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

@keyframes arrow-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}
th.today-col::after { display: block; }
td.today-col::after { display: none; }

body.dark-mode .today-col {
    background: linear-gradient(to bottom, rgba(0, 123, 255, 0.15), rgba(0, 123, 255, 0.2)) !important;
    border-left-color: #3b9bff !important;
    border-right-color: #3b9bff !important;
}
body.dark-mode .today-col::after {
    color: #3b9bff;
}

/* --- BOXICONS ANIMATIONS --- */
.bx-spin { animation: bx-spin 2s infinite linear; display: inline-block; }
@keyframes bx-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg); } }

.bx-beat { animation: bx-beat 1s infinite cubic-bezier(0.215, 0.61, 0.355, 1); display: inline-block; }
@keyframes bx-beat {
    0% { transform: scale(0.95); }
    5% { transform: scale(1.1); }
    39% { transform: scale(0.85); }
    45% { transform: scale(1); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.bx-bounce { animation: bx-bounce 2s infinite cubic-bezier(0.28, 0.84, 0.42, 1); display: inline-block; }
@keyframes bx-bounce {
    0% { transform: scale(1, 1) translateY(0); }
    10% { transform: scale(1.1, 0.9) translateY(0); }
    30% { transform: scale(0.9, 1.1) translateY(-20px); }
    50% { transform: scale(1.05, 0.95) translateY(0); }
    57% { transform: scale(1, 1) translateY(-7px); }
    64% { transform: scale(1, 1) translateY(0); }
    100% { transform: scale(1, 1) translateY(0); }
}

.bx-flashing { animation: bx-flashing 1.5s infinite linear; display: inline-block; }
@keyframes bx-flashing { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }

.bx-tada { animation: bx-tada 1.5s ease infinite; display: inline-block; }
@keyframes bx-tada {
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1); }
}

.bx-burst { animation: bx-burst 1.5s infinite linear; display: inline-block; }
@keyframes bx-burst {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.bx-fade-up { animation: bx-fade-up 1.5s infinite; display: inline-block; }
@keyframes bx-fade-up { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }