/* Geneflux LIS shared tokens, shell rules, and utilities. */

:root {
    --lis-color-brand: #5145cd;
    --lis-color-success: #157347;
    --lis-color-info: #056273;
    --lis-color-danger: #b42318;
    --lis-color-warning-text: #704600;
    --lis-color-muted: #5d596c;
    --lis-surface-subtle: #f8f7fa;
    --lis-border-subtle: rgba(47, 43, 61, 0.12);
    --lis-shadow-card: 0 0.375rem 1rem rgba(34, 48, 62, 0.08);
    --lis-focus-ring: #5145cd;
    --lis-radius-card: 1rem;
    --lis-space-panel: 1rem;
}

html, body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    height: 100%;
    overflow-x: hidden;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

@keyframes lisSkeletonPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.lis-skeleton {
    border-radius: 0.375rem;
    background: linear-gradient(90deg, rgba(93, 89, 108, 0.09), rgba(93, 89, 108, 0.16), rgba(93, 89, 108, 0.09));
    background-size: 200% 100%;
    animation: lisSkeletonPulse 1.5s ease-in-out infinite;
}

.lis-skeleton-label { width: 7rem; height: 0.75rem; }
.lis-skeleton-value { width: 3.5rem; height: 1.75rem; }
.lis-skeleton-icon { width: 2.75rem; height: 2.75rem; flex: 0 0 2.75rem; }
.lis-skeleton-copy { width: min(100%, 11rem); height: 0.75rem; }
.lis-skeleton-heading { width: 9rem; height: 1.25rem; }
.lis-skeleton-chart { width: 100%; height: 13.75rem; }

.lis-report-table-shell {
    position: relative;
}

.lis-table-refresh-indicator {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    pointer-events: none;
}

.lis-skeleton-table-progress {
    width: 100%;
    height: 0.25rem;
    border-radius: 0;
}

.lis-skeleton-table-row {
    width: 100%;
    height: 1.75rem;
}

/* Shared listing table presentation. */
.lis-table-responsive {
    overflow-y: hidden;
}

.lis-data-table thead th {
    padding: 0.75rem 1rem;
    color: var(--bs-heading-color);
    background: var(--lis-surface-subtle);
    border-bottom: 1px solid var(--lis-border-subtle);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lis-data-table tbody td {
    padding: 0.875rem 1rem;
    border-color: var(--lis-border-subtle);
    vertical-align: middle;
}

.lis-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.lis-data-table .lis-action-column {
    width: 1%;
    min-width: 3.5rem;
    white-space: nowrap;
}

.lis-data-table .lis-action-column .btn-icon {
    border: 0;
    box-shadow: 0 0.15rem 0.4rem rgba(47, 43, 61, 0.16);
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.lis-data-table .lis-action-column .btn-label-primary,
.lis-data-table .lis-action-column .btn-text-secondary {
    background-color: var(--bs-primary);
    color: #fff;
}

.lis-data-table .lis-action-column .btn-label-secondary {
    background-color: var(--bs-secondary);
    color: #fff;
}

.lis-data-table .lis-action-column .btn-label-success {
    background-color: var(--bs-success);
    color: #fff;
}

.lis-data-table .lis-action-column .btn-label-danger {
    background-color: var(--bs-danger);
    color: #fff;
}

.lis-data-table .lis-action-column .btn-label-warning {
    background-color: var(--bs-warning);
    color: var(--bs-dark);
}

.lis-data-table .lis-action-column .btn-icon:hover,
.lis-data-table .lis-action-column .btn-icon:focus-visible {
    box-shadow: 0 0.3rem 0.65rem rgba(47, 43, 61, 0.24);
    color: #fff;
    filter: brightness(0.92) saturate(1.1);
    transform: translateY(-1px);
}

.lis-data-table .lis-action-column .btn-label-warning:hover,
.lis-data-table .lis-action-column .btn-label-warning:focus-visible {
    color: var(--bs-dark);
}

@media (prefers-reduced-motion: reduce) {
    .lis-data-table .lis-action-column .btn-icon {
        transition: none;
    }

    .lis-data-table .lis-action-column .btn-icon:hover,
    .lis-data-table .lis-action-column .btn-icon:focus-visible {
        transform: none;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   Vuexy Layout Integration
   ======================================== */
.app-brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.lis-hospital-name {
    max-width: 10rem;
}

.lis-upload-error-alert {
    z-index: 10;
}

.dropdown-menu button.dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
}

/* Patient directory: single card, table flush to card edges (no inner card-datatable gap). */
.patient-directory-card {
    border: 1px solid var(--lis-border-subtle);
    box-shadow: var(--lis-shadow-card);
    overflow: hidden;
}

.patient-directory-card .table-responsive {
    margin-bottom: 0;
}

/* Patient detail modal (directory + hospital admin): structured sections, readable table */
.lis-patient-detail-modal .modal-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(67, 89, 113, 0.12);
}

.lis-patient-detail-modal .patient-detail-hero-name {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--bs-heading-color);
}

.lis-patient-detail-modal .patient-detail-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
}

.lis-patient-detail-modal .patient-detail-section {
    border-radius: 0.5rem;
    border: 1px solid rgba(67, 89, 113, 0.12);
    background: var(--bs-body-bg);
    overflow: hidden;
}

.lis-patient-detail-modal .patient-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: rgba(105, 108, 255, 0.06);
    border-bottom: 1px solid rgba(67, 89, 113, 0.1);
}

.lis-patient-detail-modal .patient-detail-section-title {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
}

.lis-patient-detail-modal .patient-detail-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.2rem;
}

.lis-patient-detail-modal .patient-detail-field-value {
    font-size: 0.9375rem;
    color: var(--bs-body-color);
}

.lis-patient-detail-modal .patient-detail-grid {
    padding: 1rem 1rem 0.25rem;
}

.lis-patient-detail-modal .patient-detail-attending {
    padding: 0.75rem 1rem 1rem;
    margin-top: 0.25rem;
    border-top: 1px dashed rgba(67, 89, 113, 0.15);
}

.lis-patient-detail-modal .patient-detail-report-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    border-bottom-width: 1px;
    white-space: nowrap;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.lis-patient-detail-modal .patient-detail-report-table tbody td {
    font-size: 0.875rem;
    vertical-align: middle;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.lis-patient-detail-modal .patient-detail-report-table tbody tr:nth-of-type(odd) {
    background-color: rgba(67, 89, 113, 0.04);
}

.lis-patient-detail-modal .patient-detail-test-cell {
    max-width: 14rem;
}

.lis-patient-detail-modal .patient-detail-hospital-eyebrow {
    letter-spacing: 0.04em;
}

@media (max-width: 767.98px) {
    table.lis-responsive-records thead {
        display: none;
    }

    table.lis-responsive-records,
    table.lis-responsive-records tbody,
    table.lis-responsive-records tr,
    table.lis-responsive-records td {
        display: block;
        width: 100%;
    }

    table.lis-responsive-records tbody tr {
        padding: 0.75rem;
        border-bottom: 1px solid var(--bs-border-color);
    }

    table.lis-responsive-records tbody td {
        border: 0;
        padding: 0.35rem 0;
        text-align: left !important;
    }

    table.lis-responsive-records tbody td[data-label] {
        display: grid;
        grid-template-columns: minmax(6.5rem, 35%) minmax(0, 1fr);
        align-items: start;
        gap: 0.75rem;
    }

    table.lis-responsive-records tbody td[data-label]::before {
        content: attr(data-label);
        color: var(--bs-secondary-color);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .lis-data-table .lis-action-column {
        width: 100%;
        min-width: 0;
    }

    table.lis-responsive-records tbody td[data-label="Actions"] > .d-flex,
    table.lis-responsive-records tbody td[data-label="Action"] > .d-flex {
        justify-content: flex-start !important;
    }
}

.workflow-guard-card {
    border: 1px solid var(--lis-border-subtle);
    box-shadow: var(--lis-shadow-card);
}

.lis-modal-shell {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-height: 100vh;
    display: block;
    background: rgba(34, 48, 62, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1080;
    overflow-x: hidden;
    overflow-y: auto;
}

.lis-modal-dialog {
    margin: 1.75rem auto;
}

.lis-modal-content {
    border: 0;
    border-radius: var(--lis-radius-card);
    overflow: hidden;
    box-shadow: 0 1rem 2.5rem rgba(34, 48, 62, 0.2);
}

.lis-modal-body {
    max-height: min(70vh, 800px);
    overflow-y: auto;
}

.lis-modal-close {
    margin-left: auto;
}

.lis-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
}

/* ── Upload Report split-pane dialog (Google-print style) ── */

.lis-upload-dialog {
    max-width: min(1320px, 88vw);
    width: min(1320px, 88vw);
    margin: 1.5rem auto;
}

.lis-upload-dialog .lis-modal-content {
    position: relative;
}

.lis-upload-modal-body {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.lis-upload-split {
    height: min(72vh, 720px);
    min-height: 380px;
    flex: 1 1 auto;
}

.lis-upload-split--readonly {
    height: auto;
    min-height: 0;
}

/* New upload: step 1 — full-width drop zone only */
.lis-upload-split.lis-upload-split--stage-upload {
    display: block;
}

.lis-upload-drop-pane {
    height: 100%;
    min-height: min(72vh, 720px);
    padding: 1.25rem;
}

.lis-upload-drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(min(72vh, 720px) - 2.5rem);
    border: 2px dashed rgba(34, 48, 62, 0.22);
    border-radius: 0.75rem;
    background: rgba(248, 247, 250, 0.65);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.lis-upload-drop-zone:hover,
.lis-upload-drop-zone.lis-upload-drop-zone--drag {
    border-color: var(--bs-primary);
    background: rgba(13, 110, 253, 0.06);
}

.lis-upload-drop-zone .lis-upload-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.lis-upload-drop-hint {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.lis-upload-pdf-pane {
    flex: 1 1 50%;
    max-width: 50%;
    min-width: 0;
    background: #f4f5f7;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
    display: flex;
    flex-direction: column;
}

.lis-upload-form-pane {
    flex: 1 1 50%;
    max-width: 50%;
    min-width: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.lis-upload-modal-footer {
    padding: 1.25rem 1.75rem !important;
    gap: 0.75rem;
    flex-wrap: nowrap;
    align-items: center;
}

.lis-upload-modal-footer .lis-upload-save-submit {
    gap: 0.375rem;
    min-width: 0;
}

.lis-upload-mobile-pdf-frame {
    height: min(50vh, 420px);
    min-height: 240px;
}

.lis-upload-mobile-pdf-frame--compact {
    height: min(32vh, 260px);
    min-height: 180px;
}

.lis-pdf-expand-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(34, 48, 62, 0.15);
}

.lis-pdf-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1095;
    display: flex;
    flex-direction: column;
    background: #1e2630;
}

.lis-pdf-fullscreen-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    flex-shrink: 0;
}

.lis-pdf-fullscreen-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.5rem;
}

.lis-pdf-fullscreen-frame {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0.375rem;
    background: #fff;
}

/* Read-only report view: same shell width as upload; internal split layout only */
.lis-upload-dialog--readonly .lis-modal-content {
    display: flex;
    flex-direction: column;
}

.lis-upload-dialog--readonly .lis-upload-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lis-upload-dialog--readonly .lis-upload-split {
    height: min(72vh, 720px);
    min-height: 380px;
    flex: 1 1 auto;
}

.lis-upload-dialog--readonly .lis-upload-split--readonly {
    display: flex;
    min-height: 0;
}

.lis-upload-dialog--readonly .modal-header,
.lis-upload-dialog--readonly .lis-upload-modal-footer {
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .lis-upload-dialog--readonly .lis-upload-split--readonly {
        flex-direction: row;
    }

    .lis-upload-dialog--readonly .lis-upload-pdf-pane {
        flex: 1 1 52%;
        max-width: 52%;
        min-height: 0;
        overflow: hidden;
    }

    .lis-upload-dialog--readonly .lis-upload-pdf-pane iframe {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
    }

    .lis-upload-dialog--readonly .lis-upload-form-pane {
        flex: 1 1 48%;
        max-width: 48%;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .lis-upload-dialog--readonly .lis-upload-form-pane fieldset {
        margin-bottom: 0.75rem !important;
        padding: 0.625rem 0.875rem !important;
    }

    .lis-upload-dialog--readonly .lis-upload-form-pane .row.g-3 {
        --bs-gutter-y: 0.5rem;
    }

    .lis-upload-dialog--readonly .lis-upload-readonly-details {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 991.98px) {
    .lis-upload-dialog--readonly .lis-upload-split--readonly {
        flex-direction: column;
    }

    .lis-upload-dialog--readonly .lis-upload-form-pane {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0.75rem 1rem 0.5rem;
    }

    .lis-upload-dialog--readonly .lis-upload-mobile-pdf--readonly {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        margin-bottom: 0.5rem !important;
    }

    .lis-upload-dialog--readonly .lis-upload-mobile-pdf--readonly .lis-upload-mobile-pdf-frame {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        max-height: none;
    }

    .lis-upload-dialog--readonly .lis-upload-readonly-details {
        flex: 0 0 auto;
        max-height: 32vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .lis-upload-dialog--readonly .lis-upload-mobile-pdf--readonly .lis-upload-mobile-pdf-label {
        flex-shrink: 0;
    }
}

.lis-modal-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.app-search-input {
    min-width: 260px;
}

.app-search-input--bounded {
    max-width: 350px;
}

.app-search-input .input-group-text {
    background: #fff;
    border-right: 0;
}

.app-search-input .form-control {
    border-left: 0;
}

.empty-state-panel {
    max-width: 22rem;
    margin: 0 auto;
}

.app-dialog {
    min-width: min(720px, 90vw);
}

.app-dialog-lg {
    min-width: min(900px, 96vw);
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--lis-color-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dbdade;
}

.profile-avatar-lg {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.lis-auth-wrapper {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 22%, rgba(40, 199, 111, 0.1), transparent 28%),
        radial-gradient(circle at 72% 64%, rgba(115, 103, 240, 0.08), transparent 30%),
        #f4faf6;
}

.lis-auth-wrapper .authentication-inner {
    min-height: 100vh;
}

.lis-auth-hero {
    position: relative;
    overflow: hidden;
}

.lis-auth-hero-content {
    position: relative;
    width: 100%;
    max-width: 56rem;
}

.lis-auth-hero-banner {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1.25rem;
    box-shadow: 0 1rem 2.5rem rgba(15, 55, 35, 0.16);
    object-fit: cover;
}

.lis-auth-panel {
    padding: clamp(1.5rem, 4vw, 4rem);
    min-height: 100vh;
}

.lis-auth-card-wrap {
    width: min(100%, 30rem);
}

.lis-login-card {
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 1rem 3rem rgba(34, 48, 62, 0.14);
}

.lis-password-toggle .lis-password-toggle-btn,
.auth-pass-inputgroup .password-addon {
    cursor: pointer;
    pointer-events: auto;
    color: inherit;
    z-index: 3;
}

.lis-password-toggle .lis-password-toggle-btn:focus,
.auth-pass-inputgroup .password-addon:focus {
    box-shadow: none;
}

.lis-demo-accounts {
    border: 1px solid rgba(47, 43, 61, 0.12);
    border-radius: var(--lis-radius-card);
    background: var(--lis-surface-subtle);
    padding: var(--lis-space-panel);
}

.lis-demo-accounts code {
    white-space: normal;
    text-align: right;
}

@media (max-width: 991.98px) {
    .app-dialog,
    .app-dialog-lg {
        min-width: auto;
    }

    .lis-modal-dialog {
        width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .lis-modal-body {
        max-height: calc(100vh - 11rem);
    }

    .lis-upload-dialog {
        max-width: calc(100vw - 1rem);
        width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .lis-upload-dialog .lis-modal-content {
        max-height: calc(100dvh - 1rem);
        display: flex;
        flex-direction: column;
    }

    .lis-upload-dialog .lis-upload-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        max-height: none;
    }

    .lis-upload-split {
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .lis-upload-form-pane {
        max-width: 100%;
        flex: 1 1 auto;
        overflow-y: visible;
        padding: 0.875rem 1rem 1rem;
    }

    .lis-upload-pdf-pane {
        max-width: 100%;
    }

    .lis-upload-drop-pane {
        min-height: min(55vh, 520px);
        padding: 1rem;
    }

    .lis-upload-drop-zone {
        min-height: calc(min(55vh, 520px) - 2rem);
    }

}

@media (max-width: 575.98px) {
    .lis-upload-dialog {
        max-width: calc(100vw - 0.5rem);
        width: calc(100vw - 0.5rem);
        margin: 0.25rem auto;
    }

    .lis-upload-dialog .lis-modal-content {
        border-radius: 0.75rem;
        max-height: calc(100dvh - 0.5rem);
    }

    .lis-modal-header,
    .lis-upload-modal-footer {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .lis-upload-form-pane fieldset {
        padding: 0.75rem !important;
    }

    .lis-upload-dialog .lis-upload-mobile-pdf-frame {
        height: min(42vh, 360px);
        min-height: 200px;
    }

    .lis-upload-mobile-pdf-frame--compact {
        height: min(28vh, 220px);
        min-height: 160px;
    }

    .lis-pdf-fullscreen-toolbar {
        padding: 0.625rem 0.75rem;
    }

    .lis-pdf-fullscreen-body {
        padding: 0.25rem;
    }

    .lis-upload-modal-footer {
        gap: 0.375rem;
    }

    .lis-upload-modal-footer .btn {
        width: auto;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        white-space: normal;
    }

    .lis-upload-modal-footer .lis-upload-save-submit {
        flex: 1 1 auto;
    }

    .lis-upload-modal-footer .lis-upload-save-submit .btn {
        flex: 1 1 0;
        min-width: 0;
    }

}

.text-muted {
    color: var(--lis-color-muted) !important;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus {
    box-shadow: none !important;
}

:where(button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid var(--lis-focus-ring) !important;
    outline-offset: -2px;
}

a[href]:focus-visible {
    outline: 2px solid var(--lis-focus-ring) !important;
    outline-offset: 2px;
}

/* FocusOnNavigate and modal headings use tabindex=-1 for screen-reader announcements, not interaction. */
[tabindex="-1"]:focus-visible {
    outline: none !important;
}

.badge.bg-label-primary {
    background-color: #ebe9ff !important;
    color: var(--lis-color-brand) !important;
}

.badge.bg-label-info {
    background-color: #e2f5f7 !important;
    color: var(--lis-color-info) !important;
}

.badge.bg-label-success {
    background-color: #e3f4ea !important;
    color: var(--lis-color-success) !important;
}

.badge.bg-label-warning {
    background-color: #fff0cc !important;
    color: var(--lis-color-warning-text) !important;
}

.badge.bg-label-danger {
    background-color: #fde8e7 !important;
    color: #a61b12 !important;
}

.badge.bg-label-secondary {
    background-color: #e9ebef !important;
    color: #4f566b !important;
}

.toast.bg-success { background-color: var(--lis-color-success) !important; }
.toast.bg-danger { background-color: var(--lis-color-danger) !important; }
.toast.bg-info { background-color: var(--lis-color-info) !important; }
.toast.bg-warning { background-color: #f9e2a8 !important; color: #4f3100 !important; }

:where(button, input, select, textarea):disabled,
.disabled {
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Vuexy: submenu toggles (.menu-link.menu-toggle) must receive clicks; theme can leave pointer-events disabled on nested menu links. */
#layout-menu .menu-link.menu-toggle,
#layout-menu .lis-admin-submenu-toggle {
    pointer-events: auto !important;
    cursor: pointer;
    user-select: none;
}

#layout-menu .menu-sub .menu-link {
    pointer-events: auto !important;
    cursor: pointer;
}

/* Keep submenu links above the next top-level row so clicks cannot fall through to e.g. Settings. */
#layout-menu .menu-inner > .menu-item .menu-sub {
    position: relative;
    z-index: 2;
}

/* Sidebar brand: full logo when open, "G" only when collapsed */
.lis-app-brand {
    position: relative;
    flex-wrap: nowrap;
    min-height: 4.5rem;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.lis-app-brand .lis-brand-full,
.lis-app-brand .lis-brand-expand {
    position: absolute;
    inset-block-start: 0.75rem;
    height: 3rem;
    display: flex !important;
    align-items: center;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.lis-app-brand .lis-brand-full {
    inset-inline-start: 1.375rem;
    width: 11.625rem;
    opacity: 1;
    visibility: visible;
    min-width: 0;
    overflow: hidden;
}

.lis-app-brand .lis-brand-expand {
    inset-inline-start: 0.9375rem;
    width: 2.5rem;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
}

.lis-app-brand .lis-brand-full .app-brand-logo {
    display: flex !important;
    align-items: center;
    height: 2.5rem;
}

.lis-app-brand .lis-brand-full .app-brand-img {
    display: block !important;
    max-width: 100%;
    height: 2.5rem;
    width: auto;
    object-fit: contain;
}

.lis-app-brand .lis-brand-collapse-toggle {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 13.75rem;
    transform: translateY(-50%);
}

.lis-app-brand .app-brand-mark {
    cursor: pointer;
    flex-shrink: 0;
}

/* Collapsed rail — class set by syncLisSidebarBrand() + Vuexy html.layout-menu-collapsed */
html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu.lis-sidebar-collapsed .lis-app-brand,
html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand {
    padding-inline: 0.35rem !important;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-full {
    display: flex !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-expand {
    display: flex !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-collapse-toggle {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-expand:hover .app-brand-mark {
    transform: scale(1.08);
    filter: drop-shadow(0 0.35rem 0.5rem rgba(0, 96, 72, 0.28));
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .app-brand-mark {
    transition: transform 0.15s ease, filter 0.15s ease;
}

/* Preserve the role row's space so navigation icons do not jump when the collapsed rail expands on hover. */
.lis-sidebar-role {
    height: 2rem;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu.lis-sidebar-collapsed .lis-sidebar-role {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Keep the collapsed desktop rail icon-only; custom span wrappers are not covered by Vuexy's stock label selectors. */
html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu.lis-sidebar-collapsed .menu-inner > .menu-item > .menu-link > :not(.menu-icon) {
    display: none !important;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu.lis-sidebar-collapsed .menu-inner > .menu-item > .menu-link {
    width: calc(100% - 1.5rem) !important;
    min-height: 2.375rem;
    overflow: hidden;
}

/* Top bar: menu icon always available to open/close sidebar */
.lis-navbar-menu-toggle {
    cursor: pointer;
}

.lis-login-card .card-body {
    padding: 2rem !important;
}

/* Admin dashboard (main overview page) */
.lis-admin-dash .lis-dash-kpi {
    border: 1px solid rgba(47, 43, 61, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lis-admin-dash .lis-dash-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.4rem 1.25rem rgba(47, 43, 61, 0.08);
}

.lis-admin-dash .lis-dash-kpi-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.lis-admin-dash .lis-activity-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Hospital admin summary (muted dashboard) */
.lis-hospital-dashboard .lis-kpi-card {
    border: 1px solid rgba(47, 43, 61, 0.08);
    transition: box-shadow 0.15s ease;
}

.lis-hospital-dashboard .lis-kpi-card:hover {
    box-shadow: 0 0.25rem 1rem rgba(47, 43, 61, 0.06);
}

.lis-hospital-dashboard .lis-kpi-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.lis-hospital-dashboard .lis-kpi-icon.soft-teal {
    background-color: rgba(0, 186, 209, 0.12);
    color: #0097a7;
}

.lis-hospital-dashboard .lis-kpi-icon.soft-slate {
    background-color: rgba(93, 89, 108, 0.1);
    color: #5d596c;
}

.lis-hospital-dashboard .lis-kpi-icon.soft-green {
    background-color: rgba(40, 199, 111, 0.12);
    color: #28a870;
}

.lis-hospital-dashboard .lis-kpi-icon.soft-violet {
    background-color: rgba(115, 103, 240, 0.12);
    color: #6e62d4;
}

.lis-test-bar-track {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(47, 43, 61, 0.07);
    overflow: hidden;
}

.lis-test-bar-fill {
    height: 100%;
    border-radius: 0.25rem;
    transition: width 0.35s ease;
}

.lis-test-bar-fill.lis-bar-0 { background-color: #8d9eb5; }
.lis-test-bar-fill.lis-bar-1 { background-color: #92b8a8; }
.lis-test-bar-fill.lis-bar-2 { background-color: #a896c8; }
.lis-test-bar-fill.lis-bar-3 { background-color: #9eb5c4; }
.lis-test-bar-fill.lis-bar-4 { background-color: #b5a896; }
.lis-test-bar-fill.lis-bar-5 { background-color: #8fb8c4; }

/* Hospital details: table footers + pagination (avoid content hugging table border / odd pill height) */
.lis-hospital-dashboard .lis-table-pagination {
    padding: 0.75rem 1rem 1rem;
    border-color: rgba(47, 43, 61, 0.08) !important;
}

.lis-hospital-dashboard .lis-table-pagination .pagination {
    gap: 0.25rem;
}

.lis-hospital-dashboard .lis-table-pagination .pagination .page-item {
    display: flex;
    align-items: center;
}

.lis-hospital-dashboard .lis-table-pagination .pagination .page-link {
    padding: 0.35rem 0.65rem;
    min-height: auto;
    line-height: 1.35;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.lis-modal-body .lis-table-pagination {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

/* Select2 in LIS forms / modals */
.lis-select2-field .select2-container {
    width: 100% !important;
}

.lis-select2-field .select2-selection--single {
    min-height: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
}

.lis-modal-content .select2-container--open {
    z-index: 1100;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
}

.lis-toast-container {
    z-index: 2000;
}

.lis-scroll-panel {
    max-height: 200px;
    overflow-y: auto;
}

.lis-column-compact {
    width: 3rem;
}

.lis-page-size-select {
    width: auto;
}

.lis-empty-state-icon {
    width: 72px;
    height: 72px;
}

.lis-auth-brand-logo {
    height: 72px;
}

.lis-auth-page-logo {
    max-height: 120px;
}
