body {
}
/* Page: Examination — minimal extras; builds on home.css variables and utilities */

/* Cookie consent banner */
.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 12px 16px 16px;
    pointer-events: none;
}

.cookie-consent__inner {
    pointer-events: auto;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    box-shadow: var(--shadow-soft);
}

.cookie-consent__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1 1 100%;
}

.cookie-consent__message {
    margin: 0;
    flex: 1 1 280px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-left: auto;
}

.cookie-consent__link {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-2);
    text-decoration: none;
}

    .cookie-consent__link:hover {
        text-decoration: underline;
    }

body.cookie-consent-visible {
    padding-bottom: 88px;
}

/* Terms and policies acceptance */
.terms-acceptance__label {
    align-items: flex-start;
}

.terms-acceptance__text {
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}

.terms-acceptance__link {
    font-weight: 600;
    color: var(--accent-2);
    text-decoration: none;
}

    .terms-acceptance__link:hover {
        text-decoration: underline;
    }

.terms-acceptance__error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

    .terms-acceptance__error[hidden] {
        display: none;
    }

@media (max-width: 640px) {
    .cookie-consent__actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    body.cookie-consent-visible {
        padding-bottom: 120px;
    }
}

/* FORM */
.form {
    padding: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

.form .fg {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: span 3;
}

    .form .fg.span-2 {
        grid-column: span 6;
    }

    .form .fg.actions {
        grid-column: 10 / -1;
        align-items: end;
        justify-content: end;
        gap: 10px;
        flex-direction: row;
    }

.form .field-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 0;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
    color: #c2410c;

}

    .form .field-note i,
    .form .field-note svg {
        color: var(--accent);
        font-size: 13px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .form .field-note span {
        flex: 1;
    }

.form label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.input,
.select,
.textarea,
.checks {
    width: 100%;
}

.input,
.select,
textarea.input {
    background: var(--card);
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    outline: none;
    box-shadow: var(--shadow-soft);
}

    .input:focus,
    .select:focus,
    textarea.input:focus {
        border-color: #c7d2fe;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

textarea.input {
    resize: vertical;
}

.wrapper {
    padding: 20px;
}

.card {
    margin-bottom: 20px;
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 8px 2px 0 2px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
}

/* BUTTONS */
.btn,
a.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    display: inline-flex; /* use flex for easy centering */
    justify-content: center; /* center horizontally */
    align-items: center; /* center vertically */
    font-size: 12px;
}

    .btn:hover {
        filter: brightness(0.98);
    }

    .btn.ghost {
        background: #fff;
        color: #1f2937;
        border: 1px solid #e5e7eb;
    }

    .btn.warning {
        background: #f2dede;
        color: #1f2937;
        border: 1px solid #e5e7eb;
    }

    .btn.danger {
        background: #fcf8e3;
        color: #1f2937;
        border: 1px solid #e5e7eb;
    }

    .btn.yallow {
        background: #f8e9af;
        color: #b91c1c;
        border-color: #fecaca;
    }

    .btn.success {
        background: var(--accent-2);
    }

/* =======================
   TABS (new, real tab style)
   ======================= */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    margin: 0 0 8px 0;
}

.tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    margin: 0;
    cursor: pointer;
    font-weight: 600;
    color: #64748b; /* slate-500 */
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    position: relative;
}

    .tab + .tab {
        margin-left: 6px;
    }

    .tab:hover {
        color: #1e293b;
        border-bottom-color: #c7d2fe;
    }

    .tab:focus-visible {
        outline: none;
        box-shadow: 0 2px 0 0 rgba(59, 130, 246, 0.35);
        border-bottom-color: #93c5fd;
    }

    /* Active tab with primary blue and subtle bg */
    .tab.active {
        color: #1d4ed8; /* primary */
        border-bottom-color: #1d4ed8;
        background: linear-gradient(to bottom, rgba(29, 78, 216, 0.06), rgba(29, 78, 216, 0));
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

/* Panels */
.tab-panels {
    padding-top: 10px;
}

.tab-panel {
    display: none;
}

    .tab-panel.active {
        display: block;
    }

/* TOOLBAR */
.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 4px 14px 4px;
    border-bottom: 1px dashed #eef2f7;
}

    .toolbar .left,
    .toolbar .right {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

/* TABLE */
.table-wrap {
    margin-top: 12px;
    border: 1px solid #eef2f7;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .table thead th {
        text-align: left;
        background: #f8fafc;
        color: #60708a;
        font-weight: 700;
        letter-spacing: 0.2px;
        padding: 12px;
        border-bottom: 1px solid #eef2f7;
    }

    .table tbody tr th {
        text-align: left;
        background: #f8fafc;
        color: #60708a;
        font-weight: 700;
        letter-spacing: 0.2px;
        padding: 12px;
        border-bottom: 1px solid #eef2f7;
    }

    .table tbody td {
        padding: 12px;
        border-top: 1px solid #f1f5f9;
        color: #334155;
    }

    .table tbody tr:hover {
        background: #fafbff;
    }

.link {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
    margin-right: 8px;
}

    .link.danger {
        color: #ef4444;
    }

.chip-dd {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3ff;
    color: #1d4ed8;
    font-weight: 700;
}

/* CARD GRID - Horizontal card layout */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.sessions-card-actions .sessions-card-ico {
    display: block;
    flex-shrink: 0;
    vertical-align: middle;
}

.card-item {
    background: var(--card);
    border: 1px solid #eef2f7;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

    .card-item:hover {
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

    .card-item.card-item--closed {
        background: #f2dede;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    }

    .card-item.card-item--closed:hover {
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    }

.case-closed-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5c1f1f;
    background: #f2dede;
    border: 1px solid #d4a3a3;
}

.card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.card-header img {
    flex-shrink: 0;
    border-radius: 8px;
}

.card-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .card-title h5 {
        margin: 0;
        font-size: 15px;
        font-weight: 600;
        color: #1f2937;
        word-break: break-word;
    }

.doc-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: #eef3ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
}

.card-notes {
    flex: 1;
    margin-bottom: 12px;
}

    .card-notes p {
        margin: 0;
        font-size: 13px;
        color: #64748b;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    justify-content: flex-end;
}

    .card-actions .btn {
        padding: 8px 10px;
        font-size: 11px;
    }

        .card-actions .btn svg {
            margin: 0;
        }

/* EMPTY states */
.empty {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .form .fg {
        grid-column: span 4;
    }

        .form .fg.span-2 {
            grid-column: span 8;
        }

        .form .fg.actions {
            grid-column: 9 / -1;
        }
}

@media (max-width: 930px) {
    .form .fg,
    .form .fg.span-2,
    .form .fg.actions {
        grid-column: 1 / -1;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

        .toolbar .right {
            justify-content: flex-start;
        }

    .tab {
        padding: 10px 12px;
    }
}

/* ============ SEARCH modal ============ */
.search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 80;
    padding: 16px;
}

.modal-shell {
    width: min(1100px, 96vw);
    height: min(86vh, 900px);
    display: flex;
    flex-direction: column;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 10px;
}

    .modal-head h2 {
        font-size: 18px;
        margin: 0;
    }

.modal-body {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 16px;
    height: 100%;
}

/* Filters (left 25%) */
.filters {
    border-right: 1px dashed #e5e7eb;
    padding-right: 12px;
    overflow: auto;
}

    .filters .fg {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 12px;
    }

        .filters .fg.two {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

/* Results (right) */
.results {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.results-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.results .muted.small {
    font-size: 12px;
    color: var(--muted);
}

.result-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    overflow: scroll;
    height: 100%;
}

    .result-list li {
        border: 1px solid #eef2f7;
        border-radius: 12px;
        padding: 12px;
        background: #fff;
        box-shadow: var(--shadow-soft);
        cursor: pointer;
    }

        .result-list li.selected {
            background: #f0f4ff; /* Light blue background */
        }

    .result-list li {
        transition: all 0.2s ease;
    }

        .result-list li:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transform: translateY(-2px);
            border-color: #c7d2fe;
            background: #fafbff;
        }

    .result-list .title {
        font-weight: 700;
        margin-bottom: 4px;
        color: #0e1322;
    }

    .result-list .meta {
        color: #64748b;
        font-size: 13px;
        width: 75% !important;
        word-wrap: break-word;
    }

/* Scrollbar helper */
.scroll-3 {
    scrollbar-width: thin;
}

    .scroll-3::-webkit-scrollbar {
        width: 8px;
    }

    .scroll-3::-webkit-scrollbar-thumb {
        background: #e5e7eb;
        border-radius: 999px;
    }

/* Responsive modal */
@media (max-width: 930px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .filters {
        border-right: 0;
        border-bottom: 1px dashed #e5e7eb;
        padding-bottom: 12px;
    }
}

/* --- Edit modal (reuses your card/buttons styles) --- */
.scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
    z-index: 90;
}

    .scrim.visible {
        opacity: 1;
        pointer-events: auto;
    }

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 95;
    padding: 16px;
}

