/* Custom Styles for PPI Application */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f6f9ff;
    color: #333333;
}

/* Smooth transition ONLY when theme toggle button is manually clicked */
body.theme-transitioning,
body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important;
}

/* Sidebar styling */
.sidebar {
    width: 270px !important;
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
}

.sidebar .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
    color: #0d6efd;
    background-color: #f1f5f9;
}

.sidebar .nav-link.active {
    color: #0d6efd !important;
    background-color: #e7f1ff !important;
    font-weight: 600 !important;
}

.sidebar .sub-nav-link {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.sidebar .sub-nav-link:hover {
    color: #0d6efd;
    background-color: #f8fafc;
}

.sidebar .sub-nav-link.active {
    color: #0d6efd !important;
    font-weight: 600 !important;
}

.sidebar .sub-bullet {
    font-size: 8px;
    margin-right: 10px;
    color: #94a3b8;
}

.sidebar .sub-nav-link.active .sub-bullet {
    color: #0d6efd;
}

.sidebar .nav-heading {
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 600;
}

/* Main Content Area Offset */
@media (min-width: 768px) {
    main.main-content {
        margin-left: 270px !important;
        width: calc(100% - 270px) !important;
        transition: all 0.25s ease-in-out;
    }
}

/* Sidebar Toggle / Collapsed State */
body.sidebar-collapsed #sidebar {
    display: none !important;
}

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

.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0px 0 20px rgba(1, 41, 112, 0.06);
}

.card-title {
    padding: 12px 0;
    font-size: 17px;
    font-weight: 600;
    color: #012970;
}

/* Accordion custom styling for audit checklist */
.audit-accordion .accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0c63e4;
    font-weight: 600;
}

.audit-item-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
}

.audit-item-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   COMPREHENSIVE DARK MODE SYSTEM (Clean, Consistent, High-Contrast)
   ========================================================================== */
html.dark-mode, html.dark-mode body {
    background-color: #0b1329 !important;
    color: #f1f5f9 !important;
}

/* Header & Sidebar */
html.dark-mode #header {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark-mode #header .logo span,
html.dark-mode #header a,
html.dark-mode #header .nav-link {
    color: #f8fafc !important;
}

html.dark-mode #sidebar {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark-mode #sidebar .nav-link {
    color: #cbd5e1 !important;
}

html.dark-mode #sidebar .nav-link:hover {
    color: #38bdf8 !important;
    background-color: #0f172a !important;
}

html.dark-mode #sidebar .nav-link.active {
    color: #38bdf8 !important;
    background-color: #0369a1 !important;
}

