/* ==========================================================================
   Mission Veng Local Council — UI Components & Utilities
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .92rem;
    padding: .7rem 1.35rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    line-height: 1.2;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn:active { transform: scale(.98); }

.btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(13,148,136,.28);
    border: 1px solid rgba(255,255,255,.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(13,148,136,.42), 0 2px 6px rgba(13,148,136,.25);
    transform: translateY(-2px);
    text-decoration: none !important;
}

.btn-secondary {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 55%, #ccfbf1 100%);
    color: #0f766e;
    border-color: #99f6e4;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(13,148,136,.18);
    text-decoration: none !important;
}

.btn-outline {
    background-color: transparent;
    color: #ffffff;
    border-color: rgba(255,255,255,.45);
}

.btn-outline:hover {
    background: linear-gradient(135deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.12) 100%);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    text-decoration: none !important;
}

.btn-hero-primary {
    background: #ffffff;
    color: #0f766e;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0,0,0,.18), 0 0 18px rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.8);
}

.btn-hero-primary:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 50%, #ccfbf1 100%);
    color: #0f766e;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,.22), 0 0 22px rgba(20,184,166,.35);
    text-decoration: none !important;
}

.btn-hero-glass {
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.32);
    font-weight: 600;
}

.btn-hero-glass:hover {
    background: linear-gradient(135deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,.18) 100%);
    color: #ffffff;
    border-color: rgba(255,255,255,.7);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0,0,0,.25);
    text-decoration: none !important;
}

.btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(217,119,6,.28);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217,119,6,.42);
    text-decoration: none !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220,38,38,.28);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 50%, #b91c1c 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220,38,38,.42);
    text-decoration: none !important;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.9rem 1.8rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--slate-700);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--slate-800);
    background-color: #ffffff;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--slate-500);
    margin-top: 0.35rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pending {
    background-color: var(--warning-bg);
    color: #854d0e;
    border: 1px solid #fef08a;
}

.badge-under_review {
    background-color: var(--info-bg);
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-approved {
    background-color: var(--success-bg);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-rejected {
    background-color: var(--danger-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-submitted {
    background-color: var(--info-bg);
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-investigating {
    background-color: var(--warning-bg);
    color: #854d0e;
    border: 1px solid #fef08a;
}

.badge-resolved {
    background-color: var(--success-bg);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: transform 0.25s;
}

.modal-backdrop.active .modal-dialog {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.3rem;
    color: var(--slate-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--slate-400);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--slate-800);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--slate-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--slate-50);
}

/* Stepper / Timeline */
.status-stepper {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
}

.status-stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--slate-200);
    z-index: 1;
}

.status-stepper .step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25%;
    text-align: center;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: #ffffff;
    border: 3px solid var(--slate-300);
    color: var(--slate-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    transition: all 0.3s;
}