.modal-shell {
    width: min(760px, 96vw);
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.modal-content {
    overflow: auto;
    padding: 8px 2px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
}

/* ===== MODAL FORM GRID LAYOUT ===== */
/* 12-column grid system for flexible field arrangements */
/* Default: 2 fields per row (span-6) */
.modal-form .fg {
    grid-column: span 6;
}

    /* Individual column spans (1-12) */
    .modal-form .fg.span-1 {
        grid-column: span 1;
    }

    .modal-form .fg.span-2 {
        grid-column: span 2;
    }

    .modal-form .fg.span-3 {
        grid-column: span 3;
    }

    .modal-form .fg.span-4 {
        grid-column: span 4;
    }

    .modal-form .fg.span-5 {
        grid-column: span 5;
    }

    .modal-form .fg.span-6 {
        grid-column: span 6;
    }

    .modal-form .fg.span-7 {
        grid-column: span 7;
    }

    .modal-form .fg.span-8 {
        grid-column: span 8;
    }

    .modal-form .fg.span-9 {
        grid-column: span 9;
    }

    .modal-form .fg.span-10 {
        grid-column: span 10;
    }

    .modal-form .fg.span-11 {
        grid-column: span 11;
    }

    .modal-form .fg.span-12 {
        grid-column: span 12;
    }

/* Responsive: stack all fields on mobile for better usability */
@media (max-width: 930px) {
    .modal-shell {
        width: 96vw;
    }

    .modal-form .fg,
    .modal-form .fg.span-1,
    .modal-form .fg.span-2,
    .modal-form .fg.span-3,
    .modal-form .fg.span-4,
    .modal-form .fg.span-5,
    .modal-form .fg.span-6,
    .modal-form .fg.span-7,
    .modal-form .fg.span-8,
    .modal-form .fg.span-9,
    .modal-form .fg.span-10,
    .modal-form .fg.span-11,
    .modal-form .fg.span-12 {
        grid-column: 1 / -1;
    }
}

/* Tablet: small spans become half-width for better usability */
@media (max-width: 1024px) and (min-width: 931px) {
    .modal-form .fg.span-1,
    .modal-form .fg.span-2,
    .modal-form .fg.span-3,
    .modal-form .fg.span-4 {
        grid-column: span 6;
    }
}

/* ===== MODAL SIZES ===== */
/* Small modal - for confirmations, simple dialogs */
.modal.small .modal-shell {
    width: min(480px, 96vw);
    max-height: min(60vh, 600px);
}

/* Medium modal - for forms with moderate content (default if no size class) */
.modal.medium .modal-shell {
    width: min(760px, 96vw);
    max-height: min(85vh, 800px);
}

/* Large modal - for complex forms, data tables */
.modal.large .modal-shell {
    width: min(95%, 96vw);
    max-height: min(90vh, 1000px);
}

/* Field-help modal: reusable on any page (search + form field descriptions) */
.modal.modal--help .modal-shell {
    width: min(720px, 96vw);
    height: auto;
    max-height: min(90vh, 760px);
}

.modal.modal--help .modal-body {
    display: block;
    height: auto;
    max-height: min(70vh, 620px);
    overflow-y: auto;
    padding-top: 4px;
}

.field-help-section-title {
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: #334155;
    letter-spacing: 0.02em;
}

    .field-help-section-title:first-child {
        margin-top: 0;
    }

.field-help-dl {
    margin: 0 0 12px;
    padding: 0;
}

    .field-help-dl > div {
        display: grid;
        grid-template-columns: minmax(120px, 200px) 1fr;
        gap: 6px 14px;
        padding: 10px 0;
        border-bottom: 1px dashed #e5e7eb;
    }

    .field-help-dl dt {
        margin: 0;
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
    }

    .field-help-dl dd {
        margin: 0;
        font-size: 13px;
        line-height: 1.45;
        color: #1e293b;
    }

/* Responsive adjustments for tablets */
@media (max-width: 1024px) {
    .modal.large .modal-shell {
        width: min(900px, 96vw);
    }
}

/* Mobile: all modals become full-width with appropriate padding */
@media (max-width: 768px) {
    .modal.small .modal-shell,
    .modal.medium .modal-shell,
    .modal.large .modal-shell {
        width: 96vw;
        max-height: 92vh;
    }
}

/* Danger button (reuses existing modal styles) */
.btn.danger {
    background: #ef4444;
    color: #fff;
}

    .btn.danger:hover {
        filter: brightness(0.95);
    }

/* ---- Search modal should fill the viewport and let the list scroll ---- */
.modal--search .modal-shell {
    width: min(1100px, 96vw);
    height: min(92vh, 900px); /* take the height back */
    display: flex;
    flex-direction: column;
}

/* grid inside the search modal must be able to shrink */
.modal--search .modal-body {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0; /* critical for nested scroll */
}

/* left pane */
.modal--search .filters {
    border-right: 1px dashed #e5e7eb;
    padding-right: 12px;
    overflow: auto;
    min-height: 0;
}

/* right pane */
.modal--search .results {
    display: flex;
    flex-direction: column;
    min-height: 0; /* allow child to take remaining height */
}

.modal--search .result-list {
    display: flex;
    flex-direction: column;
}

/* responsive: single column on small screens */
@media (max-width: 930px) {
    .modal--search .modal-body {
        grid-template-columns: 1fr;
    }

    .modal--search .filters {
        border-right: 0;
        border-bottom: 1px dashed #e5e7eb;
        padding-bottom: 12px;
    }
}

/* --- Pager --- */
.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #eef2f7;
}