/* Base Surfaces, Cards, Headers & Footers */
html.dark-mode .card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html.dark-mode .card-header,
html.dark-mode .card-header.bg-white,
html.dark-mode .card-header.bg-light {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html.dark-mode .card-footer,
html.dark-mode .card-footer.bg-white,
html.dark-mode .card-footer.bg-light {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

/* Neutralize Rogue White & Light Backgrounds in Dark Mode */
html.dark-mode .bg-white {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

html.dark-mode .bg-light,
html.dark-mode .bg-light-subtle {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Borders */
html.dark-mode .border,
html.dark-mode .border-top,
html.dark-mode .border-bottom,
html.dark-mode .border-start,
html.dark-mode .border-end {
    border-color: #334155 !important;
}

/* Tables */
html.dark-mode .table {
    color: #f8fafc !important;
    --bs-table-bg: transparent !important;
    border-color: #334155 !important;
}

html.dark-mode .table-light,
html.dark-mode .table-light > *,
html.dark-mode .table-light > * > *,
html.dark-mode tr.table-light,
html.dark-mode tr.table-light > *,
html.dark-mode thead.table-light tr th,
html.dark-mode tfoot.table-light tr td,
html.dark-mode tfoot.table-light tr th,
html.dark-mode .table-audit-checklist thead th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > *,
[data-bs-theme="dark"] .table-light > * > *,
[data-bs-theme="dark"] tr.table-light,
[data-bs-theme="dark"] tr.table-light > *,
[data-bs-theme="dark"] thead.table-light tr th,
[data-bs-theme="dark"] tfoot.table-light tr td,
[data-bs-theme="dark"] tfoot.table-light tr th {
    --bs-table-bg: #1e293b !important;
    --bs-table-color: #f8fafc !important;
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html.dark-mode .table-light td,
html.dark-mode .table-light th,
[data-bs-theme="dark"] .table-light td,
[data-bs-theme="dark"] .table-light th {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

html.dark-mode .table-hover tbody tr:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* Form Controls & Input Groups */
html.dark-mode .form-control,
html.dark-mode .form-select {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25) !important;
}

html.dark-mode .form-control::placeholder {
    color: #64748b !important;
}

html.dark-mode .input-group-text,
html.dark-mode .input-group-text.bg-light {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.dark-mode .input-group-text i {
    color: #38bdf8 !important;
}

/* TomSelect Dropdown Dark Mode (Fix invisible options in Department / Room select) */
html.dark-mode .ts-wrapper .ts-control,
html.dark-mode .ts-control {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
    box-shadow: none !important;
}

html.dark-mode .ts-wrapper.focus .ts-control {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25) !important;
}

html.dark-mode .ts-control input {
    color: #f8fafc !important;
    background: transparent !important;
}

html.dark-mode .ts-control input::placeholder {
    color: #64748b !important;
}

html.dark-mode .ts-control .item {
    color: #f8fafc !important;
    background-color: transparent !important;
}

/* Chevron arrow on TomSelect in dark mode */
html.dark-mode .ts-wrapper.form-select .ts-control,
html.dark-mode .ts-wrapper.single .ts-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

/* TomSelect Dropdown Menu & Options */
html.dark-mode .ts-dropdown {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
    color: #f8fafc !important;
    margin-top: 4px !important;
}

html.dark-mode .ts-dropdown .ts-dropdown-content {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

html.dark-mode .ts-dropdown .option {
    color: #f1f5f9 !important;
    background-color: transparent !important;
    padding: 0.6rem 0.9rem !important;
    font-size: 0.9rem !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4) !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

html.dark-mode .ts-dropdown .option:last-child {
    border-bottom: none !important;
}

html.dark-mode .ts-dropdown .option:hover,
html.dark-mode .ts-dropdown .option.active {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

html.dark-mode .ts-dropdown .option.selected {
    background-color: rgba(2, 132, 199, 0.25) !important;
    color: #38bdf8 !important;
    font-weight: 600 !important;
}

html.dark-mode .ts-dropdown .optgroup-header {
    color: #94a3b8 !important;
    background-color: #0f172a !important;
    font-weight: 600 !important;
    padding: 0.4rem 0.9rem !important;
}

html.dark-mode .ts-dropdown .no-results {
    color: #94a3b8 !important;
    background-color: transparent !important;
    padding: 0.75rem !important;
}

/* Native Select options */
html.dark-mode select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Flatpickr Calendar Dark Mode */
html.dark-mode .flatpickr-calendar {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6) !important;
    color: #f8fafc !important;
}

html.dark-mode .flatpickr-calendar.arrowTop:before,
html.dark-mode .flatpickr-calendar.arrowTop:after {
    border-bottom-color: #1e293b !important;
}

html.dark-mode .flatpickr-months {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

html.dark-mode .flatpickr-months .flatpickr-month,
html.dark-mode .flatpickr-current-month .cur-month,
html.dark-mode .flatpickr-current-month input.cur-year {
    color: #f8fafc !important;
    fill: #f8fafc !important;
}

html.dark-mode .flatpickr-months .flatpickr-prev-month,
html.dark-mode .flatpickr-months .flatpickr-next-month {
    color: #94a3b8 !important;
    fill: #94a3b8 !important;
}

html.dark-mode .flatpickr-months .flatpickr-prev-month:hover svg,
html.dark-mode .flatpickr-months .flatpickr-next-month:hover svg {
    fill: #38bdf8 !important;
}

html.dark-mode span.flatpickr-weekday {
    color: #94a3b8 !important;
    background: #0f172a !important;
}

html.dark-mode .flatpickr-day {
    color: #e2e8f0 !important;
}

html.dark-mode .flatpickr-day:hover {
    background: #334155 !important;
    border-color: #334155 !important;
}

html.dark-mode .flatpickr-day.today {
    border-color: #38bdf8 !important;
}

html.dark-mode .flatpickr-day.selected,
html.dark-mode .flatpickr-day.startRange,
html.dark-mode .flatpickr-day.endRange {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

html.dark-mode .flatpickr-day.prevMonthDay,
html.dark-mode .flatpickr-day.nextMonthDay {
    color: #475569 !important;
}

/* Typography & Headings */
html.dark-mode .text-dark {
    color: #f8fafc !important;
}

/* Ensure badges and elements with bright warning background keep dark readable text */
html.dark-mode .badge.bg-warning,
html.dark-mode .bg-warning.text-dark,
html.dark-mode .bg-warning .text-dark,
html.dark-mode .badge.bg-warning .text-dark,
html.dark-mode .badge.bg-warning i,
html.dark-mode .bg-warning.text-dark i {
    color: #0f172a !important;
}

html.dark-mode .text-secondary,
html.dark-mode .text-muted,
html.dark-mode .form-text {
    color: #94a3b8 !important;
}

html.dark-mode h1, html.dark-mode h2, html.dark-mode h3,
html.dark-mode h4, html.dark-mode h5, html.dark-mode h6,
html.dark-mode .card-title {
    color: #f8fafc !important;
}

/* Alerts */
html.dark-mode .alert {
    border-width: 1px !important;
    border-style: solid !important;
}

html.dark-mode .alert-info {
    background-color: rgba(14, 165, 233, 0.14) !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
    color: #bae6fd !important;
}
html.dark-mode .alert-info .text-dark,
html.dark-mode .alert-info strong,
html.dark-mode .alert-info div {
    color: #e0f2fe !important;
}
html.dark-mode .alert-info i {
    color: #38bdf8 !important;
}

html.dark-mode .alert-success {
    background-color: rgba(34, 197, 94, 0.14) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    color: #bbf7d0 !important;
}
html.dark-mode .alert-success strong,
html.dark-mode .alert-success div {
    color: #dcfce7 !important;
}

html.dark-mode .alert-warning {
    background-color: rgba(234, 179, 8, 0.14) !important;
    border-color: rgba(234, 179, 8, 0.35) !important;
    color: #fef08a !important;
}
html.dark-mode .alert-warning strong,
html.dark-mode .alert-warning div {
    color: #fef9c3 !important;
}

html.dark-mode .alert-danger {
    background-color: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #fecaca !important;
}
html.dark-mode .alert-danger strong,
html.dark-mode .alert-danger div {
    color: #fee2e2 !important;
}

/* Modals */
html.dark-mode .modal-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html.dark-mode .modal-header,
html.dark-mode .modal-footer {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdowns */
html.dark-mode .dropdown-menu {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

html.dark-mode .dropdown-item {
    color: #cbd5e1 !important;
}

html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
    background-color: #334155 !important;
    color: #ffffff !important;
}

html.dark-mode .dropdown-divider {
    border-color: #334155 !important;
}

/* Badges */
html.dark-mode .badge.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.18) !important;
    color: #60a5fa !important;
    border-color: #2563eb !important;
}

html.dark-mode .badge.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.18) !important;
    color: #4ade80 !important;
    border-color: #16a34a !important;
}

html.dark-mode .badge.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
    border-color: #dc2626 !important;
}

html.dark-mode .badge.bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.18) !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

/* Canvas & Signature Pad */
html.dark-mode canvas#signature-canvas {
    background-color: #ffffff !important;
    border: 1px dashed #94a3b8 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode .signature-pad-container {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark-mode .signature-pad-container .text-muted,
html.dark-mode .signature-pad-container small,
html.dark-mode .signature-hint-text {
    color: #cbd5e1 !important;
}

html.dark-mode .signature-pad-container small i,
html.dark-mode .signature-hint-text i {
    color: #38bdf8 !important;
}

/* Locked Signature Display in Dark Mode */
html.dark-mode .locked-signature-box {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

html.dark-mode img[alt="Tanda Tangan Petugas"],
html.dark-mode .signature-preview-img,
html.dark-mode .locked-signature-img {
    filter: invert(1) hue-rotate(180deg) brightness(1.8) contrast(1.2) !important;
}

/* Tabs */
html.dark-mode .nav-tabs {
    border-color: #334155 !important;
}

html.dark-mode .nav-tabs .nav-link {
    color: #94a3b8 !important;
    border-color: transparent !important;
    background-color: transparent !important;
}

html.dark-mode .nav-tabs .nav-link:hover {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.08) !important;
    border-color: transparent !important;
}

html.dark-mode .nav-tabs .nav-link.active {
    color: #38bdf8 !important;
    background-color: #1e293b !important;
    border-color: #334155 #334155 #1e293b !important;
}

/* Hide scrollbars on tab header */
.card-header-tabs {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.card-header-tabs::-webkit-scrollbar {
    display: none;
}

html.dark-mode .breadcrumb-item,
html.dark-mode .breadcrumb-item a,
html.dark-mode .breadcrumb-item.active {
    color: #94a3b8 !important;
}

/* Audit Detail Page Layout Styles */
.audit-detail-container {
    max-width: 980px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.audit-detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.audit-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.audit-info-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}

.audit-info-value {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
}

/* Sticky Header & Table Widths */
.table-audit-checklist {
    border-collapse: separate;
    border-spacing: 0;
}

.table-audit-checklist thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.table-audit-checklist tbody td {
    font-size: 13px;
    vertical-align: middle;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.col-width-code {
    width: 10% !important;
    min-width: 70px;
}

.col-width-question {
    width: 75% !important;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: normal;
}

.col-width-result {
    width: 15% !important;
    min-width: 100px;
    text-align: center;
}

/* Rating Stars */
.star-rating {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 2px;
}

/* Pre-printed Letterhead Spacer */
.print-preprinted-spacer {
    display: none;
}

/* Audit Detail Typography in Dark Mode */
html.dark-mode .audit-detail-title,
html.dark-mode .audit-card-title,
html.dark-mode .audit-info-value {
    color: #f8fafc !important;
}

html.dark-mode .audit-info-label {
    color: #94a3b8 !important;
}


/* ==========================================
   PRINT STYLES (@media print)
   ========================================== */
.print-only,
.print-only-header,
.print-only-footer {
    display: none !important;
}

@media print {
    /* Hide screen UI elements */
    #header,
    #sidebar,
    .sidebar,
    .breadcrumb,
    .btn-toolbar,
    .no-print,
    .btn,
    .nav-tabs,
    form,
    .pagination,
    .alert-dismissible .btn-close,
    #sidebar-toggle-btn,
    #theme-toggle-btn,
    .border-bottom,
    h1.h3 {
        border-bottom: none !important;
    }

    #header,
    #sidebar,
    .sidebar,
    .breadcrumb,
    .btn-toolbar,
    .no-print,
    .btn,
    .nav-tabs,
    form,
    .pagination,
    .alert-dismissible .btn-close,
    #sidebar-toggle-btn,
    #theme-toggle-btn,
    h1.h3 {
        display: none !important;
    }

    /* Page & Media Setup */
    @page {
        size: A4 portrait;
        margin: 10mm 12mm 12mm 12mm;
    }

    html, body, html.dark-mode, html.dark-mode body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-family: 'Poppins', Arial, sans-serif !important;
        font-size: 9.5pt !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .audit-detail-container, .container-fluid, .container {
        padding: 0 5px !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

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

    /* PRESERVE 2-COLUMN SIDE-BY-SIDE GRID IN PRINT */
    .print-row-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
    }

    .print-col-7 {
        flex: 0 0 58% !important;
        max-width: 58% !important;
        width: 58% !important;
    }

    .print-col-5 {
        flex: 0 0 42% !important;
        max-width: 42% !important;
        width: 42% !important;
    }

    /* Print Header (Kop Surat) */
    .print-only-header:not(.d-none-print) {
        display: block !important;
        margin-bottom: 12px;
        text-align: center;
    }

    .print-only-header.d-none-print {
        display: none !important;
    }

    /* Pre-printed Letterhead Spacer Mode */
    .print-preprinted-spacer:not(.d-none) {
        display: block !important;
        height: 20mm !important;
    }

    .print-kop-title {
        font-size: 14pt !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        color: #000000 !important;
        margin: 0;
        letter-spacing: 0.5px;
    }

    .print-kop-subtitle {
        font-size: 10pt !important;
        font-weight: 600 !important;
        color: #333333 !important;
        margin: 1px 0;
    }

    .print-kop-info {
        font-size: 8pt !important;
        color: #555555 !important;
        margin: 0;
    }

    .print-kop-divider {
        border: 0;
        border-top: 2px double #000000 !important;
        margin: 6px 0 10px 0 !important;
        opacity: 1 !important;
    }

    .print-doc-title {
        font-size: 11.5pt !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        text-align: center;
        margin-bottom: 10px;
        color: #000000 !important;
        letter-spacing: 0.5px;
    }

    /* Cards in Print */
    .card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        background-color: #ffffff !important;
        margin-bottom: 10px !important;
        border-radius: 4px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .card-header {
        background-color: #f1f5f9 !important;
        color: #0f172a !important;
        border-bottom: 1px solid #cbd5e1 !important;
        font-weight: 700 !important;
        padding: 6px 10px !important;
    }

    .card-body {
        padding: 8px 10px !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    /* Tables in Print */
    .table-responsive {
        overflow: visible !important;
    }

    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
        color: #000000 !important;
        margin-bottom: 5px !important;
    }

    .table th, .table td {
        border: 1px solid #94a3b8 !important;
        padding: 5px 8px !important;
        background-color: transparent !important;
        color: #000000 !important;
    }

    .table thead th, .table-light, thead.table-light tr th, .table-audit-checklist thead th, .hh-summary-row, .hh-summary-row > td, .hh-subheader-row, .hh-subheader-row > td {
        background-color: #e2e8f0 !important;
        color: #0f172a !important;
        font-weight: 700 !important;
        border-bottom: 2px solid #64748b !important;
        padding: 5px 8px !important;
    }

    /* Badges */
    .badge {
        border: 1px solid #64748b !important;
        color: #000000 !important;
        background-color: #ffffff !important;
        font-weight: 600 !important;
        padding: 2px 5px !important;
        border-radius: 3px !important;
        font-size: 8pt !important;
    }

    .badge.bg-success, .badge.bg-success-subtle {
        background-color: #d1e7dd !important;
        color: #0f5132 !important;
        border-color: #a3cfbb !important;
    }

    .badge.bg-danger, .badge.bg-danger-subtle {
        background-color: #f8d7da !important;
        color: #842029 !important;
        border-color: #f5c2c7 !important;
    }

    .badge.bg-secondary, .badge.bg-secondary-subtle {
        background-color: #e2e3e5 !important;
        color: #41464b !important;
        border-color: #c6c7c8 !important;
    }

    .badge.bg-warning, .badge.bg-warning-subtle {
        background-color: #fff3cd !important;
        color: #664d03 !important;
        border-color: #ffecb5 !important;
    }

    .badge.bg-primary, .badge.bg-primary-subtle {
        background-color: #cff4fc !important;
        color: #055160 !important;
        border-color: #9eeaf9 !important;
    }

    /* Prevent Page Break on Sections and Signatures */
    .print-avoid-break {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Signatures Section */
    .print-signature-box {
        margin-top: 15px;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .print-signature-space {
        height: 50px;
    }

    /* Typography Overrides */
    h1, h2, h3, h4, h5, h6, .text-dark, .text-muted, p, span, strong, div {
        color: #000000 !important;
    }

    .bg-light, .bg-light-subtle {
        background-color: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
    }
}

/* High Contrast & Bold Styling for Outline Warning Buttons */
.btn-outline-warning {
    color: #92400e !important;
    border-color: #d97706 !important;
    background-color: #fef3c7 !important;
    font-weight: 500 !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    color: #ffffff !important;
    background-color: #d97706 !important;
    border-color: #b45309 !important;
}

/* Dark Mode Action Buttons Enhancement */
html.dark-mode .btn-outline-primary {
    color: #60a5fa !important;
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.18) !important;
    font-weight: 500 !important;
}

html.dark-mode .btn-outline-primary:hover,
html.dark-mode .btn-outline-primary:focus,
html.dark-mode .btn-outline-primary:active {
    color: #ffffff !important;
    background-color: #2563eb !important;
    border-color: #1d4ed8 !important;
}

html.dark-mode .btn-outline-danger {
    color: #f87171 !important;
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.18) !important;
    font-weight: 500 !important;
}

html.dark-mode .btn-outline-danger:hover,
html.dark-mode .btn-outline-danger:focus,
html.dark-mode .btn-outline-danger:active {
    color: #ffffff !important;
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
}

/* Application Footer Styling */
footer.footer {
    border-color: #e2e8f0 !important;
    transition: all 0.25s ease-in-out;
}

footer.footer a {
    transition: color 0.15s ease-in-out;
}

footer.footer a:hover {
    color: #0b5ed7 !important;
    text-decoration: underline !important;
}

html.dark-mode footer.footer {
    border-color: #334155 !important;
}

html.dark-mode footer.footer .text-secondary {
    color: #94a3b8 !important;
}

html.dark-mode footer.footer a {
    color: #38bdf8 !important;
}

html.dark-mode footer.footer a:hover {
    color: #7dd3fc !important;
}

/* Hand Hygiene Locked Matrix Cells */
.hh-locked-cell {
    background-color: #f1f5f9 !important;
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

html.dark-mode .hh-locked-cell,
[data-bs-theme="dark"] .hh-locked-cell {
    background-color: rgba(255, 255, 255, 0.04) !important;
    opacity: 0.35 !important;
}

/* Hand Hygiene Incomplete Row Highlight */
.hh-incomplete-row {
    background-color: #fef2f2 !important;
    border: 2px solid #ef4444 !important;
    animation: hhPulse 1.5s infinite;
}

html.dark-mode .hh-incomplete-row,
[data-bs-theme="dark"] .hh-incomplete-row {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border: 2px solid #f87171 !important;
}

@keyframes hhPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Hand Hygiene Summary Highlight Row */
.hh-summary-row,
tr.hh-summary-row {
    background-color: #f1f5f9 !important;
}

.hh-summary-row > td,
.hh-summary-row > th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

.hh-subheader-row,
tr.hh-subheader-row {
    background-color: #f8fafc !important;
}

.hh-subheader-row > td,
.hh-subheader-row > th {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Dark Mode Hand Hygiene Highlight Rows */
html.dark-mode .hh-summary-row,
[data-bs-theme="dark"] .hh-summary-row,
html.dark-mode tr.hh-summary-row,
[data-bs-theme="dark"] tr.hh-summary-row {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark-mode .hh-summary-row > td,
[data-bs-theme="dark"] .hh-summary-row > td,
html.dark-mode .hh-summary-row > th,
[data-bs-theme="dark"] .hh-summary-row > th {
    background-color: #243044 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html.dark-mode .hh-summary-row .text-primary,
[data-bs-theme="dark"] .hh-summary-row .text-primary {
    color: #38bdf8 !important;
}

html.dark-mode .hh-subheader-row,
[data-bs-theme="dark"] .hh-subheader-row,
html.dark-mode tr.hh-subheader-row,
[data-bs-theme="dark"] tr.hh-subheader-row {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

html.dark-mode .hh-subheader-row > td,
[data-bs-theme="dark"] .hh-subheader-row > td,
html.dark-mode .hh-subheader-row > th,
[data-bs-theme="dark"] .hh-subheader-row > th {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html.dark-mode .text-primary,
[data-bs-theme="dark"] .text-primary {
    color: #38bdf8 !important;
}

/* ==========================================================================
   Modern Pagination & AJAX Loading UX
   ========================================================================== */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    gap: 4px;
    margin-bottom: 0;
}

.pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0;
    color: #475569;
    background-color: #ffffff;
    text-decoration: none;
    transition: all 0.18s ease-in-out;
}

.pagination .page-item .page-link:hover {
    color: #2563eb;
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.pagination .page-item.disabled .page-link {
    color: #94a3b8;
    background-color: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.65;
    pointer-events: none;
}

/* Dark Mode Pagination */
html.dark-mode .pagination .page-item .page-link,
[data-bs-theme="dark"] .pagination .page-item .page-link {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

html.dark-mode .pagination .page-item .page-link:hover,
[data-bs-theme="dark"] .pagination .page-item .page-link:hover {
    background-color: #334155;
    border-color: #475569;
    color: #ffffff;
}

html.dark-mode .pagination .page-item.active .page-link,
[data-bs-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

html.dark-mode .pagination .page-item.disabled .page-link,
[data-bs-theme="dark"] .pagination .page-item.disabled .page-link {
    background-color: #0f172a;
    border-color: #1e293b;
    color: #64748b;
}

/* AJAX Table Transition & Loading State */
.ajax-table-wrapper {
    position: relative;
    transition: opacity 0.2s ease-in-out;
}

.ajax-table-wrapper.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.ajax-table-wrapper.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: -1.125rem;
    margin-left: -1.125rem;
    border: 3px solid rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ajax-spinner 0.65s linear infinite;
    z-index: 10;
}

@keyframes ajax-spinner {
    to { transform: rotate(360deg); }
}

html.dark-mode .ajax-table-wrapper.is-loading::after,
[data-bs-theme="dark"] .ajax-table-wrapper.is-loading::after {
    border-color: rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
}

/* ==========================================================================
   SweetAlert2 Custom UI/UX Confirmation Popup (Light & Dark Theme)
   ========================================================================== */
.swal2-popup,
.bsafe-swal-popup {
    border-radius: 18px !important;
    padding: 1.75rem 1.5rem !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.25), 0 10px 15px -5px rgba(0, 0, 0, 0.1) !important;
}

html:not(.dark-mode) .swal2-popup,
[data-bs-theme="light"] .swal2-popup,
.bsafe-swal-popup:not(.dark-theme) {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark-mode) .swal2-title,
[data-bs-theme="light"] .swal2-title {
    color: #0f172a !important;
}

html:not(.dark-mode) .swal2-html-container,
[data-bs-theme="light"] .swal2-html-container {
    color: #475569 !important;
}

.swal2-title,
.bsafe-swal-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    padding: 0.5rem 1rem 0 !important;
    letter-spacing: -0.01em !important;
}

.swal2-html-container,
.bsafe-swal-text {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
    padding: 0.75rem 0.5rem 1.25rem !important;
}

.swal2-actions {
    gap: 10px !important;
    margin-top: 0.5rem !important;
    width: 100% !important;
    justify-content: center !important;
}

.swal2-actions button {
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    padding: 0.6rem 1.25rem !important;
    transition: all 0.2s ease !important;
}

/* Light Theme SweetAlert backdrop */
.swal2-container {
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    background: rgba(15, 23, 42, 0.45) !important;
}

/* Dark Theme SweetAlert Styling */
html.dark-mode .swal2-popup,
[data-bs-theme="dark"] .swal2-popup,
body.dark-mode .swal2-popup,
html.dark-mode div.swal2-popup,
[data-bs-theme="dark"] div.swal2-popup,
html.dark-mode .bsafe-swal-popup,
[data-bs-theme="dark"] .bsafe-swal-popup,
.bsafe-swal-popup.dark-theme {
    background: #1e293b !important;
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75) !important;
}

html.dark-mode .swal2-title,
[data-bs-theme="dark"] .swal2-title,
html.dark-mode .bsafe-swal-title,
[data-bs-theme="dark"] .bsafe-swal-title,
.bsafe-swal-popup.dark-theme .bsafe-swal-title {
    color: #f8fafc !important;
}

html.dark-mode .swal2-html-container,
[data-bs-theme="dark"] .swal2-html-container,
html.dark-mode .bsafe-swal-text,
[data-bs-theme="dark"] .bsafe-swal-text,
.bsafe-swal-popup.dark-theme .bsafe-swal-text {
    color: #cbd5e1 !important;
}

html.dark-mode .swal2-container,
[data-bs-theme="dark"] .swal2-container {
    background: rgba(11, 19, 41, 0.75) !important;
}

/* SweetAlert Icons Enhancement */
.swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

html.dark-mode .swal2-icon.swal2-warning,
[data-bs-theme="dark"] .swal2-icon.swal2-warning {
    border-color: #fbbf24 !important;
    color: #fbbf24 !important;
}

.swal2-icon.swal2-question {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

html.dark-mode .swal2-icon.swal2-question,
[data-bs-theme="dark"] .swal2-icon.swal2-question {
    border-color: #60a5fa !important;
    color: #60a5fa !important;
}

/* ==========================================================================
   Executive Dashboard Modern Styling & Theme Adaptations
   ========================================================================== */

.executive-kpi-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.executive-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08) !important;
}

html.dark-mode .executive-kpi-card,
[data-bs-theme="dark"] .executive-kpi-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

html.dark-mode .executive-kpi-card:hover,
[data-bs-theme="dark"] .executive-kpi-card:hover {
    box-shadow: 0 12px 24px -5px rgba(0, 0, 0, 0.5) !important;
    border-color: #475569 !important;
}

/* Sub-stat pill inside KPI cards */
.kpi-sub-pill {
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

html.dark-mode .kpi-sub-pill,
[data-bs-theme="dark"] .kpi-sub-pill {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155;
}

/* Subtle Progress Bar Track & Fills */
.kpi-progress {
    display: flex !important;
    height: 8px !important;
    border-radius: 6px !important;
    background-color: #e2e8f0;
    overflow: hidden !important;
    width: 100%;
}

.kpi-progress .progress-bar {
    height: 100% !important;
    display: block !important;
    border-radius: 6px !important;
    transition: width 0.4s ease;
}

.kpi-progress .progress-bar.bg-success {
    background-color: #10b981 !important;
}

.kpi-progress .progress-bar.bg-warning {
    background-color: #f59e0b !important;
}

.kpi-progress .progress-bar.bg-danger {
    background-color: #ef4444 !important;
}

.kpi-progress .progress-bar.bg-primary {
    background-color: #0d6efd !important;
}

html.dark-mode .kpi-progress,
[data-bs-theme="dark"] .kpi-progress {
    background-color: #334155 !important;
}

/* Subtle Tint Boxes for Icons */
.kpi-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

html.dark-mode .bg-primary-subtle {
    background-color: rgba(14, 165, 233, 0.18) !important;
    color: #38bdf8 !important;
}

html.dark-mode .bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
}

html.dark-mode .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
}

html.dark-mode .bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.18) !important;
    color: #f87171 !important;
}

html.dark-mode .bg-info-subtle {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #22d3ee !important;
}

/* Executive Banner */
.executive-banner {
    border-radius: 12px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #ffffff;
}

html.dark-mode .executive-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%) !important;
    border: 1px solid #1e40af;
}

/* ApexCharts Dark Theme Overrides */
html.dark-mode .apexcharts-canvas text {
    fill: #94a3b8 !important;
}

html.dark-mode .apexcharts-legend-text {
    color: #cbd5e1 !important;
}

html.dark-mode .apexcharts-tooltip {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6) !important;
    color: #f8fafc !important;
}

html.dark-mode .apexcharts-tooltip-title {
    background: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
    font-weight: 600 !important;
}

html.dark-mode .apexcharts-tooltip-series-group {
    background: #1e293b !important;
    color: #f8fafc !important;
}

html.dark-mode .apexcharts-tooltip-text-y-value,
html.dark-mode .apexcharts-tooltip-text-goals-value,
html.dark-mode .apexcharts-tooltip-text-z-value {
    color: #f8fafc !important;
    font-weight: 700 !important;
}

html.dark-mode .apexcharts-xaxistooltip,
html.dark-mode .apexcharts-yaxistooltip {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
}

html.dark-mode .apexcharts-gridline {
    stroke: #334155 !important;
}

html.dark-mode .apexcharts-radialbar-track path {
    stroke: #334155 !important;
}

/* ==========================================================================
   Notyf Toast Notification Widening & Polish
   ========================================================================== */
.notyf {
    padding: 76px 24px 24px 24px !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    z-index: 99999 !important;
}

.notyf__wrapper {
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.notyf__toast {
    min-width: 380px !important;
    max-width: 520px !important;
    border-radius: 12px !important;
    padding: 14px 20px !important;
    box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.28) !important;
    pointer-events: auto !important;
    margin-bottom: 12px !important;
    overflow: hidden !important;
}

/* Pastikan warna hijau / latar toast memenuhi seluruh kotak (bukan hanya ripple) */
.notyf__toast--success {
    background-color: #10b981 !important;
}

.notyf__toast--error {
    background-color: #ef4444 !important;
}

.notyf__toast--warning {
    background-color: #f59e0b !important;
}

.notyf__toast--info {
    background-color: #0d6efd !important;
}

.notyf__ripple {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.notyf__wrapper {
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    position: relative !important;
    z-index: 2 !important;
}

.notyf__icon {
    margin-right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.notyf__message {
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
    white-space: normal !important;
}

@media (max-width: 576px) {
    .notyf {
        padding: 70px 12px 12px 12px !important;
        align-items: center !important;
    }
    .notyf__toast {
        min-width: 90vw !important;
        max-width: 95vw !important;
    }
}