.status-stepper .step-item.completed .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.status-stepper .step-item.active .step-circle {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.status-stepper .step-item.completed .step-title,
.status-stepper .step-item.active .step-title {
    color: var(--slate-900);
}


/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: var(--slate-50);
    padding: 0.9rem 1.25rem;
    font-weight: 700;
    color: var(--slate-700);
    border-bottom: 1px solid var(--slate-200);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: linear-gradient(90deg, #f0fdfa 0%, #ffffff 80%, #f0fdfa 100%);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1rem 1.4rem;
    box-shadow: var(--shadow-xl);
    border-left: 5px solid var(--primary);
    min-width: 280px;
    max-width: 420px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: toastSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideDown {
    from { transform: translateY(-25px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-success {
    border-left-color: var(--success);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Printable Certificate Sheet */
.certificate-wrapper {
    background: #525659;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.certificate-sheet {
    background: #ffffff;
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    padding: 6mm 8mm;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.certificate-border {
    border: 3px double #064e3b;
    min-height: calc(297mm - 12mm);
    padding: 7mm 9mm;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Screen A4 Document Sheet (Physical 210mm x 297mm @ 96 DPI: 794px x 1123px) */
.cert-a4-sheet {
    width: 794px;
    height: 1123px;
    min-height: 1123px;
    max-height: 1123px;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-radius: 4px;
    padding: 18px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: 'Times New Roman', Times, serif;
    overflow: hidden;
}

.cert-a4-border {
    border: 2.5px double #064e3b;
    padding: 18px 24px;
    height: calc(1123px - 36px);
    min-height: calc(1123px - 36px);
    max-height: calc(1123px - 36px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-grow: 1;
    overflow: hidden;
}

.cert-header {
    position: relative;
    text-align: center;
    border-bottom: 1.5px solid #064e3b;
    padding-bottom: 0.45rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.cert-header h2 {
    font-size: 14pt;
    color: #064e3b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0.1rem 0;
    font-weight: 800;
    line-height: 1.25;
}

.cert-header p {
    font-size: 10.5pt;
    color: #064e3b;
    font-weight: 700;
    margin: 0.1rem 0;
}

.cert-tracking {
    display: flex;
    justify-content: space-between;
    font-size: 9.5pt;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.cert-title {
    text-align: center;
    font-size: 13.5pt;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #064e3b;
    border-bottom: 2px solid #064e3b;
    display: table;
    margin: 0 auto 0.95rem;
    padding-bottom: 3px;
    flex-shrink: 0;
}

.cert-body {
    font-size: 11pt;
    line-height: 1.6;
    color: #0f172a;
    text-align: justify;
    margin-bottom: 0.65rem !important;
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0;
    font-family: 'Times New Roman', Times, serif;
    overflow: hidden;
}

.cert-body > *:first-child {
    margin-top: 0 !important;
}

.cert-body > *:last-child {
    margin-bottom: 0 !important;
}

.cert-body p {
    margin: 0 0 0.4rem 0;
}

.cert-body p:last-child {
    margin-bottom: 0;
}

/* Certificate Body & Editor Structured Elements (Lists, Tables, Boxes) */
.cert-body ul, .cert-wysiwyg-editor ul {
    margin: 6px 0 8px 0 !important;
    padding-left: 26px !important;
    list-style: disc outside !important;
    list-style-type: disc !important;
}

.cert-body ol, .cert-wysiwyg-editor ol {
    margin: 6px 0 8px 0 !important;
    padding-left: 26px !important;
    list-style: decimal outside !important;
    list-style-type: decimal !important;
}

.cert-body li, .cert-wysiwyg-editor li {
    margin: 2px 0 !important;
    padding-left: 2px !important;
    display: list-item !important;
    line-height: 1.5;
}

.cert-body table, .cert-wysiwyg-editor table,
table.cert-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 6px 0 8px 0 !important;
    font-family: inherit;
    font-size: 10.5pt;
    table-layout: auto;
}

.cert-body table td, .cert-body table th,
.cert-wysiwyg-editor table td, .cert-wysiwyg-editor table th,
table.cert-table td, table.cert-table th {
    border: 1px solid #cbd5e1 !important;
    padding: 5px 8px !important;
    vertical-align: middle !important;
    line-height: 1.45;
}

.cert-body .cert-box, .cert-wysiwyg-editor .cert-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin: 6px 0 !important;
    font-family: inherit;
    box-sizing: border-box;
    display: block;
}

.cert-signatures {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    margin-bottom: 0.45rem;
    text-align: center;
    page-break-inside: avoid;
    break-inside: avoid;
    flex-shrink: 0 !important;
    min-height: 140px;
}

.cert-sig-box {
    width: 175px;
    padding-top: 0.2rem;
    font-size: 9.5pt;
    font-weight: 600;
    color: #1e293b;
}

.cert-qr {
    text-align: left;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    font-size: 8pt;
    color: #64748b;
    page-break-inside: avoid;
    break-inside: avoid;
}

.cert-footer-bottom {
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8pt;
    color: #475569;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    page-break-inside: avoid;
    break-inside: avoid;
}

.wt-btn {
    background: #ffffff;
    border: none;
    border-right: 1px solid #cbd5e1;
    padding: 4px 8px;
    min-width: 30px;
    height: 28px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-sizing: border-box;
}
.wt-btn i {
    font-size: 0.88rem;
    line-height: 1;
}
.wt-btn:last-child {
    border-right: none;
}
.wt-btn:hover {
    background: #e2e8f0;
    color: #064e3b;
}
.wt-btn:active {
    background: #cbd5e1;
}

@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    html, body {
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .no-print {
        display: none !important;
    }
    .certificate-wrapper {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        display: block !important;
    }
    .cert-a4-sheet,
    .certificate-sheet {
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 210mm !important;
        max-width: 210mm !important;
        min-width: 210mm !important;
        height: 297mm !important;
        min-height: 297mm !important;
        max-height: 297mm !important;
        margin: 0 auto !important;
        padding: 18px 24px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        page-break-after: always !important;
        break-after: page !important;
        overflow: hidden !important;
        font-family: 'Times New Roman', Times, serif !important;
    }
    .cert-a4-sheet:last-child,
    .certificate-sheet:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }
    .cert-a4-border,
    .certificate-border {
        border: 2.5px double #064e3b !important;
        padding: 18px 24px !important;
        height: calc(297mm - 36px) !important;
        min-height: calc(297mm - 36px) !important;
        max-height: calc(297mm - 36px) !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
        flex-grow: 1 !important;
        overflow: hidden !important;
    }
    .cert-signatures {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .cert-qr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .cert-footer-bottom {
        position: static !important;
        margin-top: 0 !important;
        padding-top: 0.35rem !important;
        border-top: 1px solid #cbd5e1 !important;
        background: #ffffff !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* ============================================================
   Modal Overlay (used by openModal / closeModal in app.js)
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay .modal {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0,0,0,0.06);
    transform: translateY(24px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* ============================================================
   Notice Badge variants
   ============================================================ */
.badge-general {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-urgent {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Status stepper step title */
.step-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================================
   Gallery Grid & Card Components
   ============================================================ */
.gallery-grid,
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .gallery-grid,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .gallery-grid,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.gallery-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.gallery-card-img-wrap {
    height: 220px;
    background: var(--slate-100);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card-img-wrap img {
    transform: scale(1.05);
}

/* ==========================================================================
   Client-Side SPA Navigation & Loading Bar
   ========================================================================== */
#spa-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 50%, #f59e0b 100%);
    z-index: 999999;
    opacity: 0;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.7);
}

.page-content-wrapper {
    animation: spaPageFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spaPageFadeIn {
    0% {
        opacity: 0.88;
        transform: translateY(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Certificate Template Modal: 2-Section Gridview (Left: Editor, Right: True A4 Certificate) */
.cert-tpl-grid {
    display: grid;
    grid-template-columns: minmax(380px, 1fr) minmax(680px, 720px);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .cert-tpl-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Certificate WYSIWYG Rich Editor & Atomic Variable Badges */
.cert-wysiwyg-editor {
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cert-wysiwyg-editor:focus {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15) !important;
}

.cert-wysiwyg-editor p {
    margin: 0 0 0.5rem 0;
}
.cert-wysiwyg-editor p:last-child {
    margin-bottom: 0;
}

.cert-var-badge {
    display: inline-flex;
    align-items: center;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 700;
    font-size: 0.85em;
    user-select: all;
    margin: 0 2px;
    vertical-align: middle;
    cursor: default;
    line-height: 1.35;
    white-space: nowrap;
}

.cert-var-badge:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.cert-var-badge .cert-var-del {
    margin-left: 5px;
    color: #059669;
    font-size: 0.9em;
    font-weight: 800;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    transition: opacity 0.15s, color 0.15s;
    user-select: none;
}

.cert-var-badge .cert-var-del:hover {
    opacity: 1;
    color: #dc2626;
}

.cert-page-break-badge {
    border-top: 2px dashed #059669;
    border-bottom: 2px dashed #059669;
    margin: 14px 0;
    padding: 6px 10px;
    text-align: center;
    color: #065f46;
    font-weight: 700;
    font-size: 0.75rem;
    background: #ecfdf5;
    border-radius: 6px;
    user-select: none;
    cursor: default;
    display: block;
}

/* Admin Toggle Switch */
.adm-switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
}
.adm-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.adm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.adm-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .25s ease;
    border-radius: 24px;
}
.adm-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.adm-switch input:checked + .adm-slider {
    background-color: #0f766e;
}
.adm-switch input:checked + .adm-slider:before {
    transform: translateX(20px);
}

/* Custom Certificate Color Picker Popover */
.cert-custom-color-popover {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100000;
    width: 264px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 14px 30px -5px rgba(15, 23, 42, 0.2), 0 8px 12px -6px rgba(15, 23, 42, 0.1);
    padding: 12px;
    box-sizing: border-box;
    user-select: none;
    animation: admColorPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes admColorPop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.cert-swatch-btn {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-sizing: border-box;
}
.cert-swatch-btn:hover {
    transform: scale(1.18);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    z-index: 5;
}
.cert-swatch-btn.active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #0d9488 !important;
    transform: scale(1.08);
}

/* Microsoft Word Style Certificate Editor & Drag-Drop Canvas */
.cert-tpl-workspace {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.cert-ribbon-toolbar {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Compact & Elegant Dynamic Data Tag Chips */
.cert-tags-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 28px;
    box-sizing: border-box;
}

.cert-tags-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.cert-tags-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.cert-tag-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f766e;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.14s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cert-tag-chip:hover {
    background: #0d9488;
    color: #ffffff;
    border-color: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(13, 148, 136, 0.22);
}

.cert-tag-chip:active {
    transform: translateY(0);
    box-shadow: none;
}

.cert-tag-chip .tag-plus {
    font-weight: 800;
    opacity: 0.55;
    font-size: 0.76rem;
    line-height: 1;
}

.cert-tag-chip:hover .tag-plus {
    opacity: 1;
    color: #ffffff;
}

/* In-place Editable Fields on Certificate */
.cert-editable-field {
    outline: none;
    transition: background 0.15s, box-shadow 0.15s, outline 0.15s;
    border-radius: 3px;
    cursor: text;
}
.cert-editable-field:hover {
    background: rgba(13, 148, 136, 0.06);
    outline: 1px dashed #0d9488;
}
.cert-editable-field:focus {
    background: rgba(13, 148, 136, 0.09) !important;
    outline: 1.5px solid #0d9488 !important;
}
.cert-editable-field[data-placeholder]:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    font-style: italic;
}

/* Microsoft Word-style Movable & Resizable Graphical Object */
.cert-word-obj {
    position: relative;
    display: inline-block;
    user-select: none;
    touch-action: none;
    cursor: grab;
    transition: outline 0.12s ease;
    border-radius: 4px;
    box-sizing: border-box;
}
.cert-word-obj:hover {
    outline: 1.5px dashed #38bdf8;
    outline-offset: 4px;
}
.cert-word-obj.is-selected {
    outline: 2px solid #2563eb !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
    z-index: 50;
}
.cert-word-obj.is-dragging {
    cursor: grabbing !important;
    opacity: 0.92;
    z-index: 100;
}

/* Word 8 Handles */
.cert-obj-handles {
    display: none;
}
.cert-word-obj.is-selected .cert-obj-handles {
    display: block;
}
.cert-handle {
    position: absolute;
    width: 9px;
    height: 9px;
    background: #ffffff;
    border: 1.5px solid #2563eb;
    border-radius: 1px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 60;
    box-sizing: border-box;
}
.cert-handle-nw { top: -8px; left: -8px; cursor: nwse-resize; }
.cert-handle-ne { top: -8px; right: -8px; cursor: nesw-resize; }
.cert-handle-se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.cert-handle-sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.cert-handle-n  { top: -8px; left: calc(50% - 4.5px); cursor: ns-resize; }
.cert-handle-s  { bottom: -8px; left: calc(50% - 4.5px); cursor: ns-resize; }
.cert-handle-e  { top: calc(50% - 4.5px); right: -8px; cursor: ew-resize; }
.cert-handle-w  { top: calc(50% - 4.5px); left: -8px; cursor: ew-resize; }

/* Word Floating Action Pill */
.cert-obj-pill {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 70;
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.cert-word-obj.is-selected .cert-obj-pill {
    display: inline-flex;
}
.cert-obj-pill-btn {
    background: #334155;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.12s;
}
.cert-obj-pill-btn:hover {
    background: #0284c7;
}

/* Full-width Certificate Template Modal with 10px margins */
.adm-modal-backdrop.is-cert-fullwidth {
    padding: 10px !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

.adm-modal-backdrop.is-cert-fullwidth .adm-modal-card {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

.adm-modal-backdrop.is-cert-fullwidth .adm-modal-header {
    padding: 8px 14px !important;
    flex-shrink: 0 !important;
}

.adm-modal-backdrop.is-cert-fullwidth .adm-modal-body {
    padding: 8px 10px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow-y: hidden !important;
}

.adm-modal-backdrop.is-cert-fullwidth .adm-modal-footer {
    padding: 8px 14px !important;
    flex-shrink: 0 !important;
}

.adm-modal-backdrop.is-cert-fullwidth .cert-tpl-workspace {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    gap: 0.45rem !important;
    height: 100% !important;
}

.adm-modal-backdrop.is-cert-fullwidth #tpl-preview-viewport {
    flex: 1 !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
}

/* Button Group without overflow clipping */
.cert-btn-group {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
}
.cert-btn-group > .wt-btn:first-child {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}
.cert-btn-group > .wt-btn:last-child {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    border-right: none;
}

/* Floating Tool Badge displayed right above hovered/clicked button */
.cert-floating-tool-badge {
    position: fixed;
    z-index: 1000000;
    display: none;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    transform: translate(-50%, -100%);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.08);
    opacity: 0;
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}

.cert-floating-tool-badge.is-visible {
    display: inline-flex;
    opacity: 1;
}

.cert-floating-tool-badge .floating-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.cert-floating-tool-badge.is-active .floating-badge-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.cert-floating-tool-badge .floating-badge-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #cbd5e1;
}

.cert-floating-tool-badge .floating-badge-arrow::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #f1f5f9;
}

/* ============================================================
   COMPONENTS DARK THEME SYSTEM
   ============================================================ */
html[data-theme="dark"] .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .card-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .card-desc {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .card-header {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .card-footer {
    background-color: #162032 !important;
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .btn-secondary {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .btn-secondary:hover {
    background: #475569 !important;
    color: #ffffff !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .form-label {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-textarea {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .form-textarea:focus {
    border-color: #2dd4bf !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25) !important;
}

html[data-theme="dark"] .form-hint {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .modal-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: #334155 !important;
}

html[data-theme="dark"] .modal-footer {
    background: #162032 !important;
}

html[data-theme="dark"] .modal-close {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .modal-close:hover {
    color: #f8fafc !important;
}

html[data-theme="dark"] .status-stepper::before {
    background: #334155 !important;
}

html[data-theme="dark"] .step-circle {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .status-stepper .step-item.active .step-title,
html[data-theme="dark"] .status-stepper .step-item.completed .step-title {
    color: #f8fafc !important;
}

html[data-theme="dark"] .step-title {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .table-responsive {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .data-table th {
    background: #162032 !important;
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .data-table td {
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .data-table tr:hover td {
    background: #243047 !important;
}

html[data-theme="dark"] .toast {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .gallery-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .gallery-card-img-wrap {
    background: #0f172a !important;
}

html[data-theme="dark"] .adm-switch-wrap,
html[data-theme="dark"] .adm-switch-wrap span,
html[data-theme="dark"] .adm-switch-wrap label,
html[data-theme="dark"] label.adm-switch-wrap,
html[data-theme="dark"] .adm-switch-label,
html[data-theme="dark"] .adm-form-switch-label,
html[data-theme="dark"] .switch-label {
    color: #f8fafc !important;
}

html[data-theme="dark"] .adm-slider {
    background-color: #334155 !important;
}

html[data-theme="dark"] .adm-switch input:checked + .adm-slider {
    background-color: #0d9488 !important;
}

html[data-theme="dark"] .cert-tags-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cert-tag-chip {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #2dd4bf !important;
}

html[data-theme="dark"] .cert-tag-chip:hover {
    background: #0d9488 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .help-text,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .form-subtext,
html[data-theme="dark"] .form-helper {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .input-group-text {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .wt-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-right-color: #334155 !important;
}

html[data-theme="dark"] .wt-btn:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .cert-btn-group {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .cert-sig-box {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .cert-footer-bottom {
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cert-tracking {
    color: #cbd5e1 !important;
}

/* ==========================================================================
/* ==========================================================================
   PREMIUM ADAPTIVE SHIMMER SKELETON LOADING SYSTEM (LIGHT & DARK MODES)
   ========================================================================== */
:root,
html,
html:not([data-theme="dark"]),
html[data-theme="light"],
[data-theme="light"],
body:not(.dark-mode) {
    --kh-shimmer-base: #e2e8f0;
    --kh-shimmer-wave: rgba(255, 255, 255, 0.85);
    --kh-shimmer-card-bg: #ffffff;
    --kh-shimmer-card-border: #e2e8f0;
    --kh-shimmer-card-border-subtle: #f1f5f9;
    --kh-shimmer-card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
    --kh-shimmer-divider: #e2e8f0;
    --kh-shimmer-table-border: #f1f5f9;
}

/* Explicit Dark Theme Targets Only */
html[data-theme="dark"],
[data-theme="dark"],
body.dark-mode,
html.dark,
.dark-theme {
    --kh-shimmer-base: #334155;
    --kh-shimmer-wave: rgba(255, 255, 255, 0.16);
    --kh-shimmer-card-bg: #1e293b;
    --kh-shimmer-card-border: #334155;
    --kh-shimmer-card-border-subtle: #1e293b;
    --kh-shimmer-card-shadow: 0 6px 20px -2px rgba(0, 0, 0, 0.5);
    --kh-shimmer-divider: #334155;
    --kh-shimmer-table-border: #1e293b;
}

@keyframes khShimmerSweep {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.kh-skeleton,
.kh-shimmer-item,
.kh-shimmer-box,
.kh-shimmer-line,
.kh-shimmer-title,
.kh-shimmer-badge,
.kh-shimmer-btn,
.kh-shimmer-avatar,
.kh-shimmer-media {
    background-color: var(--kh-shimmer-base);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        var(--kh-shimmer-wave) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: khShimmerSweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: 6px;
    display: block;
    position: relative;
    overflow: hidden;
    will-change: background-position;
}

@media (prefers-reduced-motion: reduce) {
    .kh-skeleton,
    .kh-shimmer-item,
    .kh-shimmer-box,
    .kh-shimmer-line,
    .kh-shimmer-title,
    .kh-shimmer-badge,
    .kh-shimmer-btn,
    .kh-shimmer-avatar,
    .kh-shimmer-media {
        animation: none !important;
        background-image: none !important;
        background-color: var(--kh-shimmer-base) !important;
    }
}

/* Specific Shimmer Geometry Elements */
.kh-shimmer-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.kh-shimmer-line.w-full { width: 100%; }
.kh-shimmer-line.w-95 { width: 95%; }
.kh-shimmer-line.w-92 { width: 92%; }
.kh-shimmer-line.w-90 { width: 90%; }
.kh-shimmer-line.w-85 { width: 85%; }
.kh-shimmer-line.w-80 { width: 80%; }
.kh-shimmer-line.w-75 { width: 75%; }
.kh-shimmer-line.w-70 { width: 70%; }
.kh-shimmer-line.w-65 { width: 65%; }
.kh-shimmer-line.w-95 { width: 95%; }
.kh-shimmer-line.w-90 { width: 90%; }
.kh-shimmer-line.w-85 { width: 85%; }
.kh-shimmer-line.w-80 { width: 80%; }
.kh-shimmer-line.w-75 { width: 75%; }
.kh-shimmer-line.w-70 { width: 70%; }
.kh-shimmer-line.w-65 { width: 65%; }
.kh-shimmer-line.w-60 { width: 60%; }
.kh-shimmer-line.w-55 { width: 55%; }
.kh-shimmer-line.w-50 { width: 50%; }
.kh-shimmer-line.w-45 { width: 45%; }
.kh-shimmer-line.w-40 { width: 40%; }
.kh-shimmer-line.w-35 { width: 35%; }
.kh-shimmer-line.w-30 { width: 30%; }
.kh-shimmer-line.w-25 { width: 25%; }
.kh-shimmer-line.w-20 { width: 20%; }
.kh-shimmer-line.w-15 { width: 15%; }
.kh-shimmer-line.w-10 { width: 10%; }
.kh-shimmer-line.w-full { width: 100%; }

.kh-shimmer-title {
    height: 28px;
    margin-bottom: 14px;
    border-radius: 8px;
}
.kh-shimmer-title.sm {
    height: 20px;
    border-radius: 6px;
    margin-bottom: 8px;
}
.kh-shimmer-title.lg {
    height: 36px;
    border-radius: 10px;
}
.kh-shimmer-title.xl {
    height: 48px;
    border-radius: 12px;
}

.kh-shimmer-badge {
    height: 24px;
    width: 90px;
    border-radius: 9999px;
    display: inline-block;
}

.kh-shimmer-pill {
    height: 28px;
    width: 100px;
    border-radius: 9999px;
    display: inline-block;
}

.kh-shimmer-btn {
    height: 40px;
    width: 140px;
    border-radius: 8px;
    display: inline-block;
}
.kh-shimmer-btn.sm {
    height: 32px;
    width: 100px;
    border-radius: 6px;
}
.kh-shimmer-btn.lg {
    height: 48px;
    width: 180px;
    border-radius: 10px;
}

.kh-shimmer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kh-shimmer-avatar.sm {
    width: 32px;
    height: 32px;
}
.kh-shimmer-avatar.lg {
    width: 80px;
    height: 80px;
}
.kh-shimmer-avatar.xl {
    width: 104px;
    height: 104px;
}

.kh-shimmer-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kh-shimmer-icon.sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}
.kh-shimmer-icon.lg {
    width: 60px;
    height: 60px;
    border-radius: 14px;
}

.kh-shimmer-media {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.kh-shimmer-media.tall {
    height: 460px;
}
.kh-shimmer-media.sm {
    height: 160px;
}

.kh-shimmer-input {
    width: 100%;
    height: 44px;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Shimmer Card Wrappers */
.kh-shimmer-card {
    background: var(--kh-shimmer-card-bg) !important;
    border: 1px solid var(--kh-shimmer-card-border) !important;
    border-radius: 14px;
    padding: 1.5rem;
    box-sizing: border-box;
    box-shadow: var(--kh-shimmer-card-shadow);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.kh-shimmer-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--kh-shimmer-card-border-subtle);
    padding-top: 0.85rem;
    margin-top: auto;
}

.kh-shimmer-divider {
    border-top: 1px solid var(--kh-shimmer-divider) !important;
}

.kh-shimmer-divider-dashed {
    border-bottom: 1px dashed var(--kh-shimmer-divider) !important;
}

.kh-shimmer-subcard {
    background: var(--kh-shimmer-card-bg) !important;
    border: 1px solid var(--kh-shimmer-card-border) !important;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kh-shimmer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* KPI Stat Cards & Grid */
.kh-shimmer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    width: 100%;
    margin-bottom: 2rem;
    box-sizing: border-box;
}

.kh-shimmer-stat-card {
    background: var(--kh-shimmer-card-bg) !important;
    border: 1px solid var(--kh-shimmer-card-border) !important;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-sizing: border-box;
    box-shadow: var(--kh-shimmer-card-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Hero Slider Skeleton */
.kh-shimmer-hero {
    width: 100%;
    min-height: 380px;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-sizing: border-box;
    background: var(--kh-shimmer-card-bg) !important;
    border: 1px solid var(--kh-shimmer-card-border) !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 2rem;
}

/* Ticker Skeleton */
.kh-shimmer-ticker {
    width: 100%;
    height: 52px;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    box-sizing: border-box;
    background: var(--kh-shimmer-card-bg) !important;
    border: 1px solid var(--kh-shimmer-card-border) !important;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Form Skeleton */
.kh-shimmer-form {
    background: var(--kh-shimmer-card-bg) !important;
    border: 1px solid var(--kh-shimmer-card-border) !important;
    border-radius: 16px;
    padding: 2rem;
    box-sizing: border-box;
    box-shadow: var(--kh-shimmer-card-shadow);
}

/* Detail View Full Article Shimmer Skeleton */
.kh-shimmer-detail-wrap {
    width: 100%;
    animation: fadeIn 0.25s ease-in;
    box-sizing: border-box;
}

/* Table Shimmer Rows */
.kh-table-shimmer tr {
    pointer-events: none;
    border-bottom: 1px solid var(--kh-shimmer-table-border);
}
.kh-table-shimmer td {
    padding: 1rem 0.75rem;
    background: transparent;
    border-bottom: 1px solid var(--kh-shimmer-table-border);
}

/* Explicit Light Mode rules for shimmer cards and containers */
html:not([data-theme="dark"]) .wf-notice-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-history-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-history-blog-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-contact-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-service-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-citizen-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-past-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-subcommittee-card.kh-shimmer-card,
html:not([data-theme="dark"]) .wf-staff-card.kh-shimmer-card,
html:not([data-theme="dark"]) .adm-card.kh-shimmer-card,
html[data-theme="light"] .wf-notice-card.kh-shimmer-card,
html[data-theme="light"] .wf-history-card.kh-shimmer-card,
html[data-theme="light"] .wf-history-blog-card.kh-shimmer-card,
html[data-theme="light"] .wf-contact-card.kh-shimmer-card,
html[data-theme="light"] .wf-service-card.kh-shimmer-card,
html[data-theme="light"] .wf-citizen-card.kh-shimmer-card,
html[data-theme="light"] .wf-past-card.kh-shimmer-card,
html[data-theme="light"] .wf-subcommittee-card.kh-shimmer-card,
html[data-theme="light"] .wf-staff-card.kh-shimmer-card,
html[data-theme="light"] .adm-card.kh-shimmer-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Explicit Light Mode rules for detail views & tracking panels */
html:not([data-theme="dark"]) .wf-notice-view-card,
html:not([data-theme="dark"]) .wf-history-view-card,
html:not([data-theme="dark"]) .wf-form-card,
html:not([data-theme="dark"]) .wf-track-result-panel.kh-shimmer-detail-wrap,
html[data-theme="light"] .wf-notice-view-card,
html[data-theme="light"] .wf-history-view-card,
html[data-theme="light"] .wf-form-card,
html[data-theme="light"] .wf-track-result-panel.kh-shimmer-detail-wrap {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Explicit Dark Mode rules for shimmer cards and containers */
html[data-theme="dark"] .wf-notice-card.kh-shimmer-card,
html[data-theme="dark"] .wf-history-card.kh-shimmer-card,
html[data-theme="dark"] .wf-history-blog-card.kh-shimmer-card,
html[data-theme="dark"] .wf-contact-card.kh-shimmer-card,
html[data-theme="dark"] .wf-service-card.kh-shimmer-card,
html[data-theme="dark"] .wf-citizen-card.kh-shimmer-card,
html[data-theme="dark"] .wf-past-card.kh-shimmer-card,
html[data-theme="dark"] .wf-subcommittee-card.kh-shimmer-card,
html[data-theme="dark"] .wf-staff-card.kh-shimmer-card,
html[data-theme="dark"] .adm-card.kh-shimmer-card,
[data-theme="dark"] .wf-notice-card.kh-shimmer-card,
[data-theme="dark"] .wf-history-card.kh-shimmer-card,
[data-theme="dark"] .wf-history-blog-card.kh-shimmer-card,
[data-theme="dark"] .wf-contact-card.kh-shimmer-card,
[data-theme="dark"] .wf-service-card.kh-shimmer-card,
[data-theme="dark"] .wf-citizen-card.kh-shimmer-card,
[data-theme="dark"] .wf-past-card.kh-shimmer-card,
[data-theme="dark"] .wf-subcommittee-card.kh-shimmer-card,
[data-theme="dark"] .wf-staff-card.kh-shimmer-card,
[data-theme="dark"] .adm-card.kh-shimmer-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Explicit Dark Mode rules for detail views & tracking panels */
html[data-theme="dark"] .wf-notice-view-card,
[data-theme="dark"] .wf-notice-view-card,
html[data-theme="dark"] .wf-history-view-card,
[data-theme="dark"] .wf-history-view-card,
html[data-theme="dark"] .wf-form-card,
[data-theme="dark"] .wf-form-card,
html[data-theme="dark"] .wf-track-result-panel.kh-shimmer-detail-wrap,
[data-theme="dark"] .wf-track-result-panel.kh-shimmer-detail-wrap {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Explicit Light Mode styling for skeleton shapes inside all containers */
html:not([data-theme="dark"]) .kh-skeleton,
html:not([data-theme="dark"]) .kh-shimmer-item,
html:not([data-theme="dark"]) .kh-shimmer-box,
html:not([data-theme="dark"]) .kh-shimmer-line,
html:not([data-theme="dark"]) .kh-shimmer-title,
html:not([data-theme="dark"]) .kh-shimmer-badge,
html:not([data-theme="dark"]) .kh-shimmer-pill,
html:not([data-theme="dark"]) .kh-shimmer-btn,
html:not([data-theme="dark"]) .kh-shimmer-avatar,
html:not([data-theme="dark"]) .kh-shimmer-media,
html[data-theme="light"] .kh-skeleton,
html[data-theme="light"] .kh-shimmer-item,
html[data-theme="light"] .kh-shimmer-box,
html[data-theme="light"] .kh-shimmer-line,
html[data-theme="light"] .kh-shimmer-title,
html[data-theme="light"] .kh-shimmer-badge,
html[data-theme="light"] .kh-shimmer-pill,
html[data-theme="light"] .kh-shimmer-btn,
html[data-theme="light"] .kh-shimmer-avatar,
html[data-theme="light"] .kh-shimmer-media {
    background-color: #e2e8f0 !important;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.85) 50%,
        rgba(255, 255, 255, 0) 100%
    ) !important;
}

/* Explicit Dark Mode styling for skeleton shapes inside all containers */
html[data-theme="dark"] .kh-skeleton,
html[data-theme="dark"] .kh-shimmer-item,
html[data-theme="dark"] .kh-shimmer-box,
html[data-theme="dark"] .kh-shimmer-line,
html[data-theme="dark"] .kh-shimmer-title,
html[data-theme="dark"] .kh-shimmer-badge,
html[data-theme="dark"] .kh-shimmer-pill,
html[data-theme="dark"] .kh-shimmer-btn,
html[data-theme="dark"] .kh-shimmer-avatar,
html[data-theme="dark"] .kh-shimmer-media,
[data-theme="dark"] .kh-skeleton,
[data-theme="dark"] .kh-shimmer-item,
[data-theme="dark"] .kh-shimmer-box,
[data-theme="dark"] .kh-shimmer-line,
[data-theme="dark"] .kh-shimmer-title,
[data-theme="dark"] .kh-shimmer-badge,
[data-theme="dark"] .kh-shimmer-pill,
[data-theme="dark"] .kh-shimmer-btn,
[data-theme="dark"] .kh-shimmer-avatar,
[data-theme="dark"] .kh-shimmer-media {
    background-color: #334155 !important;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.16) 50%,
        rgba(255, 255, 255, 0) 100%
    ) !important;
}