.pg-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

    .pg-btn[disabled] {
        opacity: 0.45;
        cursor: not-allowed;
    }

.pg-input {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: var(--shadow-soft);
}

    .pg-input input {
        width: 48px;
        border: 0;
        background: transparent;
        text-align: right;
        font-weight: 700;
        outline: none;
    }

    .pg-input .slash {
        color: #94a3b8;
    }

#pgTotal {
    font-weight: 700;
}

.pg-size {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
}

    .pg-size select {
        border: 1px solid #e5e7eb;
        background: #fff;
        border-radius: 10px;
        padding: 6px 8px;
        outline: none;
    }

/* Turn off list scrolling; pager handles it */
.modal--search .result-list {
    overflow: auto;
    height: auto;
}

.form .fg.span-1 {
    grid-column: span 1;
}

.form .fg.span-2 {
    grid-column: span 2;
}

.form .fg.span-3 {
    grid-column: span 3;
}

.form .fg.span-4 {
    grid-column: span 4;
}

.form .fg.span-5 {
    grid-column: span 5;
}

.form .fg.span-6 {
    grid-column: span 6;
}

.form .fg.span-7 {
    grid-column: span 7;
}

.form .fg.span-8 {
    grid-column: span 8;
}

.form .fg.span-9 {
    grid-column: span 9;
}

.form .fg.span-10 {
    grid-column: span 10;
}

.form .fg.span-11 {
    grid-column: span 11;
}

.form .fg.span-12 {
    grid-column: span 12;
}

.captcha-panel-wrap {
    grid-column: span 12;
}

.captcha-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.captcha-panel__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-panel__image-wrap {
    flex-shrink: 0;
}

