/* ==========================================
   1. CORE VARIABLES & THEME
   ========================================== */
:root {
    --dqdc-bg: #f8fafc;
    --dqdc-card: #ffffff;
    --dqdc-border: #cbd5e1;
    --dqdc-primary: #1d4ed8;
    --dqdc-primary-hover: #1e40af;
    --dqdc-critical: #dc2626;
    --dqdc-text: #0f172a;
}

[data-theme="dark"] {
    --dqdc-bg: #0f172a;
    --dqdc-card: #1e293b;
    --dqdc-border: #334155;
    --dqdc-text: #f8fafc;
}

.dqdc-comp-wrapper {
    width: 96vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    background: var(--dqdc-bg); 
    padding: 24px; 
    border-radius: 8px;
    border: 1px solid var(--dqdc-border); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--dqdc-text);
    transition: background-color 0.3s, color 0.3s;
}

.capa-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rig-badge { background: #0f172a; color: #fff; padding: 6px 12px; border-radius: 6px; font-weight: bold; font-size: 13px; letter-spacing: 0.5px; }

/* ==========================================
   2. TABS & FILTER BARS
   ========================================== */
.capa-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid var(--dqdc-border); padding-bottom: 15px; flex-wrap: wrap; }

.capa-tab-btn { background: #3b82f6; border: 1px solid #2563eb; font-weight: bold; color: #fff; cursor: pointer; padding: 10px 18px; border-radius: 6px; transition: all 0.2s ease-in-out; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: inline-flex; align-items: center; justify-content: center; text-decoration: none;}
.capa-tab-btn:hover { background: #2563eb; transform: translateY(-2px); color: #fff; box-shadow: 0 6px 10px rgba(0,0,0,0.15); }
.capa-tab-btn.active { background: #1e40af; box-shadow: inset 0 3px 6px rgba(0,0,0,0.2); border-color: #1e3a8a; }

.capa-pill-btn { background: #f8fafc; border: 1px solid #cbd5e1; color: #475569; padding: 10px 18px; border-radius: 6px; font-size: 13px; font-weight: bold; cursor: pointer; transition: all 0.2s ease-in-out; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.capa-pill-btn.active { background: #1d4ed8; color: #ffffff; border-color: #1e40af; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.capa-pill-btn:hover:not(.active) { background: #e2e8f0; color: #0f172a; }

.capa-section-container { display: none; animation: fadeIn 0.3s ease-in-out; }
.capa-section-container.active { display: block; }
.admin-sub-section { display: none; animation: fadeIn 0.3s ease-in-out; }
.admin-sub-section.active { display: block; }

/* ==========================================
   3. GRIDS & FORMS
   ========================================== */
.comp-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.form-group label { display: block; font-size: 12px; font-weight: bold; margin-bottom: 6px; color: #475569; letter-spacing: 0.3px; }
.form-group label:has(+ input:required)::after, .form-group label:has(+ select:required)::after, .form-group label:has(+ textarea:required)::after { content: " *"; color: var(--dqdc-critical); }

.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--dqdc-border); border-radius: 6px; font-size: 14px; box-sizing: border-box; background-color: var(--dqdc-card); color: var(--dqdc-text); transition: all 0.2s ease-in-out; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--dqdc-primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
.input-error { border-color: var(--dqdc-critical) !important; background-color: #fef2f2 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important; }

/* Ensure Filter inputs have identical sizes */
.capa-input { 
    height: 40px; 
    padding: 0 12px; 
    font-size: 14px; 
    border: 1px solid var(--dqdc-border); 
    border-radius: 6px; 
    background-color: var(--dqdc-card);
    color: var(--dqdc-text);
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}
.capa-input:focus {
    border-color: var(--dqdc-primary); 
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
    outline: none;
}

select.capa-input { line-height: 40px; }
#matrix-limit { width: 80px !important; text-align: center; }

/* ==========================================
   4. UNIVERSAL BUTTONS
   ========================================== */
.capa-btn-primary { 
    background: #1d4ed8 !important; 
    color: white !important; 
    border: 1px solid #1e40af !important; 
    padding: 10px 20px; 
    border-radius: 6px !important; 
    cursor: pointer; 
    font-weight: bold !important; 
    font-size: 14px;
    transition: all 0.2s ease-in-out !important; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    min-height: 40px;
}
.capa-btn-primary:hover { 
    background: #1e40af !important; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(29,78,216,0.3) !important; 
}

.capa-btn-secondary { 
    background: #e0e7ff !important; 
    color: #1d4ed8 !important; 
    border: 1px solid #c7d2fe !important; 
    padding: 10px 20px; 
    border-radius: 6px !important; 
    cursor: pointer; 
    font-weight: bold !important; 
    font-size: 14px;
    transition: all 0.2s ease-in-out !important; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none;
    min-height: 40px;
}
.capa-btn-secondary:hover { 
    background: #c7d2fe !important; 
    transform: translateY(-2px); 
    color: #1e3a8a !important; 
}

.btn-tbl-action { 
    padding: 6px 12px !important; 
    font-size: 12px !important; 
    color: white !important; 
    border: none !important; 
    border-radius: 4px !important; 
    cursor: pointer; 
    font-weight: bold !important; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    transition: transform 0.2s, filter 0.2s !important; 
}
.btn-tbl-action:hover { 
    transform: translateY(-1px); 
    filter: brightness(1.1); 
}

/* ==========================================
   5. WIZARD UI & SINGLE PAGE MODE
   ========================================== */
.comp-card { background: var(--dqdc-card); padding: 25px; margin-bottom: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid var(--dqdc-border); transition: all 0.3s ease; }
.wizard-progress { display: flex; border-bottom: 2px solid var(--dqdc-border); margin-bottom: 20px; }
.wizard-step { flex: 1; padding: 12px 10px; text-align: center; color: #64748b; font-weight: bold; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.3s, border-color 0.3s; }
.wizard-step.active { color: var(--dqdc-primary); border-bottom-color: var(--dqdc-primary); }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Single Page Form Mode Override */
.single-page-mode .wizard-panel { display: block !important; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 2px dashed var(--dqdc-border); animation: none; }
.single-page-mode .wizard-progress, .single-page-mode .btn-wizard-next, .single-page-mode .btn-wizard-prev { display: none !important; }

/* ==========================================
   6. TABLES & BADGES
   ========================================== */
.capa-table { width: 100%; border-collapse: collapse; background: var(--dqdc-card); font-size: 13px; }
.capa-table th, .capa-table td { border: 1px solid var(--dqdc-border); padding: 12px; vertical-align: middle; word-wrap: break-word; }
.capa-table th { background: #1e3a8a !important; color: #ffffff; text-align: center; white-space: nowrap; font-size: 14px; font-weight: bold; border: 1px solid #94a3b8; }
.elite-matrix-container th { position: sticky; top: 0; z-index: 10; outline: 1px solid #1e3a8a; }
.capa-table td { text-align: center; color: var(--dqdc-text); }

/* Master Matrix Sub-Headers (Inherits from PHP inline styles) */
.capa-table thead tr:nth-child(2) th, 
.capa-table thead tr:nth-child(3) th, 
.capa-table thead tr:nth-child(4) th, 
.capa-table thead tr:nth-child(5) th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-bottom: 1px solid #94a3b8 !important;
    font-size: 13px;
}
.capa-table thead tr:nth-child(6) th { background: #cbd5e1 !important; color: #0f172a !important; }

.badge { display: inline-block; min-width: 80px; text-align: center; padding: 6px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; color: #ffffff; }
.stat-valid { background: #16a34a; border: 1px solid #15803d; }
.stat-expiring { background: #ea580c; border: 1px solid #c2410c; }
.stat-expired { background: #dc2626; border: 1px solid #b91c1c; }
.stat-missing { background: #fef2f2; border: 1px solid #dc2626; color: #dc2626; }
.stat-grace { background: #fef08a; border: 1px solid #eab308; color: #854d0e; }
.stat-pending { background: #8b5cf6; border: 1px solid #7c3aed; }

[data-theme="dark"] .capa-table th { background: #0f172a; }
[data-theme="dark"] .capa-btn-secondary { background: #1e293b !important; border-color: #475569 !important; color: #f8fafc !important; }
[data-theme="dark"] .capa-table thead tr:nth-child(2) th, 
[data-theme="dark"] .capa-table thead tr:nth-child(3) th, 
[data-theme="dark"] .capa-table thead tr:nth-child(4) th, 
[data-theme="dark"] .capa-table thead tr:nth-child(5) th {
    background: #1e293b !important; color: #f8fafc !important; border-bottom: 1px solid #334155 !important;
}
[data-theme="dark"] .capa-table thead tr:nth-child(6) th { background: #334155 !important; color: #f8fafc !important; }

/* ==========================================
   7. TOASTS & ADVANCED FEATURES UI
   ========================================== */
#sig-assessor, #sig-trainee { width: 100%; height: 100px; cursor: crosshair; }
.chk-row { width: 18px; height: 18px; cursor: pointer; accent-color: var(--dqdc-primary); }

#pob-score { transition: all 0.3s ease; }
#pob-score.green { background: #16a34a; }
#pob-score.red { background: #dc2626; animation: flashWarning 1s infinite alternate; }
@keyframes flashWarning { from { opacity: 1; } to { opacity: 0.6; } }

#evidence-lightbox { backdrop-filter: blur(8px); }

#dqdc-toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.dqdc-toast { background: #ffffff; padding: 16px 24px; border-radius: 8px; color: #0f172a; font-size: 14px; font-weight: bold; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 12px; transform: translateX(120%); opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); border-left: 5px solid #cbd5e1; pointer-events: auto; }
.dqdc-toast.show { transform: translateX(0); opacity: 1; }
.dqdc-toast-success { border-left-color: #16a34a; }
.dqdc-toast-error { border-left-color: #dc2626; }
.dqdc-toast-info { border-left-color: #3b82f6; }

[data-theme="dark"] .dqdc-toast { background: #1e293b; color: #f8fafc; border-left-color: #475569; }
[data-theme="dark"] .dqdc-toast-success { border-left-color: #16a34a; }
[data-theme="dark"] .dqdc-toast-error { border-left-color: #dc2626; }


/* ==========================================
   8. SELECT2 CUSTOM UI STYLING (Bulletproof)
   ========================================== */
.select2-container, .select2-container * { box-sizing: border-box !important; }

/* Prevent Horizontal Overflow */
.select2-container--open .select2-dropdown {
    overflow-x: hidden !important;
}
.select2-results__option {
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 10px 12px !important;
    line-height: 1.4 !important;
}

/* Base Selection Box Styling */
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-height: 42px !important;
    height: auto !important;
    border: 1px solid var(--dqdc-border) !important;
    border-radius: 6px !important;
    background-color: var(--dqdc-card) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
    padding-bottom: 2px !important;
    display: flex;
    align-items: center;
}

/* Fix text color for active selection */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dqdc-text) !important;
    line-height: normal !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--dqdc-primary) !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15) !important;
}

/* Multi-Select Pills Styling */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e0e7ff !important;
    border: 1px solid #c7d2fe !important;
    color: var(--dqdc-primary) !important;
    border-radius: 4px !important;
    padding: 4px 8px 4px 24px !important; 
    margin: 4px 4px 0 0 !important;
    font-weight: 600;
    font-size: 13px;
    position: relative;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--dqdc-primary) !important;
    border: none !important;
    position: absolute !important;
    left: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 18px;
    padding: 0 4px !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--dqdc-critical) !important;
    background: transparent !important;
}

/* Fix the Inline Search Field */
.select2-container .select2-search--inline { float: left !important; margin-top: 4px !important; }
.select2-container .select2-search--inline .select2-search__field {
    margin: 0 !important;
    padding: 4px !important;
    height: 28px !important;
    font-size: 14px;
    color: var(--dqdc-text) !important;
}

/* Perfect Dropdown Vertical Positioning */
.select2-container--default .select2-dropdown {
    border: 1px solid var(--dqdc-primary) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    z-index: 999999 !important; /* Guarantee above modals/tables */
    background: var(--dqdc-card) !important; /* Adapt to theme */
}

.select2-container--default .select2-dropdown--below { margin-top: 6px !important; border-top: 1px solid var(--dqdc-primary) !important; border-radius: 6px !important; }
.select2-container--default .select2-dropdown--above { margin-top: -6px !important; border-bottom: 1px solid var(--dqdc-primary) !important; border-radius: 6px !important; }

/* FIX: Dropdown Search Box Sticking/Hiding behind options */
.select2-search--dropdown {
    padding: 12px !important;
    background: var(--dqdc-bg) !important;
    border-bottom: 1px solid var(--dqdc-border) !important;
    display: block !important; 
    position: sticky !important; /* Fixed sticky search */
    top: 0 !important;
    z-index: 105000 !important; /* Keeps it above the scrolling options list */
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid var(--dqdc-primary) !important;
    border-radius: 6px !important;
    height: 38px !important;
    padding: 8px 12px !important;
    width: 100% !important; 
    box-sizing: border-box !important;
    background: var(--dqdc-card) !important;
    color: var(--dqdc-text) !important;
}

.select2-results__options { max-height: 280px !important; overflow-y: auto !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--dqdc-primary) !important; color: white !important; }
.select2-results__options[aria-multiselectable="true"] .select2-results__option[aria-selected="true"] { display: none !important; }

/* Select2 Dark Mode Hard Overrides */
[data-theme="dark"] .select2-container--default .select2-results__option { background: var(--dqdc-card) !important; color: var(--dqdc-text) !important; }
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--dqdc-primary) !important; color: white !important; }
[data-theme="dark"] .select2-selection__placeholder { color: #94a3b8 !important; }

/* ==========================================
   9. ENTERPRISE PRINT OPTIMIZATION
   ========================================== */
@media print {
    #wpadminbar, #adminmenuwrap, #adminmenuback, #wpfooter { display: none !important; }
    #wpcontent, #wpbody-content { margin-left: 0 !important; padding: 0 !important; }
    
    .capa-header-bar, .capa-tabs, .capa-filter-bar, .wizard-progress, 
    #matrix-pagination, .btn-tbl-action, .capa-btn-primary, .capa-btn-secondary,
    #evidence-drop-zone, .wizard-panel:not(.active) {
        display: none !important;
    }

    body, .dqdc-comp-wrapper { 
        background: #fff !important; 
        color: #000 !important; 
        width: 100% !important; 
        max-width: 100% !important; 
        border: none !important; 
        box-shadow: none !important; 
        padding: 0 !important;
        margin: 0 !important;
    }

    .capa-table { border: 1px solid #000 !important; font-size: 10px !important; }
    .capa-table th, .capa-table td { border: 1px solid #ccc !important; padding: 6px !important; }
    .capa-table th { background: #f0f0f0 !important; color: #000 !important; -webkit-print-color-adjust: exact; }
    
    .badge { border: 1px solid #000; color: #000 !important; background: transparent !important; }
    .stat-valid { border-color: #16a34a; }
    .stat-expired { border-color: #dc2626; font-weight: 900; }
    
    tr { page-break-inside: avoid; }
    .comp-card { page-break-inside: avoid; border: none !important; padding: 0 !important; margin-bottom: 20px !important; box-shadow: none !important; }
}

/* ==========================================
   10. DATATABLES UI OVERRIDES
   ========================================== */
.dataTables_wrapper { width: 100%; clear: both; margin-top: 15px; position: relative; z-index: 1; }
.dataTables_wrapper .dataTables_length { float: left; margin-bottom: 15px; }
.dataTables_wrapper .dataTables_filter { float: right; margin-bottom: 15px; text-align: right; position: relative; z-index: 2; }
.dataTables_wrapper .dataTables_info { float: left; clear: both; margin-top: 10px; font-size: 13px; color: #64748b; }
.dataTables_wrapper .dataTables_paginate { float: right; margin-top: 10px; font-size: 13px; color: #64748b; }
.dataTables_wrapper::after { content: ""; display: table; clear: both; }
.dataTables_wrapper table.dataTable { clear: both; margin: 15px 0 !important; width: 100% !important; border-collapse: collapse; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { 
    border: 1px solid var(--dqdc-border); 
    border-radius: 6px; 
    padding: 8px 12px; 
    margin-left: 8px; 
    outline: none; 
    background: var(--dqdc-card); 
    color: var(--dqdc-text);
    transition: all 0.2s;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--dqdc-primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
.dataTables_wrapper .dataTables_paginate .paginate_button { padding: 6px 12px !important; border-radius: 4px; border: 1px solid transparent; cursor: pointer; color: var(--dqdc-text) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--dqdc-border) !important; border-color: var(--dqdc-border); }
.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { 
    background: var(--dqdc-primary) !important; 
    color: white !important; 
    border: 1px solid var(--dqdc-primary-hover); 
}

[data-theme="dark"] .dataTables_wrapper label { color: var(--dqdc-text); }
[data-theme="dark"] .dataTables_wrapper .dataTables_info, [data-theme="dark"] .dataTables_wrapper .dataTables_paginate, [data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button { color: var(--dqdc-text) !important; }

/* ==========================================
   11. CUSTOM DYNAMIC WIDTHS & ELITE MATRIX
   ========================================== */
.dataTables_wrapper, .capa-section-container, .elite-matrix-container { 
    width: var(--dqdc-custom-width, 100%) !important; 
}

.elite-matrix-container { 
    width: var(--dqdc-custom-width, 100%) !important; 
    overflow: auto !important; 
    border-radius: 8px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
    border: 1px solid var(--dqdc-border); 
    background: var(--dqdc-card); 
}
.elite-matrix-table { 
    min-width: 100%; 
    border-collapse: separate !important; 
    border-spacing: 0; 
}
/* 1. Remove the global top stickiness from ALL headers so they don't overlap */
.elite-matrix-table thead th { 
    background-clip: padding-box; 
    border-bottom: 1px solid #cbd5e1 !important;
}

/* 2. Apply vertical stickiness ONLY to the Training Description row */
.elite-matrix-table thead tr.matrix-sticky-header th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    border-bottom: 2px solid #94a3b8 !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* 3. Keep the left column (Employee Details) frozen horizontally for ALL rows */
.elite-matrix-table .freeze-pane { 
    position: sticky !important; 
    left: 0 !important; 
    z-index: 15 !important; 
    outline: 1px solid #cbd5e1; 
    background-clip: padding-box; 
    background-color: inherit;
}

/* 4. Ensure the intersection of the sticky top row and frozen left column stays on top */
.elite-matrix-table thead tr.matrix-sticky-header .freeze-pane { 
    z-index: 25 !important; 
}.elite-row:hover td { 
    background-color: var(--dqdc-bg) !important; 
    filter: brightness(0.97); 
    transition: 0.2s; 
    cursor: pointer; 
}

.dqdc-comp-wrapper { 
    max-width: 100%; 
    overflow-x: hidden; 
}

/* ==========================================
   12. DRAGGABLE TABLE RESIZER HANDLES
   ========================================== */
.resizer {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    user-select: none;
    z-index: 100;
    background: linear-gradient(135deg, transparent 50%, #94a3b8 50%);
    
    /* NEW: Hide the handle by default with a smooth fade transition */
    opacity: 0; 
    transition: opacity 0.2s ease;
}

/* NEW: Reveal the handle only when the user hovers over the specific column header */
th:hover .resizer {
    opacity: 1;
}

/* Highlight blue when interacting or actively dragging */
.resizer:hover, .resizer.resizing {
    opacity: 1; /* Keep it visible while dragging */
    background: linear-gradient(135deg, transparent 50%, #3b82f6 50%);
}

th { position: relative; }

/* Quick Renew Hover Effects */
.matrix-cell-clickable { 
    transition: all 0.2s ease; 
    position: relative; 
}
.matrix-cell-clickable:hover { 
    box-shadow: inset 0 0 0 2px #3b82f6 !important; 
    filter: brightness(0.95); 
}


/* ==========================================
   13. ENTERPRISE UI/UX UPGRADES
   ========================================== */
.tabular-nums { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 600; letter-spacing: -0.5px; }
.btn-tbl-action, .capa-btn-primary, .capa-btn-secondary { min-height: 44px; min-width: 44px; }
.truncate-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; display: inline-block; vertical-align: bottom; }
.capa-table .freeze-right { position: sticky; right: 0; z-index: 10; background: inherit; outline: 1px solid var(--dqdc-border); box-shadow: -4px 0 8px rgba(0,0,0,0.05); }
.capa-table thead .freeze-right { z-index: 20; }

#network-status-indicator { position: fixed; top: 0; left: 50%; transform: translateX(-50%); padding: 6px 16px; font-size: 13px; font-weight: bold; color: #fff; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; z-index: 999999; display: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
#network-status-indicator.offline { background: #ea580c; display: block; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { top: -40px; } to { top: 0; } }


/* PDF Export Loading Spinner Overlay */
#pdf-progress-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.85); z-index: 9999999; display: none; align-items: center; justify-content: center; flex-direction: column; color: #fff; backdrop-filter: blur(4px); }
.pdf-spinner { border: 4px solid rgba(255,255,255,0.2); border-top: 4px solid #3b82f6; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }