/* ========================================
   Geneflux LIS - Custom Styles
   ======================================== */

:root {
    --gf-green: #6fd67f;
    --gf-green-dark: #5bc46b;
    --gf-green-light: #e8f8eb;
    --gf-light-grey: #e8e8e8;
    --gf-dark-grey: #a6a6a6;
    --gf-white: #ffffff;
    --gf-text: #333333;
    --gf-text-secondary: #666666;
    --gf-bg: #f5f5f5;
    --gf-danger: #e74c3c;
}

[data-bs-theme="dark"] {
    --gf-bg: #232333;
    --gf-white: #2f3349;
    --gf-text: #cfd3ec;
    --gf-text-secondary: #a3a7cc;
    --gf-light-grey: #434968;
    --gf-bg-body: #232333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gf-bg);
    color: var(--gf-text);
    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;
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: auto;
}

.login-card {
    background: var(--gf-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.login-logo {
    width: 200px;
    margin-bottom: 8px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gf-text);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--gf-text-secondary);
    margin-bottom: 32px;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--gf-danger);
    font-size: 0.85rem;
    margin-bottom: 16px;
    text-align: left;
}

/* ========================================
   Main Layout
   ======================================== */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    width: 260px;
    background: var(--gf-white);
    border-right: 1px solid var(--gf-light-grey);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gf-light-grey);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    height: 36px;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gf-text);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gf-dark-grey);
    padding: 12px 12px 8px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gf-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.sidebar-nav .nav-item:hover {
    background: var(--gf-green-light);
    color: var(--gf-green-dark);
}

.sidebar-nav .nav-item.active {
    background: var(--gf-green);
    color: white;
}

.nav-item .mud-icon-root {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gf-light-grey);
}

/* ========================================
   Main Content Area
   ======================================== */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--gf-bg);
}

.app-topbar {
    height: 64px;
    background: var(--gf-white);
    border-bottom: 1px solid var(--gf-light-grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gf-text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ========================================
   Dashboard Cards
   ======================================== */
.dashboard-card {
    background: var(--gf-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.dashboard-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}

.dashboard-card-body {
    padding: 20px;
}

/* ========================================
   Filter Panel
   ======================================== */
.filter-panel {
    background: var(--gf-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.filter-header {
    background: var(--gf-green);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-body {
    padding: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ========================================
   Identity Toggle (NRIC / Passport)
   ======================================== */
.identity-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dbdade;
    height: 38px;
}

.identity-toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
}

.identity-toggle-btn.inactive {
    background: var(--gf-light-grey);
    color: var(--gf-text-secondary);
}

.identity-toggle-btn.active {
    background: var(--gf-dark-grey);
    color: white;
}

/* ========================================
   Data Table
   ======================================== */
.mud-table .mud-table-head .mud-table-cell {
    background-color: var(--gf-dark-grey) !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mud-table .mud-table-body .mud-table-row:hover {
    background-color: var(--gf-green-light) !important;
}

.mud-table .mud-table-body .mud-table-cell {
    font-size: 0.85rem;
    padding: 12px 16px !important;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.draft {
    background: #fff3cd;
    color: #856404;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

/* ========================================
   Pagination
   ======================================== */
.mud-table-pagination {
    background: var(--gf-dark-grey) !important;
    color: white !important;
}

/* ========================================
   Action Toolbar
   ======================================== */
.action-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-toolbar .search-box {
    flex: 1;
    min-width: 250px;
}

.filter-badge {
    position: relative;
}

.filter-badge .badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--gf-danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ========================================
   Dialog / Modal Overrides
   ======================================== */
.upload-dialog .mud-dialog-title {
    background: var(--gf-green);
    color: white;
}

/* ========================================
   User Profile Menu
   ======================================== */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gf-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ========================================
   Settings Page
   ======================================== */
.settings-tabs .mud-tab.mud-tab-active {
    color: var(--gf-green-dark) !important;
}

.settings-card {
    background: var(--gf-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

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

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .app-sidebar {
        display: none;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .action-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========================================
   Vuexy Layout Integration
   ======================================== */
.lis-brand {
    letter-spacing: 0.02em;
    line-height: 1;
}

.app-brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7367f0 0%, #28c76f 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0.25rem 0.75rem rgba(115, 103, 240, 0.25);
}

.lis-avatar {
    background: linear-gradient(135deg, #0ab39c 0%, #405189 100%);
    font-weight: 700;
}

.navbar-search-icon {
    color: #a8aab4;
}

.lis-welcome-card {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 35%),
        linear-gradient(135deg, #405189 0%, #0ab39c 100%);
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.75);
}

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

.app-toolbar-card {
    border: 1px solid rgba(115, 103, 240, 0.12);
    box-shadow: 0 0.375rem 1rem rgba(34, 48, 62, 0.08);
}

/* Patient directory: single card, table flush to card edges (no inner card-datatable gap). */
.patient-directory-card {
    border: 1px solid rgba(115, 103, 240, 0.12);
    box-shadow: 0 0.375rem 1rem rgba(34, 48, 62, 0.08);
    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;
}

.role-flow-card {
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.role-flow-card:hover {
    transform: translateY(-3px);
    border-color: rgba(115, 103, 240, 0.3) !important;
    box-shadow: 0 0.625rem 1.5rem rgba(34, 48, 62, 0.1) !important;
}

.workflow-validation-card,
.workflow-guard-card {
    border: 1px solid rgba(64, 81, 137, 0.12);
    box-shadow: 0 0.5rem 1.4rem rgba(34, 48, 62, 0.08);
}

.workflow-step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.workflow-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(47, 43, 61, 0.12);
    background: #fff;
}

.workflow-step-item.is-complete {
    background: rgba(40, 199, 111, 0.08);
    border-color: rgba(40, 199, 111, 0.18);
}

.workflow-step-item.is-active {
    background: rgba(115, 103, 240, 0.08);
    border-color: rgba(115, 103, 240, 0.18);
}

.workflow-step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7367f0 0%, #28c76f 100%);
    flex-shrink: 0;
}

.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: 1rem;
    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;
}

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

/* 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: wrap;
    align-items: center;
}

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

/* Confirmation overlay */

.lis-confirm-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: inherit;
}

.lis-confirm-card {
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.75rem;
    padding: 2rem 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.lis-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

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

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

.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;
}

.filter-panel {
    border: 1px solid rgba(64, 81, 137, 0.08);
    box-shadow: 0 5px 20px rgba(64, 81, 137, 0.08);
}

.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(--gf-dark-grey);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.identity-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mud-dialog {
    border-radius: 1rem !important;
}

.mud-dialog .modal-header,
.mud-dialog .modal-body,
.mud-dialog .modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

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

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

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

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

.lis-auth-hero::before {
    content: "";
    position: absolute;
    width: 34rem;
    height: 34rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(115, 103, 240, 0.18), rgba(40, 199, 111, 0.1));
    filter: blur(2px);
}

.lis-auth-hero-content {
    position: relative;
    max-width: 44rem;
}

.lis-auth-flow-card {
    border-radius: 1.25rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(47, 43, 61, 0.08);
    box-shadow: 0 0.75rem 2rem rgba(34, 48, 62, 0.08);
}

.auth-workflow-steps {
    grid-template-columns: 1fr;
}

.lis-auth-role-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.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: 1rem;
    background: rgba(248, 247, 250, 0.82);
    padding: 1rem;
}

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

@media (max-width: 768px) {
    .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-split {
        height: min(55vh, 520px);
    }

    .lis-upload-form-pane {
        padding: 1rem;
    }

    .workflow-step-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Dark Mode Layout Fixes
   ======================================== */
[data-bs-theme="dark"] .layout-navbar.navbar-detached {
    background-color: var(--gf-white) !important;
    border-color: var(--gf-light-grey) !important;
}

[data-bs-theme="dark"] .layout-navbar .form-control,
[data-bs-theme="dark"] .layout-navbar .navbar-search-icon i {
    color: var(--gf-text) !important;
}

[data-bs-theme="dark"] .card {
    background-color: var(--gf-white);
    border-color: var(--gf-light-grey);
}

[data-bs-theme="dark"] .text-muted {
    color: var(--gf-text-secondary) !important;
}

[data-bs-theme="dark"] .bg-menu-theme {
    background-color: var(--gf-white) !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;
}

.lis-app-brand .lis-brand-expand {
    display: none;
    flex: 1;
    justify-content: center;
    align-items: center;
    min-width: 0;
    cursor: pointer;
}

.lis-app-brand .lis-brand-full {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.lis-app-brand .lis-brand-full .app-brand-img {
    display: block;
    max-width: 100%;
    height: 34px;
    width: auto;
    object-fit: contain;
}

.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 {
    justify-content: center;
    padding-inline: 0.35rem !important;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-full,
html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .app-brand-img,
html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .app-brand-logo {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: 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,
html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .app-brand-img-collapsed {
    display: flex !important;
    width: 100%;
    margin: 0;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-collapse-toggle {
    display: none !important;
}

html.layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .lis-app-brand .lis-brand-expand:hover .app-brand-mark {
    transform: scale(1.08);
    box-shadow: 0 0.35rem 1rem rgba(115, 103, 240, 0.35);
}

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

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

[data-bs-theme="dark"] .table-light {
    background-color: var(--gf-light-grey) !important;
    color: var(--gf-text) !important;
}

[data-bs-theme="dark"] .table thead th {
    background-color: var(--gf-light-grey) !important;
    color: var(--gf-text) !important;
    border-color: var(--gf-light-grey) !important;
}

.lis-auth-panel {
    min-height: 100vh;
}

.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;
}

[data-bs-theme="dark"] .lis-admin-dash .lis-dash-kpi {
    border-color: rgba(207, 211, 236, 0.12);
}

/* 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; }

[data-bs-theme="dark"] .lis-test-bar-track {
    background-color: rgba(207, 211, 236, 0.08);
}

[data-bs-theme="dark"] .lis-hospital-dashboard .lis-kpi-card {
    border-color: rgba(207, 211, 236, 0.12);
}

/* 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;
}

[data-bs-theme="dark"] .lis-hospital-dashboard .lis-table-pagination {
    border-color: rgba(207, 211, 236, 0.12) !important;
}