.captcha-panel__image {
    display: block;
    width: 200px;
    max-width: 100%;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.captcha-panel__field {
    flex: 1 1 12rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.captcha-panel__refresh {
    flex-shrink: 0;
}

.form-grid--footer {
    margin-top: 4px;
    align-items: end;
}

.form-grid__aside {
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .captcha-panel__row {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .captcha-panel__refresh {
        margin-left: auto;
    }

    .form-grid--footer .form-grid__aside,
    .form-grid--footer .fg.actions {
        grid-column: span 12;
    }

    .form-grid--footer .fg.actions {
        justify-content: stretch;
        flex-wrap: wrap;
    }
}

.text-danger {
    color: #a94442;
}

.iframe {
    width: 100%;
    height: 610px;
    border: 0;
}

.tab-panel .iframe {
    height: 850px;
}

.results-head {
    gap: 10px;
}

    .results-head .sort {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

        .results-head .sort label {
            font-size: 12px;
            color: var(--muted);
            font-weight: 600;
        }

/* Screen-reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 1, 1);
    white-space: nowrap;
    border: 0;
}

/* Full-screen blurred overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 130;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Spinner */
.loading-spinner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    border-top-color: var(--accent-2, #2563eb);
    animation: spin 0.9s linear infinite;
    box-shadow: var(--shadow-soft);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Action Bar ===== */
.actionbar {
    z-index: 60;
    background: var(--card);
    border: 1px solid #eef2f7;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* groups */
.ab-left,
.ab-right,
.ab-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.actionbar--center-title {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.actionbar--center-title .ab-left {
    justify-self: start;
}

.actionbar--center-title .ab-center {
    justify-self: center;
    justify-content: center;
    text-align: center;
}

.actionbar--center-title .ab-center .page-title {
    margin: 0;
}

.actionbar--center-title .ab-right {
    justify-self: end;
    justify-content: flex-end;
}

/* pill buttons */
.ab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.04s ease, box-shadow 0.15s ease, background 0.15s ease;
}

    .ab-btn:hover {
        background: #f8fafc;
    }

    .ab-btn:active {
        transform: translateY(1px);
    }

    .ab-btn.primary {
        background: var(--accent-2);
        color: #fff;
        border-color: transparent;
    }

        .ab-btn.primary:hover {
            filter: brightness(0.98);
        }

    .ab-btn.danger {
        background: #fff5f5;
        color: #b91c1c;
        border-color: #fecaca;
    }

.ab-ico {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
}

    .ab-ico svg {
        width: 18px;
        height: 18px;
    }

/* Mobile: make it horizontally scrollable without breaking layout */
@media (max-width: 930px) {
    .actionbar {
        top: 56px;
        padding: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ab-left,
    .ab-right,
    .ab-center {
        flex-wrap: nowrap;
    }

    .actionbar--center-title {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        justify-items: center;
        gap: 8px;
    }

    .actionbar--center-title .ab-left,
    .actionbar--center-title .ab-right {
        justify-self: center;
        justify-content: center;
    }
}

.result-list li .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-list li .right {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8; /* slate-400 */
    font-size: 18px;
}

.result-list li .ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9; /* light gray circle */
    color: #475569; /* darker slate icon */
}

/* Upload Modal */
/* --- Upload Modal (um-*) --- */
.modal--upload .modal-shell {
    width: min(860px, 96vw);
}

.um-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
}

.um-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.um-right {
    min-width: 0;
}

@media (max-width: 930px) {
    .um-body {
        grid-template-columns: 1fr;
    }
}

.um-drop {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    min-height: 160px;
    padding: 16px;
    border: 1.5px dashed #e5e7eb;
    border-radius: 14px;
    background: linear-gradient(to bottom right, #ffffff, #fbfdff);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.04s;
    box-shadow: var(--shadow-soft);
}

    .um-drop:hover {
        background: #f8fafc;
        border-color: #c7d2fe;
    }

    .um-drop:active {
        transform: translateY(1px);
    }

.um-drop-ico {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eef3ff;
    color: #1d4ed8;
}

.um-drop-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .um-drop-text strong {
        font-weight: 700;
    }

.um-sub {
    font-size: 12px;
    color: var(--muted);
}

.um-files {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
}

    .um-files li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border: 1px solid #eef2f7;
        border-radius: 10px;
        background: #fff;
        color: #0f172a;
        font-size: 14px;
    }

    .um-files .name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .um-files .size {
        color: #64748b;
        font-variant-numeric: tabular-nums;
    }

.um-remove {
    border: 0;
    background: #fff5f5;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 4px 8px;
    font-weight: 700;
    cursor: pointer;
}

.um-box {
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.um-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.um-rules {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    list-style-type: decimal;
}

    .um-rules code {
        background: #f3f4f6;
        border: 1px solid #eceff3;
        border-radius: 6px;
        padding: 0 6px;
    }

/* subtle focus ring for keyboard users */
#umFile:focus + .um-drop,
.um-drop:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.cal_Theme .ajax__calendar_container th {
    padding: 0px;
}

.cal_Theme .ajax__calendar_container td {
    padding: 0px;
}

.cal_Theme .ajax__calendar_month {
    padding-bottom: 3px;
    margin-top: -3.5px;
}

.table-title {
    font-size: 14px;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 8px;
}

.table-action-bar {
    margin: 10px 0;
    display: flex;
    justify-content: end;
    align-items: center;
}

.save-btn-action-bar {
    margin-left: 10px;
}

.table-results-info {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    color: #475569;
    font-size: 0.875rem;
    text-align: right;
}

/* Chat Styles */

.chat-container {
    max-width: 600px;
    margin: 20px;
    font-family: Arial;
    height: 500px; /* Set a fixed height */
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 10px;
}

.chat-bubble {
    padding: 10px 15px;
    border-radius: 15px;
    margin: 10px 0;
    font-size: 1.2rem;
    background-color: #f1f0f0;
    max-width: 90%;
}

.chat-input {
    padding: 10px 15px;
    border-radius: 15px;
    margin: 10px 0;
    background-color: #f1f0f0;
    width: 90%;
    border: 1px solid #ccc;
    outline: none;
    font-size: 1.2rem;
    box-sizing: border-box;
    display: inline-block; /* or block depending on layout */
}

.typing {
    border-right: 2px solid black;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.fixed-box {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: black;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 275px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.card.form .text-danger,
.card.form label.text-danger,
.card.form span.text-danger,
.card.form .field-validation-error {
    color: #a94442 !important;
}

.text-info {
    color: #31708f;
}

a.text-info:hover,
a.text-info:focus {
    color: #245269;
}

/* Remove jstree default icon styling */
#divTree .jstree-themeicon {
    background-image: none !important;
    background-color: transparent !important;
    width: 24px !important;
    height: 24px !important;
}

#divTree .jstree-icon.jstree-themeicon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 6px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    vertical-align: middle;
    flex-shrink: 0;
}

    #divTree .jstree-icon.jstree-themeicon svg {
        width: 18px;
        height: 18px;
        color: #555;
        stroke: #555;
        display: block;
    }

    #divTree .jstree-icon.jstree-themeicon:before {
        display: none !important;
    }

#divTree {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
}

#divTree .jstree-node {
    min-height: 24px;
    margin-left: 0;
}

#divTree .jstree-anchor {
    padding: 2px 0 2px 4px;
    height: 24px;
    line-height: 24px;

}

#divTree .jstree-wholerow {
    height: 24px;
}

/* Add padding for nested nodes (children) */
#divTree .jstree-children .jstree-node {
    margin-left: 24px;
}

#divTree .jstree-children .jstree-children .jstree-node {
    margin-left: 48px;
}

#divTree .jstree-children .jstree-children .jstree-children .jstree-node {
    margin-left: 72px;
}

#divTree .jstree-children .jstree-children .jstree-children .jstree-children .jstree-node {
    margin-left: 96px;
}

/* Ensure icon container doesn't have any overflow issues */
#divTree .jstree-anchor > .jstree-icon {
    margin-right: 6px;
}

/* Remove background color when checkbox is checked */
#divTree .jstree-node.jstree-checked > .jstree-wholerow {
    background: transparent !important;
}

#divTree .jstree-node.jstree-checked > .jstree-wholerow-ul {
    background: transparent !important;
}

#divTree .jstree-anchor.jstree-clicked {
    background: transparent !important;
    box-shadow: none !important;
}

#divTree .jstree-node.jstree-selected > .jstree-wholerow {
    background: transparent !important;
}

/* Ensure hover effect doesn't add background */
#divTree .jstree-node:hover > .jstree-wholerow {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Shared selected tree node style for Settings pages */
    #divTree .jstree-anchor.tree-node-selected {
        background-color: #9eadcc !important;
        color: #fff !important;
        border-radius: 6px;
    }

    #divTree .jstree-wholerow.jstree-wholerow-clicked {
        background-color: #9eadcc !important;
        opacity: 0.18;
        border-radius: 6px;
    }

#divTree .jstree-anchor.tree-node-selected .jstree-icon svg {
    stroke: currentColor;
}

/* Payments status actions */
.payments-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.payments-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.payments-status.is-paid {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #15803d;
}

.payments-status.is-not-paid {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.payments-card-actions .btn.success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.payments-card-actions .btn.ghost {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

/* REMINDERS & TASKS */
.reminders-actionbar {
    flex-wrap: nowrap;
}

.reminders-actionbar .ab-left,
.reminders-actionbar .ab-right {
    flex-shrink: 0;
}

.reminders-actionbar .reminders-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.reminders-actionbar .reminders-filters .select {
    width: auto;
    min-width: 150px;
    flex: 0 0 auto;
}

.reminders-list-container {
    padding: 8px 4px;
}

.reminders-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.reminders-card-item {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.reminders-card-item:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.reminders-card-item.priority-low { border-left: 4px solid #93c5fd; }
.reminders-card-item.priority-medium { border-left: 4px solid #fbbf24; }
.reminders-card-item.priority-high { border-left: 4px solid #f97316; }
.reminders-card-item.priority-urgent { border-left: 4px solid #ef4444; }

.reminders-card-item .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.reminders-card-item .card-title h5 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
}

.reminders-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
}

.reminders-priority-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    white-space: nowrap;
}

.reminders-card-details p {
    margin: 4px 0;
    font-size: 13px;
}

.reminders-description {
    color: var(--muted, #6b7280);
    margin-bottom: 8px !important;
}

.reminders-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.reminders-modal-form .reminders-form-grid {
    gap: 12px;
}

.reminders-error {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 8px;
}

.reminders-field-msg {
    display: block;
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}

.reminders-modal-actions .fg.actions {
    display: flex;
    gap: 8px;
}

#reminderUsers {
    min-height: 120px;
}

#reminderDescription {
    min-height: calc(4.5em + 35px);
}

/* CALENDAR LEGEND */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted, #6b7280);
}

.calendar-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.calendar-legend-dot.reminder {
    background: #3b82f6;
}

.calendar-legend-dot.task {
    background: #f59e0b;
}

.calendar-legend-dot.done {
    background: #9ca3af;
}

/* SUPPORT TICKETS */
.tickets-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.tickets-empty {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    font-size: 14px;
}

.tickets-card-item {
    cursor: pointer;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tickets-card-item:hover,
.tickets-card-item:focus-visible {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.tickets-card-item.status-open { border-left: 4px solid #3b82f6; }
.tickets-card-item.status-in-progress { border-left: 4px solid #f59e0b; }
.tickets-card-item.status-waiting { border-left: 4px solid #8b5cf6; }
.tickets-card-item.status-resolved { border-left: 4px solid #22c55e; }
.tickets-card-item.status-closed {
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
    opacity: 0.92;
}

.tickets-card-item .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.tickets-card-item .card-title h5 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.tickets-subject {
    font-size: 13px;
    color: var(--muted, #6b7280);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tickets-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tickets-status-badge.status-open {
    background: #eff6ff;
    color: #1d4ed8;
}

.tickets-status-badge.status-in-progress {
    background: #fffbeb;
    color: #b45309;
}

.tickets-status-badge.status-waiting {
    background: #f5f3ff;
    color: #6d28d9;
}

.tickets-status-badge.status-resolved {
    background: #f0fdf4;
    color: #15803d;
}

.tickets-status-badge.status-closed {
    background: #f1f5f9;
    color: #475569;
}

.tickets-card-details p {
    margin: 4px 0;
    font-size: 13px;
    color: #374151;
}

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 460px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: #fafafa;
}

    .ticket-thread:empty::after {
        content: "No messages yet.";
        color: var(--muted, #6b7280);
        font-size: 13px;
        padding: 16px;
    }

.ticket-msg {
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
}

.ticket-thread .result-item {
    list-style: none;
}

/* YOUTUBE DEMO BUTTON (reusable) */
.youtube-demo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: transform .2s ease, filter .2s ease;
}

.youtube-demo-logo {
    display: block;
    filter: drop-shadow(0 2px 5px rgba(255, 0, 0, 0.35));
    transition: transform .2s ease, filter .2s ease;
}

.youtube-demo-btn:hover .youtube-demo-logo {
    transform: scale(1.12);
    filter: drop-shadow(0 4px 10px rgba(255, 0, 0, 0.55));
}

.youtube-demo-btn:active .youtube-demo-logo {
    transform: scale(.98);
}

/* HELP BUTTON (reusable) */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: transform .2s ease, filter .2s ease;
}

.help-logo {
    display: block;
    filter: drop-shadow(0 2px 5px rgba(37, 99, 235, 0.35));
    transition: transform .2s ease, filter .2s ease;
}

.help-btn:hover .help-logo {
    transform: scale(1.12);
    filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.55));
}

.help-btn:active .help-logo {
    transform: scale(.98);
}