/* ==========================================================================
   PrimeHPM Web — Modern Healthcare Information System (HIS) Design System
   ========================================================================== */

/* Shared search icon: avoids platform-dependent magnifier emoji rendering. */
.hpm-search-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    vertical-align: -0.125em;
    overflow: visible;
}

button .hpm-search-icon,
.btn .hpm-search-icon {
    margin-right: 0.3em;
}

button.icon-only .hpm-search-icon,
.btn-find.icon-only .hpm-search-icon,
.search-icon .hpm-search-icon,
.diagnostic-test-search-icon .hpm-search-icon,
.diag-doctor-search-icon .hpm-search-icon {
    margin-right: 0;
}

:root {
    /* Brand & Primary Clinical Palette */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --primary-glow: rgba(2, 132, 199, 0.22);
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #ecfdf5;
    --success-dark: #047857;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --warning-dark: #b45309;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-dark: #b91c1c;
    --info: #06b6d4;
    --info-light: #ecfeff;
    --info-dark: #0e7490;
    --violet: #8b5cf6;
    --violet-light: #f5f3ff;
    --violet-dark: #6d28d9;

    /* Neutrals & Surfaces */
    --ink: #0f172a;
    --ink-secondary: #334155;
    --muted: #64748b;
    --subtle: #94a3b8;
    --line: #e2e8f0;
    --line-subtle: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --canvas: #f8fafc;
    
    /* Light Theme / Clean Medical Sidebar Surfaces */
    --sidebar-bg: #ffffff;
    --sidebar-surface: #f8fafc;
    --sidebar-hover: #f1f5f9;
    --sidebar-active: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --sidebar-text: #475569;
    --sidebar-text-bright: #0f172a;
    --sidebar-border: #e2e8f0;

    /* Elevation & Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.1), 0 4px 10px -4px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 20px 35px -5px rgba(15, 23, 42, 0.14), 0 8px 16px -6px rgba(15, 23, 42, 0.08);

    /* Typography */
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink-secondary);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--canvas); }
body { font-size: 13.5px; line-height: 1.5; color: var(--ink-secondary); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6, p { margin-top: 0; margin-bottom: 0; }
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
h1:focus-visible, h2:focus-visible, h3:focus-visible,
.page-heading:focus, .page-heading h1:focus,
[tabindex="-1"]:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.sidebar ::-webkit-scrollbar-thumb { background: #cbd5e1; }
.sidebar ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================================================
   Application Shell Layout
   ========================================================================== */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 275px minmax(0, 1fr);
    background: var(--canvas);
}

/* ==========================================================================
   Sidebar Styling (Clean & Modern Medical Enterprise Theme)
   ========================================================================== */
.sidebar {
    background: #ffffff;
    color: #1e293b;
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 12px 14px 14px;
    border-right: 1px solid #e2e8f0;
    z-index: 40;
    overflow: hidden;
    box-shadow: 1px 0 3px rgba(15, 23, 42, 0.02);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.brand {
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    font-weight: 800;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand strong {
    display: block;
    font-size: 14px;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: -0.2px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.brand small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.mobile-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

/* Nav Menu Wrapper & Quick Search */
.nav-menu-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.nav-search-box {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.nav-search-box svg {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
}

.nav-search-box input {
    width: 100%;
    min-height: 33px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 28px 6px 31px;
    font-size: 12px;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

.nav-search-box input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.nav-search-box input::placeholder {
    color: #94a3b8;
}

.nav-search-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
}

.nav-search-clear:hover {
    color: #0f172a;
}

/* Scrollable Nav Menu */
.nav-menu-scroll {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 3px;
    padding-bottom: 16px;
    margin-bottom: 4px;
    scroll-behavior: smooth;
}

.nav-menu-scroll::-webkit-scrollbar {
    width: 4px;
}

.nav-menu-scroll::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.nav-menu-scroll::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Direct Navigation Links */
.nav-item-link {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    padding: 7.5px 10px;
    border-radius: 7px;
    font-weight: 550;
    font-size: 12.5px;
    transition: all 0.14s ease;
    position: relative;
    text-decoration: none;
}

.nav-item-link:hover {
    color: #0284c7;
    background: #f8fafc;
}

.nav-item-link.active {
    color: #0284c7 !important;
    background: #eff6ff !important;
    font-weight: 650 !important;
}

.nav-item-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: #0284c7;
    border-radius: 0 3px 3px 0;
}

.nav-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.14s ease, transform 0.14s ease;
    background: transparent;
    border: none;
}

.nav-code svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2;
    display: block;
}

.nav-item-link:hover .nav-code {
    color: #0284c7;
}

.nav-item-link.active .nav-code {
    color: #0284c7 !important;
}

.nav-item-link.active .nav-code svg {
    stroke: #0284c7;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Accordion Nav Groups */
.nav-group {
    display: flex;
    flex-direction: column;
    margin-top: 2px;
}

.nav-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: #334155;
    padding: 7px 10px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.14s ease;
    text-align: left;
    user-select: none;
}

.nav-group-header:hover {
    color: #0f172a;
    background: #f8fafc;
}

.nav-group.open > .nav-group-header {
    color: #0f172a;
    font-weight: 650;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group-icon {
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: color 0.14s ease;
}

.nav-group-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2;
}

.nav-group-header:hover .nav-group-icon,
.nav-group.open > .nav-group-header .nav-group-icon {
    color: #0284c7;
}

.nav-group-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-chevron-svg {
    color: #94a3b8;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.14s ease;
    display: inline-block;
    flex-shrink: 0;
}

.nav-group.open > .nav-group-header .nav-chevron-svg {
    transform: rotate(90deg);
    color: #0284c7;
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-left: 6px;
    margin: 2px 0 4px 17px;
    border-left: 1.5px solid #e2e8f0;
}

.nav-group-items .nav-item-link {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

.nav-group-items .nav-item-link .nav-code {
    width: 16px;
    height: 16px;
}

.nav-group-items .nav-item-link .nav-code svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.8;
}

.nav-group-items .nav-item-link:hover {
    color: #0284c7;
    background: #f8fafc;
}

.nav-group-items .nav-item-link.active {
    color: #0284c7 !important;
    background: #eff6ff !important;
    font-weight: 600 !important;
}

/* Empty Search Results State */
.nav-empty-search {
    text-align: center;
    padding: 24px 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    margin: 8px 4px;
}

.nav-empty-search .empty-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.nav-empty-search .empty-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.nav-empty-search .empty-hint {
    font-size: 10.5px;
    color: #64748b;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    padding: 12px 6px 0;
    color: #64748b;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-weight: 550;
    font-size: 11px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.2);
    animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

/* ==========================================================================
   Glassmorphic Topbar
   ========================================================================== */

.topbar {
    height: 66px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    padding: 6px 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.breadcrumb-module {
    display: flex;
    flex-direction: column;
}

.breadcrumb-module small {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.8px;
    font-weight: 800;
}

.breadcrumb-module strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--ink);
    letter-spacing: -0.2px;
}

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

.live-clock-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.live-clock-chip svg {
    color: var(--primary);
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #ffffff;
    border: 1px solid var(--line);
    padding: 4px 10px 4px 6px;
    border-radius: 99px;
    box-shadow: var(--shadow-xs);
}

.user-avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-details strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}

.user-details small {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.logout-button {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 8px;
    padding: 6.5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.logout-button:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.page-content {
    flex: 1 0 auto;
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 32px 64px;
    animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Page Headings, Buttons & Badges
   ========================================================================== */

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-block;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 6px;
    padding: 3px 8px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.page-heading h1 {
    font-size: clamp(24px, 2.8vw, 30px);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin-bottom: 4px;
}

.page-heading p {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.page-heading code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 2px 6px;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
}

/* Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    font-size: 12.5px;
    transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-success {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-dark {
    background: #0f172a;
    color: #ffffff;
}

.btn-dark:hover {
    background: #1e293b;
}

.btn-ghost {
    background: transparent;
    color: #64748b;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: none;
}

.btn-sm {
    min-height: 31px;
    padding: 5px 11px;
    font-size: 11.5px;
    border-radius: 6px;
}

/* Fast Actions Floating Banner / Hub */
.fast-actions-bar {
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 14px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    animation: fadeIn 0.2s ease;
}

.fast-actions-bar span.prompt {
    font-weight: 750;
    color: #0369a1;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fast-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fast-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.fast-action-pill:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

/* Badges & Status Chips */
.badge, .date-chip {
    font-size: 10px;
    letter-spacing: 0.5px;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.red-badge { color: #b91c1c; background: #fee2e2; }
.teal-badge { color: #0f766e; background: #ccfbf1; }
.amber-badge { color: #b45309; background: #fef3c7; }
.emerald-badge { color: #047857; background: #d1fae5; }
.violet-badge { color: #6d28d9; background: #ede9fe; }

.pill {
    color: #475569;
    background: #f1f5f9;
    border-radius: 99px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pill-danger { background: #fee2e2; color: #dc2626; font-weight: 750; }
.pill-success { background: #d1fae5; color: #059669; font-weight: 750; }
.pill-warning { background: #fef3c7; color: #d97706; font-weight: 750; }
.pill-info { background: #e0f2fe; color: #0284c7; font-weight: 750; }

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin: -6px 0 20px;
    font-size: 12.5px;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.18s ease;
}

.alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert.danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   Metric Cards & KPI Grid
   ========================================================================== */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: var(--metric, #0ea5e9);
}

.metric-card span {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    display: block;
    letter-spacing: 0.2px;
}

.metric-card strong {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    margin: 8px 0 2px;
    letter-spacing: -0.8px;
    line-height: 1.15;
}

.metric-card small {
    color: #94a3b8;
    font-size: 11px;
    display: block;
    font-weight: 500;
}

.accent-blue { --metric: #0ea5e9; }
.accent-violet { --metric: #8b5cf6; }
.accent-amber { --metric: #f59e0b; }
.accent-red { --metric: #ef4444; }
.accent-emerald { --metric: #10b981; }

/* ==========================================================================
   Module Navigation Cards & Quick Hub
   ========================================================================== */

.section-heading {
    margin: 32px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-heading h2 {
    font-size: 18px;
    font-weight: 750;
    color: var(--ink);
    letter-spacing: -0.3px;
    margin-bottom: 3px;
}

.section-heading p {
    color: var(--muted);
    font-size: 12.5px;
    margin: 0;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.module-card {
    min-height: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.module-card:hover {
    border-color: #38bdf8;
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.module-card > b {
    position: absolute;
    right: 18px;
    top: 18px;
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 3px 7px;
    border-radius: 6px;
}

.module-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-weight: 850;
    font-size: 14px;
    margin-bottom: 16px;
    transition: transform 0.15s ease;
}

.module-card:hover .module-icon {
    transform: scale(1.08);
}

.module-icon.blue { color: #0284c7; background: #e0f2fe; }
.module-icon.violet { color: #7c3aed; background: #ede9fe; }
.module-icon.amber { color: #d97706; background: #fef3c7; }
.module-icon.red { color: #dc2626; background: #fee2e2; }
.module-icon.teal { color: #0f766e; background: #ccfbf1; }
.module-icon.emerald { color: #059669; background: #d1fae5; }

.module-card h3 {
    font-size: 15px;
    font-weight: 750;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.module-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.module-card em {
    color: var(--primary);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 750;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.module-card:hover em {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Master Cards */
.master-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.master-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: all 0.18s ease;
    display: flex;
    flex-direction: column;
}

.master-card:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
    box-shadow: var(--shadow-md);
}

.master-card b {
    display: block;
    font-size: 15px;
    font-weight: 750;
    color: var(--ink);
    margin-top: 10px;
    margin-bottom: 4px;
}

.master-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Workflow Hub Tabs on Home */
.workflow-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 20px;
    overflow: visible;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.tab-btn.active {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* ==========================================================================
   Panels, Forms & Layout Grids
   ========================================================================== */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    margin-bottom: 24px;
}

.panel-heading {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    background: #ffffff;
}

.panel-heading h2 {
    font-size: 15.5px;
    font-weight: 750;
    color: var(--ink);
    letter-spacing: -0.2px;
    margin-bottom: 2px;
}

.panel-heading p {
    font-size: 11.5px;
    color: var(--muted);
    margin: 0;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.75fr);
    gap: 20px;
    align-items: start;
}

.workspace-grid.compact {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.module-layout {
    display: grid;
    grid-template-columns: minmax(440px, 1.1fr) minmax(360px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.master-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
    gap: 20px;
    align-items: start;
}

/* Forms & Inputs */
.form-panel form {
    padding: 22px;
}

.form-panel > .form-grid {
    padding: 22px 22px 0 22px;
}

.form-panel > .form-section-title {
    margin: 20px 22px 12px 22px;
}

.form-panel > .form-actions {
    margin: 18px 22px 22px 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

label > span:first-child, .line-editor label > span {
    display: block;
    color: #475569;
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    min-height: 39px;
    padding: 8px 12px;
    outline: none;
    font-size: 13px;
    transition: all 0.14s ease;
    box-sizing: border-box;
}

textarea {
    min-height: 75px;
    resize: vertical;
    line-height: 1.45;
}

input:focus, select:focus, textarea:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.16);
}

input:disabled, select:disabled, textarea:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.validation-message, .validation-errors {
    color: #dc2626;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.form-section-title {
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin: 20px 0 12px;
}

.inline-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.inline-check input {
    width: 17px;
    min-height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.input-action {
    display: flex;
    width: 100%;
}

.input-action input {
    flex: 1;
    min-width: 0;
    border-radius: 8px 0 0 8px;
}

.input-action button {
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
    border-left: 0;
    background: #f1f5f9;
    color: #334155;
    padding: 0 14px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 750;
    font-size: 11.5px;
    transition: background 0.14s ease;
}

.input-action button:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Report & Audit Log Filter Toolbar */
.report-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 18px 22px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.report-filter label {
    display: flex;
    flex-direction: column;
    min-width: 130px;
    flex: 1 1 140px;
}

.report-filter label > span {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.report-filter input,
.report-filter select {
    width: 100%;
    min-height: 38px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12.5px;
}

.report-filter .btn,
.report-filter button {
    min-height: 38px;
    padding: 0 20px;
    margin-bottom: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-row {
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 9px;
}

.patient-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #f0f9ff;
    color: #0369a1;
}

.patient-summary b {
    font-size: 13.5px;
}

.patient-summary small {
    color: #0284c7;
    font-weight: 600;
}

/* ==========================================================================
   Record Lists & Data Tables
   ========================================================================== */

.record-list, .schedule-list {
    max-height: 640px;
    overflow-y: auto;
}

.record-card, .schedule-card, .bill-card {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
    color: inherit;
    transition: background 0.12s ease;
}

button.record-card {
    cursor: pointer;
}

button.record-card:hover {
    background: #f8fafc;
}

.record-card:last-child, .schedule-card:last-child, .bill-card:last-child {
    border-bottom: 0;
}

.avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #0284c7;
    background: #e0f2fe;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 850;
}

.record-main {
    min-width: 0;
    flex: 1;
}

.record-main strong, .record-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-main strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 3px;
}

.record-main small {
    color: var(--muted);
    font-size: 11px;
}

.record-card time {
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 600;
}

.serial, .ticket-no {
    color: #0369a1;
    background: #e0f2fe;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.2px;
}

.amount {
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
    color: #059669;
}

.record-actions {
    display: flex;
    gap: 6px;
    margin-left: 6px;
}

.icon-btn {
    min-width: 30px;
    height: 30px;
    border: 1px solid #dce3ec;
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.icon-btn:hover {
    border-color: #38bdf8;
    color: #0284c7;
    background: #f0f9ff;
}

.icon-btn.danger:hover {
    border-color: #fca5a5;
    color: #dc2626;
    background: #fef2f2;
}

.empty-state {
    padding: 48px 24px;
    color: #94a3b8;
    text-align: center;
    font-size: 12.5px;
    font-weight: 500;
}

.empty-state.small {
    padding: 24px;
}

.data-table-wrap {
    overflow: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 12px;
}

.data-table th {
    color: #475569;
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.data-table td.num, .data-table th.num {
    text-align: right;
}

/* ==========================================================================
   Billing & Line Editors (Emergency / Diagnostic / OT / Pharmacy)
   ========================================================================= */

.billing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    gap: 20px;
    align-items: start;
}

.line-editor {
    display: grid;
    grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1.4fr) 110px 80px auto;
    gap: 10px;
    align-items: end;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 14px;
}

.line-editor.ot-lines {
    grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.8fr) 110px 80px auto;
}

.line-table {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.line-head, .line-row {
    display: grid;
    grid-template-columns: 40px minmax(160px, 1fr) 95px 60px 105px 36px;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
}

.line-head.ot, .line-row.ot {
    grid-template-columns: 40px minmax(130px, 1fr) minmax(110px, 0.8fr) 105px 95px 36px;
}

.line-head {
    background: #f1f5f9;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
    font-size: 10px;
}

.line-row {
    border-top: 1px solid #f1f5f9;
    color: #334155;
    font-size: 12px;
}

.line-row strong {
    text-align: right;
    color: #0f172a;
    font-weight: 750;
}

.line-row button {
    border: 0;
    background: transparent;
    color: #dc2626;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
}

.line-row button:hover {
    background: #fee2e2;
}

.billing-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    margin-top: 18px;
    align-items: start;
}

.totals {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.totals > div, .totals > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 14px;
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.totals > label > span, .totals > div > span {
    margin: 0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 700;
}

.totals input {
    width: 115px;
    min-height: 34px;
    text-align: right;
    font-weight: 750;
}

.totals .grand-total {
    border-bottom: 0;
    background: #ecfeff;
    color: #0f766e;
}

.totals .grand-total strong {
    font-size: 16px;
    font-weight: 800;
}

/* ==========================================================================
   Bed Occupancy Board Styling
   ========================================================================== */

.occupancy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    margin-top: 16px;
}

.bed-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: all 0.18s ease;
    position: relative;
}

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

.bed-card.occupied {
    border-top: 4.5px solid #ef4444;
}

.bed-card.available {
    border-top: 4.5px solid #10b981;
}

.bed-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.bed-number {
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    display: block;
    letter-spacing: -0.3px;
}

.bed-category {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
    display: block;
    font-weight: 600;
}

.bed-card-body {
    padding: 16px;
    flex: 1;
}

.occupant-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.occupant-name b {
    font-size: 14px;
    color: var(--ink);
    display: block;
}

.occupant-name small {
    font-size: 11px;
    color: #64748b;
}

.occupant-meta {
    display: grid;
    gap: 6px;
    font-size: 11.5px;
    color: #334155;
    background: #f8fafc;
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
}

.occupant-meta span {
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 750;
    margin-right: 4px;
}

.occupant-meta b {
    color: #0f172a;
}

.bed-vacant-info {
    padding: 12px 0;
    text-align: center;
}

.rate-tag {
    font-size: 22px;
    font-weight: 800;
    color: #0f766e;
    letter-spacing: -0.5px;
}

.rate-tag small {
    font-size: 12px;
    color: #64748b;
    font-weight: normal;
}

.vacant-note {
    font-size: 11.5px;
    color: #94a3b8;
    margin: 6px 0 0;
}

.bed-card-footer {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fafcff;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Modals & Dialogs */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-dialog {
    width: min(540px, 100%);
    animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 38;
}

/* Login Page Styling */
.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: 
        radial-gradient(circle at 18% 15%, rgba(224, 242, 254, 0.85) 0%, transparent 40%),
        linear-gradient(rgba(248, 250, 252, 0.82), rgba(248, 250, 252, 0.88)),
        url('/images/saas-medical-bg.jpg') no-repeat center center / cover;
}

.login-shell-body {
    flex: 1 0 auto;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-card {
    width: min(430px, 100%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.login-brand strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    display: block;
}

.login-brand small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
    display: block;
}

.login-heading {
    margin: 26px 0 20px;
}

.login-heading h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.6px;
    margin-bottom: 6px;
}

.login-heading p {
    color: var(--muted);
    font-size: 12.5px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-button {
    width: 100%;
    margin-top: 6px;
    min-height: 42px;
    font-size: 13.5px;
}

.login-note {
    display: block;
    color: #94a3b8;
    text-align: center;
    font-size: 11px;
    margin-top: 20px;
}

/* ==========================================================================
   Print Document Stylesheets
   ========================================================================== */

.print-document { display: none; }

.print-sheet.panel {
    margin-top: 20px;
    padding: 28px;
    min-height: 260mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.print-document, .print-sheet, .clinical-report-sheet, .a4-page-sheet {
    display: flex;
    flex-direction: column;
    min-height: 260mm;
    justify-content: space-between;
    box-sizing: border-box;
}

/* ==========================================================================
   Standardized Universal Hospital Print Document Header & Footer
   ========================================================================== */

.print-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2.5px solid #0284c7;
    padding-bottom: 12px;
    margin-bottom: 14px;
    gap: 16px;
}

.print-brand-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.print-brand-logo-wrap {
    flex-shrink: 0;
}

.print-brand-img {
    max-height: 65px;
    max-width: 75px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.print-brand-badge-fallback {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    font-size: 32px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.print-brand-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.print-hospital-name {
    font-size: 20px;
    font-weight: 800;
    color: #0369a1;
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.2;
}

.print-hospital-tagline {
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.print-hospital-contact {
    font-size: 10.5px;
    color: #475569;
    margin-top: 3px;
    line-height: 1.45;
}

.print-contact-address {
    font-size: 10.5px;
    color: #475569;
}

.print-contact-other {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.print-brand-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.print-doc-pill {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.print-doc-pill-label {
    color: #64748b;
    font-weight: 600;
}

.print-doc-pill-value {
    color: #0f172a;
    font-weight: 800;
}

.print-document-title-bar {
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    margin: 12px 0 16px 0;
}

.print-document-title-bar h2 {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0f172a;
    margin: 0;
}

/* Print Document Footer */
.print-document-footer {
    margin-top: auto;
    padding-top: 24px;
    page-break-inside: avoid !important;
}

.print-signatures-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 20px;
}

.print-signature-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

.print-signature-line {
    width: 100%;
    border-top: 1px solid #64748b;
    margin-bottom: 6px;
}

.print-signature-title {
    font-size: 11px;
    font-weight: 650;
    color: #334155;
    text-align: center;
}

.print-legal-notice-strip {
    border-top: 1px solid #cbd5e1;
    padding-top: 8px;
    margin-top: 12px;
}

.print-disclaimer-text {
    font-size: 10.5px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 4px 0;
    text-align: center;
    font-style: italic;
}

.print-meta-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
}

.print-generated-time {
    color: #64748b;
}

.print-page-number {
    font-weight: 700;
    color: #475569;
}

/* Legacy Support */
.print-brand {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 2.5px solid #0369a1;
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.print-brand h1 {
    color: #0369a1;
    font-size: 22px;
    font-weight: 800;
    margin: 0;
}

.print-brand p {
    color: #64748b;
    font-size: 12px;
    margin: 2px 0 0;
}

.print-title {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 16px 0;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
}

.print-grid div {
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
    font-size: 12px;
}

.print-grid span {
    color: #64748b;
    display: inline-block;
    min-width: 120px;
    font-weight: 600;
}

.print-total {
    width: 300px;
    margin: 22px 0 0 auto;
}

.print-total > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ecfeff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 750;
    color: #0f766e;
}

.print-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    color: #64748b;
    font-size: 11px;
}

.print-sign {
    border-top: 1px solid #94a3b8;
    min-width: 170px;
    padding-top: 6px;
    text-align: center;
    font-weight: 600;
}

@media print {
    html, body {
        background: white !important;
        height: 100% !important;
        min-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .app-shell { display: block !important; }
    .sidebar, .topbar, .page-heading, .form-panel, .list-panel, .metric-grid, .section-heading, .module-grid, .master-grid, .recent-bills, .fast-actions-bar, .workflow-tabs, .no-print, .btn, button { display: none !important; } body:has(.print-dev-brand-footer) .app-global-footer { display: none !important; } .app-global-footer { background: #ffffff !important; border-top: 1px solid #cbd5e1 !important; padding: 6px 12px !important; } .print-dev-brand-footer { display: flex !important; }
    .print-document { display: flex !important; }
    
    .print-document, .print-sheet, .clinical-report-sheet, .a4-page-sheet {
        display: flex !important;
        flex-direction: column !important;
        min-height: 260mm !important;
        justify-content: space-between !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    
    .print-document-footer {
        margin-top: auto !important;
        page-break-inside: avoid !important;
        padding-top: 24px !important;
    }
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Drawer
   ========================================================================== */

@media (max-width: 1200px) {
    .billing-layout { grid-template-columns: 1fr; }
    .workspace-grid { grid-template-columns: 1fr; }
    .module-layout { grid-template-columns: 1fr; }
    .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .app-shell { display: block; }
    .mobile-nav-toggle { display: inline-flex; }
    .mobile-close-btn { display: block; }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 290px;
        max-width: 85vw;
        height: 100vh;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 10px 40px -5px rgba(15, 23, 42, 0.18);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .topbar { position: sticky; height: 60px; padding: 0 18px; }
    .page-content { padding: 22px 18px 48px; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .master-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .topbar-actions .live-clock-chip { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .metric-grid { grid-template-columns: 1fr; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .line-editor, .line-editor.ot-lines { grid-template-columns: 1fr; }
    .billing-footer { grid-template-columns: 1fr; }
    .print-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Language Switcher Component
   ========================================================================== */
.lang-switcher-container {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    padding: 2px 4px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
}

.lang-switcher-container:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: none;
    background: transparent;
    border-radius: 99px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1.2;
}

.lang-btn .lang-flag {
    font-size: 13px;
    line-height: 1;
}

.lang-btn .lang-text {
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', sans-serif;
}

.lang-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.lang-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.35);
    font-weight: 700;
}

.lang-divider {
    width: 1px;
    height: 14px;
    background: #e2e8f0;
    margin: 0 1px;
}

/* ==========================================================================
   Barcode & QR Code Components & Scanner Styling
   ========================================================================== */
.barcode-qr-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
    max-width: 100%;
}

.barcode-qr-container.side-by-side {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.barcode-qr-container.stacked {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.barcode-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    min-width: 110px;
}

.barcode-wrapper svg,
svg.barcode-svg {
    width: 135px;
    min-width: 100px;
    max-width: 100%;
    height: 44px;
    display: block;
}

.barcode-wrapper svg rect,
svg.barcode-svg rect {
    shape-rendering: crispEdges;
}

.qr-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 2px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.qr-wrapper svg {
    width: 54px;
    height: 54px;
    display: block;
}

.barcode-qr-container.compact .qr-wrapper svg {
    width: 38px;
    height: 38px;
}

.barcode-qr-container.compact .barcode-wrapper svg {
    width: 100px;
    height: 30px;
}

/* Scanner Quick Scan Search Input */
.scanner-search-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.scanner-search-group .scanner-icon {
    position: absolute;
    left: 12px;
    color: #0284c7;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.scanner-search-group input {
    padding-left: 36px !important;
    border-color: #7dd3fc !important;
    background: #f0f9ff !important;
    font-weight: 600;
}

.scanner-search-group input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2) !important;
}

/* Print Specific Rules for Thermal Slips & Specimen Tube Labels */
@media print {
    .sidebar, .topbar, .page-heading button, .form-panel, .record-actions, .nav-menu-wrapper, .btn {
        display: none !important;
    }

    body, html, .app-shell, .page-content {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .barcode-wrapper svg, .qr-wrapper svg {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Specimen Tube Sticker Label (2x1 inch compact) */
    .specimen-tube-label {
        width: 2in;
        height: 1in;
        padding: 2mm;
        border: 1px dashed #94a3b8;
        page-break-after: always;
        font-size: 8px;
        line-height: 1.1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* Patient Inpatient Wristband */
    .patient-wristband {
        width: 10in;
        height: 1in;
        padding: 3mm;
        border: 1px dashed #cbd5e1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        page-break-after: always;
    }
}

/* ==========================================================================
   Public Patient Diagnostic Portal & Online Verification Styling
   ========================================================================== */

.portal-wrapper {
    min-height: 100vh;
    background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 30%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, sans-serif;
    color: #1e293b;
}

.portal-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-brand-logo {
    font-size: 28px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-hospital-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f766e;
    margin: 0;
    line-height: 1.2;
}

.portal-hospital-sub {
    font-size: 12px;
    color: #64748b;
    margin: 2px 0 0;
}

.portal-lang-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.portal-lang-btn:hover {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}

.portal-main {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 24px auto;
    padding: 0 16px;
}

.portal-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    padding: 24px;
}

/* Loading State */
.portal-loading {
    text-align: center;
    padding: 60px 20px;
}

.portal-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0d9488;
    border-radius: 50%;
    animation: portal-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes portal-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Box */
.portal-search-box {
    text-align: center;
    padding: 40px 20px;
    max-width: 580px;
    margin: 0 auto;
}

.portal-search-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.portal-search-form {
    display: flex;
    gap: 10px;
    margin: 24px 0 16px;
}

.portal-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.portal-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.portal-btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.portal-btn-primary {
    background: #0d9488;
    color: #ffffff;
}

.portal-btn-primary:hover {
    background: #0f766e;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.portal-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.portal-btn-secondary:hover {
    background: #e2e8f0;
}

.portal-help-note {
    font-size: 12.5px;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 20px;
}

.portal-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13.5px;
}

.portal-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Multi-Report Patient Portfolio List */
.portal-reports-list-container {
    padding: 10px 0;
}

.patient-list-header-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.patient-banner-avatar {
    width: 44px;
    height: 44px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.patient-banner-info {
    flex: 1;
    min-width: 200px;
}

.patient-banner-info h3 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 800;
    color: #065f46;
}

.patient-banner-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.patient-meta-pill {
    background: #ffffff;
    border: 1px solid #86efac;
    color: #047857;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.portal-reports-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.portal-report-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.portal-report-card:hover {
    border-color: #0d9488;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.1);
    transform: translateY(-1px);
}

.portal-report-card.latest-card {
    border: 2px solid #0d9488;
    background: #f0fdfa;
}

.report-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.report-card-inv {
    font-size: 16px;
    font-weight: 800;
    color: #0f766e;
}

.report-badge-latest {
    background: #fef08a;
    color: #854d0e;
    font-size: 10px;
    font-weight: 850;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #fde047;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-card-date {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.report-card-body {
    margin-bottom: 14px;
}

.report-tests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.test-pill {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.report-doctor-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #475569;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
}

/* Status Badges */
.portal-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.portal-badge-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.portal-badge-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.status-pulse-dot {
    width: 10px;
    height: 10px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: portal-pulse 1.6s infinite;
}

@keyframes portal-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Pending View Styles */
.portal-pending-view {
    text-align: center;
    padding: 20px 10px;
}

.portal-pending-hero {
    margin: 20px 0 28px;
}

.portal-pending-icon-wrap {
    width: 80px;
    height: 80px;
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.portal-pending-icon {
    font-size: 38px;
}

.portal-pending-title {
    font-size: 24px;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 8px;
}

.portal-pending-subtitle {
    font-size: 14.5px;
    color: #4b5563;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Countdown Card */
.portal-countdown-card {
    background: #ecfeff;
    border: 2px solid #a5f3fc;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 640px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.countdown-icon {
    font-size: 32px;
}

.countdown-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 750;
    color: #0e7490;
}

.countdown-time {
    display: block;
    font-size: 18px;
    color: #155e75;
    margin: 2px 0 4px;
}

.countdown-note {
    display: block;
    font-size: 12px;
    color: #64748b;
}

/* Timeline */
.portal-timeline-section {
    max-width: 640px;
    margin: 0 auto 28px;
    text-align: left;
}

.timeline-title {
    font-size: 14px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-timeline {
    position: relative;
    padding-left: 28px;
}

.portal-timeline::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 11px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-step {
    position: relative;
    margin-bottom: 20px;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.step-marker {
    position: absolute;
    left: -28px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-completed .step-marker {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.step-active .step-marker {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #ffffff;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: portal-pulse 1s infinite;
}

.step-details strong {
    display: block;
    font-size: 13.5px;
    color: #1e293b;
}

.step-details span {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 1px;
}

.portal-actions-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.portal-support-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 18px;
    max-width: 640px;
    margin: 0 auto;
    font-size: 13px;
    color: #475569;
}

/* Clinical Report Sheet View */
.report-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.report-top-actions {
    display: flex;
    gap: 8px;
}

.clinical-report-sheet,
.a4-page-sheet {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 28px 32px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    max-width: 820px;
    margin: 0 auto;
    color: #0f172a;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.report-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 2px solid #0f766e;
    padding-bottom: 16px;
    margin-bottom: 12px;
}

.report-sheet-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
}

.report-brand-badge {
    font-size: 32px;
    line-height: 1;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.report-hospital-name {
    font-size: 21px;
    font-weight: 850;
    color: #0f766e;
    margin: 0 0 3px 0;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.report-dept-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 5px 0;
}

.report-contact-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Header Dual Barcode & QR Code Box */
.report-sheet-code-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 230px;
    text-align: center;
}

.code-box-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px dashed #cbd5e1;
}

.code-title {
    font-size: 9.5px;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.5px;
}

.code-memo-id {
    font-size: 11px;
    font-weight: 850;
    color: #0f766e;
}

.code-box-footer {
    margin-top: 4px;
    font-size: 9px;
    color: #64748b;
    font-weight: 600;
}

.report-title-strip {
    background: linear-gradient(90deg, #0f766e 0%, #0d9488 100%);
    color: #ffffff;
    text-align: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

/* Demographics Grid */
.report-patient-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 14px;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.patient-grid-item.span-2 {
    grid-column: span 2;
}

.grid-label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    font-weight: 750;
    color: #64748b;
    letter-spacing: 0.2px;
}

.grid-value {
    display: block;
    font-size: 13px;
    color: #0f172a;
    font-weight: 750;
    margin-top: 1px;
}

/* Investigation Results */
.report-investigation-block {
    margin-bottom: 18px;
}

.investigation-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: 6px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 6px;
}

.investigation-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #065f46;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.investigation-badge {
    font-size: 9.5px;
    font-weight: 800;
    background: #10b981;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.4px;
}

.report-parameter-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.report-parameter-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    text-align: left;
}

.report-parameter-table td {
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    font-size: 12.5px;
}

.report-parameter-table td.param-name {
    font-weight: 700;
    color: #0f172a;
}

.value-highlight {
    font-weight: 800;
    font-size: 13px;
}

.value-highlight.flag-high, .flag-high {
    color: #b91c1c;
    background: #fef2f2;
    font-weight: 850;
}

.value-highlight.flag-low, .flag-low {
    color: #b45309;
    background: #fffbeb;
    font-weight: 850;
}

.value-highlight.flag-critical, .flag-critical {
    color: #ffffff;
    background: #ef4444;
    font-weight: 850;
}

.flag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.flag-normal {
    background: #ecfdf5;
    color: #047857;
}

.interpretation-row td {
    background: #f8fafc;
    color: #475569;
    padding: 6px 10px 8px;
    border: 1px solid #e2e8f0;
    font-size: 11px;
}

/* Signatures & Seal Grid */
.report-signatures-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 36px;
    padding-top: 14px;
    gap: 16px;
}

.signature-box {
    text-align: center;
    flex: 1;
}

.signature-line {
    border-top: 1.5px dashed #64748b;
    margin-bottom: 6px;
}

.signature-box strong {
    display: block;
    font-size: 12px;
    color: #0f172a;
    font-weight: 750;
}

.signature-box span {
    display: block;
    font-size: 10.5px;
    color: #64748b;
}

.verified-digital-seal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.digital-seal-badge {
    background: #ecfdf5;
    border: 1.5px solid #86efac;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.digital-seal-badge small {
    display: block;
    font-size: 8.5px;
    color: #166534;
    font-weight: 600;
}

.qr-verify-container {
    padding: 2px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.seal-verify-text {
    font-size: 9px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

/* Footer Legal & Security Bar */
.report-sheet-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 10.5px;
    color: #64748b;
}

.footer-security-bar {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
    font-size: 10px;
}

/* Unified 1-Page Patient Master Dossier Styles */
.patient-master-dossier {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dossier-card-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.dossier-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dossier-header-icon {
    font-size: 18px;
    line-height: 1;
}

/* A4 Print Layout Rules (Strict Single Page Fit) */
@page {
    size: A4 portrait;
    margin: 6mm 8mm 6mm 8mm;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-size: 11px !important;
        color: #0f172a !important;
    }

    .app-shell, .page-content, .portal-wrapper, .portal-main, .portal-card, .print-sheet, .doc-preview-modal-body, .patient-master-dossier {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .no-print, .portal-header, .portal-footer, .portal-actions-row, .report-top-actions, .report-header-banner,
    .portal-auth-banner, .sidebar, .topbar, .page-heading, .btn, .modal-backdrop, .sidebar-backdrop,
    .scanner-search-group, .portal-support-card, .patient-docs-nav-tabs, .fast-actions-bar,
    .doc-preview-modal-header, .doc-preview-modal-footer, .icon-btn {
        display: none !important;
    }

    .print-document {
        display: block !important;
    }

    .clinical-report-sheet, .a4-page-sheet {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 4px 6px !important;
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
    }

    .report-sheet-header, .report-title-strip, .report-patient-grid, .report-investigation-block, .report-signatures-grid, .report-sheet-footer {
        page-break-inside: avoid !important;
    }

    .report-parameter-table {
        page-break-inside: auto;
    }

    .report-parameter-table tr {
        page-break-inside: avoid !important;
    }
}

/* Due Lock & Access Control Styles for Public Portal */
.portal-due-view {
    text-align: center;
    padding: 20px 10px;
}

.portal-badge-due {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.portal-badge-auth {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
    font-size: 11.5px;
    font-weight: 800;
}

.portal-due-hero {
    margin: 20px 0 24px;
}

.portal-due-icon-wrap {
    width: 86px;
    height: 86px;
    background: #fff1f2;
    border: 2px solid #fecdd3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 18px rgba(225, 29, 72, 0.12);
}

.portal-due-icon {
    font-size: 42px;
}

.portal-due-title {
    font-size: 24px;
    font-weight: 800;
    color: #9f1239;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.portal-due-subtitle {
    font-size: 14.5px;
    color: #475569;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

.portal-due-card {
    background: #ffffff;
    border: 2px solid #fee2e2;
    border-radius: 14px;
    max-width: 640px;
    margin: 0 auto 24px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.06);
    text-align: left;
}

.portal-due-card-header {
    background: #fef2f2;
    padding: 12px 20px;
    border-bottom: 1px solid #fee2e2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 750;
    color: #991b1b;
}

.portal-due-card-body {
    padding: 18px 20px;
}

.portal-due-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 18px;
    margin-bottom: 16px;
}

.portal-due-item {
    font-size: 12.5px;
}

.portal-due-item span {
    display: block;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
}

.portal-due-item strong {
    display: block;
    color: #0f172a;
    font-size: 14.5px;
    margin-top: 2px;
}

.portal-due-amount-box {
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-due-amount-box .due-label {
    font-size: 13px;
    font-weight: 800;
    color: #9f1239;
    text-transform: uppercase;
}

.portal-due-amount-box .due-value {
    font-size: 24px;
    font-weight: 900;
    color: #e11d48;
}

/* Instructions Step Card */
.portal-due-steps {
    max-width: 640px;
    margin: 0 auto 24px;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
}

.portal-due-steps-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.portal-step-num {
    width: 24px;
    height: 24px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 50%;
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.portal-auth-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.report-sheet-footer {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

/* ==========================================================================
   Patient 360° Documents, Reports & Receipts Hub Styling
   ========================================================================== */

.patient-hub-profile-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
}

.patient-hub-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.patient-hub-main-info {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.patient-hub-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    flex-shrink: 0;
}

.patient-hub-avatar.female {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

.patient-hub-details h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    letter-spacing: -0.4px;
}

.patient-hub-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
}

.hub-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.hub-chip.primary {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.hub-chip.blood {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.patient-hub-meta-text {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.patient-hub-meta-text span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.patient-hub-fin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.hub-fin-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: transform 0.15s ease;
}

.hub-fin-card:hover {
    transform: translateY(-2px);
}

.hub-fin-card span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 750;
    color: #64748b;
    margin-bottom: 4px;
}

.hub-fin-card strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}

.hub-fin-card.accent-green {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.hub-fin-card.accent-green strong { color: #15803d; }

.hub-fin-card.accent-red {
    background: #fef2f2;
    border-color: #fecaca;
}
.hub-fin-card.accent-red strong { color: #dc2626; }

.hub-fin-card.accent-blue {
    background: #f0f9ff;
    border-color: #bae6fd;
}
.hub-fin-card.accent-blue strong { color: #0369a1; }

/* Tabs & Categories Bar */
.patient-docs-nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow: visible;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}

.patient-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px 10px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
    bottom: -2px;
}

.patient-tab-btn:hover {
    color: #0284c7;
    background: #f8fafc;
}

.patient-tab-btn.active {
    color: #0284c7;
    background: #ffffff;
    border-color: #cbd5e1 #cbd5e1 #ffffff;
    border-top: 3px solid #0284c7;
}

.patient-tab-count {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
}

.patient-tab-btn.active .patient-tab-count {
    background: #e0f2fe;
    color: #0369a1;
}

/* Document Cards & Items */
.patient-docs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.patient-doc-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.15s ease;
}

.patient-doc-item:hover {
    border-color: #7dd3fc;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
    transform: translateX(3px);
}

.doc-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.doc-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.doc-type-icon.diag { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.doc-type-icon.ticket { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.doc-type-icon.ipd { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.doc-type-icon.pharmacy { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.doc-type-icon.emergency { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.doc-type-icon.ot { background: #fefce8; color: #ca8a04; border: 1px solid #fef08a; }

.doc-item-content {
    min-width: 0;
    flex: 1;
}

.doc-item-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.doc-item-title strong {
    font-size: 14.5px;
    color: #0f172a;
    font-weight: 800;
}

.doc-item-sub {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.doc-badge-pill {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.doc-badge-pill.verified { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.doc-badge-pill.pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.doc-badge-pill.paid { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.doc-badge-pill.due { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.doc-badge-pill.auth { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }

.doc-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.doc-item-financials {
    text-align: right;
    font-size: 12.5px;
}

.doc-item-financials strong {
    display: block;
    font-size: 14.5px;
    color: #0f172a;
}

.doc-item-financials small {
    display: block;
    font-size: 11px;
}

.doc-action-btns {
    display: flex;
    gap: 6px;
}

/* Document Viewer Modal */
.doc-preview-modal {
    max-width: 820px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
}

.doc-preview-modal-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-preview-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.doc-preview-modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 840px) {
    .patient-hub-fin-grid { grid-template-columns: repeat(2, 1fr); }
    .patient-doc-item { flex-direction: column; align-items: flex-start; }
    .doc-item-right { width: 100%; justify-content: space-between; border-top: 1px dashed #e2e8f0; padding-top: 10px; }
}

/* ==========================================================================
   Hospital Setup & Branding Settings Styling
   ========================================================================== */
.brand-logo-img {
    max-height: 32px;
    max-width: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    padding: 2px;
}

.hospital-settings-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: start;
}

.settings-form-column {
    display: flex;
    flex-direction: column;
}

.settings-preview-column {
    position: relative;
}

.preview-sticky-panel {
    position: sticky;
    top: 20px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.preview-card-box {
    margin-top: 12px;
}

.preview-card-label {
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Logo Upload Container */
.logo-upload-container {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    padding: 16px;
}

.logo-preview-box {
    width: 110px;
    height: 100px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.settings-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo-upload-controls {
    flex: 1;
}

.file-upload-btn {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.danger-text {
    color: #ef4444 !important;
}

.danger-text:hover {
    background: #fee2e2 !important;
}

@media (max-width: 1100px) {
    .hospital-settings-layout {
        grid-template-columns: 1fr;
    }

    .preview-sticky-panel {
        position: static;
        margin-top: 20px;
    }
}

/* ========================================================================== 
   Desktop-compatible PrimeHPM menu bar
   ========================================================================== */
.app-shell {
    display: block;
    position: relative;
    min-height: 100vh;
}

.app-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(224, 242, 254, 0.45) 0%, transparent 45%),
        linear-gradient(rgba(248, 250, 252, 0.90), rgba(241, 245, 249, 0.93)),
        url('/images/saas-medical-bg.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.sidebar {
    display: none;
}

.main-content {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 220px;
    max-width: none;
}

.topbar-brand > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-brand strong {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.2px;
    white-space: nowrap;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.topbar-brand small {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.topbar-brand .brand-logo-img,
.topbar-brand .brand-mark {
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    max-height: 56px;
    padding: 0;
}

.radiology-icon {
    display: block;
    width: 17px;
    height: 17px;
    color: currentColor;
    flex: 0 0 auto;
}

.desktop-menu-host {
    position: sticky;
    top: 66px;
    z-index: 35;
    background: #ffffff;
    border-bottom: 2px solid #00a6c7;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.mobile-menu-heading {
    display: none;
}

.legacy-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: transparent;
}

.legacy-menu-bar {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 20px;
    gap: 3px;
    color: #334155;
    font-family: inherit;
    font-size: 12px;
    white-space: nowrap;
    overflow: visible;
    scrollbar-width: none;
}

.legacy-menu-bar::-webkit-scrollbar {
    display: none;
}

.legacy-menu-root {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.legacy-menu-root.open {
    z-index: 201;
}

.legacy-menu-root-button {
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    padding: 6.5px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.16s ease;
    user-select: none;
}

.legacy-menu-root-label {
    letter-spacing: -0.1px;
}

.menu-root-caret {
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.16s ease;
    flex-shrink: 0;
}

/* Hover state - Selectable feel */
.legacy-menu-root-button:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.legacy-menu-root-button:hover .menu-root-caret {
    color: #475569;
}

/* Active module highlight (Current page belongs to this group) */
.legacy-menu-root.active > .legacy-menu-root-button,
.legacy-menu-root-button.is-active {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #7dd3fc;
    font-weight: 700;
}

.legacy-menu-root.active > .legacy-menu-root-button .menu-root-caret,
.legacy-menu-root-button.is-active .menu-root-caret {
    color: #0284c7;
}

/* Open / Focused dropdown highlight */
.legacy-menu-root.open > .legacy-menu-root-button,
.legacy-menu-root-button.is-open {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.32);
    font-weight: 700;
}

.legacy-menu-root.open > .legacy-menu-root-button .menu-root-caret,
.legacy-menu-root-button.is-open .menu-root-caret {
    transform: rotate(180deg);
    color: #ffffff;
}

/* Dropdown Container */
.legacy-menu-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 200;
    min-width: 230px;
    max-height: 75vh;
    overflow-y: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15), 0 4px 10px rgba(15, 23, 42, 0.05);
    animation: fadeIn 0.15s ease;
}

/* Right-align dropdowns for items near screen edge */
.legacy-menu-root:nth-last-child(-n+3) .legacy-menu-dropdown {
    left: auto;
    right: 0;
}

/* Dropdown Entries */
.legacy-menu-entry {
    width: 100%;
    min-height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    padding: 6.5px 12px;
    text-align: left;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
    box-sizing: border-box;
}

.legacy-menu-entry:hover {
    background: #f0f9ff;
    color: #0284c7;
    font-weight: 600;
    padding-left: 15px;
}

.legacy-menu-entry.active {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
}

.legacy-menu-form {
    margin: 0;
}

.legacy-menu-separator {
    height: 1px;
    margin: 5px 8px;
    background: #e2e8f0;
}

.legacy-menu-nested {
    position: relative;
}

.legacy-menu-parent {
    font-weight: 600;
}

.legacy-menu-subarrow {
    color: #94a3b8;
    transition: transform 0.15s ease;
}

.legacy-menu-nested.open .legacy-menu-subarrow {
    transform: rotate(90deg);
    color: #0284c7;
}

.legacy-menu-submenu {
    position: absolute;
    top: 0;
    left: calc(100% + 4px);
    margin: 0;
    z-index: 210;
    min-width: 230px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    animation: fadeIn 0.15s ease;
}

.legacy-menu-root:nth-last-child(-n+3) .legacy-menu-submenu {
    left: auto;
    right: calc(100% + 4px);
}

.legacy-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    max-height: none;
    overflow: visible;
}

.legacy-menu-entry {
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111827;
    padding: 5px 10px 5px 24px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.legacy-menu-entry:hover,
.legacy-menu-entry.active {
    background: #dbeafe;
    color: #075985;
}

.legacy-menu-form {
    margin: 0;
}

.legacy-menu-separator {
    height: 1px;
    margin: 3px 5px 3px 22px;
    background: #d1d5db;
}

.legacy-menu-nested {
    position: relative;
}

.legacy-menu-arrow {
    margin-left: 18px;
    color: #64748b;
    font-size: 9px;
}

.legacy-menu-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    margin: 0;
    z-index: 210;
}

.legacy-module-panel {
    max-width: 680px;
    padding: 36px;
    text-align: center;
}

.legacy-module-icon {
    margin-bottom: 12px;
    font-size: 36px;
}

.legacy-module-panel h2,
.legacy-module-panel p {
    margin-bottom: 14px;
}

@media (max-width: 1100px) and (min-width: 961px) {
    .legacy-menu-root-button {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 11px;
    }

    .topbar-brand {
        min-width: 170px;
    }

    .topbar-brand small,
    .breadcrumb-module small {
        display: none;
    }
}

@media (max-width: 960px) {
    .desktop-menu-host {
    position: sticky;
    top: 66px;
    z-index: 35;
    background: #ffffff;
    border-bottom: 2px solid #00a6c7;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.mobile-menu-heading {
    display: none;
}

.legacy-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: transparent;
}

.legacy-menu-bar {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 20px;
    gap: 3px;
    color: #334155;
    font-family: inherit;
    font-size: 12px;
    white-space: nowrap;
    overflow: visible;
    scrollbar-width: none;
}

.legacy-menu-bar::-webkit-scrollbar {
    display: none;
}

.legacy-menu-root {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.legacy-menu-root-button {
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    padding: 6.5px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.16s ease;
    user-select: none;
}

.legacy-menu-root-label {
    letter-spacing: -0.1px;
}

.menu-root-caret {
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.16s ease;
    flex-shrink: 0;
}

/* Hover state - Selectable feel */
.legacy-menu-root-button:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.legacy-menu-root-button:hover .menu-root-caret {
    color: #475569;
}

/* Active module highlight (Current page belongs to this group) */
.legacy-menu-root.active > .legacy-menu-root-button,
.legacy-menu-root-button.is-active {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #7dd3fc;
    font-weight: 700;
}

.legacy-menu-root.active > .legacy-menu-root-button .menu-root-caret,
.legacy-menu-root-button.is-active .menu-root-caret {
    color: #0284c7;
}

/* Open / Focused dropdown highlight */
.legacy-menu-root.open > .legacy-menu-root-button,
.legacy-menu-root-button.is-open {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.32);
    font-weight: 700;
}

.legacy-menu-root.open > .legacy-menu-root-button .menu-root-caret,
.legacy-menu-root-button.is-open .menu-root-caret {
    transform: rotate(180deg);
    color: #ffffff;
}

/* Dropdown Container */
.legacy-menu-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 200;
    min-width: 230px;
    max-height: 75vh;
    overflow-y: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15), 0 4px 10px rgba(15, 23, 42, 0.05);
    animation: fadeIn 0.15s ease;
}

/* Right-align dropdowns for items near screen edge */
.legacy-menu-root:nth-last-child(-n+3) .legacy-menu-dropdown {
    left: auto;
    right: 0;
}

/* Dropdown Entries */
.legacy-menu-entry {
    width: 100%;
    min-height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    padding: 6.5px 12px;
    text-align: left;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
    box-sizing: border-box;
}

.legacy-menu-entry:hover {
    background: #f0f9ff;
    color: #0284c7;
    font-weight: 600;
    padding-left: 15px;
}

.legacy-menu-entry.active {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
}

.legacy-menu-form {
    margin: 0;
}

.legacy-menu-separator {
    height: 1px;
    margin: 4px 6px;
    background: #f1f5f9;
}

.legacy-menu-nested {
    position: relative;
}

.legacy-menu-parent {
    font-weight: 600;
}

.legacy-menu-subarrow {
    color: #94a3b8;
    transition: transform 0.15s ease;
}

.legacy-menu-nested.open .legacy-menu-subarrow {
    transform: rotate(90deg);
    color: #0284c7;
}

.legacy-menu-submenu {
    position: absolute;
    top: 0;
    left: calc(100% + 4px);
    margin: 0;
    z-index: 210;
    min-width: 230px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    animation: fadeIn 0.15s ease;
}

.legacy-menu-root:nth-last-child(-n+3) .legacy-menu-submenu {
    left: auto;
    right: calc(100% + 4px);
}

    .legacy-menu-dropdown {
        margin: 0 0 5px 8px;
        width: calc(100% - 8px);
    }

    .legacy-menu-submenu {
        margin-left: 14px;
        width: calc(100% - 14px);
    }

    .topbar-brand {
        min-width: 0;
    }

    .topbar-brand small,
    .breadcrumb-module {
        display: none;
    }
}

@media print {
    .desktop-menu-host {
        display: none !important;
    }
}

/* ==========================================================================
   Topbar User Profile Menu & App Actions (Change Password, Logout, Exit)
   ========================================================================== */
.user-profile-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

button.user-profile-pill {
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    border: 1px solid var(--line, #e2e8f0);
    transition: all 0.15s ease;
}

button.user-profile-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.user-dropdown-caret {
    color: #64748b;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.user-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16), 0 4px 10px rgba(0, 0, 0, 0.06);
    padding: 6px;
    z-index: 1050;
    animation: fadeIn 0.15s ease;
}

.user-dropdown-header {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
}

.user-dropdown-header strong {
    font-size: 13px;
    color: #0f172a;
}

.user-dropdown-header small {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7.5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
}

.user-dropdown-item:hover {
    background: #f1f5f9;
    color: #0284c7;
}

.user-dropdown-item.logout-item:hover,
.user-dropdown-item.exit-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.user-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.change-password-button {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 8px;
    padding: 6.5px 11px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.change-password-button:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

@media (max-width: 768px) {
    .change-password-button span {
        display: none;
    }
    .change-password-button {
        padding: 6.5px 8px;
    }
}

.user-dropdown-lang-section {
    padding: 6px 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-dropdown-section-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-left: 4px;
}

.user-dropdown-lang-section .lang-switcher-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2.5px;
    box-shadow: none;
    box-sizing: border-box;
}

.user-dropdown-lang-section .lang-btn {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 11px;
}

.user-dropdown-lang-section .lang-divider {
    display: none;
}
/* Patient Registration Form Layout - Centered Dedicated Card */
.patient-form-layout {
    max-width: 1040px;
    margin: 0 auto;
    width: 100%;
}


/* ==========================================================================
   Single Viewport On-Screen Patient Registration Form (Zero Scroll)
   ========================================================================== */

.page-content:has(.patient-screen-fit) {
    padding: 10px 20px 14px !important;
}

.patient-screen-fit {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
}

.patient-screen-fast-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.06);
    flex-wrap: wrap;
    gap: 8px;
}

.patient-screen-fast-flow .flow-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.patient-screen-fast-flow .flow-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.patient-screen-fast-flow .flow-pill {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.patient-screen-fast-flow .flow-pill:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.patient-screen-fast-flow .flow-pill.flow-highlight {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
    font-weight: 700;
}

.patient-screen-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.patient-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.patient-screen-header .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-screen-header .header-title {
    font-size: 13.5px;
    font-weight: 750;
    color: #0f172a;
}

.patient-screen-header .header-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 1px 7px;
    border-radius: 4px;
}

.patient-screen-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-screen-body {
    padding: 10px 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    background: #ffffff;
}

.patient-screen-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fafbfd;
    border: 1px solid #e8eef5;
    border-radius: 8px;
    padding: 8px 10px;
}

.patient-column-title {
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0369a1;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.compact-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compact-field label {
    font-size: 10.5px;
    font-weight: 650;
    color: #475569;
    margin: 0;
    line-height: 1.2;
}

.compact-field input,
.compact-field select {
    height: 29px;
    padding: 2px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-field input:focus,
.compact-field select:focus {
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.field-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    margin-top: 2px;
    padding: 3px 0;
}

.inline-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #0284c7;
}

.inline-check label {
    cursor: pointer;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
}

.permanent-subbox {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeIn 0.15s ease-out;
}

.patient-screen-footer {
    padding: 8px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.patient-screen-footer .footer-msg {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.inline-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-status.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.inline-status.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.patient-screen-footer .footer-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.btn-save {
    height: 32px;
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 650;
    border-radius: 6px;
}

.btn-delete {
    color: #ef4444 !important;
}

.btn-delete:hover {
    background: #fef2f2 !important;
}

@media (max-width: 980px) {
    .patient-screen-body {
        grid-template-columns: 1fr;
    }
}


/* Patient ID Search Input Group (Matching Classic Desktop Experience) */
.patient-id-search-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.patient-id-search-section .id-label {
    font-size: 12px;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.id-search-box {
    display: flex;
    align-items: center;
    gap: 4px;
}

.id-search-input {
    height: 29px;
    width: 175px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 650;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.id-search-input:focus {
    border-color: #0369a1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.id-btn {
    height: 29px;
    width: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.id-btn:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0284c7;
}

.id-btn.search-btn {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.id-btn.search-btn:hover {
    background: #0369a1;
    border-color: #0369a1;
}

.id-btn.reset-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0284c7;
}

.id-btn.reset-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.header-reg-date {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 1px 7px;
    border-radius: 4px;
}


/* Always hide print-document on screen unless in print media */
@media screen {
    .print-document {
        display: none !important;
    }
}


/* ==========================================================================
   Classic 2-Column Desktop HIS Layout (Pixel-Perfect Alignment & Space Utilization)
   ========================================================================== */

.patient-classic-fit {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.page-content:has(.patient-classic-fit) {
    padding: 6px 20px 10px !important;
}

.patient-screen-fast-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 4px 12px;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.05);
    font-size: 11.5px;
}

.patient-screen-fast-flow .flow-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.patient-screen-fast-flow .flow-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.patient-screen-fast-flow .flow-pill {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    transition: all 0.12s ease;
}

.patient-screen-fast-flow .flow-pill:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.patient-screen-fast-flow .flow-pill.flow-highlight {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
    font-weight: 700;
}

.patient-classic-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    padding: 10px 20px 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Row 1 Top Identifier Bar: Patient ID & Patient Contact No. Prominently Sized */
.classic-top-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) !important;
    gap: 32px !important;
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 7px 14px !important;
    margin-bottom: 8px !important;
}

.top-id-cell {
    display: grid !important;
    grid-template-columns: 130px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
}

.top-phone-cell {
    display: grid !important;
    grid-template-columns: 165px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
}

.classic-top-bar .classic-label.bold-label {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

.search-field-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
}

.id-search-combo .id-input {
    width: 145px !important;
    height: 31px !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    border: 2px solid #0284c7 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    color: #0369a1 !important;
    background: #ffffff !important;
}

.phone-search-combo .phone-input {
    width: 100% !important;
    height: 31px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px !important;
    border: 2px solid #0284c7 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    color: #0f172a !important;
    background: #ffffff !important;
}

.classic-top-bar .id-btn {
    height: 31px !important;
    width: 31px !important;
    min-width: 31px !important;
    border-radius: 4px !important;
}

.classic-top-bar .id-btn svg {
    width: 15px !important;
    height: 15px !important;
}

.top-status-badge {
    margin-left: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.top-status-badge .badge {
    font-size: 11px !important;
    padding: 3px 8px !important;
    font-weight: 750 !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
}

.top-status-badge .date-badge {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
    font-weight: 600 !important;
    font-size: 10.5px !important;
}

/* Autocomplete Floating Dropdowns */
.suggestions-dropdown {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    width: 350px !important;
    background: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.15) !important;
    z-index: 1050 !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    padding: 0 !important;
}

.suggestions-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #64748b !important;
    padding: 6px 10px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
}

.sugg-scroll-hint {
    padding: 8px 10px !important;
    text-align: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0284c7 !important;
    background: #f0f9ff !important;
    border-top: 1px dashed #bae6fd !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.sugg-scroll-hint:hover {
    background: #e0f2fe !important;
}

.suggestions-header .close-sugg {
    cursor: pointer !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    padding: 0 4px !important;
}

.suggestions-header .close-sugg:hover {
    color: #ef4444 !important;
}

.suggestion-item {
    padding: 6px 10px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background 0.1s ease !important;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

.suggestion-item:hover {
    background: #f0f9ff !important;
}

.sugg-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    font-size: 12px !important;
}

.sugg-id {
    color: #0284c7 !important;
    font-weight: 750 !important;
}

.sugg-phone {
    color: #0369a1 !important;
    font-weight: 750 !important;
}

.sugg-name {
    color: #0f172a !important;
    font-weight: 600 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.sugg-sub {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 10.5px !important;
    color: #64748b !important;
    margin-top: 2px !important;
}

.id-btn {
    height: 25px !important;
    width: 25px !important;
    min-width: 25px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 3px !important;
    background: #ffffff !important;
    color: #0284c7 !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.15s ease !important;
}

.id-btn:hover {
    background: #f0f9ff !important;
    border-color: #0284c7 !important;
}

.id-btn.search-btn {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

.id-btn.search-btn:hover {
    background: #0369a1 !important;
}

.classic-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
}

.classic-column-left,
.classic-column-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.classic-row {
    display: grid !important;
    grid-template-columns: 180px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    height: 27px !important;
    min-height: 27px !important;
    max-height: 27px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: none !important;
}

.classic-row.address-row {
    grid-template-columns: 155px minmax(0, 1fr) !important;
    height: 26px !important;
    min-height: 26px !important;
}

/* Laser-Aligned Labels with Red Asterisk on Right */
.classic-label {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    line-height: 1 !important;
}

.classic-label.bold-label {
    font-weight: 750 !important;
    color: #0f172a !important;
}

.classic-label .req {
    color: #dc2626 !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    margin-left: 3px !important;
    margin-right: 0 !important;
    line-height: 1 !important;
    display: inline !important;
}

.classic-input {
    height: 25px !important;
    min-height: 25px !important;
    padding: 1px 7px !important;
    font-size: 12px !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 3px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: all 0.12s ease !important;
}

.classic-input:focus {
    border-color: #0284c7 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
}

.classic-input:read-only {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.age-quad-group {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    height: 25px !important;
    width: 100%;
}

.age-subfield {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    height: 25px !important;
}

.age-box.readonly-box {
    background: #f8fafc !important;
    color: #0369a1 !important;
    font-weight: 750 !important;
    text-align: center !important;
    font-size: 11.5px !important;
    height: 25px !important;
    border: 1px solid #cbd5e1 !important;
    cursor: default !important;
    user-select: none !important;
}

.age-box.readonly-box:focus {
    outline: none !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
}

/* Classic Fieldsets on the Right */
.classic-fieldset {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px 14px 8px !important;
    margin: 0 !important;
    background: #fbfcfe !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    transition: opacity 0.15s ease !important;
}

.classic-fieldset.is-disabled {
    background: #f8fafc !important;
}

.classic-legend {
    font-size: 11.5px !important;
    font-weight: 750 !important;
    color: #0f172a !important;
    padding: 0 6px !important;
    margin-bottom: 2px !important;
}

.classic-check-row {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 4px 0 2px 2px !important;
    height: 22px !important;
}

.classic-check-row input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    cursor: pointer !important;
    accent-color: #0284c7 !important;
    margin: 0 !important;
}

.classic-check-row label {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    margin: 0 !important;
    display: inline !important;
}

/* Classic Footer & Status Box with Date and Time */
.classic-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid #e2e8f0 !important;
    height: 32px !important;
}

.footer-msg {
    display: flex !important;
    align-items: center !important;
}

.inline-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.inline-status.success {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
}

.inline-status.danger {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
}

.status-reg-datetime {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: 6px !important;
    padding-left: 6px !important;
    color: #047857 !important;
    font-size: 11.5px !important;
}

.status-reg-datetime strong {
    font-weight: 750 !important;
}

.classic-footer .footer-buttons {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-left: auto !important;
}

.classic-footer .btn-save {
    height: 28px !important;
    padding: 0 16px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.classic-footer .btn {
    height: 28px !important;
    padding: 0 12px !important;
    font-size: 11.5px !important;
}

@media (max-width: 960px) {
    .classic-top-bar,
    .classic-form-layout {
        grid-template-columns: 1fr !important;
    }
}


/* Fast Data Entry Focused Input Glow */
.classic-input:focus,
input.classic-input:focus,
select.classic-input:focus {
    border-color: #0284c7 !important;
    outline: none !important;
    box-shadow: 0 0 0 2.5px rgba(2, 132, 199, 0.28) !important;
    background-color: #f0f9ff !important;
}

.classic-check-row input[type="checkbox"]:focus {
    outline: 2px solid #0284c7 !important;
    outline-offset: 2px !important;
}

#btn-save-profile:focus {
    outline: 2px solid #0284c7 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.4) !important;
}

/* Final responsive rules for the desktop-compatible navigation. */
@media (min-width: 961px) {
    .mobile-nav-toggle {
        display: none !important;
    }

    .desktop-menu-host {
        display: block !important;
    }
}

@media (max-width: 960px) {
    .desktop-menu-host {
        display: none !important;
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(340px, 90vw) !important;
        height: 100vh !important;
        overflow-y: auto !important;
        padding: 12px !important;
        background: #ffffff !important;
        border: 0 !important;
        border-right: 1px solid #cbd5e1 !important;
        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.18) !important;
        z-index: 1100 !important;
    }

    .desktop-menu-host.mobile-open {
        display: block !important;
    }

    .mobile-menu-heading {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        padding: 0 4px 10px;
        border-bottom: 1px solid #e2e8f0;
        color: #0f172a;
    }

    .legacy-menu-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 3px !important;
        min-height: 0 !important;
        padding: 10px 0 !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .legacy-menu-root {
        display: block !important;
        width: 100% !important;
    }

    .legacy-menu-root-button {
        width: 100% !important;
        justify-content: space-between !important;
        padding: 9px 11px !important;
    }

    .legacy-menu-dropdown,
    .legacy-menu-submenu {
        position: static !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 4px 0 6px 10px !important;
        padding: 4px !important;
        border-radius: 8px !important;
        box-shadow: none !important;
    }

    .legacy-menu-submenu {
        margin-left: 14px !important;
    }

    .legacy-menu-entry {
        white-space: normal !important;
    }
}

/* Patient registration: preserve the current layout while fitting the viewport. */
.page-content:has(.patient-classic-fit) {
    height: calc(100dvh - 112px);
    min-height: 0;
    padding: clamp(6px, 1.1dvh, 10px) clamp(12px, 1.5vw, 20px) !important;
    overflow: hidden;
    box-sizing: border-box;
}

.patient-classic-fit {
    --patient-row-h: clamp(27px, 3.75dvh, 31px);
    --patient-control-h: clamp(26px, 3.55dvh, 30px);
    --patient-button-h: clamp(32px, 4.7dvh, 38px);
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.patient-classic-fit .patient-screen-fast-flow {
    flex: 0 0 auto;
    min-height: clamp(32px, 4.8dvh, 38px);
    padding: clamp(4px, .75dvh, 7px) 12px;
    margin-bottom: clamp(5px, .8dvh, 8px);
    box-sizing: border-box;
}

.patient-classic-fit .patient-screen-fast-flow .flow-pill {
    display: inline-flex;
    align-items: center;
    min-height: clamp(25px, 3.7dvh, 30px);
    padding: 3px 9px;
    line-height: 1.25;
    box-sizing: border-box;
}

.patient-classic-card {
    flex: 1 1 auto;
    min-height: 0;
    padding: clamp(9px, 1.35dvh, 13px) clamp(14px, 1.5vw, 22px) !important;
    overflow: hidden;
}

.patient-classic-card > form {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.patient-classic-fit .classic-top-bar {
    flex: 0 0 auto;
    min-height: clamp(45px, 6.4dvh, 52px);
    padding: clamp(7px, 1.05dvh, 10px) 14px !important;
    margin-bottom: clamp(7px, 1.05dvh, 10px) !important;
    box-sizing: border-box;
}

.patient-classic-fit .classic-form-layout {
    flex: 1 1 auto;
    min-height: 0;
    gap: clamp(24px, 2.7vw, 40px);
}

.patient-classic-fit .classic-column-left,
.patient-classic-fit .classic-column-right {
    min-height: 0;
    gap: clamp(2px, .4dvh, 4px);
    justify-content: space-between;
}

.patient-classic-fit .classic-row,
.patient-classic-fit .classic-row.address-row {
    height: var(--patient-row-h) !important;
    min-height: var(--patient-row-h) !important;
    max-height: var(--patient-row-h) !important;
}

.patient-classic-fit .classic-label {
    line-height: 1.25 !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.patient-classic-fit .classic-input,
.patient-classic-fit .age-quad-group,
.patient-classic-fit .age-subfield,
.patient-classic-fit .age-box.readonly-box {
    height: var(--patient-control-h) !important;
    min-height: var(--patient-control-h) !important;
    line-height: 1.25 !important;
}

.patient-classic-fit .classic-input {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.patient-classic-fit .classic-fieldset {
    flex: 1 1 0;
    min-height: 0;
    padding: clamp(6px, .9dvh, 9px) 14px clamp(7px, 1dvh, 10px) !important;
    justify-content: space-between;
}

.patient-classic-fit .classic-legend {
    line-height: 1.3;
    margin-bottom: clamp(2px, .35dvh, 4px) !important;
}

.patient-classic-fit .classic-check-row {
    flex: 0 0 auto;
    height: clamp(23px, 3.5dvh, 28px) !important;
    margin: clamp(2px, .5dvh, 5px) 0 clamp(1px, .35dvh, 3px) 2px !important;
    line-height: 1.3;
}

.patient-classic-fit .classic-footer {
    flex: 0 0 auto;
    min-height: clamp(42px, 6dvh, 49px) !important;
    height: auto !important;
    margin-top: clamp(7px, 1dvh, 10px) !important;
    padding-top: clamp(7px, 1dvh, 10px) !important;
    padding-bottom: 1px;
    box-sizing: border-box;
}

.patient-classic-fit .classic-footer .btn,
.patient-classic-fit .classic-footer .btn-save {
    height: var(--patient-button-h) !important;
    min-height: var(--patient-button-h) !important;
    padding: 5px 14px !important;
    line-height: 1.25 !important;
}

.patient-classic-fit .inline-status {
    min-height: 30px;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    line-height: 1.25;
    box-sizing: border-box;
}

@media (max-width: 1180px) {
    .patient-classic-fit .classic-form-layout {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
        gap: 20px;
    }

    .patient-classic-fit .classic-row {
        grid-template-columns: 158px minmax(0, 1fr) !important;
    }

    .patient-classic-fit .classic-row.address-row {
        grid-template-columns: 138px minmax(0, 1fr) !important;
    }

    .patient-classic-fit .classic-top-bar {
        gap: 18px !important;
    }

    .patient-classic-fit .top-id-cell {
        grid-template-columns: 105px minmax(0, 1fr) !important;
    }

    .patient-classic-fit .top-phone-cell {
        grid-template-columns: 148px minmax(0, 1fr) !important;
    }
}

/* Patient dependency deletion modal */
.patient-dependency-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
}

.patient-dependency-modal {
    width: min(760px, calc(100vw - 32px));
    max-height: min(680px, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.patient-dependency-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.patient-dependency-header h3 { margin: 0 0 3px; color: #0f172a; font-size: 18px; }
.patient-dependency-header p { margin: 0; color: #475569; font-size: 13px; }

.patient-dependency-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: 7px;
    background: #f1f5f9;
    color: #334155;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.patient-dependency-warning,
.patient-dependency-message {
    margin: 12px 18px 0;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.35;
}

.patient-dependency-warning { border: 1px solid #fbbf24; background: #fffbeb; color: #92400e; }
.patient-dependency-message.success { border: 1px solid #86efac; background: #f0fdf4; color: #166534; }
.patient-dependency-message.error { border: 1px solid #fca5a5; background: #fef2f2; color: #991b1b; }

.patient-dependency-list {
    min-height: 100px;
    margin: 12px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.patient-dependency-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.patient-dependency-row:last-child { border-bottom: 0; }
.patient-dependency-details { min-width: 0; display: grid; gap: 2px; }
.patient-dependency-details strong { color: #0f172a; font-size: 13px; }
.patient-dependency-details span { color: #0369a1; font-size: 12px; font-weight: 700; }
.patient-dependency-details small { color: #64748b; font-size: 11px; }

.patient-dependency-delete,
.btn-delete-profile-final { border: 1px solid #dc2626; background: #dc2626; color: #fff; }

.patient-dependency-delete { min-width: 82px; flex: 0 0 auto; padding: 7px 12px; }
.patient-dependency-delete:hover:not(:disabled),
.btn-delete-profile-final:hover:not(:disabled) { border-color: #b91c1c; background: #b91c1c; }
.patient-dependency-delete:disabled,
.btn-delete-profile-final:disabled { border-color: #cbd5e1; background: #cbd5e1; cursor: not-allowed; }

.patient-dependency-empty {
    padding: 28px 16px;
    color: #166534;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.patient-dependency-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 12px 18px 15px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

@media (max-width: 560px) {
    .patient-dependency-backdrop { padding: 8px; }
    .patient-dependency-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
    .patient-dependency-row { align-items: flex-end; gap: 8px; }
    .patient-dependency-warning,
    .patient-dependency-message,
    .patient-dependency-list { margin-left: 10px; margin-right: 10px; }
    .patient-dependency-header,
    .patient-dependency-footer { padding-left: 10px; padding-right: 10px; }
}

/* In-app confirmation dialog (replaces browser confirm/prompt) */
.patient-action-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, .66);
}

.patient-action-dialog {
    width: min(480px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 13px;
    box-shadow: 0 26px 80px rgba(15, 23, 42, .34);
}

.patient-action-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 23px;
    font-weight: 800;
}

.patient-action-content { min-width: 0; }
.patient-action-content h3 { margin: 1px 0 7px; color: #0f172a; font-size: 18px; }
.patient-action-content > p { margin: 0 0 12px; color: #475569; font-size: 13px; line-height: 1.45; }

.patient-action-record {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.patient-action-record strong { color: #0f172a; font-size: 13px; }
.patient-action-record span { color: #0369a1; font-size: 12px; font-weight: 700; }
.patient-action-record small { color: #64748b; font-size: 11px; }

.patient-action-reason-label {
    display: block;
    margin: 12px 0 5px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.patient-action-reason-label span { color: #dc2626; }
.patient-action-reason {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    padding: 8px 10px;
    border: 1px solid #94a3b8;
    border-radius: 7px;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    outline: none;
}

.patient-action-reason:focus { border-color: #0284c7; box-shadow: 0 0 0 3px rgba(2, 132, 199, .12); }
.patient-action-error { margin-top: 10px; padding: 8px 10px; border: 1px solid #fca5a5; border-radius: 7px; background: #fef2f2; color: #991b1b; font-size: 12px; }

.patient-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 16px;
}

.patient-action-confirm { border: 1px solid #dc2626; background: #dc2626; color: #fff; }
.patient-action-confirm:hover:not(:disabled) { border-color: #b91c1c; background: #b91c1c; }
.patient-action-confirm:disabled { border-color: #cbd5e1; background: #cbd5e1; cursor: not-allowed; }

@media (max-width: 480px) {
    .patient-action-backdrop { padding: 8px; }
    .patient-action-dialog { width: calc(100vw - 16px); grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 15px; }
    .patient-action-icon { width: 34px; height: 34px; font-size: 19px; }
}

/* Settings moved from the main menu to the topbar */
.header-settings-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-settings-button {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.header-settings-button:hover,
.header-settings-button.open {
    border-color: #7dd3fc;
    background: #f0f9ff;
    color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, .08);
}

.header-settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

/* ==========================================================================
   Header Settings Mega-Dropdown (Premium Hospital Admin Master Hub - 4 Columns)
   ========================================================================== */
.header-settings-dropdown.header-settings-mega-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1050;
    width: min(990px, calc(100vw - 24px));
    max-height: calc(100dvh - 76px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 22px 50px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(2, 132, 199, 0.08);
    animation: fadeIn .18s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.header-settings-mega-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.settings-top-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.settings-brand-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 15px;
    flex-shrink: 0;
}

.settings-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.settings-title-row strong {
    font-size: 12.5px;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.settings-count-pill {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.settings-top-brand small {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-top: 1px;
}

.settings-search-box {
    position: relative;
    flex: 1;
    max-width: 270px;
    display: flex;
    align-items: center;
}

.settings-search-lens {
    position: absolute;
    left: 8px;
    font-size: 11px;
    pointer-events: none;
    color: #64748b;
}

.settings-search-field {
    width: 100%;
    height: 28px;
    padding: 2px 24px 2px 26px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 11px;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.15s ease;
}

.settings-search-field:focus {
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.settings-search-reset {
    position: absolute;
    right: 6px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 11px;
    padding: 2px;
}
.settings-search-reset:hover {
    color: #ef4444;
}

.settings-close-x {
    border: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.12s ease;
    flex-shrink: 0;
}
.settings-close-x:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Mega Body with 4 Categories Side-by-Side */
.header-settings-mega-body {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    overflow-y: auto;
    max-height: calc(100dvh - 130px);
    overscroll-behavior: contain;
}

.settings-cat-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: border-color 0.15s ease;
}

.settings-cat-section:hover {
    border-color: #cbd5e1;
}

.settings-cat-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: 0.1px;
}

.settings-cat-icon {
    font-size: 12px;
}

.settings-cat-title {
    flex: 1;
    color: #1e293b;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-cat-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #475569;
}

/* Category Theme Accents */
.theme-admin .settings-cat-header {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
.theme-admin .settings-cat-badge { background: #bae6fd; color: #0369a1; }

.theme-clinical .settings-cat-header {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}
.theme-clinical .settings-cat-badge { background: #a7f3d0; color: #047857; }

.theme-diagnostic .settings-cat-header {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
}
.theme-diagnostic .settings-cat-badge { background: #ddd6fe; color: #6d28d9; }

.theme-pharmacy .settings-cat-header {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.theme-pharmacy .settings-cat-badge { background: #fde68a; color: #92400e; }

/* Item List */
.settings-cat-items {
    display: flex;
    flex-direction: column;
    padding: 3px;
    gap: 2px;
}

.settings-card-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.12s ease;
    border: 1px solid transparent;
    min-width: 0;
}

.settings-card-item:hover,
.settings-card-item.active {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(1px);
}

.theme-admin .settings-card-item:hover { background: #f0f9ff; border-color: #bae6fd; }
.theme-clinical .settings-card-item:hover { background: #ecfdf5; border-color: #a7f3d0; }
.theme-diagnostic .settings-card-item:hover { background: #f5f3ff; border-color: #ddd6fe; }
.theme-pharmacy .settings-card-item:hover { background: #fffbeb; border-color: #fde68a; }

.settings-item-ico {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #f1f5f9;
    font-size: 11px;
    flex-shrink: 0;
    transition: transform 0.12s ease;
}

.settings-card-item:hover .settings-item-ico {
    transform: scale(1.1);
}

.settings-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.settings-item-title {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-card-item:hover .settings-item-title {
    color: #0284c7;
}

.settings-item-desc {
    font-size: 8.5px;
    color: #64748b;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-item-arrow {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    opacity: 0;
    transform: translateX(-2px);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.settings-card-item:hover .settings-item-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #0284c7;
}

/* Empty search state */
.settings-empty-state {
    grid-column: 1 / -1;
    padding: 24px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #64748b;
}

.settings-empty-state span {
    font-size: 22px;
}

.settings-empty-state p {
    margin: 0;
    font-size: 11.5px;
}

/* Footer Bar */
.header-settings-mega-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 10.5px;
    flex-shrink: 0;
}

.settings-footer-hub-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0284c7;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.12s ease;
}
.settings-footer-hub-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.settings-footer-hint {
    color: #94a3b8;
    font-size: 9.5px;
    font-weight: 600;
}

@media (max-width: 1080px) {
    .header-settings-dropdown.header-settings-mega-dropdown {
        width: min(760px, calc(100vw - 20px));
    }
    .header-settings-mega-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .header-settings-dropdown.header-settings-mega-dropdown {
        position: fixed;
        top: 56px;
        right: 8px;
        left: 8px;
        width: auto;
    }
    .header-settings-mega-body {
        grid-template-columns: 1fr;
    }
}


/* Back-office modules are separated from the patient-service navigation. */
.header-module-menus {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.header-backoffice-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-backoffice-button {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.header-backoffice-short {
    display: none;
}

.header-backoffice-button:hover,
.header-backoffice-button.open,
.header-backoffice-button.active {
    border-color: #67e8f9;
    background: #ecfeff;
    color: #0e7490;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, .08);
}

.header-backoffice-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.header-backoffice-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1050;
    width: min(310px, calc(100vw - 24px));
    max-height: min(650px, calc(100dvh - 88px));
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .2);
    animation: fadeIn .15s ease;
}

.header-backoffice-dropdown.header-backoffice-mega {
    position: fixed;
    top: 58px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: min(840px, calc(100vw - 32px));
    max-height: calc(100dvh - 76px);
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(2, 132, 199, 0.15);
    z-index: 1050;
    border-radius: 12px;
    animation: megaDropdownFadeIn 0.16s ease-out forwards;
}

@keyframes megaDropdownFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -6px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.header-backoffice-sections-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    max-height: min(600px, calc(100dvh - 140px));
    overflow-y: auto;
    background: #f8fafc;
}

@media (max-width: 860px) {
    .header-backoffice-dropdown.header-backoffice-mega {
        position: fixed;
        top: 58px;
        left: 12px;
        right: 12px;
        transform: none;
        width: auto;
        animation: fadeIn 0.15s ease;
    }
    .header-backoffice-sections-grid {
        grid-template-columns: 1fr;
    }
}

.header-backoffice-list {
    max-height: min(520px, calc(100dvh - 145px));
    overflow-y: auto;
    padding: 8px;
    overscroll-behavior: contain;
}

.header-backoffice-heading {
    display: flex;
    align-items: center;
    padding: 11px 13px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.header-backoffice-heading > div {
    display: grid;
    gap: 1px;
}

.header-backoffice-heading strong {
    color: #0f172a;
    font-size: 13px;
}

.header-backoffice-heading small {
    color: #64748b;
    font-size: 10px;
}

.header-backoffice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: min(580px, calc(100dvh - 145px));
    overflow-y: auto;
    padding: 10px;
    overscroll-behavior: contain;
}

.header-backoffice-group {
    min-width: 0;
    align-self: start;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.header-backoffice-group h3 {
    margin: 0 0 8px;
    padding: 2px 2px 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #0369a1;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-backoffice-item {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    margin-bottom: 3px;
    transition: all 0.12s ease;
}

.header-backoffice-item-icon {
    font-size: 14px;
    line-height: 1.2;
    flex-shrink: 0;
    margin-top: 1px;
}

.header-backoffice-item-text {
    display: flex;
    flex-direction: column;
}

.header-backoffice-item-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.header-backoffice-item-sub {
    font-size: 10px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.2;
}

.header-backoffice-item:hover,
.header-backoffice-item.active {
    background: #e0f2fe;
    color: #0369a1;
}

.header-backoffice-item:hover .header-backoffice-item-title,
.header-backoffice-item.active .header-backoffice-item-title {
    color: #0284c7;
}

@media (max-width: 700px) {
    .header-settings-label,
    .header-backoffice-label { display: none; }
    .header-backoffice-short { display: inline; }
    .header-settings-button,
    .header-backoffice-button { width: 34px; padding: 0; }
    .header-settings-dropdown { position: fixed; top: 58px; right: 8px; left: 8px; width: auto; }
    .header-backoffice-dropdown { position: fixed; top: 58px; right: 8px; left: 8px; width: auto; }
    .header-backoffice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
    .topbar-actions .live-clock-chip { display: none; }
    .header-module-menus { gap: 3px; }
    .header-backoffice-button { padding-inline: 7px; }
}

@media (max-width: 460px) {
    .header-settings-grid { grid-template-columns: 1fr; }
    .header-backoffice-grid { grid-template-columns: 1fr; }
    .topbar-brand { display: none; }
}

@media (max-height: 610px) and (min-width: 961px) {
    .topbar {
        height: 58px;
    }

    .desktop-menu-host {
        top: 58px;
    }

    .legacy-menu-bar {
        min-height: 40px;
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .page-content:has(.patient-classic-fit) {
        height: calc(100dvh - 100px);
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }
}

@media (max-width: 960px) {
    .page-content:has(.patient-classic-fit) {
        height: calc(100dvh - 66px);
        padding: 6px 10px !important;
    }

    .patient-classic-fit .classic-top-bar,
    .patient-classic-fit .classic-form-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }

    .patient-classic-fit .classic-top-bar {
        gap: 12px !important;
    }

    .patient-classic-fit .classic-form-layout {
        gap: 14px;
    }

    .patient-classic-fit .classic-row {
        grid-template-columns: minmax(100px, 34%) minmax(0, 1fr) !important;
    }

    .patient-classic-fit .classic-row.address-row {
        grid-template-columns: minmax(94px, 36%) minmax(0, 1fr) !important;
    }
}

/* Keep the legacy navigation usable at every viewport width. */
@media (min-width: 1281px) {
    .desktop-menu-host {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        overscroll-behavior-x: contain;
    }

    .desktop-menu-host:has(.legacy-menu-root.open) {
        overflow: visible;
    }

    .legacy-menu-bar {
        width: max-content;
        min-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        overflow: visible;
    }

    .legacy-menu-root {
        flex: 0 0 auto;
    }
}

@media (max-width: 1280px) {
    .mobile-nav-toggle {
        display: inline-flex !important;
        flex: 0 0 auto;
    }

    .sidebar-backdrop {
        z-index: 1090;
    }

    .desktop-menu-host {
        display: none !important;
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(340px, 90vw) !important;
        max-width: 100% !important;
        height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 12px !important;
        background: #ffffff !important;
        border: 0 !important;
        border-right: 1px solid #cbd5e1 !important;
        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.18) !important;
        z-index: 1100 !important;
        overscroll-behavior: contain;
    }

    .desktop-menu-host.mobile-open {
        display: block !important;
    }

    .mobile-menu-heading {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        padding: 0 4px 10px;
        border-bottom: 1px solid #e2e8f0;
        color: #0f172a;
    }

    .legacy-menu-bar {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 3px !important;
        min-height: 0 !important;
        padding: 10px 0 !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .legacy-menu-root {
        display: block !important;
        width: 100% !important;
    }

    .legacy-menu-root-button {
        width: 100% !important;
        justify-content: space-between !important;
        padding: 9px 11px !important;
    }

    .legacy-menu-dropdown,
    .legacy-menu-submenu {
        position: static !important;
        inset: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 4px 0 6px 10px !important;
        padding: 4px !important;
        border-radius: 8px !important;
        box-shadow: none !important;
    }

    .legacy-menu-submenu {
        margin-left: 14px !important;
    }

    .legacy-menu-entry {
        white-space: normal !important;
    }

    .topbar {
        height: 60px;
        padding-inline: clamp(8px, 2vw, 18px);
    }

    .topbar-left,
    .topbar-brand,
    .topbar-brand > span {
        min-width: 0;
    }

    .topbar-brand {
        max-width: min(650px, calc(100vw - 180px));
    }

    .topbar-brand strong,
    .topbar-brand small {
        display: block;
        white-space: nowrap;
    }

    .page-content:has(.patient-classic-fit) {
        height: calc(100dvh - 60px);
    }
}

@media (max-width: 640px) {
    .topbar-left {
        gap: 8px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .topbar-brand {
        max-width: calc(100vw - 150px);
    }

    .topbar-brand .brand-logo-img,
    .topbar-brand .brand-mark {
        width: 42px;
        height: 42px;
        min-width: 42px;
        max-width: 42px;
        max-height: 42px;
    }

    .topbar-brand small {
        display: none;
    }

    .topbar-brand strong {
        font-size: 12px;
    }

    .user-details,
    .user-dropdown-caret,
    .logout-button span {
        display: none;
    }

    button.user-profile-pill,
    .logout-button {
        width: 34px;
        min-width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
    }
}

/* Kept in the primary stylesheet so no generated scoped-CSS URL is required. */
#blazor-error-ui {
    display: none;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    padding: .75rem 1.25rem;
    background: #fff7ed;
    border-top: 1px solid #fdba74;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 1rem;
    cursor: pointer;
}

/* Patient registration correction: retain the original geometry and only tune density. */
.page-content:has(.patient-classic-fit) {
    height: auto !important;
    min-height: 0;
    padding: 6px 20px 10px !important;
    overflow: visible !important;
}

.patient-classic-fit {
    height: auto !important;
    min-height: 0;
    display: block !important;
}

.patient-classic-fit .patient-screen-fast-flow {
    min-height: 34px;
    padding: 5px 12px;
    margin-bottom: 6px;
}

.patient-classic-fit .patient-screen-fast-flow .flow-pill {
    min-height: 26px;
    padding: 3px 9px;
    line-height: 1.25;
}

.patient-classic-card {
    height: auto !important;
    min-height: 0;
    display: block !important;
    flex: none !important;
    padding: 10px 20px !important;
    overflow: visible !important;
}

.patient-classic-card > form {
    height: auto !important;
    min-height: 0;
    display: block !important;
}

.patient-classic-fit .classic-top-bar {
    min-height: 47px;
    padding: 7px 14px !important;
    margin-bottom: 8px !important;
}

.patient-classic-fit .classic-form-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) !important;
    align-items: start !important;
    gap: clamp(24px, 2.7vw, 40px) !important;
    min-height: 0;
}

.patient-classic-fit .classic-column-left,
.patient-classic-fit .classic-column-right {
    height: auto !important;
    min-height: 0;
    justify-content: flex-start !important;
    gap: 3px !important;
}

.patient-classic-fit .classic-row,
.patient-classic-fit .classic-row.address-row {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
}

.patient-classic-fit .classic-input,
.patient-classic-fit .age-quad-group,
.patient-classic-fit .age-subfield,
.patient-classic-fit .age-box.readonly-box {
    height: 27px !important;
    min-height: 27px !important;
    line-height: 1.3 !important;
}

.patient-classic-fit .classic-input {
    padding: 3px 7px !important;
}

.patient-classic-fit .classic-label {
    line-height: 1.3 !important;
    overflow: visible !important;
}

.patient-classic-fit .classic-fieldset {
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 6px 12px 6px !important;
    justify-content: flex-start !important;
}

.patient-classic-fit .address-grid-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 26px;
    margin-bottom: 3px;
    width: 100%;
}

.patient-classic-fit .address-subcell {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.patient-classic-fit .address-subcell .classic-label {
    margin-bottom: 0;
    white-space: nowrap;
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
    min-width: 65px;
}

.patient-classic-fit .address-subcell .classic-input {
    flex: 1;
    min-width: 0;
    height: 25px !important;
}

.patient-classic-fit .classic-legend {
    line-height: 1.3 !important;
    margin-bottom: 3px !important;
}

.patient-classic-fit .classic-check-row {
    height: 24px !important;
    min-height: 24px;
    margin: 4px 0 2px 2px !important;
}

.patient-classic-fit .classic-footer {
    height: auto !important;
    min-height: 44px !important;
    margin-top: 8px !important;
    padding: 8px 0 1px !important;
}

.patient-classic-fit .classic-footer .btn,
.patient-classic-fit .classic-footer .btn-save {
    height: 34px !important;
    min-height: 34px !important;
    padding: 6px 14px !important;
    line-height: 1.25 !important;
}

.patient-classic-fit .inline-status {
    min-height: 30px;
    padding: 5px 12px !important;
    line-height: 1.25;
}

@media (max-height: 620px) and (min-width: 961px) {
    .page-content:has(.patient-classic-fit) {
        padding-top: 4px !important;
        padding-bottom: 5px !important;
    }

    .patient-classic-card {
        padding-top: 7px !important;
        padding-bottom: 7px !important;
    }

    .patient-classic-fit .classic-row,
    .patient-classic-fit .classic-row.address-row {
        height: 26px !important;
        min-height: 26px !important;
        max-height: 26px !important;
    }

    .patient-classic-fit .classic-input,
    .patient-classic-fit .age-quad-group,
    .patient-classic-fit .age-subfield,
    .patient-classic-fit .age-box.readonly-box {
        height: 25px !important;
        min-height: 25px !important;
    }

    .patient-classic-fit .classic-fieldset {
        padding-top: 5px !important;
        padding-bottom: 6px !important;
    }

    .patient-classic-fit .classic-footer {
        min-height: 40px !important;
        margin-top: 6px !important;
        padding-top: 6px !important;
    }
}

@media (max-width: 960px) {
    .page-content:has(.patient-classic-fit) {
        height: auto !important;
        overflow-x: auto !important;
        padding: 6px 10px 10px !important;
    }

    .patient-classic-fit {
        min-width: 760px;
    }

    .patient-classic-fit .classic-top-bar,
    .patient-classic-fit .classic-form-layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) !important;
    }
}

/* Patient Registration owns exactly the remaining viewport; page scrolling is disabled. */
.main-content:has(.patient-classic-fit) {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content:has(.patient-classic-fit) > .topbar,
.main-content:has(.patient-classic-fit) > .desktop-menu-host {
    flex: 0 0 auto;
}

.main-content:has(.patient-classic-fit) > .page-content {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden !important;
}

html:has(.patient-classic-fit),
body:has(.patient-classic-fit) {
    height: 100%;
    overflow: hidden !important;
}

.patient-classic-fit .editable-age-box {
    padding-right: 22px !important;
    text-align: center !important;
    font-weight: 750 !important;
    color: #0369a1 !important;
    background: #ffffff !important;
    cursor: text;
    appearance: textfield;
    -moz-appearance: textfield;
}

.patient-classic-fit .editable-age-box:focus::placeholder,
.patient-classic-fit .editable-age-box:focus::-webkit-input-placeholder,
.patient-classic-fit .editable-age-box:focus::-moz-placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.patient-classic-fit .editable-age-box::-webkit-inner-spin-button,
.patient-classic-fit .editable-age-box::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.patient-classic-fit .age-unit {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 1;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.patient-classic-fit .phone-search-combo .phone-input {
    flex: 1 1 150px;
    width: auto !important;
    min-width: 120px;
}

.patient-classic-fit .patient-top-action {
    flex: 0 0 auto;
    height: 31px !important;
    min-height: 31px !important;
    padding: 4px 9px !important;
    border-radius: 5px;
    font-size: 10.5px !important;
    line-height: 1.2;
    gap: 4px;
}

@media (max-width: 1180px) {
    .patient-classic-fit .patient-top-action {
        padding-right: 7px !important;
        padding-left: 7px !important;
        font-size: 10px !important;
    }
}



/* ==========================================================================
   Patient Registration Sketch-Based 3-Pane Layout System
   ========================================================================== */
.patient-classic-fit .patient-sketch-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.45fr) minmax(310px, 1.05fr) 200px;
    gap: 16px;
    align-items: stretch;
    min-height: 0;
    width: 100%;
}

/* 1. LEFT PANE: Demographics & Family details */
.patient-classic-fit .sketch-left-pane {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.patient-classic-fit .sketch-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    height: 28px;
    min-height: 28px;
}

.patient-classic-fit .sketch-label {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    text-align: left;
    margin-bottom: 0;
}

.patient-classic-fit .sketch-label.highlight-search-label {
    font-size: 11.5px !important;
    font-weight: 850 !important;
    color: #0369a1 !important;
    letter-spacing: 0.1px;
}

.patient-classic-fit .sketch-label .req {
    color: #ef4444;
    margin-left: 2px;
}

/* Symmetric 50/50 dual row grid */
.patient-classic-fit .sketch-row-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: 28px;
    min-height: 28px;
    width: 100%;
    align-items: center;
}

.patient-classic-fit .sketch-subfield {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.patient-classic-fit .sketch-sublabel {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    margin-bottom: 0;
    flex-shrink: 0;
}

.patient-classic-fit .sketch-sublabel .req {
    color: #ef4444;
    margin-left: 2px;
}

/* Linear Sex Selection Buttons */
.patient-classic-fit .sex-btn-group,
.diagnostic-classic-fit .sex-btn-group,
.patient-classic-fit .sex-btn-group,
.diagnostic-classic-fit .sex-btn-group,
.appointments-classic-fit .sex-btn-group,
.tickets-classic-fit .sex-btn-group {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
    height: 28px;
    min-width: 0;
}

.patient-classic-fit .sex-btn,
.diagnostic-classic-fit .sex-btn,
.appointments-classic-fit .sex-btn,
.tickets-classic-fit .sex-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 28px;
    padding: 0 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    line-height: 26px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.patient-classic-fit .sex-btn .sex-icon,
.diagnostic-classic-fit .sex-btn .sex-icon,
.appointments-classic-fit .sex-btn .sex-icon,
.tickets-classic-fit .sex-btn .sex-icon {
    font-size: 11.5px;
    line-height: 1;
}

.patient-classic-fit .sex-btn .sex-text,
.diagnostic-classic-fit .sex-btn .sex-text,
.appointments-classic-fit .sex-btn .sex-text,
.tickets-classic-fit .sex-btn .sex-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-classic-fit .sex-btn:hover,
.diagnostic-classic-fit .sex-btn:hover,
.appointments-classic-fit .sex-btn:hover,
.tickets-classic-fit .sex-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #0f172a;
}

/* Male Selected: Blue */
.patient-classic-fit .sex-btn.sex-btn-male.is-selected,
.diagnostic-classic-fit .sex-btn.sex-btn-male.is-selected,
.appointments-classic-fit .sex-btn.sex-btn-male.is-selected,
.tickets-classic-fit .sex-btn.sex-btn-male.is-selected {
    border: 1.5px solid #0284c7 !important;
    background: #e0f2fe !important;
    color: #0284c7 !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}

.patient-classic-fit .sex-btn.sex-btn-male:focus-visible,
.diagnostic-classic-fit .sex-btn.sex-btn-male:focus-visible,
.appointments-classic-fit .sex-btn.sex-btn-male:focus-visible,
.tickets-classic-fit .sex-btn.sex-btn-male:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 1px;
}

/* Female Selected: Pink */
.patient-classic-fit .sex-btn.sex-btn-female.is-selected,
.diagnostic-classic-fit .sex-btn.sex-btn-female.is-selected,
.appointments-classic-fit .sex-btn.sex-btn-female.is-selected,
.tickets-classic-fit .sex-btn.sex-btn-female.is-selected {
    border: 1.5px solid #ec4899 !important;
    background: #fdf2f8 !important;
    color: #db2777 !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(236, 72, 153, 0.25);
}

.patient-classic-fit .sex-btn.sex-btn-female:focus-visible,
.diagnostic-classic-fit .sex-btn.sex-btn-female:focus-visible,
.appointments-classic-fit .sex-btn.sex-btn-female:focus-visible,
.tickets-classic-fit .sex-btn.sex-btn-female:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 1px;
}

/* Other Selected: Black */
.patient-classic-fit .sex-btn.sex-btn-other.is-selected,
.diagnostic-classic-fit .sex-btn.sex-btn-other.is-selected,
.appointments-classic-fit .sex-btn.sex-btn-other.is-selected,
.tickets-classic-fit .sex-btn.sex-btn-other.is-selected {
    border: 1.5px solid #0f172a !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.patient-classic-fit .sex-btn.sex-btn-other:focus-visible,
.diagnostic-classic-fit .sex-btn.sex-btn-other:focus-visible,
.appointments-classic-fit .sex-btn.sex-btn-other:focus-visible,
.tickets-classic-fit .sex-btn.sex-btn-other:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 1px;
}


/* Linear Blood Group Selection Buttons */
.patient-classic-fit .blood-btn-group {
    display: flex;
    align-items: center;
    gap: 2.5px;
    width: 100%;
    height: 28px;
    min-width: 0;
}

.patient-classic-fit .blood-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 28px;
    padding: 0 1px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    line-height: 26px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

.patient-classic-fit .blood-btn.is-wide {
    flex: 1.25 1 0;
}

.patient-classic-fit .blood-btn:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #0f172a;
}

.patient-classic-fit .blood-btn.is-selected {
    border: 1.5px solid #dc2626 !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.patient-classic-fit .blood-btn:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 1px;
}


/* Search combo styles */
.patient-classic-fit .id-search-combo,
.patient-classic-fit .phone-search-combo {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    width: 100%;
}

.patient-classic-fit .id-search-combo .id-input,
.patient-classic-fit .phone-search-combo .phone-input {
    flex: 1;
    min-width: 0;
    height: 28px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    border: 1.8px solid #0284c7 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    color: #0369a1 !important;
    background: #f0f9ff !important;
    box-shadow: inset 0 1px 2px rgba(2, 132, 199, 0.08);
    transition: all 0.15s ease;
}

.patient-classic-fit .phone-search-combo .phone-input {
    color: #0c4a6e !important;
}

.patient-classic-fit .id-search-combo .id-input:focus,
.patient-classic-fit .phone-search-combo .phone-input:focus {
    background: #ffffff !important;
    border-color: #0369a1 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.22) !important;
}

.patient-classic-fit .id-search-combo .id-input::placeholder,
.patient-classic-fit .phone-search-combo .phone-input::placeholder {
    color: #64748b !important;
    font-weight: 600 !important;
}

.patient-classic-fit .id-search-combo .id-btn,
.patient-classic-fit .phone-search-combo .id-btn {
    height: 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.patient-classic-fit .id-btn.search-btn {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
}

.patient-classic-fit .id-btn.search-btn:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
}

/* Age Group: 3 columns (Y, M, D) spanning the field width, exactly matching Sex, Weight, Father Name */
.patient-classic-fit .age-quad-group {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 3px !important;
    width: 100% !important;
    height: 27px !important;
}

.patient-classic-fit .age-subfield {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 27px;
}

.patient-classic-fit .age-subfield .editable-age-box {
    width: 100% !important;
    height: 27px !important;
    padding: 0 16px 0 3px !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    text-align: center !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
}

.patient-classic-fit .age-subfield .age-unit {
    position: absolute;
    right: 4px;
    font-size: 9.5px;
    font-weight: 800;
    color: #64748b;
    pointer-events: none;
}

/* Weight input */
.patient-classic-fit .weight-input-box {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.patient-classic-fit .weight-val {
    padding-right: 24px !important;
    text-align: center;
    font-weight: 700;
}

.patient-classic-fit .weight-unit-pill {
    position: absolute;
    right: 7px;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    pointer-events: none;
    line-height: 1;
}

/* 2. MIDDLE PANE: Present & Permanent Address */
.patient-classic-fit .sketch-address-pane {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 7px 11px;
}

.patient-classic-fit .sketch-section-header {
    border-bottom: 1.5px solid #cbd5e1;
    padding-bottom: 2px;
    margin-bottom: 3px;
}

.patient-classic-fit .sketch-section-header .section-title {
    font-size: 11.5px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
}

.patient-classic-fit .sketch-address-fields {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.patient-classic-fit .sketch-address-fields.is-disabled {
    opacity: 0.7;
    pointer-events: none;
}

.patient-classic-fit .address-single-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    height: 26px;
    min-height: 26px;
}

.patient-classic-fit .addr-label {
    font-size: 10.5px;
    font-weight: 650;
    color: #334155;
    white-space: nowrap;
}

.patient-classic-fit .sketch-same-addr-row {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    margin: 3px 0 2px;
    font-size: 11px;
    font-weight: 700;
    color: #0284c7;
    cursor: pointer;
    user-select: none;
}

.patient-classic-fit .sketch-same-addr-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #0284c7;
}

.patient-classic-fit .sketch-same-addr-row label {
    margin: 0;
    cursor: pointer;
}

/* 3. RIGHT PANE: Photo, Bar Code, QR Code */
.patient-classic-fit .sketch-media-pane {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 7px 10px;
    min-width: 0;
    box-sizing: border-box;
}

.patient-classic-fit .sketch-photo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.patient-classic-fit .sketch-photo-frame {
    width: 136px;
    height: 150px;
    border-radius: 6px;
    border: 1.5px solid #94a3b8;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.patient-classic-fit .sketch-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.patient-classic-fit .sketch-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #94a3b8;
}

.patient-classic-fit .sketch-photo-hint {
    font-size: 9.5px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.5px;
}

.patient-classic-fit .sketch-photo-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    width: 100%;
    max-width: 154px;
}

.patient-classic-fit .btn-sketch-action {
    flex: 1 1 0 !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 6px !important;
    border-radius: 4px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    color: #334155 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: all 0.15s ease;
    margin: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.patient-classic-fit .btn-sketch-action > span {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
}

.patient-classic-fit .btn-sketch-action svg {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    min-height: 13px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.patient-classic-fit .btn-sketch-action:hover {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

.patient-classic-fit .btn-sketch-action.remove {
    flex: 0 0 24px !important;
    color: #dc2626 !important;
    border-color: #fecaca !important;
    padding: 0 5px !important;
}

.patient-classic-fit .btn-sketch-action.remove:hover {
    background: #fee2e2 !important;
}

.patient-classic-fit .sketch-code-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.patient-classic-fit .code-title {
    font-size: 10px;
    font-weight: 750;
    color: #475569;
    letter-spacing: 0.3px;
    text-align: left;
}

.patient-classic-fit .code-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.patient-classic-fit .barcode-box {
    min-height: 36px;
}

.patient-classic-fit .barcode-box svg {
    max-width: 100%;
    height: 32px !important;
    display: block;
}

.patient-classic-fit .qrcode-box {
    min-height: 58px;
    padding: 2px;
}

.patient-classic-fit .qrcode-box svg {
    width: 52px !important;
    height: 52px !important;
    display: block;
}

/* Auto-case input styling */
input[data-autocase="title"],
textarea[data-autocase="title"],
.classic-input[data-autocase="title"] {
    text-transform: capitalize;
}

input[data-autocase="email"],
.classic-input[data-autocase="email"] {
    text-transform: lowercase;
}

/* 4. BOTTOM ACTION BAR: Save / Update | Delete | Clear | Print Card | Print Wristband */
.patient-classic-fit .sketch-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1.5px solid #e2e8f0;
    padding-top: 7px;
    margin-top: 7px;
    width: 100%;
}

.patient-classic-fit .sketch-footer-status {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.patient-classic-fit .sketch-footer-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Save Button (New Entry) */
.patient-classic-fit .btn-save-update {
    min-width: 95px;
    height: 32px !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
    cursor: pointer;
    transition: all 0.15s ease;
}

.patient-classic-fit .btn-save-update:hover {
    background: linear-gradient(135deg, #0369a1, #075985) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(2, 132, 199, 0.35);
}

/* Update Button (Existing Patient) */
.patient-classic-fit .btn-update-action {
    min-width: 105px;
    height: 32px !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    background: linear-gradient(135deg, #059669, #047857) !important;
    border: 1px solid #059669 !important;
    color: #ffffff !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
    cursor: pointer;
    transition: all 0.15s ease;
}

.patient-classic-fit .btn-update-action:hover {
    background: linear-gradient(135deg, #047857, #065f46) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(5, 150, 105, 0.35);
}

.patient-classic-fit .btn-delete-action {
    height: 32px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    color: #b91c1c !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.patient-classic-fit .btn-delete-action:not(:disabled):hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.patient-classic-fit .btn-delete-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
}

.patient-classic-fit .btn-clear-action {
    height: 32px !important;
    font-size: 11.5px !important;
    font-weight: 650 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.patient-classic-fit .btn-clear-action:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.patient-classic-fit .btn-print-card {
    height: 32px !important;
    font-size: 11.5px !important;
    font-weight: 650 !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
}

.patient-classic-fit .btn-print-wristband {
    height: 32px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 5px !important;
    background: #f0fdf4 !important;
    border: 1.5px solid #10b981 !important;
    color: #047857 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.patient-classic-fit .btn-print-wristband:hover {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

/* Patient Wristband Modal & Preview Styles */
.patient-wristband-modal-dialog {
    max-width: 860px !important;
    width: 95vw !important;
}

.patient-wristband-modal-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wristband-preview-scroll-container {
    background: #e2e8f0;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 20px 14px;
    overflow-x: auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
    -webkit-overflow-scrolling: touch;
}

.patient-wristband-strap {
    width: 780px !important;
    min-width: 780px !important;
    max-width: 780px !important;
    flex-shrink: 0 !important;
    margin: 0 auto;
    height: 72px;
    background: #ffffff;
    border-radius: 36px;
    border: 1.5px solid #94a3b8;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.wristband-fastener-tab {
    width: 48px;
    height: 100%;
    background: #f1f5f9;
    border-right: 1.5px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.wristband-fastener-tab .snap-hole {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #94a3b8;
    background: #e2e8f0;
}

.wristband-fastener-tab .fastener-label {
    font-size: 8px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.wristband-print-zone {
    width: 460px;
    height: 100%;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ffffff;
    border-right: 1.5px dashed #cbd5e1;
    flex-shrink: 0;
}

.wristband-qr-box {
    width: 58px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
}

.wristband-qr-box svg {
    width: 48px !important;
    height: 48px !important;
    display: block;
}

.wristband-qr-label {
    font-size: 7px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.3px;
    line-height: 1;
}

.wristband-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4px;
    min-width: 0;
    line-height: 1.15;
}

.wristband-hospital {
    font-size: 8px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wristband-patient-name {
    font-size: 13px;
    font-weight: 850;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wristband-id-badge {
    font-size: 11px;
    font-weight: 800;
    color: #0369a1;
}

.wristband-meta-row, .wristband-contact-row {
    font-size: 9.5px;
    color: #334155;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.wristband-barcode-zone {
    width: 140px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
}

.wristband-barcode-zone svg {
    max-width: 100%;
    height: 52px !important;
    display: block;
}

.wristband-tail-zone {
    flex: 1;
    height: 100%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 12px;
}

.wristband-size-marker {
    font-size: 8px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.8px;
}

.wristband-clip-hole {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px dashed #94a3b8;
    background: #ffffff;
}

.wristband-print-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11px;
    color: #0369a1;
    font-weight: 600;
}

/* Card Photo column in CR80 card */
.patient-cr80-card .card-photo-col {
    width: 18mm !important;
    height: 22mm !important;
    flex-shrink: 0 !important;
    margin-right: 2.5mm !important;
    border-radius: 1.5mm !important;
    overflow: hidden !important;
    border: 1px solid #cbd5e1 !important;
    background: #f1f5f9 !important;
}

.patient-cr80-card .card-patient-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Webcam Modal */
.webcam-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.webcam-modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.webcam-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.btn-close-modal {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    color: #64748b !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    flex-shrink: 0 !important;
}

.btn-close-modal:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    transform: rotate(90deg) scale(1.05) !important;
}

.btn-close-modal:active {
    transform: rotate(90deg) scale(0.95) !important;
}

.btn-close-modal svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    pointer-events: none !important;
}

.webcam-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.webcam-modal-sub {
    margin: 2px 0 0;
    font-size: 11px;
    color: #64748b;
}

.webcam-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #0f172a;
}

.webcam-video-wrap {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 8px;
    overflow: hidden;
    background: #000000;
}

.webcam-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webcam-guide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.webcam-guide-oval {
    width: 200px;
    height: 250px;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
}

.webcam-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.webcam-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.webcam-modal-footer .btn-capture {
    background: #0284c7;
    color: #ffffff;
    font-weight: 700;
}

/* ==========================================================================
   Patient CR80 ID Card (Standard PVC Card: 85.60mm x 53.98mm, r=3.18mm)
   ========================================================================== */
.patient-id-card-wrapper {
    width: 85.60mm !important;
    height: 53.98mm !important;
    max-width: 85.60mm !important;
    max-height: 53.98mm !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: block !important;
}

.patient-cr80-card {
    width: 85.60mm !important;
    height: 53.98mm !important;
    max-width: 85.60mm !important;
    max-height: 53.98mm !important;
    border-radius: 3.18mm !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid #94a3b8 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, -apple-system, sans-serif !important;
    color: #0f172a !important;
    margin: 0 auto !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

/* Card Header: 11.5mm high */
.patient-cr80-card .card-header {
    height: 11.5mm !important;
    min-height: 11.5mm !important;
    max-height: 11.5mm !important;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    padding: 1.5mm 3.5mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    border-top-left-radius: 3.18mm !important;
    border-top-right-radius: 3.18mm !important;
}

.patient-cr80-card .card-brand {
    display: flex !important;
    align-items: center !important;
    gap: 2mm !important;
    max-width: 61mm !important;
    overflow: hidden !important;
}

.patient-cr80-card .card-logo {
    width: 8mm !important;
    height: 8mm !important;
    max-width: 8mm !important;
    max-height: 8mm !important;
    object-fit: contain !important;
    background: #ffffff !important;
    border-radius: 1.5mm !important;
    padding: 0.5mm !important;
    flex-shrink: 0 !important;
}

.patient-cr80-card .card-logo-fallback {
    width: 8mm !important;
    height: 8mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 1.5mm !important;
    font-size: 5mm !important;
    flex-shrink: 0 !important;
}

.patient-cr80-card .card-title-group {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
}

.patient-cr80-card .card-hospital-name {
    font-size: 8pt !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: 0.2px !important;
}

.patient-cr80-card .card-doc-type {
    font-size: 5pt !important;
    font-weight: 700 !important;
    color: #bae6fd !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.patient-cr80-card .card-header-badge {
    background: #ffffff !important;
    color: #0369a1 !important;
    border-radius: 1.8mm !important;
    padding: 0.8mm 2mm !important;
    display: flex !important;
    align-items: center !important;
    gap: 1mm !important;
    font-size: 6.5pt !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    flex-shrink: 0 !important;
}

.patient-cr80-card .card-header-badge .badge-label {
    font-size: 5pt !important;
    color: #64748b !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

/* Card Body: 28mm high */
.patient-cr80-card .card-body {
    height: 28mm !important;
    min-height: 28mm !important;
    max-height: 28mm !important;
    padding: 1.5mm 3.5mm 1mm 3.5mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
}

.patient-cr80-card .card-info-col {
    flex: 1 !important;
    max-width: 58mm !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    height: 100% !important;
    overflow: hidden !important;
}

.patient-cr80-card .card-patient-name {
    font-size: 9.5pt !important;
    font-weight: 850 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    margin-bottom: 0.8mm !important;
}

.patient-cr80-card .card-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    row-gap: 0.6mm !important;
    column-gap: 2mm !important;
}

.patient-cr80-card .card-field {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.15 !important;
}

.patient-cr80-card .card-field.span-2 {
    grid-column: span 2 !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 1.5mm !important;
}

.patient-cr80-card .field-lbl {
    font-size: 5pt !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    letter-spacing: 0.3px !important;
}

.patient-cr80-card .field-val {
    font-size: 7pt !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.patient-cr80-card .blood-highlight {
    color: #dc2626 !important;
    font-weight: 800 !important;
}

/* Card QR Box */
.patient-cr80-card .card-qr-col {
    width: 20mm !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.patient-cr80-card .card-qr-box {
    width: 18mm !important;
    height: 18mm !important;
    background: #ffffff !important;
    padding: 0.5mm !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 1.5mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.patient-cr80-card .card-qr-box svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.patient-cr80-card .card-qr-sub {
    font-size: 4.5pt !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-align: center !important;
    letter-spacing: 0.4px !important;
    margin-top: 0.5mm !important;
}

/* Card Footer: 13.5mm high */
.patient-cr80-card .card-footer {
    height: 13.5mm !important;
    min-height: 13.5mm !important;
    max-height: 13.5mm !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 0.8mm 3mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border-bottom-left-radius: 3.18mm !important;
    border-bottom-right-radius: 3.18mm !important;
}

.patient-cr80-card .card-barcode-wrap {
    width: 100% !important;
    max-width: 60mm !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.patient-cr80-card .card-barcode-wrap svg {
    max-width: 100% !important;
    height: 11.5mm !important;
    display: block !important;
}

/* Card Preview Modal */
.patient-card-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1200 !important;
    padding: 20px !important;
}

.patient-card-modal-content {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
    max-width: 520px !important;
    width: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    animation: cardModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.patient-card-modal-content.patient-wristband-modal-dialog {
    max-width: 860px !important;
    width: 95vw !important;
}

@keyframes cardModalPop {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.patient-card-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}


.patient-card-modal-body {
    padding: 24px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f1f5f9 !important;
}

.patient-card-modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    padding: 12px 20px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}
.patient-card-modal-footer .modal-footer-spacer {
    flex: 1 !important;
}
.patient-card-modal-footer .btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 7px 14px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

.patient-card-print-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 16px 12px !important;
}

.patient-card-format-row,
.patient-card-output-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.patient-card-format-row .btn:first-child {
    margin-right: auto;
}

.patient-print-format-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.patient-card-format-row .tickets-print-mode-group {
    flex: 0 0 auto;
}

.patient-card-format-row .tickets-mode-pill {
    min-width: 92px;
    justify-content: center;
    white-space: nowrap;
}

.patient-card-output-row {
    justify-content: flex-end;
}

.patient-card-main-print {
    min-width: 150px;
    justify-content: center;
}

@media (max-width: 520px) {
    .patient-card-modal-backdrop {
        padding: 8px !important;
    }

    .patient-card-modal-header {
        padding: 12px 14px !important;
    }

    .patient-card-modal-body {
        padding: 18px 10px !important;
        overflow-x: auto;
    }

    .patient-card-print-footer {
        padding: 9px 10px 10px !important;
    }

    .patient-print-format-label {
        display: none;
    }

    .patient-card-format-row .tickets-mode-pill {
        min-width: 82px;
        padding-inline: 8px;
    }

    .patient-card-output-row .btn {
        flex: 1 1 0;
        justify-content: center;
        padding-inline: 8px !important;
    }

    .patient-card-main-print {
        min-width: 0;
        flex: 2 1 145px !important;
    }
}

/* ==========================================================================
   Doctor Appointments - Classic Non-Scrolling Fit (Single Screen Layout)
   ========================================================================== */

.appointments-classic-fit {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.main-content:has(.appointments-classic-fit) {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content:has(.appointments-classic-fit) > .topbar,
.main-content:has(.appointments-classic-fit) > .desktop-menu-host {
    flex: 0 0 auto;
}

.main-content:has(.appointments-classic-fit) > .page-content {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden !important;
    padding: 6px 16px 8px !important;
}

html:has(.appointments-classic-fit),
body:has(.appointments-classic-fit) {
    height: 100%;
    overflow: hidden !important;
}

.appt-classic-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 14px;
    min-height: 44px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    flex-shrink: 0;
    gap: 12px;
}

.appt-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.appt-page-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    white-space: nowrap;
}

.appt-count-pill {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.appt-inline-alert {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 450px;
}

.appt-inline-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.appt-inline-alert.danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.appt-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.appt-date-filter-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 8px;
}

.appt-date-filter-wrap label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.appt-date-filter-input {
    border: none !important;
    background: transparent !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding: 2px 4px !important;
    height: 26px !important;
    min-height: 26px !important;
    cursor: pointer;
}

.appt-btn {
    height: 31px;
    min-height: 31px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    line-height: 1.2;
}


.appt-three-col,
.appt-four-col {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.appt-weight-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.appt-weight-box .appt-weight-val {
    padding-right: 26px !important;
    text-align: left !important;
    font-weight: 600;
}

.appt-weight-box .appt-weight-unit {
    position: absolute;
    right: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    pointer-events: none;
    line-height: 1;
}

.patient-weight-pill {
    font-size: 10.5px;
    font-weight: 700;
    color: #0284c7;
    background: #e0f2fe;
    padding: 1px 5px;
    border-radius: 4px;
}

.appt-patient-header-row,
.appt-date-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.appt-doctor-option-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.appt-doctor-option-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-doctor-option-id {
    font-size: 10.5px;
    font-weight: 800;
    color: #0284c7;
    flex-shrink: 0;
}

.appt-doctor-option-sub {
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.appt-classic-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 8px 16px 12px 16px;
    overflow-y: auto !important;
}

@media (max-width: 1024px) {
    
.appt-three-col {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.appt-patient-header-row,
.appt-date-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.appt-doctor-option-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.appt-doctor-option-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-doctor-option-id {
    font-size: 10.5px;
    font-weight: 800;
    color: #0284c7;
    flex-shrink: 0;
}

.appt-doctor-option-sub {
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.appt-classic-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4px 8px 8px 8px;
    overflow-y: auto !important;
}
}

.appt-form-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1240px;
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Keep the booking form aligned with the full-width appointments toolbar. */
.appointments-classic-fit > .appt-classic-workspace {
    justify-content: stretch;
    padding-left: 0;
    padding-right: 0;
}

.appointments-classic-fit > .appt-classic-workspace > .appt-form-card {
    max-width: none;
}

.appt-queue-card {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.appt-card-header,
.appt-queue-top {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.appt-card-header h2,
.appt-queue-top h2 {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.appt-serial-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.appt-serial-badge.emerald {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.appt-serial-badge.violet {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.appt-form-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.appt-form-twocol {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) !important;
    gap: 18px !important;
    padding: 12px 16px !important;
}

.appt-col-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.appt-col-right {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    padding-left: 18px;
    border-left: 1px solid #e2e8f0;
}

.appt-doctor-hint-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    color: #475569;
}

@media (max-width: 992px) {
    .appt-form-card {
        max-width: 100%;
    }
    .appt-form-twocol {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .appt-col-right {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
    }
}

.appt-field-sex {
    width: 100%;
}

.appt-vitals-compact-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
}

.appt-field-age,
.appt-field-weight {
    width: 215px;
    max-width: 100%;
}

.appt-unit-input-box {
    display: flex;
    align-items: stretch;
    width: 215px;
    max-width: 100%;
    height: 33px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.appt-unit-input-box:focus-within {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.14);
}

.appt-unit-input-box .appt-unit-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 10px !important;
    font-size: 12.5px !important;
    font-weight: 650 !important;
    color: #0f172a !important;
    text-align: left !important;
    background: transparent !important;
}

.appt-unit-input-box .appt-unit-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
    user-select: none;
    flex-shrink: 0;
}

.appt-temp-id-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
    border: 1px solid #bae6fd;
    border-radius: 6px;
    margin-top: 2px;
}

.appt-temp-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0284c7;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.appt-temp-id-text {
    font-size: 10.5px;
    font-weight: 600;
    color: #0369a1;
    line-height: 1.25;
}

.meta-tag.temp-id-tag {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
}

.appt-quick-doctors-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px dashed #cbd5e1;
}

.appt-quick-doc-label {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    margin-right: 2px;
}

.appt-quick-doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    font-size: 10.5px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 195px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appt-quick-doc-chip:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0369a1;
}

.appt-patient-input {
    height: 33px !important;
    font-size: 12.5px !important;
    border-radius: 6px !important;
    width: 100% !important;
}

.appointments-classic-fit .sex-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 33px;
    min-width: 0;
}

.appointments-classic-fit .sex-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 33px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11.5px;
    font-weight: 650;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

.appointments-classic-fit .sex-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
}

.appointments-classic-fit .sex-btn .sex-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.appointments-classic-fit .sex-btn .sex-svg,
.patient-classic-fit .sex-btn .sex-svg {
    display: block;
    width: 13px;
    height: 13px;
    stroke: #64748b;
    transition: stroke 0.15s ease;
}

/* Male Selected */
.appointments-classic-fit .sex-btn.sex-btn-male.is-selected,
.patient-classic-fit .sex-btn.sex-btn-male.is-selected {
    border: 1.5px solid #0284c7 !important;
    background: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}
.appointments-classic-fit .sex-btn.sex-btn-male.is-selected .sex-svg,
.patient-classic-fit .sex-btn.sex-btn-male.is-selected .sex-svg {
    stroke: #0284c7 !important;
}

/* Female Selected */
.appointments-classic-fit .sex-btn.sex-btn-female.is-selected,
.patient-classic-fit .sex-btn.sex-btn-female.is-selected {
    border: 1.5px solid #ec4899 !important;
    background: #fdf2f8 !important;
    color: #be185d !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(236, 72, 153, 0.25);
}
.appointments-classic-fit .sex-btn.sex-btn-female.is-selected .sex-svg,
.patient-classic-fit .sex-btn.sex-btn-female.is-selected .sex-svg {
    stroke: #ec4899 !important;
}

/* Other Selected */
.appointments-classic-fit .sex-btn.sex-btn-other.is-selected,
.patient-classic-fit .sex-btn.sex-btn-other.is-selected {
    border: 1.5px solid #8b5cf6 !important;
    background: #f5f3ff !important;
    color: #6d28d9 !important;
    font-weight: 850 !important;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.25);
}
.appointments-classic-fit .sex-btn.sex-btn-other.is-selected .sex-svg,
.patient-classic-fit .sex-btn.sex-btn-other.is-selected .sex-svg {
    stroke: #8b5cf6 !important;
}

.appt-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appt-field-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.appt-field-label .req {
    color: #dc2626;
    font-weight: 800;
}

.appt-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.appt-select {
    cursor: pointer;
}

.appt-doctor-search {
    position: relative;
}

.appt-doctor-search > input {
    width: 100%;
}

.appt-doctor-suggestions {
    position: absolute;
    z-index: 120;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 245px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.appt-doctor-option {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1px !important;
    padding: 6px 10px !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    text-align: left !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.appt-doctor-option:hover,
.appt-doctor-option.selected {
    background: #eff6ff;
}

.appt-doctor-option .doctor-id {
    color: #0369a1;
    font-size: 11px;
    font-weight: 800;
}

.appt-doctor-option .doctor-name {
    overflow: hidden;
    font-size: 11.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appt-doctor-empty {
    padding: 10px;
    color: #64748b;
    font-size: 11.5px;
    text-align: center;
}

.appt-doctor-scroll-hint {
    padding: 6px 10px;
    color: #0284c7;
    background: #f8fafc;
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    border-top: 1px dashed #e2e8f0;
}

.appt-doctor-scroll-hint:hover {
    background: #f0f9ff;
}

/* Doctor Consultation Schedule & Slot Picker */
.appt-doctor-schedule-box {
    margin-bottom: 6px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.appt-doc-sched-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.appt-doc-sched-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
}

.appt-fee-badge {
    font-size: 11.5px;
    font-weight: 800;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.appt-doc-sched-icon {
    font-size: 16px;
    line-height: 1.2;
}

.appt-doc-sched-time {
    font-size: 11.5px;
    color: #0f172a;
    font-weight: 600;
}

.appt-doc-sched-time strong {
    color: #065f46;
    font-weight: 750;
    margin-right: 4px;
}

.appt-doc-sched-meta {
    font-size: 10px;
    color: #047857;
    margin-top: 1px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-weight: 600;
}

.appt-doc-sched-badge {
    font-size: 9.5px;
    font-weight: 800;
    color: #047857;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    border: 1px solid #a7f3d0;
}

.appt-slot-chips-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 6px;
}

.appt-slot-chips-label {
    font-size: 10px;
    font-weight: 750;
    color: #334155;
}

.appt-slot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.appt-slot-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.appt-slot-btn:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    color: #0369a1;
}

.appt-slot-btn.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(2, 132, 199, 0.35);
}

.appt-slot-btn .slot-dot {
    font-size: 6px;
    color: #10b981;
}

.appt-slot-btn.active .slot-dot {
    color: #a7f3d0;
}

.appt-slot-btn .slot-booked-tag {
    font-size: 9px;
    opacity: 0.85;
}

/* Doctor Off Day Alert Banner */
.appt-doctor-offday-banner {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border: 1.5px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}
.appt-doc-offday-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed #fca5a5;
    padding-bottom: 5px;
}
.appt-doc-offday-badge {
    background: #fee2e2;
    color: #dc2626;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #fca5a5;
}
.appt-doc-offday-date {
    font-size: 11px;
    font-weight: 700;
    color: #991b1b;
}
.appt-doc-offday-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.appt-doc-offday-title {
    font-size: 12px;
    color: #7f1d1d;
    font-weight: 600;
}
.appt-doc-offday-title .highlight-day {
    color: #dc2626;
    font-weight: 800;
    text-decoration: underline;
}
.appt-doc-offday-meta {
    font-size: 11px;
    color: #475569;
}
.appt-doc-offday-switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #fed7aa;
    padding: 5px 10px;
    border-radius: 6px;
    margin-top: 2px;
}
.appt-switch-date-btn {
    background: #ea580c;
    color: #ffffff !important;
    border: none;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.15s;
}
.appt-switch-date-btn:hover {
    background: #c2410c;
}
.input-offday-warn {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
    font-weight: 700 !important;
}
.appt-chip.offday-chip {
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
    background: #fef2f2 !important;
}
.doc-offday-pill {
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    background: #fee2e2;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #fecaca;
}

.appt-patient-search-combo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.appt-patient-search-field {
    position: relative;
}

.appt-patient-suggestions {
    position: absolute;
    z-index: 115;
    top: calc(100% + 3px);
    left: 0;
    right: auto;
    width: min(420px, calc(200% + 10px));
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.appt-patient-option {
    width: 100%;
    display: grid;
    grid-template-columns: 82px minmax(90px, 1fr) 95px;
    gap: 7px;
    align-items: center;
    padding: 7px 8px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.appt-patient-option:hover {
    background: #eff6ff;
}

.appt-patient-option .patient-id {
    color: #0369a1;
    font-size: 10.5px;
    font-weight: 800;
}

.appt-patient-option .patient-name,
.appt-patient-option .patient-contact {
    overflow: hidden;
    color: #334155;
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appt-patient-option .patient-name {
    font-weight: 700;
}

.appt-patient-search-combo input.classic-input {
    flex: 1 1 auto;
    height: 27px !important;
    min-height: 27px !important;
    border-radius: 4px !important;
}

.appt-patient-search-combo .btn-find {
    height: 27px;
    padding: 0 12px;
    font-size: 11.5px;
    font-weight: 700;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.appt-patient-search-combo .btn-find:hover {
    background: #0369a1;
}

.appt-form-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.appt-footer-left-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.appt-footer-hint {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.appt-footer-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.appt-book-btn {
    padding: 0 18px !important;
    height: 33px !important;
    font-size: 12.5px !important;
    font-weight: 750 !important;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid #0369a1 !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28) !important;
}

.appt-book-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.36) !important;
}

.appt-btn.btn-ghost {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.appt-btn.btn-ghost:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.appt-scanner-bar {
    padding: 6px 12px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.appt-scanner-input-wrap {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.appt-scanner-icon {
    position: absolute;
    left: 9px;
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
    line-height: 1;
    z-index: 2;
}

.appt-scanner-input {
    width: 100%;
    height: 31px;
    padding-left: 30px !important;
    padding-right: 28px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 11.5px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    transition: all 0.15s ease !important;
}

.appt-scanner-input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12) !important;
}

.appt-scanner-clear {
    position: absolute;
    right: 7px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
}

.appt-scanner-clear:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Actionable Daily Schedule Slide-Over Drawer */
.appt-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease-in-out;
}

.appt-drawer-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.appt-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 580px;
    max-width: 96vw;
    background: #ffffff;
    z-index: 1060;
    box-shadow: -12px 0 32px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.appt-drawer-panel.show {
    transform: translateX(0);
}

.appt-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.appt-drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.appt-drawer-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.appt-drawer-title .date-badge {
    font-size: 11px;
    font-weight: 600;
    color: #0284c7;
    margin-left: 4px;
}

.appt-drawer-close {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
}

.appt-drawer-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.appt-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.appt-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
}

.appt-schedule-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    border: none;
    font-size: 11.5px;
    font-weight: 750;
    padding: 5px 11px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.appt-schedule-trigger-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.45);
}

.appt-schedule-trigger-btn.active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 2px 6px rgba(4, 120, 87, 0.35);
}

.appt-schedule-trigger-btn .trigger-pill {
    background: rgba(255, 255, 255, 0.22);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 800;
}

.appt-schedule-trigger-btn .trigger-pill.checked {
    background: #10b981;
    color: #ffffff;
}

.appt-queue-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appt-empty-state {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 28px 16px !important;
    background: #f8fafc !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 8px !important;
    margin: 12px !important;
}

.appt-empty-state-icon {
    font-size: 26px;
    margin-bottom: 6px;
    line-height: 1;
}

.appt-empty-state-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 3px;
}

.appt-empty-state-desc {
    font-size: 11px;
    color: #64748b;
    max-width: 320px;
    line-height: 1.4;
}

.appt-queue-pager {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.appt-queue-pager button {
    width: 25px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #0369a1;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.appt-queue-pager button:disabled {
    opacity: .4;
    cursor: default;
}

.appt-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.15s ease;
    gap: 8px;
}

.appt-queue-item:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.08);
}

.appt-queue-item.active {
    border-color: #0284c7;
    background: #f0fdf4;
}

.appt-queue-serial {
    font-size: 13px;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.appt-queue-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.appt-queue-name {
    font-size: 13px;
    font-weight: 750;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-queue-meta {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-queue-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.appt-queue-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

@media (max-height: 720px) {
    .appt-classic-topbar {
        min-height: 38px;
        padding: 4px 10px;
    }
    .appt-card-header,
    .appt-queue-top {
        padding: 5px 10px;
    }
    .appt-queue-item {
        padding: 4px 8px;
    }
}

/* ==========================================================================
   Consultation Tickets - Classic Non-Scrolling Fit (Single Screen Layout)
   ========================================================================== */

.tickets-classic-fit {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.main-content:has(.tickets-classic-fit) {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content:has(.tickets-classic-fit) > .topbar,
.main-content:has(.tickets-classic-fit) > .desktop-menu-host {
    flex: 0 0 auto;
}

.main-content:has(.tickets-classic-fit) > .page-content {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden !important;
    padding: 6px 16px 8px !important;
}

html:has(.tickets-classic-fit),
body:has(.tickets-classic-fit) {
    height: 100%;
    overflow: hidden !important;
}

.tickets-classic-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 14px;
    min-height: 44px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    flex-shrink: 0;
    gap: 12px;
}

.tickets-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.tickets-page-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    white-space: nowrap;
}

.tickets-count-pill {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.tickets-inline-alert {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 450px;
}

.tickets-inline-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tickets-inline-alert.danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tickets-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tickets-btn {
    height: 31px;
    min-height: 31px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    line-height: 1.2;
}

.tickets-classic-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 8px 16px 12px 16px;
    overflow-y: auto !important;
}

@media (max-width: 1024px) {
    .tickets-classic-workspace {
        padding: 4px 8px 8px 8px;
    }
}

.tickets-form-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    width: 100%;
    max-width: 1140px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tickets-queue-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.tickets-card-header,
.tickets-queue-top {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tickets-card-header h2,
.tickets-queue-top h2 {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.tickets-serial-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.tickets-serial-badge.emerald {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.tickets-serial-badge.violet {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.tickets-form-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100% - 37px);
    min-height: 0;
}

.tickets-form-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 9px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: hidden;
}

.tickets-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.tickets-field-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tickets-field-label .req {
    color: #dc2626;
    font-weight: 800;
}

.tickets-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tickets-select {
    cursor: pointer;
}

.tickets-patient-search-combo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tickets-patient-search-combo input {
    flex: 1 1 auto;
}

.tickets-patient-search-combo .btn-find {
    height: 25px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.tickets-patient-search-combo .btn-find:hover {
    background: #0369a1;
}

.tickets-patient-suggestions {
    position: absolute;
    z-index: 120;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    width: max(380px, 100%);
    max-width: 440px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.18), 0 4px 6px -2px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.tickets-patient-suggestions-header {
    background: #f8fafc;
    padding: 6px 10px;
    font-size: 10.5px;
    font-weight: 800;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tickets-patient-option {
    width: 100%;
    display: grid;
    grid-template-columns: 88px minmax(110px, 1fr) auto auto;
    gap: 7px;
    align-items: center;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.tickets-patient-option:hover {
    background: #f0f9ff;
}

.tickets-patient-option .patient-id {
    color: #0369a1;
    font-size: 11px;
    font-weight: 800;
}

.tickets-patient-option .patient-name {
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-patient-option .patient-contact {
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
}

.bold-number {
    font-weight: 800;
    color: #0f172a;
}

.tickets-textarea {
    resize: none;
    height: auto !important;
    min-height: 38px !important;
    max-height: 44px !important;
    padding: 4px 8px !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
}

.tickets-form-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.tickets-scanner-bar {
    padding: 6px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tickets-scanner-input-wrap {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.tickets-scanner-icon {
    position: absolute;
    left: 8px;
    font-size: 13px;
    pointer-events: none;
}

.tickets-scanner-input {
    width: 100%;
    height: 27px;
    padding: 2px 26px 2px 9px !important;
    font-size: 12px !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
}

.tickets-scanner-clear {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
}

.tickets-queue-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tickets-queue-pager {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.tickets-queue-pager button {
    width: 25px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #0369a1;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.tickets-queue-pager button:disabled {
    opacity: .4;
    cursor: default;
}

.tickets-queue-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tickets-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.15s ease;
    gap: 8px;
    cursor: pointer;
}

.tickets-queue-item:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.08);
}

.tickets-queue-item.active {
    border-color: #0284c7;
    background: #f0fdf4;
}

.tickets-queue-serial {
    font-size: 12.5px;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.tickets-queue-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.tickets-queue-name {
    font-size: 13px;
    font-weight: 750;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tickets-queue-reg {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.tickets-queue-meta {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-queue-fee {
    font-size: 11.5px;
    font-weight: 800;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}

.tickets-queue-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tickets-queue-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* --- OPD Tickets: full-width, no-scroll single screen layout --- */
.tickets-classic-fit .appt-classic-workspace {
    padding: 0 !important;
    overflow: hidden !important;
    align-items: stretch;
}

.tickets-classic-fit .tickets-wide-card {
    max-width: none !important;
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.tickets-classic-fit .tickets-wide-card .appt-form-twocol {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 20px !important;
    padding: 12px 18px !important;
    align-content: start;
}

.tickets-classic-fit .tickets-wide-card .appt-col-right {
    padding-left: 20px;
}

/* Unified input heights, borders, and typography for 100% field consistency */
.tickets-classic-fit .appt-form-body input.classic-input,
.tickets-classic-fit .appt-form-body select.classic-input,
.tickets-classic-fit .appt-form-body .appt-unit-input-box,
.tickets-classic-fit .appt-form-body .tickets-change-box {
    height: 30px !important;
    min-height: 30px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
}

.tickets-classic-fit .appt-form-body input.classic-input:focus,
.tickets-classic-fit .appt-form-body select.classic-input:focus,
.tickets-classic-fit .appt-form-body .appt-unit-input-box:focus-within {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
    outline: none !important;
}

.tickets-classic-fit .sex-btn-group {
    height: 30px !important;
}

.tickets-classic-fit .sex-btn {
    height: 30px !important;
    border-radius: 6px !important;
}

.tickets-classic-fit .appt-unit-input-box {
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: stretch !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.tickets-classic-fit .appt-unit-input-box .appt-unit-input {
    height: 100% !important;
    min-height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.tickets-classic-fit .appt-unit-input-box .appt-unit-addon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    background: #f1f5f9 !important;
    border-left: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    user-select: none !important;
}

.tickets-fee-row,
.tickets-vitals-row {
    display: flex !important;
    gap: 8px !important;
    align-items: flex-start !important;
    width: 100% !important;
}

.tickets-fee-row > .appt-field-group,
.tickets-vitals-row > .appt-field-group {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    gap: 4px !important;
}

.tickets-fee-row > .appt-field-group.ticket-type-col {
    flex: 1.8 1 0 !important;
    min-width: 175px !important;
}

.tickets-fee-row > .appt-field-group.fee-col,
.tickets-fee-row > .appt-field-group.received-col,
.tickets-fee-row > .appt-field-group.change-col {
    flex: 0.9 1 0 !important;
    min-width: 75px !important;
}

/* Custom Ticket Type Dropdown */
.tickets-type-dropdown-container {
    position: relative;
    width: 100%;
}

.tickets-type-dropdown-trigger {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
    text-align: left;
    outline: none;
}

.tickets-type-dropdown-trigger:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.tickets-type-dropdown-trigger.open,
.tickets-type-dropdown-trigger:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
    background: #ffffff;
}

.tickets-type-trigger-left {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.tickets-type-trigger-icon {
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

.tickets-type-trigger-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-type-trigger-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.tickets-type-trigger-rate {
    font-size: 11px;
    font-weight: 800;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.tickets-type-trigger-arrow {
    color: #64748b;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.tickets-type-trigger-arrow.rotated {
    transform: rotate(180deg);
}

.tickets-type-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: transparent;
}

.tickets-type-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: max(280px, 100%);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    z-index: 110;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tickets-type-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tickets-type-menu-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tickets-type-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
    width: 100%;
    box-sizing: border-box;
}

.tickets-type-menu-item:hover {
    background: #f1f5f9;
}

.tickets-type-menu-item.selected {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.tickets-type-item-main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.tickets-type-item-bullet {
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.tickets-type-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tickets-type-item-title-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tickets-type-item-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-type-default-badge {
    font-size: 9px;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 0 4px;
    border-radius: 3px;
    line-height: 1.2;
}

.tickets-type-item-hint {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-type-item-rate-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tickets-type-item-rate {
    font-size: 11.5px;
    font-weight: 800;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
}

.tickets-type-item-rate.active {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.tickets-type-item-check {
    color: #0284c7;
    font-weight: 800;
    font-size: 12px;
}

.tickets-fee-input {
    font-weight: 800 !important;
    color: #059669 !important;
}

.tickets-change-box {
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    background: #dcfce7 !important;
    border: 1px solid #86efac !important;
    color: #15803d !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.tickets-change-box.due {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}

/* --- OPD Tickets Topbar & Form Modern Enhancements --- */
.tickets-print-mode-group {
    display: inline-flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    gap: 2px;
}

.tickets-mode-pill {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tickets-mode-pill.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(2, 132, 199, 0.3);
}

.tickets-auto-print-pill {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tickets-auto-print-pill.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

/* Rate selection chips */
.tickets-rate-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tickets-rate-chip {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tickets-rate-chip:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    color: #0369a1;
}

.tickets-rate-chip.active {
    border-color: #0284c7;
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

/* Follow-up / Re-visit alert banner */
.tickets-followup-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tickets-followup-info {
    font-size: 11.5px;
    color: #1e40af;
    line-height: 1.35;
}

.tickets-followup-info strong {
    font-weight: 800;
}

.tickets-followup-action-btn {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.tickets-followup-action-btn:hover {
    background: #1d4ed8;
}

/* POS Payment and Cash Tender box */
.tickets-pos-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-fee-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.pos-fee-amount {
    font-size: 18px;
    font-weight: 900;
    color: #059669;
}

.pos-pay-methods {
    display: flex;
    gap: 6px;
}

.pos-method-btn {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.pos-method-btn.active {
    border-color: #0284c7;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
}

.pos-tender-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-tender-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.pos-currency-prefix {
    position: absolute;
    left: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}

.pos-tender-input {
    padding-left: 22px !important;
    font-weight: 800;
    color: #0f172a;
}

.pos-change-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.pos-change-badge.return {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

.pos-change-badge.due {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* Quick chips for clinical complaints */
.tickets-complaint-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.complaint-chip {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.complaint-chip:hover {
    border-color: #0284c7;
    color: #0284c7;
    background: #f0f9ff;
}

/* Quick Patient Registration Modal */
.quick-patient-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.quick-patient-modal-dialog {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.quick-patient-modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quick-patient-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-patient-modal-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 75vh;
    overflow-y: auto;
}

.quick-patient-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* --- OPD Ticket Thermal POS Slip Styles --- */
#ticket-thermal-print {
    display: none;
}

@media print {
    #ticket-thermal-print {
        display: block !important;
        width: 72mm;
        margin: 0 auto;
        padding: 4px;
        color: #000000;
        background: #ffffff;
    }
}

.thermal-token-box {
    border: 2px dashed #000000;
    padding: 6px 4px;
    margin: 8px 0;
    text-align: center;
    background: #fcfcfc;
}

.thermal-token-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.thermal-token-num {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    margin: 2px 0;
}

.thermal-room-badge {
    font-size: 12px;
    font-weight: 800;
}

@media (max-height: 720px) {
    .tickets-classic-topbar {
        min-height: 38px;
        padding: 4px 10px;
    }
    .tickets-card-header,
    .tickets-queue-top {
        padding: 5px 10px;
    }
    .tickets-form-body {
        padding: 8px 10px;
        gap: 6px;
    }
    .tickets-queue-item {
        padding: 4px 8px;
    }
}

/* ==========================================================================
   Emergency & OT Cash Memos - Classic Non-Scrolling Fit (Single Screen)
   ========================================================================== */

.emergency-classic-fit,
.ot-classic-fit,
.diagnostic-classic-fit,
.worklist-classic-fit,
.results-classic-fit,
.ipd-classic-fit,
.pharmacy-classic-fit {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.main-content:has(.emergency-classic-fit),
.main-content:has(.ot-classic-fit),
.main-content:has(.diagnostic-classic-fit),
.main-content:has(.worklist-classic-fit),
.main-content:has(.results-classic-fit),
.main-content:has(.ipd-classic-fit),
.main-content:has(.pharmacy-classic-fit) {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content:has(.emergency-classic-fit) > .topbar,
.main-content:has(.emergency-classic-fit) > .desktop-menu-host,
.main-content:has(.ot-classic-fit) > .topbar,
.main-content:has(.ot-classic-fit) > .desktop-menu-host,
.main-content:has(.diagnostic-classic-fit) > .topbar,
.main-content:has(.diagnostic-classic-fit) > .desktop-menu-host,
.main-content:has(.worklist-classic-fit) > .topbar,
.main-content:has(.worklist-classic-fit) > .desktop-menu-host,
.main-content:has(.results-classic-fit) > .topbar,
.main-content:has(.results-classic-fit) > .desktop-menu-host,
.main-content:has(.ipd-classic-fit) > .topbar,
.main-content:has(.ipd-classic-fit) > .desktop-menu-host,
.main-content:has(.pharmacy-classic-fit) > .topbar,
.main-content:has(.pharmacy-classic-fit) > .desktop-menu-host,
.main-content:has(.doctor-queue-classic-fit) > .topbar,
.main-content:has(.doctor-queue-classic-fit) > .desktop-menu-host {
    flex: 0 0 auto;
}

.main-content:has(.emergency-classic-fit) > .page-content,
.main-content:has(.ot-classic-fit) > .page-content,
.main-content:has(.worklist-classic-fit) > .page-content,
.main-content:has(.results-classic-fit) > .page-content,
.main-content:has(.ipd-classic-fit) > .page-content,
.main-content:has(.pharmacy-classic-fit) > .page-content,
.main-content:has(.doctor-queue-classic-fit) > .page-content {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden !important;
    padding: 6px 16px 8px !important;
}

.main-content:has(.diagnostic-classic-fit) > .page-content {
    flex: 1 1 0 !important;
    height: calc(100dvh - 124px) !important;
    max-height: calc(100dvh - 124px) !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 1680px !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    padding: 3px 12px 4px !important;
    box-sizing: border-box;
}

html:has(.emergency-classic-fit),
body:has(.emergency-classic-fit),
html:has(.ot-classic-fit),
body:has(.ot-classic-fit),
html:has(.diagnostic-classic-fit),
body:has(.diagnostic-classic-fit),
html:has(.worklist-classic-fit),
body:has(.worklist-classic-fit),
html:has(.results-classic-fit),
body:has(.results-classic-fit),
html:has(.ipd-classic-fit),
body:has(.ipd-classic-fit),
html:has(.pharmacy-classic-fit),
body:has(.pharmacy-classic-fit),
html:has(.doctor-queue-classic-fit),
body:has(.doctor-queue-classic-fit) {
    height: 100%;
    overflow: hidden !important;
}

.emergency-classic-topbar,
.ot-classic-topbar,
.diagnostic-classic-topbar,
.worklist-classic-topbar,
.results-classic-topbar,
.ipd-classic-topbar,
.pharmacy-classic-topbar,
.doctor-queue-classic-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 14px;
    min-height: 44px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    flex-shrink: 0;
    gap: 12px;
}

.emergency-classic-workspace,
.ot-classic-workspace,
.diagnostic-classic-workspace,
.results-classic-workspace,
.ipd-classic-workspace,
.pharmacy-classic-workspace,
.doctor-queue-classic-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
    gap: 12px;
    overflow: hidden;
}

.doctor-queue-classic-workspace {
    grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.45fr);
}

.ipd-classic-workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.8fr);
}

.worklist-classic-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 1150px) {
    .emergency-classic-workspace,
    .ot-classic-workspace,
    .diagnostic-classic-workspace,
    .results-classic-workspace,
    .ipd-classic-workspace,
    .pharmacy-classic-workspace {
        grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.85fr);
    }
}

.emergency-form-card,
.emergency-queue-card,
.ot-form-card,
.ot-queue-card,
.diagnostic-form-card,
.diagnostic-queue-card,
.worklist-card,
.results-form-card,
.results-queue-card,
.ipd-form-card,
.ipd-queue-card,
.pharmacy-form-card,
.pharmacy-queue-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.emergency-card-header,
.emergency-queue-top,
.ot-card-header,
.ot-queue-top,
.diagnostic-card-header,
.diagnostic-queue-top,
.worklist-header,
.results-card-header,
.results-queue-top,
.ipd-card-header,
.ipd-queue-top,
.pharmacy-card-header,
.pharmacy-queue-top {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.emergency-card-header h2,
.emergency-queue-top h2,
.ot-card-header h2,
.ot-queue-top h2,
.diagnostic-card-header h2,
.diagnostic-queue-top h2,
.worklist-header h2,
.results-card-header h2,
.results-queue-top h2,
.ipd-card-header h2,
.ipd-queue-top h2,
.pharmacy-card-header h2,
.pharmacy-queue-top h2 {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.emergency-badge {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.ot-badge {
    background: #ccfbf1;
    color: #0f766e;
    border: 1px solid #99f6e4;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.diagnostic-badge {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.ipd-badge {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.pharmacy-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.emergency-form-wrapper,
.ot-form-wrapper,
.diagnostic-form-wrapper,
.results-form-wrapper,
.ipd-form-wrapper,
.pharmacy-form-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100% - 37px);
    min-height: 0;
}

.emergency-form-body,
.ot-form-body,
.diagnostic-form-body,
.results-form-body,
.ipd-form-body,
.pharmacy-form-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.billing-demographics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
}

.billing-demographics-grid.ot {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.billing-demographics-grid label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    position: relative;
}

.billing-demographics-grid label > span {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.billing-demographics-grid label > span .req {
    color: #dc2626;
    font-weight: 800;
}

.billing-section-heading {
    font-size: 11.5px;
    font-weight: 800;
    color: #1e293b;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.billing-line-editor {
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1.4fr) 90px 65px auto;
    gap: 6px;
    align-items: end;
    padding: 5px 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.billing-line-editor.ot {
    grid-template-columns: minmax(170px, 1.3fr) minmax(130px, 0.9fr) 90px 65px auto;
}

.billing-line-editor label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.billing-line-editor label span {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

/* Diagnostic Test Searchable Combobox */
.diagnostic-test-search-field {
    position: relative;
    width: 100%;
    min-width: 0;
}

.diagnostic-test-combo {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.diagnostic-test-combo input.classic-input {
    width: 100%;
    padding-right: 26px !important;
    text-overflow: ellipsis;
}

.diagnostic-test-combo input.test-selected-input {
    font-weight: 750 !important;
    color: #0369a1 !important;
    background: #f0f9ff !important;
    border-color: #0284c7 !important;
}

.diagnostic-test-clear {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
}

.diagnostic-test-clear:hover {
    color: #dc2626;
    background: #fee2e2;
}

.diagnostic-test-search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    opacity: 0.45;
    pointer-events: none;
}

.diagnostic-test-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: min(520px, 180%);
    max-height: 280px;
    z-index: 1050;
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diag-test-sugg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.diag-test-sugg-hint {
    font-size: 9.5px;
    color: #0284c7;
    font-weight: 600;
    text-transform: none;
}

.diag-test-sugg-list {
    overflow-y: auto;
    max-height: 245px;
}

.diag-test-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6.5px 10px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.1s ease;
    user-select: none;
}

.diag-test-option:last-child {
    border-bottom: none;
}

.diag-test-option:hover,
.diag-test-option.active {
    background: #e0f2fe;
}

.diag-test-option.selected {
    background: #bae6fd;
    font-weight: 700;
}

.diag-test-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.diag-test-code {
    font-size: 10px;
    font-weight: 800;
    color: #0284c7;
    background: #f0f9ff;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #bae6fd;
    flex-shrink: 0;
}

.diag-test-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diag-test-rate {
    font-size: 11.5px;
    font-weight: 800;
    color: #059669;
    margin-left: 10px;
    flex-shrink: 0;
}


.billing-line-table-wrap {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    max-height: 125px;
    min-height: 55px;
}

.billing-line-head {
    display: grid;
    grid-template-columns: 36px minmax(140px, 1fr) 85px 50px 95px 32px;
    gap: 6px;
    align-items: center;
    padding: 5px 10px;
    background: #e2e8f0;
    color: #334155;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 10px;
    flex-shrink: 0;
}

.billing-line-head.ot {
    grid-template-columns: 36px minmax(120px, 1fr) minmax(110px, 0.8fr) 95px 85px 32px;
}

.billing-line-rows {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.billing-line-row {
    display: grid;
    grid-template-columns: 36px minmax(140px, 1fr) 85px 50px 95px 32px;
    gap: 6px;
    align-items: center;
    padding: 4px 10px;
    border-top: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 11.5px;
}

.billing-line-row.ot {
    grid-template-columns: 36px minmax(120px, 1fr) minmax(110px, 0.8fr) 95px 85px 32px;
}

.billing-line-row:hover {
    background: #f8fafc;
}

.billing-line-row strong {
    text-align: right;
    color: #0f172a;
    font-weight: 750;
}

.billing-line-row button {
    border: none;
    background: transparent;
    color: #ef4444;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    border-radius: 3px;
}

.billing-line-row button:hover {
    background: #fee2e2;
}

.billing-bottom-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 10px;
    align-items: start;
}

.billing-bottom-summary.align-end {
    grid-template-columns: 1fr;
    justify-items: end;
}

.billing-remarks-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.billing-remarks-box span {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.billing-remarks-box textarea {
    resize: none;
    height: 48px !important;
    min-height: 48px !important;
    font-size: 11.5px !important;
    padding: 3px 8px !important;
    line-height: 1.35 !important;
}

.billing-totals-compact {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    width: 280px;
}

.billing-totals-compact > div,
.billing-totals-compact > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2.5px 10px;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11.5px;
    color: #334155;
}

.billing-totals-compact > div strong {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.billing-totals-compact .grand-due {
    background: #eff6ff;
    border-bottom: none;
    font-weight: 800;
    color: #0369a1;
}

.billing-totals-compact .grand-due strong {
    color: #0284c7;
    font-size: 13px;
}

.billing-totals-compact input {
    width: 95px !important;
    height: 23px !important;
    padding: 1px 6px !important;
    text-align: right;
    font-size: 11.5px !important;
    font-weight: 700;
}

.emergency-form-footer,
.ot-form-footer,
.diagnostic-form-footer,
.results-form-footer,
.ipd-form-footer,
.pharmacy-form-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.worklist-metrics-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.worklist-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.worklist-metric-pill.amber {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.worklist-metric-pill.violet {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.worklist-metric-pill.green {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.worklist-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.results-patient-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
}

.results-patient-strip span {
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    display: block;
}

.results-patient-strip strong {
    color: #0f172a;
    display: block;
}

.results-test-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.results-param-table-wrap {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow-y: auto;
    max-height: 180px;
    min-height: 80px;
    flex: 1 1 auto;
}

.billing-queue-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.billing-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.15s ease;
    gap: 8px;
    cursor: pointer;
}

.billing-queue-item:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.08);
}

.billing-queue-item.active {
    border-color: #0284c7;
    background: #f0fdf4;
}

.billing-queue-serial {
    font-size: 12.5px;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.billing-queue-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.billing-queue-name {
    font-size: 13px;
    font-weight: 750;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.billing-queue-meta {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.billing-queue-amount {
    font-size: 11.5px;
    font-weight: 800;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}

.billing-queue-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

@media (max-height: 720px) {
    .emergency-classic-topbar,
    .ot-classic-topbar,
    .diagnostic-classic-topbar,
    .worklist-classic-topbar,
    .results-classic-topbar,
    .ipd-classic-topbar,
    .pharmacy-classic-topbar {
        min-height: 38px;
        padding: 4px 10px;
    }
    .emergency-card-header,
    .emergency-queue-top,
    .ot-card-header,
    .ot-queue-top,
    .diagnostic-card-header,
    .diagnostic-queue-top,
    .worklist-header,
    .results-card-header,
    .results-queue-top,
    .ipd-card-header,
    .ipd-queue-top,
    .pharmacy-card-header,
    .pharmacy-queue-top {
        padding: 5px 10px;
    }
    .emergency-form-body,
    .ot-form-body,
    .diagnostic-form-body,
    .results-form-body,
    .ipd-form-body,
    .pharmacy-form-body {
        padding: 6px 10px;
        gap: 5px;
    }
    .billing-demographics-grid {
        gap: 5px;
        padding: 6px 8px;
    }
    .billing-line-editor {
        padding: 6px 8px;
        gap: 4px;
    }
    .billing-line-table-wrap {
        max-height: 110px;
    }
    .billing-queue-item {
        padding: 4px 8px;
    }
}

/* ==========================================================================
   Doctor Appointments - Modern UX Enhancements
   ========================================================================== */

.appt-date-chips {
    display: flex;
    gap: 3px;
}

.appt-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.appt-chip:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.appt-chip.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Patient Section */
.appt-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 2.5px;
    border-radius: 7px;
    gap: 3px;
    border: 1px solid #e2e8f0;
}

.appt-mode-btn {
    border: none;
    background: transparent;
    padding: 3.5px 10px;
    font-size: 11px;
    font-weight: 650;
    color: #64748b;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap !important;
    transition: all 0.15s ease;
}

.appt-mode-btn svg {
    flex-shrink: 0;
}

.appt-mode-btn:hover {
    color: #1e293b;
}

.appt-mode-btn.active {
    background: #ffffff;
    color: #0284c7;
    font-weight: 750;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.appt-patient-verified {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.appt-patient-verified-info {
    font-size: 11.5px;
    color: #166534;
    line-height: 1.35;
}

.appt-patient-verified-info strong {
    color: #14532d;
    font-size: 12px;
}

.appt-clear-link {
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    text-decoration: underline;
}

.appt-clear-link:hover {
    background: #fee2e2;
}

.appt-footer-primary-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Right Side: Schedule & Live Queue */
.appt-queue-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.appt-date-sub {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
}

.appt-scope-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
    gap: 2px;
}

.appt-scope-tab {
    border: none;
    background: transparent;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.appt-scope-tab.active {
    background: #ffffff;
    color: #0369a1;
    font-weight: 750;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.appt-scope-tab .count-pill {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 750;
}

.appt-scope-tab.active .count-pill {
    background: #0284c7;
    color: #ffffff;
}

.appt-queue-filter-strip {
    padding: 5px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.appt-status-chips {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s ease;
}

.status-chip:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.status-chip.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    font-weight: 700;
}

.status-chip.booked.active {
    background: #0284c7;
    border-color: #0284c7;
}

.status-chip.checkedin.active {
    background: #16a34a;
    border-color: #16a34a;
}

.appt-serial-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    min-width: 44px;
}

.appt-queue-item.checkedin-item .appt-queue-serial {
    color: #15803d;
    background: #dcfce7;
}

.appt-time-pill {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.appt-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.appt-queue-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.meta-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}

.meta-tag.id-tag {
    background: #f1f5f9;
    color: #0369a1;
}

.meta-tag.walkin-tag {
    background: #fef3c7;
    color: #92400e;
}

.meta-tag.sex-tag-male {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.meta-tag.sex-tag-female {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
}

.meta-tag.sex-tag-other {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.meta-doc {
    font-weight: 600;
    color: #475569;
}

.meta-sep {
    color: #cbd5e1;
}

.appt-action-checkin {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    height: 25px;
    border-radius: 4px;
    background: #16a34a;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: background 0.12s;
}

.appt-action-checkin:hover {
    background: #15803d;
}

.appt-tool-btn {
    width: 25px;
    height: 25px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    cursor: pointer;
    color: #475569;
    transition: all 0.12s;
}

.appt-tool-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.appt-tool-btn.danger:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* ==========================================================================
   Doctors Master & Priority Setup - Classic Non-Scrolling Viewport Layout
   ========================================================================== */

.doc-master-classic-fit {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.main-content:has(.doc-master-classic-fit) {
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content:has(.doc-master-classic-fit) > .topbar,
.main-content:has(.doc-master-classic-fit) > .desktop-menu-host {
    flex: 0 0 auto;
}

.main-content:has(.doc-master-classic-fit) > .page-content {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden !important;
    padding: 6px 14px 8px !important;
}

html:has(.doc-master-classic-fit),
body:has(.doc-master-classic-fit) {
    height: 100%;
    overflow: hidden !important;
}

/* Header bar */
.doc-master-header {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    flex-shrink: 0;
    min-height: 38px;
}

.doc-master-title-col {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.doc-back-link {
    font-size: 11px;
    color: #64748b;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}
.doc-back-link:hover {
    color: #0284c7;
    background: #e0f2fe;
}

.doc-master-heading {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.doc-header-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.doc-stat-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.doc-stat-pill:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.doc-stat-pill.selected {
    box-shadow: 0 0 0 2px #0284c7;
    border-color: #0284c7;
    background: #e0f2fe;
}

.doc-stat-pill .stat-label {
    color: #64748b;
    font-weight: 600;
}

.doc-stat-pill .stat-value {
    font-weight: 800;
    color: #0f172a;
}

.doc-stat-pill.active-pill {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.doc-stat-pill.active-pill .stat-value {
    color: #16a34a;
}
.doc-stat-pill.active-pill.selected {
    box-shadow: 0 0 0 2px #16a34a;
    border-color: #16a34a;
    background: #dcfce7;
}

.doc-stat-pill.inactive-pill {
    background: #fef2f2;
    border-color: #fecaca;
}
.doc-stat-pill.inactive-pill .stat-value {
    color: #dc2626;
}
.doc-stat-pill.inactive-pill.selected {
    box-shadow: 0 0 0 2px #dc2626;
    border-color: #dc2626;
    background: #fee2e2;
}

.doc-stat-pill.priority-pill {
    background: #fefce8;
    border-color: #fef08a;
}
.doc-stat-pill.priority-pill .stat-value {
    color: #ca8a04;
}
.doc-stat-pill.priority-pill.selected {
    box-shadow: 0 0 0 2px #ca8a04;
    border-color: #ca8a04;
    background: #fef9c3;
}

.doc-btn {
    height: 28px;
    font-size: 11px;
    font-weight: 600;
    padding: 0 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.doc-btn-add {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #0369a1 !important;
    font-weight: 700 !important;
}
.doc-btn-add:hover {
    background: #0369a1 !important;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25) !important;
}

.doc-btn-excel {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
}
.doc-btn-excel:hover {
    background: #dcfce7 !important;
    color: #14532d !important;
}

.doc-btn-print {
    background: #f8fafc !important;
    color: #0369a1 !important;
    border: 1px solid #cbd5e1 !important;
}
.doc-btn-print:hover {
    background: #e0f2fe !important;
    color: #0284c7 !important;
}

/* Alert Notification */
.doc-alert {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.doc-alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.doc-alert.danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.doc-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 12px;
}

/* Main Grid (Full-Width Responsive Table) */
.doc-master-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.doc-list-card {
    flex: 1 1 auto;
    width: 100%;
}

/* Slide-Over Drawer for Doctor Add / Edit */
.doc-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1050;
    animation: docFadeIn 0.2s ease-out;
}

.doc-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 540px;
    max-width: 95vw;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.22);
    z-index: 1051;
    display: flex;
    flex-direction: column;
    animation: docSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes docFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes docSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.doc-drawer-header {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.doc-drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.doc-drawer-icon {
    font-size: 18px;
    line-height: 1;
}

.doc-drawer-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.doc-drawer-sub {
    font-size: 10.5px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.doc-drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-drawer-close {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.doc-drawer-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.doc-drawer-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.doc-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.doc-drawer-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.doc-section-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 750;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f1f5f9;
}

.doc-offday-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.doc-day-chip {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.12s ease;
}

.doc-day-chip:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.doc-day-chip.selected {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    font-weight: 750;
}

.doc-drawer-footer {
    padding: 10px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.doc-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.doc-card-header {
    padding: 8px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.doc-card-header h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.doc-card-sub {
    font-size: 10px;
    color: #64748b;
    margin-left: 6px;
}

.doc-status-badge {
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 750;
}
.doc-status-badge.active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.doc-status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Left Form Body - Comfortable, un-congested spacing */
.doc-form-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.doc-form-fields {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
}

.doc-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.doc-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-title-field {
    width: 80px;
    flex-shrink: 0;
}

.doc-name-field {
    flex: 1;
    min-width: 0;
}

/* Uniform, perfectly aligned labels */
.doc-label {
    height: 16px !important;
    min-height: 16px !important;
    margin: 0 0 3px 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.25px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    line-height: 16px !important;
    width: auto !important;
    box-sizing: border-box !important;
}

.doc-label .req {
    display: inline !important;
    color: #dc2626 !important;
    margin-left: 3px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
}

.doc-label-hint {
    font-weight: 500;
    color: #94a3b8;
    text-transform: none;
    margin-left: 3px;
}

/* Comfortable, modern input styling */
.doc-form-fields .classic-input {
    height: 28px !important;
    min-height: 28px !important;
    font-size: 11px !important;
    padding: 3px 8px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
}

.doc-form-fields .classic-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 1.5px rgba(2, 132, 199, 0.2) !important;
}

/* Priority & Status Control Box */
.doc-priority-control-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 3px;
}

.doc-priority-input {
    height: 26px !important;
    font-weight: 800;
    color: #0369a1 !important;
    background: #ffffff !important;
}

.doc-status-toggle {
    display: flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 5px;
    gap: 2px;
    height: 26px;
}

.doc-toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.doc-toggle-btn.active {
    background: #16a34a;
    color: #ffffff;
    font-weight: 750;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.doc-toggle-btn.inactive {
    background: #dc2626;
    color: #ffffff;
    font-weight: 750;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.doc-help-text {
    font-size: 8.5px;
    color: #64748b;
    line-height: 1.25;
    margin-top: 2px;
    display: block;
}

.doc-form-footer {
    padding: 7px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 42px;
    box-sizing: border-box;
}

/* Right Table Card */
.doc-filter-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 10px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.doc-filter-row {
    width: 100%;
    display: flex;
    gap: 6px;
    align-items: center;
}

.doc-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.doc-search-icon {
    position: absolute;
    left: 8px;
    font-size: 11px;
    color: #94a3b8;
    pointer-events: none;
}

.doc-search-input {
    width: 100%;
    height: 27px !important;
    padding-left: 26px !important;
    padding-right: 22px !important;
    font-size: 11px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
}

.doc-search-clear {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
}

.doc-dept-select {
    width: 160px;
    height: 27px !important;
    font-size: 11px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    box-sizing: border-box !important;
}

.doc-category-select {
    width: 150px;
    height: 27px !important;
    font-size: 11px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    box-sizing: border-box !important;
}

.doc-status-chips-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-status-chips {
    display: flex;
    gap: 4px;
    align-items: center;
}

.doc-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s ease;
    line-height: 1.2;
}

.doc-chip:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.doc-chip.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    font-weight: 700;
}

.doc-found-count {
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

/* Table Container (Internal scrolling with Sticky Header) */
.doc-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: auto;
    position: relative;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.doc-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 750;
    color: #475569;
    text-transform: uppercase;
    border-bottom: 1px solid #cbd5e1;
    box-shadow: 0 1px 0 #cbd5e1;
    letter-spacing: 0.2px;
}

.doc-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.doc-table tr:hover td {
    background: #f8fafc;
}

.doc-table tr.selected-row td {
    background: #eff6ff;
}

.doc-table tr.inactive-row td {
    opacity: 0.65;
    background: #fafafa;
}

.doc-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}

.doc-priority-none {
    color: #cbd5e1;
    font-weight: 700;
}

.doc-name-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.doc-name-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-avatar-pill {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #bae6fd;
    text-transform: uppercase;
}

.doc-title-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.doc-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.doc-name-line strong {
    color: #0f172a;
    font-size: 12px;
}

.doc-sched-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doc-sched-pill {
    font-size: 10px;
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.doc-offday-pill {
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.doc-contact-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.doc-contact-link {
    font-size: 10.5px;
    font-weight: 700;
    color: #0284c7;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.doc-contact-link:hover {
    text-decoration: underline;
    color: #0369a1;
}

.doc-email-link {
    font-size: 9.5px;
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 170px;
}
.doc-email-link:hover {
    text-decoration: underline;
    color: #0f172a;
}

.doc-address-text {
    font-size: 9.5px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.doc-id-tag {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 0 4px;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
}

/* Doctor Type badges */
.doc-type-badge {
    font-size: 8.5px;
    font-weight: 750;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1.2;
    white-space: nowrap;
}
.doc-type-badge.badge-perm {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.doc-type-badge.badge-res {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}
.doc-type-badge.badge-cont {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.doc-type-badge.badge-other {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.doc-degree-text {
    font-size: 10px;
    color: #64748b;
    line-height: 1.2;
}

.doc-contact-text {
    font-size: 9.5px;
    color: #0284c7;
    font-weight: 600;
}

.doc-dept-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.doc-dept-name {
    font-weight: 600;
    color: #334155;
    font-size: 10.5px;
}

.doc-room-text {
    font-size: 10px;
    color: #92400e;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.doc-text-muted {
    color: #cbd5e1;
    font-weight: 700;
}

.doc-status-btn {
    border: none;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 9.5px;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.doc-status-btn.btn-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.doc-status-btn.btn-active:hover {
    background: #bbf7d0;
}

.doc-status-btn.btn-inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.doc-status-btn.btn-inactive:hover {
    background: #fecaca;
}

.doc-edit-btn {
    padding: 1px 6px;
    height: 22px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 3px;
}

.doc-empty-cell {
    padding: 28px 10px;
    text-align: center;
}

.doc-empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #64748b;
}
.doc-empty-box span {
    font-size: 20px;
}

.doc-table-footer {
    padding: 5px 10px;
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    height: 30px;
    box-sizing: border-box;
}

.doc-pager-info {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
}

.doc-pager-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}

.doc-page-btn {
    width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0369a1;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 0;
}
.doc-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.doc-page-indicator {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
    padding: 0 4px;
}

.appt-priority-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
    font-size: 10px;
    font-weight: 800;
    padding: 0 5px;
    border-radius: 3px;
    margin-right: 4px;
    line-height: 1.4;
}

/* ==========================================================================
   DOCTORS COMMISSION & REFERRAL SETUP (SECTIONS & PAYOUT ANALYSIS)
   ========================================================================== */
.doc-section-switcher {
    display: flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
    gap: 2px;
    margin-left: 10px;
}

.doc-section-tab {
    border: none;
    background: transparent;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.doc-section-tab:hover {
    color: #0f172a;
}

.doc-section-tab.active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.doc-comm-pill {
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 9.5px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.doc-comm-default {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.doc-comm-custom {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fde047;
}

.doc-preset-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.doc-preset-label {
    font-size: 11px;
    font-weight: 750;
    color: #475569;
}

.doc-preset-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    cursor: pointer;
    transition: all 0.12s ease;
}
.doc-preset-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.doc-bulk-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.doc-bulk-input {
    width: 65px !important;
    height: 25px !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    text-align: center !important;
    padding: 1px 4px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

.doc-bulk-input::-webkit-outer-spin-button,
.doc-bulk-input::-webkit-inner-spin-button,
.doc-cat-input::-webkit-outer-spin-button,
.doc-cat-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.doc-bulk-input,
.doc-cat-input {
    -moz-appearance: textfield;
}

.doc-cat-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 7px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px 4px 20px 4px;
}

.doc-cat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.doc-cat-name {
    font-size: 11.5px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.doc-cat-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 76px;
    flex-shrink: 0;
}

.doc-cat-input {
    width: 58px !important;
    height: 25px !important;
    text-align: right !important;
    font-weight: 750 !important;
    font-size: 11.5px !important;
    padding: 1px 6px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* Referral Analysis KPIs */
.doc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.doc-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.doc-kpi-title {
    font-size: 10px;
    font-weight: 750;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.doc-kpi-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.doc-kpi-card.blue .doc-kpi-val { color: #0284c7; }
.doc-kpi-card.green .doc-kpi-val { color: #16a34a; }
.doc-kpi-card.amber .doc-kpi-val { color: #d97706; }
.doc-kpi-card.purple .doc-kpi-val { color: #7c3aed; }

.doc-date-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
}

.doc-date-bar label {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-date-input {
    height: 26px !important;
    font-size: 11px !important;
    padding: 2px 6px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
}

.doc-calc-btn {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #0369a1 !important;
    font-weight: 700 !important;
    height: 26px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.doc-calc-btn:hover {
    background: #0369a1 !important;
}

/* ==========================================================================
   USER ADMIN & ROLES MODERN DESIGN REFINEMENT (STRICT ZERO-SCROLL FIT)
   ========================================================================== */
body:has(.useradmin-container) {
    overflow: hidden !important;
}

.page-content:has(.useradmin-container) {
    padding: 8px 16px 8px 16px !important;
    height: calc(100vh - 142px) !important;
    max-height: calc(100vh - 142px) !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.useradmin-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.useradmin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.useradmin-header-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.useradmin-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #0284c7;
}

.useradmin-header h1 {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.2px;
}

.useradmin-header p {
    font-size: 11px;
    color: #64748b;
    margin: 0;
}

.useradmin-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.useradmin-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.useradmin-stat-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.useradmin-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    animation: fadeIn 0.2s ease-in-out;
    flex-shrink: 0;
}

.useradmin-alert-body {
    display: flex;
    align-items: center;
    gap: 6px;
}

.useradmin-alert-close {
    background: transparent;
    border: none;
    font-size: 15px;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 3px;
}
.useradmin-alert-close:hover {
    opacity: 1;
}

.useradmin-layout {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

@media (max-width: 1080px) {
    .page-content:has(.useradmin-container) {
        height: auto !important;
        overflow: auto !important;
    }
    body:has(.useradmin-container) {
        overflow: auto !important;
    }
    .useradmin-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    .useradmin-container {
        height: auto;
        overflow: visible;
    }
}

.useradmin-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.useradmin-card.editor-card {
    border-top: 3px solid #0284c7;
    overflow-y: auto;
}

.useradmin-card.list-card {
    border-top: 3px solid #6366f1;
    overflow: hidden;
}

.useradmin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    min-height: 44px;
    flex-shrink: 0;
}

.useradmin-card-title-group {
    display: flex;
    align-items: center;
    gap: 7px;
}

.useradmin-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    flex-shrink: 0;
}

.icon-editor {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.icon-list {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.useradmin-card-heading {
    display: flex;
    flex-direction: column;
}

.useradmin-card-heading h2 {
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.15;
}

.useradmin-card-heading small {
    font-size: 10px;
    color: #64748b;
}

.badge-mode-new {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.badge-mode-edit {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* User Admin Form Styling */
.useradmin-form-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.useradmin-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: stretch !important;
    text-align: left !important;
}

.useradmin-field-label {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: left !important;
    font-size: 10.5px;
    font-weight: 700;
    color: #334155;
    gap: 5px;
    width: 100%;
}

.useradmin-field-label span {
    text-align: left !important;
    display: inline-block !important;
}

.useradmin-field-label span.req {
    color: #e11d48;
}

.useradmin-field-label small {
    font-size: 9.5px;
    color: #64748b;
    font-weight: 500;
}

.useradmin-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.useradmin-input, .useradmin-select {
    width: 100%;
    min-height: 31px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 11.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    text-align: left;
    transition: all 0.15s ease;
}

.useradmin-input:focus, .useradmin-select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

.useradmin-input:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* Password Input with Show/Hide Eye and Auto-Generate Button */
.user-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.user-password-input {
    width: 100%;
    min-height: 31px;
    padding: 4px 68px 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 11.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    text-align: left;
    transition: all 0.15s ease;
}

.user-password-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

.user-password-actions {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
}

.btn-toggle-eye {
    background: transparent;
    border: none;
    color: #64748b;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-toggle-eye:hover {
    color: #0284c7;
    background: #f1f5f9;
}

.btn-quick-generate {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0284c7;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: all 0.15s ease;
}

.btn-quick-generate:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.pass-rules-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.15;
    text-align: left;
}

.pass-rules-hint svg {
    color: #0284c7;
    flex-shrink: 0;
}

/* Active Account Switch */
.user-active-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 6px 8px;
    margin-top: 1px;
}

.switch-control {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.2s;
    border-radius: 16px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.switch-control input:checked + .switch-slider {
    background-color: #22c55e;
}

.switch-control input:checked + .switch-slider:before {
    transform: translateX(14px);
}

.switch-label-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.switch-label-group strong {
    font-size: 10.5px;
    color: #0f172a;
    font-weight: 700;
}

.switch-label-group small {
    font-size: 9px;
    color: #64748b;
}

/* Form Actions */
.useradmin-form-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.btn-user-submit {
    flex: 1;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #0284c7;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid #0284c7;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-user-submit:hover {
    background: #0369a1;
    border-color: #0369a1;
}

.btn-user-unlock {
    min-height: 31px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #fde68a;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-user-unlock:hover {
    background: #fde68a;
}

.btn-user-reset {
    min-height: 31px;
    padding: 0 10px;
    background: #ffffff;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-user-reset:hover {
    background: #f8fafc;
    color: #334155;
    border-color: #94a3b8;
}

/* Staff Directory Toolbar */
.staff-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.staff-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 180px;
    flex-shrink: 0;
}

.staff-search-wrap svg {
    position: absolute;
    left: 7px;
    color: #94a3b8;
    pointer-events: none;
}

.staff-search-input {
    width: 100%;
    min-height: 28px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 3px 20px 3px 24px;
    font-size: 10.5px;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

.staff-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.staff-search-clear {
    position: absolute;
    right: 5px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.staff-select-filter {
    min-height: 28px;
    width: 105px;
    flex-shrink: 0;
    padding: 2px 5px;
    font-size: 10.5px;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    outline: none;
}

.staff-select-filter:focus {
    border-color: #6366f1;
}

/* Staff Table */
.useradmin-table-wrap {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    min-height: 0 !important;
    max-height: none !important;
    height: 100%;
}

.useradmin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.useradmin-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1;
}

.useradmin-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.useradmin-table tbody tr:hover {
    background: #f8fafc;
}

.useradmin-table tbody tr.row-selected {
    background: #eff6ff !important;
    border-left: 3px solid #0284c7;
}

.useradmin-table td {
    padding: 7px 10px;
    vertical-align: middle;
}

/* User Identity Cell */
.user-identity-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.user-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.avatar-admin { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); }
.avatar-doctor { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); }
.avatar-reception { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); }
.avatar-cashier { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.avatar-nurse { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.avatar-lab { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.avatar-pharmacy { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.avatar-authorizer { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%); }
.avatar-default { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }

.user-names-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}

.user-display-name {
    font-weight: 750;
    color: #0f172a;
    font-size: 11.5px;
    line-height: 1.2;
}

.user-sub-meta {
    font-size: 10px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Semantic Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.2;
}

.role-badge-admin {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.role-badge-doctor {
    background: #ccfbf1;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.role-badge-reception {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.role-badge-cashier {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.role-badge-nurse {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.role-badge-lab {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.role-badge-pharmacy {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

.role-badge-authorizer {
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

.role-badge-default {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Status Pill with dot */
.user-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 12px;
}

.status-active {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-active .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
}

.status-inactive {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-inactive .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ef4444;
}

.created-date-cell {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
}

/* Edit Row Button */
.btn-table-edit {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0369a1;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-table-edit:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.empty-staff-state {
    padding: 30px 16px;
    text-align: center;
    color: #94a3b8;
}

/* ==========================================================================
   DOCTOR LINK POP-UP MODAL (ZERO SCROLLBAR ON FORM)
   ========================================================================== */
.useradmin-card.editor-card {
    border-top: 3px solid #0284c7;
    overflow: hidden !important; /* Strictly prevent any scrollbar on the form card */
}

.doctor-link-card {
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    padding: 6px 10px;
    border-radius: 6px;
    position: relative;
}

.btn-select-doctor-trigger {
    width: 100%;
    min-height: 33px;
    padding: 5px 10px;
    background: #ffffff;
    border: 1.5px dashed #0d9488;
    border-radius: 6px;
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}
.btn-select-doctor-trigger:hover {
    background: #f0fdfa;
    border-color: #0f766e;
}

.trigger-icon-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trigger-action-badge {
    background: #0d9488;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 750;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.btn-doc-change {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f766e;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-doc-change:hover {
    background: #0d9488;
    color: #ffffff;
    border-color: #0d9488;
}

.selected-doctor-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ffffff;
    border: 1.5px solid #14b8a6;
    border-radius: 6px;
    padding: 5px 9px;
    transition: all 0.15s ease;
    text-align: left;
}

.doc-badge-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.doc-badge-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.doc-badge-details strong {
    font-size: 11.5px;
    color: #0f766e;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-badge-details small {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Backdrop and Dialog */
.doctor-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.doctor-modal-dialog {
    width: 580px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 60px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
    border: 1px solid #e2e8f0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.doctor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.doctor-modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doctor-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.doctor-modal-heading h3 {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.doctor-modal-heading small {
    font-size: 11px;
    color: #64748b;
}

.doctor-modal-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.doctor-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.doctor-modal-search-wrap {
    padding: 10px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    flex-shrink: 0;
}

.doctor-modal-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.doctor-modal-search-box svg {
    position: absolute;
    left: 11px;
    color: #0d9488;
    pointer-events: none;
}

.doctor-modal-search-input {
    width: 100%;
    min-height: 36px;
    padding: 6px 30px 6px 34px;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    font-size: 12px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: all 0.15s ease;
}
.doctor-modal-search-input:focus {
    border-color: #0d9488;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.doctor-modal-search-clear {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
}

.doctor-modal-list {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
    min-height: 180px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doctor-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}
.doctor-modal-item:hover {
    border-color: #0d9488;
    background: #f0fdfa;
    transform: translateX(2px);
}
.doctor-modal-item.active-selected {
    border-color: #0d9488;
    background: #ccfbf1;
}

.doctor-modal-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.doc-modal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-modal-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-modal-name {
    font-size: 12px;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.25;
}

.doc-modal-meta {
    font-size: 10.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

.doc-modal-dept-badge {
    background: #f1f5f9;
    color: #334155;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
}

.btn-modal-choose {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f766e;
    font-size: 10.5px;
    font-weight: 750;
    padding: 4px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.doctor-modal-item:hover .btn-modal-choose {
    background: #0d9488;
    color: #ffffff;
    border-color: #0d9488;
}

.doctor-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.doctor-modal-footer-count {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.btn-modal-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 5px;
    cursor: pointer;
}
.btn-modal-cancel:hover {
    background: #f1f5f9;
}

.doc-modal-empty {
    padding: 30px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

/* ==========================================================================
   Emergency Services Classic Non-Scroll Mode & Pop-up Modals
   ========================================================================== */

.emergency-classic-fit {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    overflow: hidden !important;
}

.main-content:has(.emergency-classic-fit) > .page-content {
    overflow: hidden !important;
    padding: 6px 14px 6px !important;
    display: flex;
    flex-direction: column;
}

.emergency-classic-fit .emergency-form-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
}

.emergency-classic-fit .emergency-form-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100% - 37px);
    min-height: 0;
    overflow: hidden !important;
}

.emergency-classic-fit .emergency-form-body {
    overflow: hidden !important;
    padding: 6px 12px !important;
    gap: 6px !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.emergency-classic-fit .billing-demographics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 5px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    flex-shrink: 0;
}

.emergency-classic-fit .billing-demographics-grid label,
.billing-doc-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.emergency-classic-fit .billing-demographics-grid label > span,
.billing-doc-col .classic-field-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
}

.emergency-classic-fit .billing-demographics-grid .classic-input {
    height: 27px !important;
    min-height: 27px !important;
    font-size: 11.5px !important;
    padding: 2px 7px !important;
}

.emergency-classic-fit .billing-demographics-grid .btn-find {
    height: 27px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
}

/* Attending Doctor Badge & Trigger in Demographics */
.btn-emergency-doc-trigger {
    height: 27px;
    min-height: 27px;
    background: #f0fdf4;
    border: 1px dashed #16a34a;
    border-radius: 4px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.btn-emergency-doc-trigger:hover {
    background: #dcfce7;
    border-color: #15803d;
}

.btn-emergency-doc-trigger .doc-trigger-text {
    font-size: 11.5px;
    font-weight: 700;
    color: #15803d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emergency-selected-doctor-badge {
    height: 27px;
    min-height: 27px;
    background: #f8fafc;
    border: 1.5px solid #0284c7;
    border-radius: 4px;
    padding: 1px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.emergency-selected-doctor-badge .doc-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.emergency-selected-doctor-badge .doc-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.1;
}

.emergency-selected-doctor-badge .doc-meta strong {
    font-size: 11px;
    color: #0369a1;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emergency-selected-doctor-badge .doc-meta small {
    font-size: 9.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emergency-selected-doctor-badge .doc-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.emergency-selected-doctor-badge .btn-doc-edit,
.emergency-selected-doctor-badge .btn-doc-clear {
    border: none;
    background: transparent;
    font-size: 11px;
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
}

.emergency-selected-doctor-badge .btn-doc-edit:hover {
    background: #e0f2fe;
}

.emergency-selected-doctor-badge .btn-doc-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Line Editor Section */
.emergency-classic-fit .billing-line-editor {
    display: grid;
    grid-template-columns: minmax(110px, 0.75fr) minmax(150px, 1.25fr) 80px 52px auto;
    gap: 5px;
    padding: 4px 8px;
    align-items: end;
    flex-shrink: 0;
}

.emergency-classic-fit .billing-line-editor .classic-input {
    height: 27px !important;
    min-height: 27px !important;
    font-size: 11.5px !important;
    padding: 2px 7px !important;
}

.billing-line-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.billing-line-btn-group .btn-add-line {
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    height: 27px;
}

.billing-line-btn-group .btn-browse-catalog {
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    height: 27px;
    white-space: nowrap;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.billing-line-btn-group .btn-browse-catalog:hover {
    background: #bae6fd;
}

/* Table Area in Classic Fit: Fully Flexed Inside Available Height */
.emergency-classic-fit .billing-line-table-wrap {
    flex: 1 1 auto;
    min-height: 75px;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
}

.emergency-classic-fit .billing-line-rows {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* Emergency Bottom Panel (Remarks Trigger + Compact Totals Strip) */
.emergency-bottom-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 3px 10px;
    flex-shrink: 0;
    min-height: 36px;
}

.emergency-classic-fit .emergency-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #ffffff;
    flex-shrink: 0;
    min-height: 38px;
}

.emg-bottom-helpers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.btn-emg-remarks-trigger {
    border: 1px dashed #94a3b8;
    background: #ffffff;
    color: #475569;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-emg-remarks-trigger:hover {
    border-color: #4f46e5;
    background: #f5f3ff;
    color: #4f46e5;
}

.btn-emg-remarks-trigger .remarks-badge {
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9.5px;
    font-weight: 700;
}

.emg-remarks-chip {
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    overflow: hidden;
    transition: all 0.15s ease;
}

.emg-remarks-chip:hover {
    border-color: #6366f1;
    background: #e0e7ff;
}

.remarks-chip-content {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.remarks-chip-content .remarks-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
    color: #1e1b4b;
}

.remarks-edit-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
}

.emg-totals-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.emg-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
}

.emg-stat .stat-lbl {
    color: #64748b;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.emg-stat .stat-val {
    color: #0f172a;
    font-weight: 800;
    font-size: 12px;
}

.emg-stat.discount-stat {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    transition: all 0.15s ease;
}

.emg-stat.discount-stat:hover {
    background: #ecfdf5;
    border-color: #059669;
}

.emg-stat.discount-stat .stat-lbl-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.emg-stat.discount-stat .has-discount {
    color: #059669 !important;
}

.emg-paid-input {
    width: 76px !important;
    height: 25px !important;
    padding: 1px 5px !important;
    text-align: right;
    font-weight: 800;
    font-size: 12px !important;
    border: 1px solid #cbd5e1 !important;
}

.emg-stat.due-stat {
    background: #eff6ff;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
}

.emg-stat.due-stat .due-amount {
    color: #0284c7;
    font-size: 12.5px;
}

/* Modals: Remarks, Discount & Catalog */
.remarks-modal-dialog {
    width: 520px;
}

.remarks-modal-body {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.remarks-quick-chips,
.discount-quick-chips,
.authorizer-quick-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.quick-chip-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-right: 2px;
}

.quick-chip {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    padding: 2.5px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.quick-chip.active,
.quick-chip.is-selected {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
}

.remarks-textarea-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}

.remarks-modal-textarea {
    width: 100%;
    min-height: 90px;
    max-height: 160px;
    resize: vertical;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.remarks-char-counter {
    align-self: flex-end;
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 3px;
}

.discount-modal-dialog {
    width: 480px;
}

.discount-modal-body {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.discount-summary-banner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    gap: 8px;
}

.discount-summary-banner .summary-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.discount-summary-banner .summary-stat span {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.discount-summary-banner .summary-stat strong {
    font-size: 13.5px;
    font-weight: 800;
}

.discount-form-fields {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 10px;
}

.discount-form-fields label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.discount-form-fields label span {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.discount-warning-note {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
}

.service-modal-dialog {
    width: 700px;
    max-height: calc(100vh - 70px);
}

.service-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    max-height: 95px;
    overflow-y: auto;
}

.service-cat-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.service-cat-chip:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

.service-cat-chip.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    font-weight: 700;
}

.service-modal-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 12px;
}

.service-catalog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
    transition: background 0.15s;
}

.service-catalog-item:hover {
    background: #f8fafc;
}

.service-catalog-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.service-catalog-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-catalog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-cat-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

.service-rate-badge {
    color: #0284c7;
    font-weight: 800;
    font-size: 11.5px;
}

/* ==========================================================================
   OT Cash Memos Classic Non-Scroll Mode & Pop-up Modals
   ========================================================================== */

.ot-classic-fit {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    overflow: hidden !important;
}

.main-content:has(.ot-classic-fit) > .page-content {
    overflow: hidden !important;
    padding: 6px 14px 6px !important;
    display: flex;
    flex-direction: column;
}

.ot-classic-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    min-height: 32px;
}

.ot-classic-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(360px, 0.92fr);
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden !important;
}

.ot-classic-fit .ot-form-card,
.ot-classic-fit .ot-queue-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ot-card-header,
.ot-queue-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    min-height: 37px;
}

.ot-card-header h2,
.ot-queue-top h2 {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.ot-badge {
    font-size: 10px;
    font-weight: 800;
    color: #0d9488;
    background: #ccfbf1;
    border: 1px solid #99f6e4;
    padding: 2px 7px;
    border-radius: 4px;
}

.ot-classic-fit .ot-form-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100% - 37px);
    min-height: 0;
    overflow: hidden !important;
}

.ot-classic-fit .ot-form-body {
    overflow: hidden !important;
    padding: 6px 12px !important;
    gap: 6px !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.ot-classic-fit .billing-demographics-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.35fr 1.05fr 0.95fr;
    gap: 5px;
    padding: 5px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    flex-shrink: 0;
}

.ot-classic-fit .billing-section-heading {
    margin: 2px 0 1px;
    font-size: 11px;
    font-weight: 750;
    color: #334155;
}

.ot-classic-fit .billing-demographics-grid label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.ot-classic-fit .billing-demographics-grid label > span {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
}

.ot-classic-fit .billing-demographics-grid .classic-input {
    height: 27px !important;
    min-height: 27px !important;
    font-size: 11.5px !important;
    padding: 2px 7px !important;
}

.ot-classic-fit .billing-demographics-grid .btn-find {
    height: 27px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
}

.ot-classic-fit .billing-line-editor {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 4px 8px;
    flex-shrink: 0;
}

.ot-classic-fit .billing-line-editor .classic-input {
    height: 27px !important;
    min-height: 27px !important;
    font-size: 11.5px !important;
    padding: 2px 7px !important;
}

.ot-classic-fit .billing-line-table-wrap {
    flex: 1 1 auto;
    min-height: 75px;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
}

.ot-classic-fit .billing-line-rows {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.billing-line-head.ot,
.billing-line-row.ot {
    display: grid;
    grid-template-columns: 24px 1.4fr 1.2fr 100px 90px 24px;
    gap: 6px;
    align-items: center;
    padding: 4px 8px;
    font-size: 11.5px;
}

.ot-bottom-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 3px 10px;
    flex-shrink: 0;
    min-height: 36px;
}

.ot-bottom-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.ot-room-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 11px;
    font-weight: 750;
    padding: 2px 8px;
    border-radius: 12px;
}

.ot-auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.ot-classic-fit .ot-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #ffffff;
    flex-shrink: 0;
    min-height: 38px;
}

.ot-classic-fit .billing-queue-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 4px 6px;
}

/* ==========================================================================
   Canteen Sales, Products & Challan Classic Non-Scroll Mode
   ========================================================================== */

.canteen-classic-fit {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    overflow: hidden !important;
}

.main-content:has(.canteen-classic-fit) > .page-content {
    overflow: hidden !important;
    padding: 6px 14px 6px !important;
    display: flex;
    flex-direction: column;
}

.canteen-classic-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    min-height: 32px;
}

.canteen-classic-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(360px, 0.92fr);
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden !important;
}

.canteen-classic-fit .canteen-form-card,
.canteen-classic-fit .canteen-queue-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.canteen-card-header,
.canteen-queue-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    min-height: 37px;
}

.canteen-card-header h2,
.canteen-queue-top h2 {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.canteen-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    color: #0284c7;
    border: 1.5px solid #bfdbfe;
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 6px;
}

.canteen-badge {
    font-size: 10px;
    font-weight: 800;
    color: #d97706;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 2px 7px;
    border-radius: 4px;
}

.canteen-classic-fit .canteen-form-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100% - 37px);
    min-height: 0;
    overflow: hidden !important;
}

.canteen-classic-fit .canteen-form-body {
    overflow: hidden !important;
    padding: 6px 12px !important;
    gap: 6px !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.billing-demographics-grid.canteen-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr 0.85fr;
    gap: 5px;
    padding: 5px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    flex-shrink: 0;
}

.canteen-token-input-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.canteen-token-input-col > span {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
}

.canteen-debtor-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 3px 8px;
    margin-top: 3px;
}

.canteen-debtor-pill {
    background: #ffffff;
    border: 1px solid #f59e0b;
    color: #92400e;
    font-size: 10.5px;
    padding: 1px 7px;
    border-radius: 4px;
}

.canteen-line-editor {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 4px 8px;
    flex-shrink: 0;
}

.canteen-table-wrap {
    flex: 1 1 auto;
    min-height: 75px;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
}

.canteen-table-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 10px;
    font-weight: 750;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.canteen-table-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 11.5px;
    transition: background 0.1s ease;
}

.canteen-table-row:hover {
    background: #f8fafc;
}

.canteen-table-row.active {
    background: #eff6ff;
}

.btn-line-delete {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11.5px;
    cursor: pointer;
    border-radius: 3px;
    padding: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.btn-line-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.canteen-bottom-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 3px 10px;
    flex-shrink: 0;
    min-height: 36px;
}

.canteen-bottom-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.canteen-order-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.canteen-disc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 11px;
    font-weight: 750;
    padding: 2px 8px;
    border-radius: 12px;
}

.canteen-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #ffffff;
    flex-shrink: 0;
    min-height: 38px;
}

.canteen-queue-token {
    font-size: 9.5px;
    font-weight: 800;
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 0.5px 4px;
    border-radius: 3px;
}

.canteen-type-tag {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    margin-left: 3px;
}

/* Canteen Menu Modal */
.canteen-menu-dialog {
    width: 720px;
    max-height: calc(100vh - 60px);
}

.canteen-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 14px;
    overflow-y: auto;
    max-height: 380px;
}

.canteen-menu-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 72px;
}

.canteen-menu-card:hover {
    border-color: #f59e0b;
    background: #fffbeb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.menu-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-card-cat {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.menu-kitchen-tag {
    font-size: 9px;
    font-weight: 700;
    background: #fef3c7;
    color: #b45309;
    padding: 1px 4px;
    border-radius: 3px;
}

.menu-card-title {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.25;
    margin: 3px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-card-price {
    font-size: 12.5px;
    font-weight: 800;
    color: #0284c7;
}

.menu-card-stock {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
}

.menu-card-stock.low-stock {
    color: #dc2626;
    font-weight: 700;
}

.canteen-stock-pill {
    display: inline-block;
    padding: 1.5px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
}

.canteen-stock-pill.ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.canteen-stock-pill.low {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Thermal Canteen Token Receipt Print Format */
.canteen-token-sheet {
    width: 78mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 10px;
    font-family: 'Courier New', Courier, monospace, sans-serif;
    background: #ffffff;
    color: #000000;
}

.canteen-token-header {
    text-align: center;
    margin-bottom: 6px;
}

.canteen-token-header h3 {
    font-size: 13.5px;
    font-weight: 800;
    margin: 0;
    color: #000000;
    text-transform: uppercase;
}

.canteen-tagline {
    font-size: 10px;
    font-weight: 700;
    color: #333333;
    margin: 2px 0;
}

.canteen-token-num {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 1.5px;
    margin: 5px 0;
    border: 2px solid #000;
    display: inline-block;
    padding: 2px 14px;
    border-radius: 6px;
}

.canteen-token-bill {
    font-size: 10px;
    color: #444;
}

.canteen-cust-info {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    margin-top: 4px;
}

.canteen-token-divider {
    border-top: 1px dashed #000;
    margin: 6px 0;
}

.canteen-token-table {
    width: 100%;
    font-size: 11px;
    border-collapse: collapse;
    margin: 4px 0;
}

.canteen-token-table th,
.canteen-token-table td {
    padding: 2.5px 0;
}

.canteen-token-totals {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    margin-top: 4px;
}

.canteen-token-totals div {
    display: flex;
    justify-content: space-between;
}

.canteen-token-totals .grand-line {
    font-size: 13px;
    font-weight: 900;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 3px 0;
    margin: 2px 0;
}

.canteen-token-footer {
    text-align: center;
    margin-top: 8px;
    font-size: 9.5px;
}

/* ==========================================================================
   Diagnostics & Lab Module UX: Mega Dropdown, Workflow Tabs & OPD/IPD Toggle
   ========================================================================== */
.legacy-menu-dropdown.mega-diagnostic-dropdown {
    min-width: 340px;
    padding: 8px 6px;
    border-radius: 14px;
    border: 1px solid #94a3b8;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.legacy-menu-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    padding: 3.5px 8px;
    border-radius: 6px;
    margin: 5px 3px 3px;
    user-select: none;
}

.legacy-menu-header-icon {
    font-size: 11.5px;
}

.legacy-menu-entry.with-desc {
    padding: 6px 9px;
    min-height: 40px;
    border-radius: 8px;
    margin-bottom: 2px;
}

.legacy-menu-entry-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.legacy-menu-entry-icon {
    font-size: 15px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.legacy-menu-entry-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.legacy-menu-entry-label {
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    line-height: 1.25;
}

.legacy-menu-entry:hover .legacy-menu-entry-label,
.legacy-menu-entry.active .legacy-menu-entry-label {
    color: #0284c7;
}

.legacy-menu-entry-sub {
    font-size: 10px;
    color: #64748b;
    white-space: normal;
    line-height: 1.25;
    margin-top: 1px;
}

.legacy-menu-entry-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1.5px 6px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    flex-shrink: 0;
    margin-left: 6px;
}

/* Workflow Sub-Navigation Tabs across Diagnostic Pages */
.diagnostic-flow-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f1f5f9;
    padding: 2.5px 4px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.diagnostic-flow-tabs::-webkit-scrollbar {
    display: none;
}

.flow-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3.5px 9px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.flow-tab:hover {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.flow-tab.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
    font-weight: 700;
}

.flow-tab-icon {
    font-size: 12px;
}

.flow-tab-pill {
    font-size: 9px;
    font-weight: 800;
    padding: 0.5px 4px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #334155;
}

.flow-tab.active .flow-tab-pill {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* OPD / IPD billing destination selector */
.diagnostic-billing-type-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.diagnostic-card-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.diagnostic-billing-type-label {
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.diagnostic-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
}

.mode-toggle-btn {
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diagnostic-billing-type-picker .mode-toggle-btn {
    font-size: 10px;
    line-height: 1.1;
    padding: 4px 12px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.diagnostic-billing-type-picker .mode-toggle-btn .mode-toggle-text,
.diagnostic-billing-type-picker .mode-toggle-btn > span:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    text-align: left;
}

.diagnostic-billing-type-picker .mode-toggle-btn strong {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1px;
}

.diagnostic-billing-type-picker .mode-toggle-btn small {
    font-size: 9px;
    font-weight: 600;
    opacity: .85;
    margin-top: 1px;
}

.diagnostic-billing-type-picker .mode-toggle-icon {
    font-size: 13px;
    line-height: 1;
}

.mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
}

.mode-toggle-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.diagnostic-mode-toggle .mode-toggle-btn.opd-active {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: #ffffff !important;
    border-color: #15803d !important;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35) !important;
}

.diagnostic-mode-toggle .mode-toggle-btn.opd-active * {
    color: #ffffff !important;
}

.diagnostic-mode-toggle .mode-toggle-btn.ipd-active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
}

.diagnostic-mode-toggle .mode-toggle-btn.ipd-active * {
    color: #ffffff !important;
}

.diagnostic-mode-toggle .mode-toggle-btn.disabled-ipd-mode,
.diagnostic-mode-toggle .mode-toggle-btn:disabled {
    opacity: 0.38 !important;
    filter: grayscale(100%) blur(0.7px) !important;
    cursor: not-allowed !important;
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    border: 1px dashed #cbd5e1 !important;
    box-shadow: none !important;
    pointer-events: none !important;
    user-select: none !important;
}

.diagnostic-mode-toggle .mode-toggle-btn.disabled-ipd-mode *,
.diagnostic-mode-toggle .mode-toggle-btn:disabled * {
    color: #94a3b8 !important;
}

.diagnostic-mode-explainer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 5px 10px;
    border-bottom: 1px solid;
    flex-shrink: 0;
}

.diagnostic-mode-explainer.ipd {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.diagnostic-mode-explainer-icon {
    font-size: 16px;
    line-height: 1;
}

.diagnostic-mode-explainer-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.diagnostic-mode-explainer-copy > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.diagnostic-mode-explainer-copy strong {
    font-size: 11px;
    white-space: nowrap;
}

.diagnostic-mode-explainer-copy > div > span {
    font-size: 10px;
    line-height: 1.2;
}

@media (max-width: 1100px) {
    .diagnostic-billing-type-label,
    .diagnostic-billing-type-picker .mode-toggle-btn small {
        display: none;
    }

    .diagnostic-mode-explainer-copy > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 1px;
    }
}

/* ==========================================================================
   Doctor Prescription Workspace & Medication Builder Redesign
   ========================================================================== */
.rx-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
    gap: 16px;
    align-items: flex-start;
}

@media (max-width: 1200px) {
    .rx-workspace-grid {
        grid-template-columns: 1fr;
    }
}

.rx-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.rx-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.rx-card-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rx-patient-hero-badge {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.rx-patient-hero-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #0f172a;
}

.rx-med-builder-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    transition: all 0.15s ease;
}

.rx-med-builder-box:focus-within {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.rx-search-wrapper {
    position: relative;
    width: 100%;
}

.rx-search-input {
    width: 100%;
    height: 38px;
    padding: 6px 36px 6px 34px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.15s ease;
}

.rx-search-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.rx-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #64748b;
    pointer-events: none;
}

.rx-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.rx-search-clear:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.rx-med-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.18), 0 4px 6px -2px rgba(15, 23, 42, 0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}

.rx-med-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.rx-med-item:hover,
.rx-med-item.highlighted {
    background: #eff6ff;
}

.rx-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.rx-chip {
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}

.rx-chip:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.rx-chip.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.rx-calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
}

.rx-calc-badge.manual {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.rx-type-pill {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    background: #e0f2fe;
    color: #0369a1;
    margin-left: 6px;
}

.rx-selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

.rx-selected-pill .btn-clear {
    background: transparent;
    border: none;
    color: #0369a1;
    cursor: pointer;
    font-weight: 800;
    padding: 0 4px;
    border-radius: 3px;
}

.rx-selected-pill .btn-clear:hover {
    background: #bae6fd;
}

.diag-test-cat-badge {
    font-size: 9.5px;
    font-weight: 700;
    color: #0369a1;
    background: #f0f9ff;
    padding: 1.5px 6px;
    border-radius: 999px;
    border: 1px solid #bae6fd;
    flex-shrink: 0;
    letter-spacing: 0.2px;
    margin-left: 6px;
    display: inline-block;
}

.diag-test-option:hover .diag-test-cat-badge,
.diag-test-option.active .diag-test-cat-badge {
    background: #ffffff;
    border-color: #38bdf8;
    color: #0284c7;
}

/* ==========================================================================
   Diagnostic Billing - 2-Part Layout (Left: Data Entry, Right: Live Bill Preview)
   ========================================================================== */

.diagnostic-classic-fit {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    gap: 4px !important;
}

.diagnostic-classic-fit .diagnostic-classic-topbar {
    min-height: 40px !important;
    padding: 4px 12px !important;
    flex-shrink: 0 !important;
}

.diagnostic-topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
}

.diagnostic-topbar-center .diagnostic-billing-type-picker {
    background: #ffffff;
    padding: 3px 4px 3px 12px;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.diagnostic-topbar-center .diagnostic-billing-type-label {
    font-size: 9.5px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.6px;
    margin-right: 6px;
    text-transform: uppercase;
}

.diagnostic-classic-workspace.diagnostic-full-workspace {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 1 1 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    grid-template-columns: none !important;
}

.diagnostic-full-workspace .diagnostic-form-card {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.diagnostic-full-workspace .diagnostic-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.diagnostic-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagnostic-card-title-wrap h2 {
    font-size: 13px !important;
    font-weight: 800;
}

.diagnostic-full-workspace .diagnostic-form-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.diag-billing-two-col {
    display: grid !important;
    grid-template-columns: minmax(360px, 1fr) minmax(460px, 1.3fr);
    gap: 8px;
    flex: 1 1 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 6px 8px !important;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .diag-billing-two-col {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

/* Left Column: Data Entry & Test Selection */
.diag-entry-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.diag-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    flex-shrink: 0;
}

.diag-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 3px;
    border-bottom: 1px solid #f1f5f9;
}

.diag-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.diag-section-sub {
    font-size: 10px;
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

/* Demographics Grid inside Section - 2 Columns (Age on left, Referred by on right) */
.diag-demographics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
}

.diag-demographics-grid label {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
    position: relative;
}

.diag-demographics-grid label span {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
}

.diag-demographics-grid .classic-input {
    height: 26px !important;
    padding: 2px 6px !important;
    font-size: 11.5px !important;
}

.diag-demographics-grid .tickets-patient-search-combo {
    height: 26px !important;
}

.diag-demographics-grid .tickets-patient-search-combo .btn-find {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    height: 26px !important;
    width: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 11px !important;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
    text-align: center;
}

.diag-field-ipd,
.diag-field-pid,
.diag-field-contact,
.diag-field-name,
.diag-field-sex,
.diag-field-age,
.diag-field-ref {
    grid-column: span 1 !important;
}

.diag-doctor-combo {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.diag-doctor-combo input.classic-input {
    width: 100%;
    padding-right: 27px !important;
    text-overflow: ellipsis;
}

.diag-doctor-combo input.doctor-selected-input {
    color: #0369a1 !important;
    font-weight: 750 !important;
    background: #f0f9ff !important;
    border-color: #38bdf8 !important;
}

.diag-doctor-clear,
.diag-doctor-search-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}

.diag-doctor-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #64748b;
    font-size: 10px;
    cursor: pointer;
}

.diag-doctor-clear:hover {
    color: #dc2626;
    background: #fee2e2;
}

.diag-doctor-search-icon {
    color: #64748b;
    font-size: 10px;
    opacity: 0.65;
    pointer-events: none;
}

.diag-doctor-suggestions {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 3px);
    left: 0;
    width: 100%;
    max-height: 230px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #38bdf8;
    border-radius: 5px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.diag-doctor-option {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
}

.diag-doctor-option:last-child {
    border-bottom: 0;
}

.diag-doctor-option:hover,
.diag-doctor-option.selected {
    background: #e0f2fe;
}

.diag-doctor-option.walk-in {
    color: #64748b;
    font-style: italic;
}

.doctor-option-main {
    overflow: hidden;
    font-size: 11px !important;
    font-weight: 750 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-option-meta {
    overflow: hidden;
    color: #64748b !important;
    font-size: 9.5px !important;
    font-weight: 600 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diag-doctor-empty {
    padding: 9px;
    color: #94a3b8;
    font-size: 10.5px;
    text-align: center;
}

/* Sex buttons and clear SVG icons */
.diagnostic-classic-fit .sex-btn-group {
    height: 26px !important;
}

.diagnostic-classic-fit .sex-btn {
    height: 26px !important;
    line-height: 24px !important;
    padding: 0 4px !important;
    font-size: 10.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
}

.diagnostic-classic-fit .sex-btn .sex-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0 !important;
}

.diagnostic-classic-fit .sex-btn .sex-svg {
    display: block !important;
    width: 12px !important;
    height: 12px !important;
}

.diagnostic-classic-fit .sex-btn.sex-btn-male.is-selected .sex-svg {
    stroke: #0284c7;
}

.diagnostic-classic-fit .sex-btn.sex-btn-female.is-selected .sex-svg {
    stroke: #ec4899;
}

.diagnostic-classic-fit .sex-btn.sex-btn-other.is-selected .sex-svg {
    stroke: #8b5cf6;
}

/* Line Editor inside Section */
.diag-line-editor {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.diag-line-editor .diagnostic-test-search-field {
    flex: 1 1 auto;
    min-width: 0;
}

.diag-line-editor .diagnostic-test-combo input.classic-input {
    height: 27px !important;
    font-size: 11.5px !important;
}

.diag-input-rate {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
}

.diag-input-rate span,
.diag-input-qty span {
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
}

.diag-input-rate .classic-input,
.diag-input-qty .classic-input {
    height: 27px !important;
    font-size: 11.5px !important;
    padding: 2px 6px !important;
}

.diag-input-qty {
    width: 50px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
}

.diag-add-test-btn {
    height: 27px !important;
    font-weight: 800;
    font-size: 11.5px;
    white-space: nowrap;
    padding: 0 10px;
    flex-shrink: 0;
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.diag-add-test-btn:hover {
    background: #0369a1;
    border-color: #0369a1;
}

/* Remarks Section */
.diag-remarks-card {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
}

.diag-remarks-field {
    display: flex;
    flex-direction: column;
    margin: 0;
    flex: 0 0 auto;
    min-height: 0;
}

.diag-remarks-textarea {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    box-sizing: border-box;
    resize: none;
    font-size: 11px !important;
    padding: 4px 6px !important;
    line-height: 1.3 !important;
}

/* Right Column: Live Bill Preview & Calculations */
.diag-preview-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.diag-preview-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.diag-preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.diag-preview-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diag-preview-title {
    font-size: 11.5px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
}

.diag-preview-badge {
    background: #0284c7;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
}

.btn-clear-tests {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    background: #fff;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-clear-tests:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* Table Wrap - Flexibly takes available height with scroll when needed */
.diag-bill-preview-table-wrap {
    --diag-bill-columns: 34px minmax(180px, 1fr) 88px 48px 104px 30px;
    flex: 1 1 0;
    min-height: 60px;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.diag-preview-table-head {
    display: grid;
    grid-template-columns: var(--diag-bill-columns);
    gap: 4px;
    align-items: center;
    padding: 4px 8px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 2;
}

.diag-preview-table-rows {
    overflow: visible;
    flex: 1 0 auto;
    min-width: 0;
}

.diag-preview-table-row {
    display: grid;
    grid-template-columns: var(--diag-bill-columns);
    gap: 4px;
    align-items: center;
    padding: 3px 8px;
    border-bottom: 1px solid #f8fafc;
    font-size: 11px;
    color: #1e293b;
    transition: background 0.12s;
}

.diag-preview-table-row:hover {
    background: #f0fdf4;
}

.pcol-sl {
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
    font-size: 10px;
}

.pcol-name {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pcol-test-title {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

.diag-test-cat-pill {
    font-size: 8.5px;
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 3px;
    padding: 0 3px;
    width: fit-content;
    line-height: 1.2;
}

.pcol-rate {
    text-align: right;
    color: #475569;
    font-weight: 600;
    font-size: 10.5px;
}

.pcol-qty {
    text-align: center;
    font-weight: 700;
    color: #1e293b;
    font-size: 10.5px;
}

.pcol-amount {
    text-align: right;
    font-weight: 800;
    color: #0f172a;
    font-size: 11.5px;
}

.pcol-del {
    text-align: center;
}

.diag-item-del-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.diag-item-del-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.diag-preview-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    text-align: center;
    color: #94a3b8;
    gap: 2px;
    margin: auto 0;
}

.diag-preview-empty-state .empty-icon {
    font-size: 18px;
    margin-bottom: 1px;
    opacity: 0.8;
}

.diag-preview-empty-state strong {
    font-size: 11.5px;
    color: #475569;
}

.diag-preview-empty-state span {
    font-size: 10.5px;
    color: #94a3b8;
    max-width: 280px;
}

/* Totals Summary Box */
.diag-totals-summary-box {
    margin-top: auto;
    background: #f8fafc;
    padding: 4px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.diag-totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #334155;
    padding: 1px 0;
}

.totals-label {
    font-weight: 700;
    color: #475569;
}

.totals-value {
    font-weight: 800;
}

.gross-val {
    font-size: 12px;
    color: #0f172a;
}

.diag-totals-row.net-payable-row {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 3px 6px;
    margin: 1px 0;
}

.diag-totals-row.net-payable-row .totals-label {
    color: #1e40af;
    font-size: 11.5px;
    font-weight: 800;
}

.diag-totals-row.discount-total-row {
    padding: 2px 6px;
    border: 1px dashed #fbbf24;
    border-radius: 4px;
    background: #fffbeb;
    color: #b45309;
}

.diag-totals-row.discount-total-row .totals-label,
.diag-totals-row.discount-total-row .totals-value {
    color: #b45309;
    font-weight: 800;
}

.net-val {
    font-size: 13px;
    color: #1d4ed8;
    font-weight: 900;
}

.totals-input-wrap {
    width: 110px;
}

.authorizer-input-wrap {
    width: 170px;
}

.diag-authorizer-select {
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.totals-dual-input-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 160px;
}

.percent-input-wrap {
    position: relative;
    width: 60px;
    flex-shrink: 0;
}

.percent-input-wrap .diag-tot-input {
    padding-right: 16px !important;
}

.unit-symbol {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    pointer-events: none;
}

.diag-tot-input {
    text-align: right;
    font-weight: 800;
    height: 22px !important;
    font-size: 11.5px !important;
    padding: 1px 5px !important;
}

.diag-totals-row.due-row.has-due .due-val {
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 850;
}

.diag-totals-row.due-row.zero-due .due-val {
    color: #16a34a;
    font-size: 11.5px;
}

/* Due Alert Card */
.diag-due-alert-card {
    background: #fffdf5;
    border: 1px solid #facc15;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    padding: 4px 7px;
    margin-top: 2px;
}

.diag-due-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.diag-due-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.diag-due-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.diag-due-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fef3c7;
    color: #b45309;
    font-size: 13px;
    font-weight: 900;
}

.due-warning-text {
    display: block;
    color: #92400e;
    font-weight: 800;
    font-size: 9px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.diag-due-amount {
    display: block;
    margin-top: 1px;
    color: #dc2626;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 900;
}

.btn-quick-full-pay {
    min-height: 26px;
    background: #ffffff;
    border: 1px solid #0d9488;
    color: #0f766e;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-quick-full-pay:hover {
    background: #0f766e;
    color: #ffffff;
}

.diag-due-release-chk {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #475569;
    font-size: 9.5px;
    font-weight: 700;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.diag-due-release-chk input[type="checkbox"] {
    appearance: auto !important;
    width: 14px !important;
    min-width: 14px !important;
    max-width: 14px !important;
    height: 14px !important;
    min-height: 14px !important;
    max-height: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 0 0 14px;
}

/* Footer Actions */
.diag-preview-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 5px 8px;
    background: #ffffff;
    flex-shrink: 0;
}

.diag-btn-save {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 750 !important;
    font-size: 11.5px !important;
    padding: 0 10px !important;
    height: 29px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.diag-btn-save:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
}

.diag-btn-print {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 11.5px !important;
    padding: 0 12px !important;
    height: 29px !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.diag-btn-print:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border-color: #065f46 !important;
}

.diag-sub-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.diag-btn-clear,
.diag-sub-actions > button:last-child {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 29px !important;
    min-width: 74px;
    padding: 0 11px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.diag-btn-clear:hover,
.diag-sub-actions > button:last-child:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #dc2626 !important;
}

.diag-preview-footer-actions .diag-btn-save,
.diag-preview-footer-actions .diag-btn-print {
    width: auto !important;
    min-width: 148px !important;
    max-width: none !important;
}

.diag-preview-footer-actions .diag-btn-clear,
.diag-preview-footer-actions .diag-sub-actions > button:last-child {
    width: 112px !important;
    min-width: 112px !important;
    max-width: 112px !important;
}

.diag-preview-footer-actions .diag-btn-save,
.diag-preview-footer-actions .diag-btn-print,
.diag-preview-footer-actions .diag-btn-clear,
.diag-preview-footer-actions .diag-sub-actions > button:last-child {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 8px !important;
    line-height: 1 !important;
}

@media (max-width: 1280px) {
    .diag-bill-preview-table-wrap {
        --diag-bill-columns: 30px minmax(140px, 1fr) 76px 42px 88px 26px;
    }
}

/* ==========================================================================
   Diagnostic Billing - Recent Bills Pop-up Modal Dialog
   ========================================================================== */

.diag-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: diagModalFadeIn 0.15s ease-out;
}

@keyframes diagModalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.diag-modal-dialog {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.08);
    width: 96%;
    max-width: 1140px;
    height: 86vh;
    max-height: 760px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diag-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.diag-modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.diag-modal-icon {
    font-size: 22px;
}

.diag-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.diag-modal-subtitle {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
}

.diag-modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.diag-modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

.diag-modal-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.diag-modal-search-box {
    position: relative;
    flex: 1 1 320px;
    display: flex;
    align-items: center;
}

.diag-modal-search-box .search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    color: #64748b;
    pointer-events: none;
}

.diag-modal-search-input {
    width: 100%;
    padding-left: 32px !important;
    padding-right: 28px !important;
    height: 34px !important;
    font-size: 12px !important;
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    border-radius: 6px !important;
}

.diag-modal-search-box .search-clear-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
}

.diag-modal-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.diag-modal-tab {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.diag-modal-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.diag-modal-tab.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.diag-modal-tab.doctor-orders-tab {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.diag-modal-tab.doctor-orders-tab.active {
    background: #b45309;
    color: #ffffff;
    border-color: #b45309;
}

.diag-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
    background: #ffffff;
}

.diag-modal-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.diag-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.diag-modal-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #cbd5e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.diag-modal-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.diag-modal-table tr:hover {
    background: #f8fafc;
}

.diag-modal-table tr.selected-row {
    background: #f0fdf4;
}

.btn-memo-link {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11.5px;
    transition: all 0.15s;
}

.btn-memo-link:hover {
    background: #0284c7;
    color: #ffffff;
}

.modal-patient-info {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.modal-patient-info .patient-name {
    color: #0f172a;
    font-weight: 750;
    font-size: 12px;
}

.modal-patient-info .patient-id-sub {
    font-size: 10.5px;
    color: #0284c7;
    font-weight: 700;
}

.modal-patient-info .patient-meta-sub {
    font-size: 10px;
    color: #64748b;
}

.modal-date-text {
    font-weight: 700;
    color: #334155;
    display: block;
}

.modal-time-text {
    font-size: 10px;
    color: #64748b;
}

.disc-sub-badge {
    font-size: 9.5px;
    color: #b45309;
    font-weight: 700;
}

.diag-modal-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-action-sm {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
}

.btn-action-sm.select {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.btn-action-sm.select:hover {
    background: #0369a1;
}

.btn-action-sm.print:hover {
    background: #e2e8f0;
}

.btn-action-sm.delete {
    color: #dc2626;
    border-color: #fecaca;
    background: #fff;
}

.btn-action-sm.delete:hover {
    background: #fee2e2;
}

.diag-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
}

.diag-modal-empty .empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.diag-modal-empty h4 {
    margin: 0;
    font-size: 14px;
    color: #475569;
}

.diag-modal-empty p {
    margin: 4px 0 0;
    font-size: 11.5px;
}

/* Orders Grid inside Modal */
.diag-modal-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
}

.diag-modal-order-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.15s;
}

.diag-modal-order-card:hover {
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
    transform: translateY(-1px);
}

.order-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #475569;
}

.order-card-notes {
    font-size: 10.5px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    padding: 4px 6px;
    color: #334155;
}

.diag-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.diag-modal-footer-count {
    font-size: 11.5px;
    color: #64748b;
}

.tickets-count-badge {
    background: #0284c7;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 5px;
}

.btn-header-modal-trigger {
    font-size: 11px !important;
    padding: 3px 9px !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    font-weight: 700 !important;
}

.btn-header-modal-trigger:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.diag-modal-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 8px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.diag-modal-date-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.diag-modal-date-input {
    height: 30px !important;
    padding: 2px 8px !important;
    font-size: 11.5px !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
}

.diag-modal-select {
    height: 30px !important;
    padding: 2px 8px !important;
    font-size: 11.5px !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    font-weight: 600;
}

.diag-modal-presets {
    display: flex;
    align-items: center;
    gap: 4px;
}

.diag-date-chip {
    padding: 3px 8px;
    font-size: 10.5px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s;
}

.diag-date-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.diag-date-chip.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.diag-modal-reset-btn {
    height: 30px !important;
    font-size: 11px !important;
    padding: 2px 10px !important;
    font-weight: 700 !important;
}

.diag-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: #0284c7;
    font-weight: 600;
    font-size: 13px;
}


/* Diagnostic Test Master: separate Pathology and Imaging catalogues */
.diagnostic-test-master-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: calc(100vh - 62px);
}

.dtm-tabs {
    display: flex;
    gap: 8px;
    padding: 0 2px;
}

.dtm-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #475569;
    cursor: pointer;
    text-align: left;
}

.dtm-tab > span:first-child { font-size: 19px; }
.dtm-tab > span:last-child { display: flex; flex-direction: column; }
.dtm-tab strong { color: #1e293b; font-size: 12px; }
.dtm-tab small { color: #64748b; font-size: 9.5px; margin-top: 1px; }
.dtm-tab.active { box-shadow: 0 0 0 2px rgba(2, 132, 199, .12); }
.dtm-tab.active.pathology { border-color: #0d9488; background: #f0fdfa; }
.dtm-tab.active.imaging { border-color: #2563eb; background: #eff6ff; }

.dtm-workspace {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.dtm-form-card,
.dtm-list-card {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    overflow: hidden;
    min-width: 0;
}

.dtm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 7px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.dtm-card-header h2 { margin: 0; color: #0f172a; font-size: 13px; }
.dtm-card-header p { margin: 2px 0 0; color: #64748b; font-size: 9.5px; }

.dtm-form-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.dtm-form-body label { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.dtm-form-body label > span { color: #334155; font-size: 10.5px; font-weight: 750; }
.dtm-form-body .classic-input { width: 100%; height: 30px; }
.dtm-form-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding-top: 3px; }
.dtm-form-actions .btn { min-height: 28px; padding: 4px 10px; font-size: 10.5px; }

.dtm-list-card { display: flex; flex-direction: column; min-height: 0; }
.dtm-list-header { flex-shrink: 0; }
.dtm-search-wrap { position: relative; width: min(290px, 45%); }
.dtm-search-wrap > span { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 16px; pointer-events: none; }
.dtm-search-wrap input { width: 100%; height: 29px; padding-left: 27px !important; font-size: 10.5px; }
.dtm-table-wrap { overflow: auto; flex: 1; min-height: 0; max-height: calc(100vh - 210px); }
.dtm-table { width: 100%; font-size: 10.5px; }
.dtm-table thead { position: sticky; top: 0; z-index: 1; }
.dtm-table th { white-space: nowrap; }
.dtm-table td { padding-top: 5px; padding-bottom: 5px; }
.dtm-table tr.selected td { background: #e0f2fe; }
.dtm-category-pill { display: inline-block; max-width: 190px; padding: 1px 5px; border-radius: 9px; background: #f1f5f9; color: #475569; font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.dtm-edit-btn { padding: 2px 7px !important; font-size: 9.5px !important; white-space: nowrap; }
.dtm-empty { padding: 28px !important; text-align: center; color: #94a3b8; }

@media (max-width: 900px) {
    .dtm-workspace { grid-template-columns: 1fr; }
    .dtm-table-wrap { max-height: none; }
    .dtm-tabs { overflow-x: auto; }
    .dtm-tab { min-width: 165px; }
}

@media (max-width: 600px) {
    .dtm-list-header { align-items: stretch; flex-direction: column; }
    .dtm-search-wrap { width: 100%; }
}

/* ==========================================================================
   Diagnostic Cash Memo Return & Refund Modern Design System
   ========================================================================== */

.diagnostic-returns-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.95fr) !important;
    gap: 14px !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 1100px) {
    .diagnostic-returns-workspace {
        grid-template-columns: 1fr !important;
        overflow-y: auto !important;
    }
}

/* Modern Hero Search Bar */
.return-search-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    margin-bottom: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.return-search-hero:focus-within {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.return-search-icon {
    font-size: 16px;
    color: #0284c7;
    flex-shrink: 0;
}

.return-search-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.return-search-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    padding: 6px 26px 6px 0 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    background: transparent !important;
    box-shadow: none !important;
}

.return-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.return-search-clear-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.return-search-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.return-search-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.return-search-action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1, #075985);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

.return-search-action-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.return-search-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Autocomplete suggestions */
.return-memo-suggestions {
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.return-memo-searching {
    padding: 12px 14px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.return-memo-suggestion {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 110px;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    color: #334155;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.return-memo-suggestion:last-child {
    border-bottom: none;
}

.return-memo-suggestion:hover,
.return-memo-suggestion:focus {
    background: #eff6ff;
    outline: none;
}

.return-memo-suggestion-id {
    display: inline-block;
    padding: 3px 8px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    font-size: 12px;
    border-radius: 6px;
    text-align: center;
}

.return-memo-suggestion-info {
    min-width: 0;
}

.return-memo-suggestion-name {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.return-memo-suggestion-sub {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 10.5px;
}

.return-memo-suggestion-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.return-memo-suggestion-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.return-memo-suggestion-badge.opd {
    background: #dbeafe;
    color: #1d4ed8;
}

.return-memo-suggestion-badge.ipd {
    background: #ede9fe;
    color: #6d28d9;
}

/* 3-Step Process Flow Banner */
.return-process-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
}

.return-process-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.return-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.return-process-step.active .return-step-num {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.return-process-step.completed .return-step-num {
    background: #10b981;
    color: #ffffff;
}

.return-process-step.pending .return-step-num {
    background: #e2e8f0;
    color: #64748b;
}

.return-step-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.return-step-label strong {
    font-size: 11px;
    color: #1e293b;
    line-height: 1.2;
}

.return-step-label span {
    font-size: 9.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.return-step-arrow {
    color: #cbd5e1;
    font-size: 14px;
    flex-shrink: 0;
}

/* Policy & Safety Notice */
.return-policy-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-size: 11px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.return-policy-alert-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Quick Recent Diagnostic Bills Card */
.return-quick-bills-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    margin-bottom: 12px;
}

.return-quick-bills-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.return-quick-bills-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.return-quick-bills-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.return-quick-bills-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.return-quick-bills-table th {
    padding: 6px 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.return-quick-bills-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.return-quick-bills-table tr:hover td {
    background: #f8fafc;
}

.return-quick-bills-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0284c7;
    cursor: pointer;
    transition: all 0.12s ease;
}

.return-quick-bills-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Patient & Invoice Banner (When Memo is Loaded) */
.return-patient-banner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    margin-bottom: 12px;
}

.return-patient-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.return-patient-id-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.return-patient-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.return-patient-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.return-patient-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.return-patient-meta {
    font-size: 11px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.return-patient-change-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.return-patient-change-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.return-patient-financial-pills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}

.return-patient-fin-pill {
    padding: 6px 10px;
    border-radius: 7px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.return-patient-fin-pill span {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.return-patient-fin-pill strong {
    font-size: 12.5px;
    font-weight: 800;
    color: #1e293b;
}

.return-patient-fin-pill.due strong {
    color: #dc2626;
}

.return-patient-fin-pill.adj strong {
    color: #b45309;
}

/* Items Table */
.return-items-table-card {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.return-items-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11.5px;
}

.return-items-table-title {
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.return-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0284c7;
    cursor: pointer;
    user-select: none;
}

.return-items-table-wrap {
    max-height: 240px;
    overflow-y: auto;
}

.return-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
}

.return-items-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 7px 10px;
    border-bottom: 1px solid #cbd5e1;
    text-align: left;
}

.return-items-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.return-items-table tr.selected-row td {
    background: #f0fdf4 !important;
}

.return-items-table tr.selected-row td:first-child {
    border-left: 3px solid #10b981;
}

.return-items-table tr.blocked-row td {
    background: #fafafa;
    color: #94a3b8;
}

/* Stepper Quantity Input */
.return-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.return-qty-btn {
    width: 22px;
    height: 24px;
    border: none;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}

.return-qty-btn:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

.return-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.return-qty-input {
    width: 34px !important;
    height: 24px !important;
    border: none !important;
    text-align: center !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Status Badges in Table */
.return-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 4px;
    white-space: nowrap;
}

.return-status-badge.ready {
    background: #dcfce7;
    color: #15803d;
}

.return-status-badge.reported {
    background: #fee2e2;
    color: #b91c1c;
}

.return-status-badge.inlab {
    background: #ffedd5;
    color: #c2410c;
}

.return-status-badge.returned {
    background: #f1f5f9;
    color: #64748b;
}

/* Quick Reason Chips */
.return-reason-section {
    margin-bottom: 12px;
}

.return-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 8px;
}

.return-reason-chip {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}

.return-reason-chip:hover {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.return-reason-chip.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

/* Settlement 4-Card KPI Grid */
.return-settlement-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .return-settlement-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.return-settlement-card {
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.return-settlement-card .label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.return-settlement-card .value {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}

.return-settlement-card.refund-kpi {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.15);
}

.return-settlement-card.refund-kpi .label {
    color: #15803d;
}

.return-settlement-card.refund-kpi .value {
    font-size: 17px;
    font-weight: 900;
    color: #166534;
}

.return-settlement-card.due-kpi {
    background: #fffbeb;
    border-color: #fde68a;
}

.return-settlement-card.due-kpi .label {
    color: #92400e;
}

.return-settlement-card.due-kpi .value {
    color: #b45309;
}

/* Right Panel: Recent Returns Operational Center */
.return-recent-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.return-recent-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.return-recent-search-input {
    width: 100% !important;
    height: 32px !important;
    padding: 4px 28px 4px 30px !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

.return-recent-search-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12) !important;
}

.return-recent-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
    line-height: 1;
    z-index: 2;
}

.return-recent-search-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 2;
}

.return-recent-search-clear:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.return-recent-filter-pills {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.return-recent-filter-btn {
    padding: 3px 10px;
    font-size: 10.5px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s ease;
}

.return-recent-filter-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.return-recent-filter-btn.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.return-recent-stat-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 1px solid #bbf7d0;
    font-size: 11px;
    font-weight: 600;
    color: #166534;
}

.return-recent-stat-strip strong {
    font-size: 12.5px;
    font-weight: 850;
    color: #15803d;
}

/* Dedicated Table Styling for Recent Returns */
.return-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: fixed;
}

.return-recent-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 750;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 7px 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.return-recent-table th.text-right {
    text-align: right;
}

.return-recent-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.return-recent-table tr:hover td {
    background: #f8fafc;
}

.return-recent-table tr.selected td {
    background: #e0f2fe;
}

.return-voucher-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.return-voucher-num {
    font-size: 12.5px;
    font-weight: 850;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.return-status-tag {
    display: inline-block;
    padding: 1.5px 6px;
    font-size: 8.5px;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.return-status-tag.completed {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.return-status-tag.cancelled {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.return-row-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.return-row-view-btn:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(2, 132, 199, 0.25);
    transform: translateY(-1px);
}

.return-recent-table td.text-right .return-row-view-btn {
    margin-left: auto;
}

.return-row-view-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.return-recent-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 10px;
    color: #64748b;
    flex-shrink: 0;
}

/* Saved Return Official Voucher View */
.return-voucher-card {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    margin-bottom: 12px;
}

.return-voucher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.return-voucher-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.return-voucher-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.return-voucher-body {
    padding: 14px 16px;
}

.return-voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.return-voucher-grid div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.return-voucher-grid span {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.return-voucher-grid strong {
    font-size: 12px;
    color: #1e293b;
}

.return-voucher-audit-box {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 10.5px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.return-voucher-void-banner {
    margin-top: 10px;
    padding: 9px 12px;
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 11px;
}

.return-action-bar {
    position: sticky;
    z-index: 3;
    bottom: -10px;
    display: flex;
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 -14px -10px;
    padding: 8px 14px 10px;
    border-top: 1px solid #e2e8f0;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -4px 10px rgb(15 23 42 / 5%);
}

.return-action-bar .btn {
    min-height: 34px;
}

@media (max-height: 720px) {
    .return-action-bar {
        bottom: -6px;
        margin: 0 -10px -6px;
        padding: 6px 10px;
    }
}

.required-mark {
    color: #dc2626 !important;
    font-weight: 900;
}

/* Diagnostic return confirmation */
.return-confirm-backdrop {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgb(15 23 42 / 55%);
    backdrop-filter: blur(2px);
}

.return-confirm-modal {
    width: min(540px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgb(15 23 42 / 28%);
}

.return-confirm-header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 30px;
    gap: 11px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #dbeafe;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.return-confirm-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #0284c7;
    color: #fff;
    font-size: 23px;
    font-weight: 900;
    box-shadow: 0 5px 12px rgb(2 132 199 / 25%);
}

.return-confirm-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 850;
}

.return-confirm-header p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 11px;
}

.return-confirm-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.return-confirm-close:hover { background: #e2e8f0; color: #0f172a; }

.return-confirm-body {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 15px 18px;
}

.return-confirm-memo {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 7px 14px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.return-confirm-memo div { display: contents; }
.return-confirm-memo span,
.return-confirm-receiver span { color: #64748b; font-size: 11px; font-weight: 650; }
.return-confirm-memo strong { color: #1e293b; font-size: 11.5px; overflow-wrap: anywhere; }

.return-confirm-section-title {
    margin: 13px 0 6px;
    color: #475569;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.return-confirm-items {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.return-confirm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 11px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 11.5px;
}

.return-confirm-item:last-child { border-bottom: 0; }
.return-confirm-item small { color: #0284c7; font-size: 10px; font-weight: 800; }
.return-confirm-item strong { color: #0f172a; white-space: nowrap; }

.return-confirm-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.return-confirm-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
}

.return-confirm-totals .refund {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.return-confirm-totals .due {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.return-confirm-totals strong { font-size: 12px; white-space: nowrap; }

.return-confirm-receiver {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
    padding: 8px 11px;
    border-radius: 7px;
    background: #f8fafc;
}

.return-confirm-receiver strong { color: #1e293b; font-size: 11.5px; }

.return-confirm-warning {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-top: 11px;
    padding: 9px 11px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
}

.return-confirm-warning > span {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #ea580c;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.return-confirm-warning p { margin: 0; font-size: 10.5px; line-height: 1.45; }

.return-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.return-confirm-actions .btn { min-height: 36px; padding: 0 17px; }
.return-confirm-submit { box-shadow: 0 5px 12px rgb(2 132 199 / 20%); }

@media (max-width: 560px) {
    .return-confirm-backdrop { padding: 10px; }
    .return-confirm-header { padding: 13px; }
    .return-confirm-body { padding: 12px 13px; }
    .return-confirm-totals { grid-template-columns: 1fr; }
    .return-confirm-actions { padding: 10px 13px; }
}

.void-confirm-modal { width: min(500px, 100%); }

.void-confirm-header {
    border-bottom-color: #fecaca;
    background: linear-gradient(135deg, #fff1f2, #fff7ed);
}

.void-confirm-icon {
    background: #dc2626;
    box-shadow: 0 5px 12px rgb(220 38 38 / 24%);
}

.void-confirm-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.void-confirm-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.void-confirm-summary span { color: #64748b; font-size: 10.5px; font-weight: 650; }
.void-confirm-summary strong { color: #0f172a; font-size: 11.5px; white-space: nowrap; }

.void-reason-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 13px;
}

.void-reason-field > span {
    color: #334155;
    font-size: 11.5px;
    font-weight: 800;
}

.void-reason-field textarea.classic-input {
    width: 100%;
    height: 76px !important;
    min-height: 76px !important;
    padding: 8px 10px !important;
    resize: vertical;
    line-height: 1.4;
}

.void-reason-field small { color: #64748b; font-size: 9.5px; }
.void-confirm-warning { border-color: #fecaca; background: #fff1f2; color: #991b1b; }
.void-confirm-warning > span { background: #dc2626; }

.void-confirm-submit {
    min-height: 36px;
    padding: 0 17px;
    border-color: #b91c1c;
    background: #dc2626;
    color: #fff;
    box-shadow: 0 5px 12px rgb(220 38 38 / 20%);
}

.void-confirm-submit:hover:not(:disabled) { border-color: #991b1b; background: #b91c1c; }
.void-confirm-submit:disabled { border-color: #fca5a5; background: #fca5a5; cursor: not-allowed; box-shadow: none; }

@media (max-width: 560px) {
    .void-confirm-summary { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Pharmacy POS High-Performance Upgrades (Autocomplete, Hotkeys, Thermal)
   ========================================================================== */
.pos-typeahead-wrapper {
    position: relative;
    width: 100%;
}
.pos-med-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #0284c7;
    border-radius: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 120;
}
.pos-med-item {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s ease;
}
.pos-med-item:hover, .pos-med-item.highlighted {
    background: #f0f9ff;
}
.pos-med-item:last-child {
    border-bottom: none;
}
.pos-med-name {
    font-weight: 700;
    font-size: 12.5px;
    color: #0f172a;
}
.pos-med-sub {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 6px;
    align-items: center;
}
.pos-stock-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}
.pos-stock-badge.in-stock {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.pos-stock-badge.out-stock {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.pos-hotkeys-strip {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 10.5px;
    color: #475569;
    flex-wrap: wrap;
    margin-top: 4px;
}
.pos-hotkey-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
}
.pos-hotkey-key {
    background: #0284c7;
    color: #ffffff;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 9.5px;
    font-weight: 800;
}

/* Tender & Change Calculator */
.tender-calculator-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.quick-cash-chips {
    display: flex;
    gap: 4px;
    align-items: center;
}
.quick-cash-chip {
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
}
.quick-cash-chip:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

/* 80mm Thermal Receipt styling */
.pos-receipt-80mm {
    width: 290px;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    color: #000000;
    padding: 10px 8px;
    background: #ffffff;
    border: 1px dashed #94a3b8;
}
.pos-thermal-header {
    text-align: center;
    border-bottom: 1px dashed #000000;
    padding-bottom: 6px;
    margin-bottom: 6px;
}
.pos-thermal-title {
    font-size: 13.5px;
    font-weight: 900;
    text-transform: uppercase;
}
.pos-thermal-meta {
    font-size: 10px;
    line-height: 1.3;
}
.pos-thermal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
    margin: 6px 0;
}
.pos-thermal-table th {
    border-bottom: 1px dashed #000000;
    padding: 3px 0;
    text-align: left;
}
.pos-thermal-table td {
    padding: 2px 0;
    vertical-align: top;
}
.pos-thermal-summary {
    border-top: 1px dashed #000000;
    border-bottom: 1px dashed #000000;
    padding: 4px 0;
    margin: 4px 0;
    font-size: 11px;
}
.pos-thermal-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}
.pos-thermal-row.grand {
    font-weight: 900;
    font-size: 12px;
    border-top: 1px solid #000000;
    padding-top: 2px;
}
.pos-thermal-footer {
    text-align: center;
    font-size: 9.5px;
    margin-top: 6px;
    line-height: 1.3;
}

/* Generic Alternative Suggestion */
.pos-generic-alt-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
}
.pos-alt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: #ffffff;
    border: 1px solid #fef3c7;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* ==========================================================================
   IPD & Bed Masters Enhancement Styles
   ========================================================================== */
.ipd-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
    overflow-x: auto;
}

.ipd-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px 10px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
    bottom: -2px;
}

.ipd-tab-btn:hover {
    color: #0284c7;
    background: #f8fafc;
}

.ipd-tab-btn.active {
    color: #0284c7;
    background: #ffffff;
    border-color: #cbd5e1;
    border-bottom-color: #ffffff;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.04);
}

.ipd-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #475569;
}

.ipd-tab-btn.active .ipd-tab-count {
    background: #e0f2fe;
    color: #0369a1;
}

.ipd-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.ipd-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ipd-search-box {
    position: relative;
    min-width: 220px;
    max-width: 320px;
    flex: 1;
}

.ipd-status-filters {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
}

.ipd-status-chip {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ipd-status-chip.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bed-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.bed-matrix-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bed-matrix-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.bed-matrix-card.status-available {
    border-color: #a7f3d0;
    border-top: 4px solid #10b981;
}

.bed-matrix-card.status-occupied {
    border-color: #fecdd3;
    border-top: 4px solid #f43f5e;
}

.bed-matrix-card.status-cleaning {
    border-color: #fde68a;
    border-top: 4px solid #f59e0b;
}

.bed-matrix-card.status-maintenance {
    border-color: #cbd5e1;
    border-top: 4px solid #64748b;
}

.bed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.bed-card-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bed-card-name {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.bed-card-cat {
    font-size: 11px;
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    margin-top: 2px;
    display: inline-block;
}

.bed-patient-box {
    background: #fff1f2;
    border: 1px solid #ffe4e6;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0;
}

.bed-patient-name {
    font-weight: 800;
    font-size: 13.5px;
    color: #9f1239;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bed-patient-meta {
    font-size: 11.5px;
    color: #be123c;
    line-height: 1.45;
}

.bed-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.bed-quick-status-btn {
    font-size: 11px;
    font-weight: 750;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bed-quick-status-btn:hover {
    background: #e2e8f0;
}

.pricing-calc-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 10px;
}

.pricing-calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
}

.pricing-calc-total {
    border-top: 1.5px dashed #cbd5e1;
    padding-top: 6px;
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-weight: 850;
    font-size: 13.5px;
    color: #0369a1;
}

.bulk-preview-wrap {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.bulk-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 4px;
}

.bulk-bed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.bulk-bed-chip.is-new {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.bulk-bed-chip.is-dup {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
    text-decoration: line-through;
}







/* ==========================================================================
   Diagnostic Cash Memo / Bill - A5 Half-Page (Delta Hospital Authentic Style)
   ========================================================================== */
.a5-memo-sheet {
    width: 140mm !important;
    max-width: 100% !important;
    margin: 16px auto !important;
    padding: 12px 14px 14px 14px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    font-family: Arial, "Helvetica Neue", Helvetica, "Segoe UI", sans-serif !important;
    color: #000000 !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
}

.a5-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding-bottom: 6px !important;
    border-bottom: 1.5px solid #000000 !important;
}

.a5-brand-block {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.a5-brand-logo {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
}

.a5-logo-placeholder {
    font-size: 32px !important;
    line-height: 1 !important;
}

.a5-brand-text {
    display: flex !important;
    flex-direction: column !important;
}

.a5-hosp-name {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #003366 !important;
    letter-spacing: -0.2px !important;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

.a5-hosp-address {
    font-size: 9.5px !important;
    color: #222222 !important;
    margin-top: 2px !important;
}

.a5-copy-tags {
    text-align: right !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}

.a5-counter-no {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #333333 !important;
    margin-bottom: 2px !important;
}

.a5-patient-copy-tag {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #003366 !important;
    letter-spacing: 0.3px !important;
    border-bottom: 1px solid #003366 !important;
    padding-bottom: 1px !important;
}

.a5-orig-copy-tag {
    font-size: 9.5px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    margin-top: 3px !important;
}

.a5-bill-meta-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 5px 0 !important;
    border-bottom: 1px solid #000000 !important;
    font-size: 11px !important;
}

.a5-bill-no-date {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.a5-meta-label {
    color: #000000 !important;
    font-weight: 700 !important;
}

.a5-meta-val {
    color: #000000 !important;
    font-weight: 600 !important;
}

.a5-bill-barcode {
    max-height: 28px !important;
}

.a5-bill-barcode svg {
    height: 24px !important;
}

.a5-patient-info-box {
    padding: 6px 0 !important;
    border-bottom: 1px solid #000000 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 11px !important;
}

.a5-patient-info-left {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
}

.a5-patient-info-right-qr {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 8px !important;
    min-width: 75px !important;
}

.a5-patient-info-right-qr svg {
    width: 68px !important;
    height: 68px !important;
}

.a5-pinfo-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
    line-height: 1.35 !important;
}

.a5-pinfo-col {
    display: flex !important;
    align-items: baseline !important;
}

.a5-pinfo-col.a5-col-full {
    flex: 1 !important;
}

.a5-patient-info-box .a5-lbl {
    width: 75px !important;
    min-width: 75px !important;
    font-weight: 700 !important;
    color: #000000 !important;
}

.a5-patient-info-box .a5-pinfo-col:not(.a5-col-full):not(:first-child) .a5-lbl {
    width: auto !important;
    min-width: 0 !important;
    margin-right: 4px !important;
    white-space: nowrap !important;
}

.a5-patient-info-box .a5-pinfo-col:not(.a5-col-full) .a5-val {
    white-space: nowrap !important;
}

.a5-qr-caption {
    margin-top: 3px !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    text-align: center !important;
    line-height: 1.15 !important;
}

.a5-portal-banner {
    margin-top: 8px !important;
    padding: 5px 8px !important;
    border: 1px dashed #64748b !important;
    border-radius: 4px !important;
    background: #f8fafc !important;
    font-size: 9.5px !important;
    line-height: 1.35 !important;
    color: #0f172a !important;
    text-align: center !important;
}

.a5-portal-banner a {
    color: #0369a1 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    word-break: break-all !important;
}

.a5-patient-info-box .a5-colon {
    margin-right: 6px !important;
    font-weight: 700 !important;
    color: #000000 !important;
}

.a5-val {
    color: #000000 !important;
}

.a5-patient-name {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #000000 !important;
}

.a5-items-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 4px !important;
    font-size: 11px !important;
}

.a5-items-table th {
    border-top: 1px solid #000000 !important;
    border-bottom: 1px solid #000000 !important;
    padding: 3px 4px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    background: #ffffff !important;
    text-align: left !important;
}

.a5-items-table td {
    padding: 3px 4px !important;
    border-bottom: 1px dotted #cccccc !important;
    vertical-align: middle !important;
    color: #000000 !important;
}

.a5-cell-code {
    font-family: Arial, monospace !important;
    font-size: 10.5px !important;
    color: #000000 !important;
}

.a5-cell-name {
    color: #000000 !important;
    font-weight: normal !important;
}

.a5-cell-delivery {
    font-size: 10px !important;
    color: #000000 !important;
}

.a5-cell-qty {
    text-align: center !important;
}

.a5-cell-price {
    text-align: right !important;
    font-weight: 600 !important;
}

.a5-remarks-test-id-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    padding: 4px 0 !important;
    border-top: 1px solid #000000 !important;
    border-bottom: 1px solid #000000 !important;
    font-size: 10px !important;
    margin-top: 2px !important;
}

.a5-remarks-test-id-row .a5-lbl {
    font-weight: 700 !important;
    color: #000000 !important;
    margin-right: 4px !important;
}

.a5-financial-split {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding-top: 6px !important;
    gap: 12px !important;
}

.a5-fin-left {
    flex: 1.2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.a5-stamp-box {
    text-align: center !important;
    margin: 2px 0 4px 0 !important;
}

.a5-stamp {
    display: inline-block !important;
    padding: 4px 24px !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    letter-spacing: 3px !important;
    border-radius: 3px !important;
    text-align: center !important;
    font-family: Arial, "Helvetica Neue", sans-serif !important;
}

.a5-stamp-paid {
    color: #059669 !important;
    border: 2px solid #059669 !important;
    background: #f0fdf4 !important;
}

.a5-stamp-due {
    color: #dc2626 !important;
    border: 2px solid #dc2626 !important;
    background: #fef2f2 !important;
}

.a5-in-word {
    font-size: 10px !important;
    color: #000000 !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
}

.a5-mini-pay-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5px !important;
    border: 1px solid #000000 !important;
}

.a5-mini-pay-table th {
    background: #f3f4f6 !important;
    padding: 2px 4px !important;
    border: 1px solid #000000 !important;
    font-weight: 700 !important;
    color: #000000 !important;
    text-align: left !important;
}

.a5-mini-pay-table td {
    padding: 2px 4px !important;
    border: 1px solid #cccccc !important;
    color: #000000 !important;
}

.a5-prepared-by {
    font-size: 10px !important;
    color: #000000 !important;
    font-weight: 600 !important;
    margin-top: 3px !important;
}

.a5-fin-right {
    flex: 0.9 !important;
    padding: 2px 0 0 8px !important;
}

.a5-financial-summary {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    font-size: 11px !important;
}

.a5-fin-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 1px 0 !important;
}

.a5-fin-row span:first-child {
    color: #000000 !important;
    font-weight: 600 !important;
}

.a5-fin-val {
    font-weight: 700 !important;
    color: #000000 !important;
    min-width: 65px !important;
    text-align: right !important;
}

.a5-fin-net {
    border-top: 1px solid #000000 !important;
    border-bottom: 1px solid #000000 !important;
    padding: 3px 0 !important;
    margin: 2px 0 !important;
    font-size: 11.5px !important;
}

.a5-fin-net span:first-child, .a5-fin-net .a5-fin-val {
    font-weight: 800 !important;
    color: #000000 !important;
}

.a5-fin-due {
    border-top: 1px solid #000000 !important;
    padding-top: 2px !important;
    margin-top: 1px !important;
    font-size: 11.5px !important;
}

.a5-due-text {
    color: #dc2626 !important;
    font-weight: 900 !important;
}

.a5-footer-instruction {
    margin-top: 12px !important;
    padding-top: 6px !important;
    border-top: 1px solid #000000 !important;
    font-size: 10px !important;
    color: #003366 !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
}

.a5-footer-sub {
    font-size: 8.5px !important;
    color: #555555 !important;
    margin-top: 2px !important;
    font-weight: normal !important;
    text-transform: none !important;
}

/* Print Toolbar */
.diag-print-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    margin: 20px auto 12px auto !important;
    width: 140mm !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.diag-print-layout-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.diag-print-layout-toggle .toggle-lbl {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #334155 !important;
}

.diag-print-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

@media print {
    .diag-print-toolbar {
        display: none !important;
    }
    .a5-memo-sheet {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 136mm !important;
    }
}


/* ==========================================================================
   Diagnostic Alert / Error Popup Modal Box
   ========================================================================== */
.diag-alert-modal-dialog {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    width: 460px !important;
    max-width: 92vw !important;
    overflow: hidden !important;
    margin: auto !important;
    animation: diagModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border: 1px solid #cbd5e1 !important;
}

.diag-alert-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 18px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.diag-alert-modal-header.header-danger {
    background: #fef2f2 !important;
    border-color: #fecdd3 !important;
}

.diag-alert-modal-header.header-warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
}

.diag-alert-modal-header.header-success {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

.diag-alert-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.diag-alert-icon {
    font-size: 22px !important;
    line-height: 1 !important;
}

.diag-alert-title {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.diag-alert-close-btn {
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

.diag-alert-close-btn:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.08) !important;
}

.diag-alert-modal-body {
    padding: 20px 22px !important;
}

.diag-alert-message {
    margin: 0 !important;
    font-size: 14.5px !important;
    line-height: 1.55 !important;
    color: #1e293b !important;
    font-weight: 500 !important;
}

.diag-alert-technical-details {
    margin-top: 14px !important;
    padding: 10px 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    color: #64748b !important;
    word-break: break-word !important;
    max-height: 130px !important;
    overflow-y: auto !important;
}

.diag-alert-tech-head {
    font-weight: 700 !important;
    margin-bottom: 4px !important;
    color: #475569 !important;
}

.diag-alert-technical-details code {
    font-family: Consolas, Monaco, "Courier New", monospace !important;
    color: #dc2626 !important;
}

.diag-alert-modal-footer {
    display: flex !important;
    justify-content: flex-end !important;
    padding: 12px 18px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

.diag-alert-action-btn {
    min-width: 90px !important;
    font-weight: 600 !important;
}

.diagnostic-classic-fit .diagnostic-classic-topbar {
    overflow: hidden !important;
}

.diag-field-contact .appt-patient-suggestions {
    left: auto !important;
    right: 0 !important;
}

/* ==========================================================================
   Pathology Sample Collection & Imaging Worklist Styles
   ========================================================================== */
.tickets-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 250px !important;
    min-width: 210px !important;
    max-width: 280px !important;
    flex: 0 0 250px !important;
}

.tickets-search-wrap input.classic-input {
    width: 100% !important;
    height: 30px !important;
    min-height: 30px !important;
    padding-left: 28px !important;
    padding-right: 24px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

.tickets-search-wrap input.classic-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
}

.tickets-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 13px;
    pointer-events: none;
    line-height: 1;
}

.tickets-search-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    line-height: 1;
}

.tickets-search-clear:hover {
    color: #ef4444;
}

.sample-actions-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
    white-space: nowrap;
}

.sample-action-btn {
    height: 27px !important;
    min-height: 27px !important;
    padding: 2px 9px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.sample-action-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.sample-collect-btn {
    height: 27px !important;
    min-height: 27px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 10px !important;
    border-radius: 5px !important;
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.sample-collect-btn:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
}

.collected-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sample-collected-badge {
    height: 27px !important;
    padding: 2px 8px !important;
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

.sample-collected-badge small {
    font-size: 9.5px !important;
    font-weight: 600 !important;
    color: #166534 !important;
    opacity: 0.85 !important;
}

.btn-recollect-pill {
    height: 27px !important;
    min-height: 27px !important;
    padding: 2px 8px !important;
    background: #ffffff !important;
    color: #d97706 !important;
    border: 1px solid #fcd34d !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
}

.btn-recollect-pill:hover {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border-color: #f59e0b !important;
}

.imaging-room-input {
    height: 26px !important;
    min-height: 26px !important;
    font-size: 11px !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    width: 140px !important;
    box-sizing: border-box !important;
    transition: all 0.12s ease !important;
}

.imaging-room-input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    outline: none !important;
}

/* Sample Barcode Sticker Preview & Print */
.sample-sticker-modal-dialog {
    width: 360px;
    max-width: 95vw;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: diagModalFadeIn 0.2s ease-out;
}

.sample-sticker-box-wrap {
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e2e8f0;
}

.sample-sticker-label {
    width: 40mm !important;
    height: 20mm !important;
    max-width: 40mm !important;
    max-height: 20mm !important;
    padding: 1.2mm 1.5mm !important;
    background: #ffffff !important;
    border: 1px dashed #64748b !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 7px !important;
    line-height: 1.1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    color: #000000 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.tube-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 7.5px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

.tube-patient-name {
    font-size: 8px;
    font-weight: 800;
    color: #000;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 60%;
}

.tube-meta-tag {
    font-size: 6.5px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.tube-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 6.5px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    margin-top: 0.5px;
}

.tube-test-badge {
    font-weight: 800;
    font-size: 7px;
    color: #000;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 50%;
}

.tube-barcode-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0.5px 0;
}

.tube-barcode-wrap svg {
    width: 100% !important;
    max-width: 36mm !important;
    height: 8.5mm !important;
    display: block;
}

.tube-barcode-code {
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    color: #000;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.tube-row-sub {
    display: flex;
    justify-content: space-between;
    font-size: 6px;
    font-weight: 600;
    color: #475569;
    line-height: 1;
}

/* Sample Bill View Modal */
.sample-bill-modal-dialog {
    width: 720px;
    max-width: 95vw;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: diagModalFadeIn 0.2s ease-out;
}

.sample-bill-modal-body {
    padding: 16px;
    overflow-y: auto;
    background: #f1f5f9;
    flex: 1 1 auto;
}

.sample-bill-modal-body .a5-memo-sheet {
    display: block !important;
    width: 100% !important;
    max-width: 620px !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 14px 16px !important;
    color: #0f172a !important;
}

/* Imaging & Radiology Study Tag Styles */
.imaging-study-tag {
    width: 50mm !important;
    min-height: 25mm !important;
    max-width: 50mm !important;
    padding: 1.5mm 2mm !important;
    background: #ffffff !important;
    border: 1px dashed #64748b !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 7.5px !important;
    line-height: 1.15 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    color: #000000 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.imaging-tag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
    padding-bottom: 1px;
    margin-bottom: 2px;
    font-weight: 800;
    font-size: 7.5px;
    text-transform: uppercase;
}

.imaging-tag-patient {
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1.1;
    color: #000;
}

.imaging-tag-meta {
    font-size: 7px;
    line-height: 1.2;
    color: #000;
    margin-top: 1px;
}

.imaging-tag-barcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.imaging-tag-barcode svg {
    width: 100% !important;
    max-width: 44mm !important;
    height: 9mm !important;
    display: block;
}

.imaging-tag-barcode-code {
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #000;
    font-family: 'Courier New', monospace;
    text-align: center;
}

/* ==========================================================================
   Delta Hospital Official Clinical Laboratory Report Sheet (Matching PDF Standard)
   ========================================================================== */
.delta-report-sheet {
    background: #ffffff;
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 28px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: Arial, Tahoma, Helvetica, sans-serif;
    color: #0f172a;
    line-height: 1.35;
    position: relative;
    box-sizing: border-box;
}

.delta-report-header {
    border-bottom: 2px solid #0f766e;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.delta-hosp-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 6px;
}

.delta-hosp-logo {
    max-height: 52px;
    max-width: 140px;
    object-fit: contain;
}

.delta-logo-placeholder {
    font-size: 36px;
    line-height: 1;
}

.delta-hosp-info {
    flex: 1;
}

.delta-hosp-name {
    font-size: 20px;
    font-weight: 800;
    color: #0f766e;
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

.delta-hosp-tagline {
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 2px 0;
}

.delta-hosp-addr {
    font-size: 11px;
    color: #475569;
    margin: 0;
}

.delta-barcodes-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.delta-barcode-left,
.delta-barcode-right {
    min-width: 130px;
    text-align: center;
}

.delta-barcode-left svg,
.delta-barcode-right svg {
    max-height: 32px;
    max-width: 140px;
}

.delta-report-title-wrap {
    text-align: center;
    flex: 1;
}

.delta-report-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delta-patient-box {
    border: 1px solid #1e293b;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 11.5px;
    background: #ffffff;
}

.delta-patient-grid-4 {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 1.2fr 1.2fr;
    gap: 4px 12px;
}

.delta-patient-grid-3 {
    display: grid;
    grid-template-columns: 1.8fr 1.4fr 1.4fr;
    gap: 4px 12px;
}

.delta-patient-grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 2.6fr;
    gap: 4px 12px;
}

.delta-patient-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 12px;
}

.delta-cell {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.delta-cell.span-2 {
    grid-column: span 2;
}

.delta-lbl {
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
    font-size: 11px;
}

.delta-sep {
    color: #475569;
    font-weight: 700;
}

.delta-val {
    color: #0f172a;
    font-weight: 700;
    font-size: 11.5px;
}

.delta-pt-name {
    font-size: 12.5px;
    color: #0f172a;
}

.delta-analyzer-note {
    font-size: 10px;
    font-style: italic;
    color: #334155;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #cbd5e1;
}

.delta-hn-indicator {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.delta-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    margin-bottom: 16px;
}

.delta-results-table th {
    border-top: 1.5px solid #0f172a;
    border-bottom: 1.5px solid #0f172a;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    color: #0f172a;
    background: #f8fafc;
}

.delta-results-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.delta-results-table tr.delta-group-heading td {
    font-weight: 800;
    background: #f1f5f9;
    padding: 6px 8px;
    color: #0f172a;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #cbd5e1;
}

.delta-results-table tr.delta-test-separator-row td {
    background: #0f766e;
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    padding: 6px 10px;
    letter-spacing: 0.5px;
}

.delta-param-name {
    color: #0f172a;
}

.delta-sub-param {
    padding-left: 18px !important;
}

.delta-val-cell {
    font-size: 12px;
    color: #0f172a;
}

.delta-val-high {
    color: #b91c1c !important;
    font-weight: 800 !important;
}

.delta-val-low {
    color: #0284c7 !important;
    font-weight: 800 !important;
}

.delta-abnormal-marker {
    font-size: 9px;
    color: #b91c1c;
    margin-left: 3px;
}

.delta-unit-cell {
    color: #475569;
}

.delta-ref-cell {
    color: #334155;
    font-size: 11px;
    line-height: 1.3;
}

.delta-signatures-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 24px;
    padding-top: 12px;
    page-break-inside: avoid;
}

.delta-sign-col {
    max-width: 48%;
    font-size: 11px;
    line-height: 1.35;
}

.delta-sign-line {
    border-top: 1px solid #64748b;
    width: 190px;
    margin-bottom: 6px;
}

.delta-sign-name {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.delta-sign-sub {
    color: #475569;
    font-size: 10.5px;
}

.delta-report-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #cbd5e1;
    padding-top: 6px;
    margin-top: 14px;
    font-size: 10px;
    color: #64748b;
    page-break-inside: avoid;
}

/* Patient Memos Quick Bar */
.results-patient-memos-bar {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.results-patient-memos-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.results-memo-pill {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #059669;
    background: #ffffff;
    color: #059669;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.results-memo-pill.active,
.results-memo-pill:hover {
    background: #059669;
    color: #ffffff;
}

/* Print Toolbar in Results Page */
.results-print-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.results-print-mode-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media print {
    .delta-report-sheet {
        border: none !important;
        box-shadow: none !important;
        padding: 4mm 6mm !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
    }
    .results-print-toolbar,
    .results-patient-memos-bar,
    .results-form-card,
    .results-queue-card,
    .results-classic-topbar {
        display: none !important;
    }
}

/* ==========================================================================
   Delta Hospital Written Imaging & Radiology Report (X-Ray, USG, CT, MRI)
   ========================================================================== */
.delta-imaging-report-body {
    padding: 8px 0 16px 0;
}

.delta-imaging-study-header {
    background: #f1f5f9;
    border-left: 4px solid #0f766e;
    padding: 8px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.delta-imaging-lbl {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delta-imaging-study-name {
    font-size: 14px;
    color: #0f172a;
    letter-spacing: 0.3px;
}

.delta-film-counter-banner {
    background: #fffbeb;
    border: 1px solid #fef08a;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 11px;
    color: #854d0e;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.delta-imaging-section {
    margin-bottom: 18px;
    page-break-inside: avoid;
}

.delta-imaging-section-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 3px;
}

.delta-imaging-section-content {
    font-size: 12px;
    line-height: 1.7;
    color: #1e293b;
    white-space: pre-wrap;
    padding: 2px 4px;
    font-family: Arial, Tahoma, Helvetica, sans-serif;
}

.delta-imaging-counter-footer-notice {
    margin-top: 18px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 10.5px;
    color: #475569;
    line-height: 1.45;
}

/* Quick template pills for imaging editor */
.imaging-template-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
}

.imaging-template-btn {
    font-size: 11px;
    padding: 3px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #0f766e;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.imaging-template-btn:hover {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}


/* ==========================================================================
   Rich Hospital & Diagnostic Analytics Dashboard (Statistics & Disease Ratio)
   ========================================================================== */

.dash-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.dash-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--line, #e2e8f0);
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.dash-preset-pills {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.dash-pill-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dash-pill-btn.active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dash-custom-dates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
}

.dash-custom-dates input[type="date"] {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11.5px;
    background: #ffffff;
}

.dash-kpi-grid-6 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dash-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.dash-tab-item {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 750;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.18s ease;
    white-space: nowrap;
    margin-bottom: -2px;
}

.dash-tab-item:hover {
    color: #0284c7;
}

.dash-tab-item.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
}

.dash-tab-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 800;
}

.disease-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.disease-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.disease-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.disease-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.disease-card-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disease-ratio-big {
    font-size: 26px;
    font-weight: 850;
    line-height: 1.1;
    margin: 8px 0 4px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.disease-ratio-sub {
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 12px;
}

.disease-progress-track {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.disease-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.fill-critical { background: linear-gradient(90deg, #f87171, #ef4444); }
.fill-warning { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.fill-info { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.fill-success { background: linear-gradient(90deg, #34d399, #10b981); }

.disease-breakdown-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
    margin-top: 4px;
}

.disease-tag {
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.dash-timeline-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    margin-bottom: 24px;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.dash-table th {
    background: #f8fafc;
    padding: 10px 12px;
    font-weight: 750;
    color: #475569;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.dash-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.dash-table tr:hover td {
    background: #f8fafc;
}

.mini-ratio-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 110px;
}

.mini-bar-track {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.dash-alerts-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-alert-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    gap: 12px;
}

.dash-alert-row.warning {
    background: #fffbeb;
    border-color: #fef3c7;
    border-left-color: #f59e0b;
}

.dash-alert-row.info {
    background: #f0f9ff;
    border-color: #e0f2fe;
    border-left-color: #0284c7;
}

/* ==========================================================================
   Enhanced Diagnostic Results & Reporting System (User-Friendly UX)
   ========================================================================== */

.results-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.results-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.results-mode-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.results-mode-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.results-mode-btn.active.imaging {
    background: #0f766e;
    box-shadow: 0 1px 3px rgba(15, 118, 110, 0.3);
}

/* Quick Metrics Counters Bar */
.results-kpi-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.results-kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    background: #ffffff;
}

.results-kpi-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.results-kpi-pill.total {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.results-kpi-pill.pending {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.results-kpi-pill.draft {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.results-kpi-pill.verified {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.results-kpi-pill.active {
    box-shadow: 0 0 0 2px #0284c7;
}

/* Enhanced Right Queue Controls */
.results-queue-filter-wrap {
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.results-queue-tabs {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
}

.results-queue-tab {
    flex: 1;
    padding: 3px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.results-queue-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.results-queue-chip {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    margin-right: 3px;
    margin-top: 2px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Specimen Quick Selector Chips */
.specimen-chip-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.specimen-chip {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.12s ease;
}

.specimen-chip:hover {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
}

.specimen-chip.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

/* Enhanced Table Rows */
.results-row-high {
    background-color: #fff1f2 !important;
}

.results-row-high input {
    color: #b91c1c !important;
    font-weight: 800 !important;
}

.results-row-low {
    background-color: #fffbeb !important;
}

.results-row-low input {
    color: #b45309 !important;
    font-weight: 800 !important;
}

.results-row-critical {
    background-color: #fee2e2 !important;
    border-left: 3px solid #dc2626 !important;
}

.results-row-header {
    background-color: #f1f5f9 !important;
}

.results-row-header input {
    font-weight: 800 !important;
    color: #1e293b !important;
    text-transform: uppercase;
}

/* Action Toolbar above Parameters */
.results-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 6px;
    gap: 8px;
    flex-wrap: wrap;
}

.results-quick-btn {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.12s ease;
}

.results-quick-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.results-quick-btn.primary {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.results-quick-btn.primary:hover {
    background: #0369a1;
}

.results-quick-btn.success {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.results-quick-btn.success:hover {
    background: #047857;
}

/* Verified Badge Seal */
.results-verified-seal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 11px;
    font-weight: 750;
}

/* Pad Mode Support for Printing on Pre-printed Hospital Stationery */
.delta-pad-mode .delta-report-header {
    display: none !important;
}

.delta-pad-mode .delta-pad-spacer {
    height: 65mm;
    display: block;
}

@media print {
    .delta-pad-mode .delta-report-header {
        display: none !important;
    }
    .delta-pad-mode .delta-pad-spacer {
        height: 60mm !important;
        display: block !important;
    }
}



/* ==========================================================================
   EMERGENCY SERVICES & OT CASH MEMOS UI/UX STANDARDIZATION (POSIX & TICKETS PARADIGM)
   ========================================================================== */
.emergency-classic-fit .appt-classic-workspace,
.ot-classic-fit .appt-classic-workspace {
    padding: 0 !important;
    overflow: hidden !important;
    align-items: stretch;
}

.emergency-classic-fit .tickets-wide-card,
.ot-classic-fit .tickets-wide-card {
    max-width: none !important;
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.emergency-classic-fit .tickets-wide-card .appt-form-twocol,
.ot-classic-fit .tickets-wide-card .appt-form-twocol {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) !important;
    gap: 16px !important;
    padding: 10px 16px !important;
    align-content: start;
    height: calc(100% - 46px);
    overflow-y: auto;
}

.emergency-classic-fit .tickets-wide-card .appt-col-right,
.ot-classic-fit .tickets-wide-card .appt-col-right {
    padding-left: 16px;
    border-left: 1px solid #f1f5f9;
}

.emergency-classic-fit .appt-form-body input.classic-input,
.emergency-classic-fit .appt-form-body select.classic-input,
.emergency-classic-fit .appt-form-body .appt-unit-input-box,
.emergency-classic-fit .appt-form-body .tickets-change-box,
.ot-classic-fit .appt-form-body input.classic-input,
.ot-classic-fit .appt-form-body select.classic-input,
.ot-classic-fit .appt-form-body .appt-unit-input-box,
.ot-classic-fit .appt-form-body .tickets-change-box {
    height: 30px !important;
    min-height: 30px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
}

.emergency-classic-fit .appt-form-body input.classic-input:focus,
.emergency-classic-fit .appt-form-body select.classic-input:focus,
.emergency-classic-fit .appt-form-body .appt-unit-input-box:focus-within,
.ot-classic-fit .appt-form-body input.classic-input:focus,
.ot-classic-fit .appt-form-body select.classic-input:focus,
.ot-classic-fit .appt-form-body .appt-unit-input-box:focus-within {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
    outline: none !important;
}

.emergency-classic-fit .sex-btn-group,
.ot-classic-fit .sex-btn-group {
    height: 30px !important;
}

.emergency-classic-fit .sex-btn,
.ot-classic-fit .sex-btn {
    height: 30px !important;
    border-radius: 6px !important;
}

.emergency-classic-fit .appt-unit-input-box,
.ot-classic-fit .appt-unit-input-box {
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: stretch !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.emergency-classic-fit .appt-unit-input-box .appt-unit-input,
.ot-classic-fit .appt-unit-input-box .appt-unit-input {
    height: 100% !important;
    min-height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.emergency-classic-fit .appt-unit-input-box .appt-unit-addon,
.ot-classic-fit .appt-unit-input-box .appt-unit-addon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    background: #f1f5f9 !important;
    border-left: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    user-select: none !important;
}

/* Service Item Billing Table Clean Styles */
.emg-line-table-container {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    margin-top: 6px;
    min-height: 80px;
    max-height: 175px;
    display: flex;
    flex-direction: column;
}

.emg-line-table-head {
    display: grid;
    grid-template-columns: 28px 1fr 85px 50px 90px 32px;
    background: #f1f5f9;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 750;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.ot-line-table-head {
    display: grid;
    grid-template-columns: 28px 1fr 130px 80px 45px 85px 32px;
    background: #f1f5f9;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 750;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.emg-line-table-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

.emg-line-row {
    display: grid;
    grid-template-columns: 28px 1fr 85px 50px 90px 32px;
    align-items: center;
    padding: 5px 8px;
    font-size: 11.5px;
    border-bottom: 1px solid #f1f5f9;
}

.ot-line-row {
    display: grid;
    grid-template-columns: 28px 1fr 130px 80px 45px 85px 32px;
    align-items: center;
    padding: 5px 8px;
    font-size: 11.5px;
    border-bottom: 1px solid #f1f5f9;
}

.emg-line-row:nth-child(even),
.ot-line-row:nth-child(even) {
    background-color: #fafbfd;
}

.emg-line-row:hover,
.ot-line-row:hover {
    background-color: #f0fdf4;
}

/* POS Payment Panel Box */
.emg-pos-counter-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emg-pos-figures-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.emg-pos-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
}

.emg-pos-stat-lbl {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
}

.emg-pos-stat-val {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
}

.emg-pos-stat-val.gross {
    color: #334155;
}

.emg-pos-stat-val.discount {
    color: #059669;
    cursor: pointer;
}

.emg-pos-stat-val.due {
    color: #dc2626;
}

.emg-pos-stat-val.change {
    color: #0284c7;
}

/* OT Room Visual Chips */
.ot-room-radio-group {
    display: flex;
    gap: 6px;
    width: 100%;
}

.ot-room-radio-chip {
    flex: 1;
    height: 30px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ot-room-radio-chip:hover {
    border-color: #0f766e;
    background: #f0fdfa;
    color: #0f766e;
}

.ot-room-radio-chip.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 118, 110, 0.25);
}


/* ==========================================================================
   Emergency & OT Cash Memo Standard Polish (Search inputs, buttons, footer)
   ========================================================================== */
.emergency-classic-fit .appt-patient-search-combo,
.ot-classic-fit .appt-patient-search-combo {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
}

.emergency-classic-fit .appt-patient-search-combo input.classic-input,
.ot-classic-fit .appt-patient-search-combo input.classic-input {
    flex: 1 1 auto !important;
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 4px !important;
}

.emergency-classic-fit .appt-patient-search-combo .btn-find,
.ot-classic-fit .appt-patient-search-combo .btn-find {
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 12px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.emergency-classic-fit .appt-patient-search-combo .btn-find svg,
.ot-classic-fit .appt-patient-search-combo .btn-find svg {
    margin: 0 !important;
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0 !important;
}

.emergency-classic-fit .appt-doctor-search-combo-wrap .appt-doctor-search,
.ot-classic-fit .appt-doctor-search-combo-wrap .appt-doctor-search {
    position: relative !important;
    flex: 1 1 auto !important;
}

.emergency-classic-fit .appt-doctor-search-combo-wrap .appt-doctor-search input,
.ot-classic-fit .appt-doctor-search-combo-wrap .appt-doctor-search input {
    width: 100% !important;
    height: 30px !important;
    padding-right: 28px !important;
}

.emergency-classic-fit .diag-doctor-search-icon,
.ot-classic-fit .diag-doctor-search-icon {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #94a3b8 !important;
    display: inline-flex !important;
    align-items: center !important;
    pointer-events: none !important;
}

.emergency-classic-fit .diag-doctor-clear,
.ot-classic-fit .diag-doctor-clear {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 11px !important;
}

.emergency-classic-fit .appt-form-footer,
.ot-classic-fit .appt-form-footer,
.ipd-classic-fit .appt-form-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 9px 16px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

.emergency-classic-fit .appt-footer-right-actions,
.ot-classic-fit .appt-footer-right-actions,
.ipd-classic-fit .appt-footer-right-actions {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.tickets-type-dropdown-trigger:disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    border-color: #e2e8f0 !important;
}

.metric-card.metric-active {
    box-shadow: 0 0 0 2px #0284c7, 0 8px 16px rgba(2, 132, 199, 0.12) !important;
    transform: translateY(-2px) !important;
}

/* ==========================================================================
   Global Developer Branding Footer
   ========================================================================== */
.app-owner-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-owner-shell > .owner-page,
.app-owner-shell > .owner-invoice-page {
    flex: 1 0 auto;
}

.app-global-footer {
    margin-top: auto;
    flex: 0 0 auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e2e8f0;
    padding: 10px 24px;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.app-global-footer-inner {
    max-width: 1560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
}

.app-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.app-footer-logo {
    height: 20px;
    max-width: 90px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.app-footer-logo-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0284c7 0%, #0f172a 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.app-footer-dev-text strong {
    color: #0f172a;
    font-weight: 750;
}

.app-footer-sep {
    color: #cbd5e1;
    font-weight: 700;
}

.app-footer-copy {
    color: #64748b;
    font-size: 11.5px;
}

.app-footer-contact {
    color: #475569;
    font-size: 11.5px;
}

.app-footer-contact strong {
    color: #0f172a;
    font-weight: 700;
}

.print-dev-brand-footer {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 10px;
    color: #475569;
    line-height: 1.35;
    page-break-inside: avoid;
}

.print-dev-brand-left {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.print-dev-brand-left strong {
    color: #0f172a;
    font-weight: 750;
}

.print-dev-brand-logo {
    height: 14px;
    max-width: 72px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
}

.print-dev-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    background: #0f172a;
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
}

.print-dev-brand-sep {
    color: #94a3b8;
}

.print-dev-brand-contact {
    color: #334155;
    font-weight: 600;
}

.print-dev-brand-footer.compact-thermal {
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px dashed #000000;
    font-size: 9px;
    color: #000000;
    text-align: center;
    flex-direction: column;
    gap: 2px;
}

.print-dev-brand-footer.compact-thermal .print-dev-brand-sep {
    display: none;
}

.print-dev-brand-footer.compact-thermal .print-dev-brand-logo {
    height: 12px;
}

.print-dev-brand-footer.compact-thermal .print-dev-brand-badge {
    background: #000000;
    width: 13px;
    height: 13px;
    font-size: 7px;
}

.print-dev-brand-footer.compact-thermal .print-dev-brand-left strong,
.print-dev-brand-footer.compact-thermal .print-dev-brand-contact {
    color: #000000;
}

.main-content:has(:is(.patient-classic-fit, .appointments-classic-fit, .tickets-classic-fit, .emergency-classic-fit, .ot-classic-fit, .diagnostic-classic-fit, .worklist-classic-fit, .results-classic-fit, .ipd-classic-fit, .pharmacy-classic-fit, .doctor-queue-classic-fit, .doc-master-classic-fit, .canteen-classic-fit, .useradmin-container)) > .app-global-footer {
    margin-top: auto;
    flex: 0 0 auto;
    padding: 4px 16px;
    min-height: 26px;
}

.main-content:has(:is(.patient-classic-fit, .appointments-classic-fit, .tickets-classic-fit, .emergency-classic-fit, .ot-classic-fit, .diagnostic-classic-fit, .worklist-classic-fit, .results-classic-fit, .ipd-classic-fit, .pharmacy-classic-fit, .doctor-queue-classic-fit, .doc-master-classic-fit, .canteen-classic-fit, .useradmin-container)) > .app-global-footer .app-global-footer-inner {
    font-size: 11px;
    gap: 4px 10px;
}

.main-content:has(:is(.patient-classic-fit, .appointments-classic-fit, .tickets-classic-fit, .emergency-classic-fit, .ot-classic-fit, .diagnostic-classic-fit, .worklist-classic-fit, .results-classic-fit, .ipd-classic-fit, .pharmacy-classic-fit, .doctor-queue-classic-fit, .doc-master-classic-fit, .canteen-classic-fit, .useradmin-container)) > .app-global-footer .app-footer-logo {
    height: 16px;
}

.main-content:has(:is(.patient-classic-fit, .appointments-classic-fit, .tickets-classic-fit, .emergency-classic-fit, .ot-classic-fit, .diagnostic-classic-fit, .worklist-classic-fit, .results-classic-fit, .ipd-classic-fit, .pharmacy-classic-fit, .doctor-queue-classic-fit, .doc-master-classic-fit, .canteen-classic-fit, .useradmin-container)) > .app-global-footer .app-footer-logo-badge {
    width: 17px;
    height: 17px;
    font-size: 8.5px;
    border-radius: 4px;
}

.main-content:has(:is(.patient-classic-fit, .appointments-classic-fit, .tickets-classic-fit, .emergency-classic-fit, .ot-classic-fit, .diagnostic-classic-fit, .worklist-classic-fit, .results-classic-fit, .ipd-classic-fit, .pharmacy-classic-fit, .doctor-queue-classic-fit, .doc-master-classic-fit, .canteen-classic-fit, .useradmin-container)) > .app-global-footer .app-footer-copy {
    font-size: 10.5px;
}

/* ==========================================================================
   Mobile Responsiveness: Hamburger Drawer, Topbar, Patient Registration & Appointments
   ========================================================================== */
.mobile-backoffice-section {
    display: none;
}

@media (max-width: 1280px) {
    .mobile-nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        flex: 0 0 auto;
    }

    .mobile-close-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #334155;
        font-size: 15px;
        line-height: 1;
        flex-shrink: 0;
    }

    .mobile-close-btn:hover {
        background: #fee2e2;
        border-color: #fca5a5;
        color: #dc2626;
    }

    .sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1090 !important;
        background: rgba(15, 23, 42, 0.55);
    }

    .desktop-menu-host.mobile-open {
        display: flex !important;
        flex-direction: column;
        width: min(340px, 88vw) !important;
        padding: 12px 12px 24px !important;
        z-index: 1100 !important;
    }

    .mobile-menu-heading strong {
        font-size: 14px;
        font-weight: 800;
        color: #0f172a;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-right: 8px;
    }

    .legacy-menu-backdrop {
        display: none !important;
    }

    .legacy-menu-dropdown.mega-diagnostic-dropdown {
        min-width: 0 !important;
        width: auto !important;
        padding: 6px !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
    }

    .legacy-menu-entry {
        white-space: normal !important;
        height: auto !important;
        padding: 7px 10px !important;
    }

    .legacy-menu-entry.with-desc {
        padding: 7px 8px !important;
        min-height: 0 !important;
    }
}

@media (max-width: 1200px) {
    html:has(.patient-classic-fit),
    body:has(.patient-classic-fit) {
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .main-content:has(.patient-classic-fit) {
        height: auto !important;
        min-height: 100dvh !important;
        overflow: visible !important;
    }

    .main-content:has(.patient-classic-fit) > .page-content,
    .page-content:has(.patient-classic-fit) {
        height: auto !important;
        overflow: visible !important;
        overflow-x: hidden !important;
    }
}

@media (max-width: 1120px) {
    .patient-classic-fit .patient-sketch-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    .patient-classic-fit .sketch-media-pane {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
        align-items: center;
        gap: 14px;
    }

    .patient-classic-fit .sketch-media-pane .sketch-photo-wrap {
        width: auto;
    }

    .patient-classic-fit .sketch-media-pane .sketch-code-wrap {
        flex: 1 1 180px;
        max-width: 240px;
    }
}

@media (max-width: 992px) {
    html:has(.appointments-classic-fit),
    body:has(.appointments-classic-fit) {
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .main-content:has(.appointments-classic-fit) {
        height: auto !important;
        min-height: 100dvh !important;
        overflow: visible !important;
    }

    .main-content:has(.appointments-classic-fit) > .page-content {
        height: auto !important;
        overflow: visible !important;
        padding: 8px 10px 14px !important;
    }

    .appointments-classic-fit,
    .appt-classic-workspace,
    .appt-form-card,
    .appt-form-body {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .appointments-classic-fit > .appt-classic-workspace {
        padding: 0 !important;
    }

    .appt-classic-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
        height: auto;
    }

    .appt-top-left {
        flex-wrap: wrap;
        gap: 6px;
    }

    .appt-inline-alert {
        max-width: 100%;
        white-space: normal;
    }

    .appt-top-actions {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .appt-card-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .appt-card-header-title-wrap {
        flex-wrap: wrap;
        gap: 6px !important;
    }
}

@media (max-width: 960px) {
    .header-module-menus {
        display: none !important;
    }

    .mobile-backoffice-section {
        display: flex;
        flex-direction: column;
        gap: 3px;
        margin-top: 8px;
        padding-top: 10px;
        border-top: 1px solid #e2e8f0;
    }

    .mobile-backoffice-divider {
        padding: 4px 10px 6px;
        font-size: 10.5px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: #64748b;
    }

    .mobile-backoffice-link,
    .mobile-backoffice-toggle {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 9px 11px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: #334155;
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        box-sizing: border-box;
    }

    .mobile-backoffice-link:hover,
    .mobile-backoffice-toggle:hover {
        background: #f1f5f9;
        color: #0f172a;
    }

    .mobile-backoffice-link.active,
    .mobile-backoffice-toggle.is-open {
        background: #0284c7;
        color: #ffffff;
        font-weight: 700;
    }

    .mobile-backoffice-toggle.is-open .menu-root-caret {
        transform: rotate(180deg);
        color: #ffffff;
    }

    .mobile-backoffice-items {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin: 4px 0 6px 10px;
        padding: 4px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #f8fafc;
    }

    .mobile-backoffice-subitem {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 10px;
        border-radius: 6px;
        color: #334155;
        font-size: 12px;
        font-weight: 500;
        text-decoration: none;
    }

    .mobile-backoffice-subitem:hover,
    .mobile-backoffice-subitem.active {
        background: #e0f2fe;
        color: #0284c7;
        font-weight: 700;
    }

    .mobile-subitem-icon {
        font-size: 14px;
        flex-shrink: 0;
    }

    .page-content:has(.patient-classic-fit) {
        padding: 8px 10px 14px !important;
        overflow-x: hidden !important;
    }

    .patient-classic-fit {
        min-width: 0 !important;
        width: 100% !important;
    }

    .patient-classic-card {
        padding: 12px !important;
    }

    .patient-classic-fit .patient-sketch-layout {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .patient-classic-fit .sketch-left-pane {
        height: auto !important;
        gap: 8px !important;
    }

    .patient-classic-fit .sketch-row,
    .patient-classic-fit .sketch-row-dual,
    .patient-classic-fit .address-single-row,
    .patient-classic-fit .sketch-same-addr-row,
    .patient-classic-fit .classic-row {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }
}

@media (max-width: 640px) {
    .topbar {
        height: 56px !important;
        padding: 0 10px !important;
        gap: 6px;
    }

    .topbar-left {
        gap: 8px !important;
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar-brand {
        display: flex !important;
        min-width: 0 !important;
        max-width: calc(100vw - 175px) !important;
        gap: 7px !important;
    }

    .topbar-brand .brand-logo-img,
    .topbar-brand .brand-mark {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }

    .topbar-brand strong {
        font-size: 12.5px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 100% !important;
    }

    .topbar-actions {
        gap: 6px !important;
        flex-shrink: 0;
    }

    .header-settings-button {
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        justify-content: center;
    }

    .header-settings-label {
        display: none !important;
    }

    .header-settings-dropdown.header-settings-mega-dropdown {
        position: fixed !important;
        top: 58px !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100dvh - 70px) !important;
    }

    .header-settings-mega-top {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .settings-top-brand {
        flex: 1 1 calc(100% - 36px);
    }

    .settings-search-box {
        order: 3;
        flex: 1 1 100% !important;
        max-width: none !important;
    }

    .user-dropdown-menu {
        position: fixed !important;
        top: 58px !important;
        right: 8px !important;
        left: auto !important;
        max-width: calc(100vw - 16px) !important;
    }

    /* Patient Registration mobile form controls */
    .patient-classic-fit .patient-screen-fast-flow {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        padding: 8px 10px !important;
    }

    .patient-classic-fit .patient-screen-fast-flow .flow-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .patient-classic-fit .sketch-row-dual {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .patient-classic-fit .sketch-row,
    .patient-classic-fit .sketch-subfield,
    .patient-classic-fit .address-single-row {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
        align-items: stretch !important;
    }

    .patient-classic-fit .sketch-label,
    .patient-classic-fit .sketch-sublabel,
    .patient-classic-fit .addr-label {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 11.5px !important;
    }

    .patient-classic-fit .classic-input,
    .patient-classic-fit .id-search-combo .id-input,
    .patient-classic-fit .phone-search-combo .phone-input,
    .patient-classic-fit .age-subfield .editable-age-box {
        height: 36px !important;
        min-height: 36px !important;
        font-size: 13px !important;
    }

    .patient-classic-fit .id-search-combo .id-btn,
    .patient-classic-fit .phone-search-combo .id-btn {
        height: 36px !important;
        width: 38px !important;
        min-width: 38px !important;
    }

    .patient-classic-fit .age-quad-group,
    .patient-classic-fit .age-subfield {
        height: 36px !important;
        min-height: 36px !important;
        gap: 6px !important;
    }

    .patient-classic-fit .sex-btn-group {
        height: auto !important;
        min-height: 36px !important;
        gap: 6px !important;
    }

    .patient-classic-fit .sex-btn {
        height: 36px !important;
        font-size: 12px !important;
    }

    .patient-classic-fit .blood-btn-group {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 5px !important;
        height: auto !important;
    }

    .patient-classic-fit .blood-btn {
        height: 34px !important;
        font-size: 12px !important;
    }

    .patient-classic-fit .sketch-same-addr-row {
        padding: 4px 0 !important;
    }

    .patient-classic-fit .sketch-media-pane {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px !important;
    }

    .patient-classic-fit .sketch-media-pane .sketch-code-wrap {
        max-width: none !important;
    }

    .patient-classic-fit .sketch-photo-buttons {
        max-width: 240px !important;
    }

    .patient-classic-fit .btn-sketch-action {
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
    }

    .patient-classic-fit .sketch-footer-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding-top: 12px !important;
        margin-top: 12px !important;
    }

    .patient-classic-fit .sketch-footer-buttons {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .patient-classic-fit .sketch-footer-buttons #btn-save-profile {
        grid-column: 1 / -1 !important;
        height: 40px !important;
        font-size: 13px !important;
    }

    .patient-classic-fit .sketch-footer-buttons .btn {
        height: 36px !important;
        width: 100% !important;
    }

    .suggestions-dropdown {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    .webcam-video-wrap {
        width: min(320px, 100%) !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    /* Doctor Appointments mobile controls */
    .appt-top-actions .appt-date-filter-wrap {
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 4px 8px;
    }

    .appt-top-actions .tickets-print-mode-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .appt-top-actions .tickets-mode-pill {
        justify-content: center;
    }

    .appt-top-actions .appt-btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        height: 36px;
        min-height: 36px;
    }

    .appt-schedule-trigger-btn {
        width: 100%;
        justify-content: center;
        padding: 7px 12px;
    }

    .appt-form-twocol {
        padding: 12px !important;
        gap: 14px !important;
    }

    .appt-doctor-combo-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .appt-dept-filter-select {
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        height: 36px !important;
        font-size: 13px !important;
    }

    .appt-datetime-row,
    .appt-name-phone-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .appointments-classic-fit .classic-input,
    .appointments-classic-fit .appt-time-input {
        min-height: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }

    .appointments-classic-fit .sex-btn-group,
    .appointments-classic-fit .sex-btn {
        height: 36px !important;
        min-height: 36px !important;
    }

    .appt-doc-sched-top {
        flex-wrap: wrap !important;
    }

    .appt-doc-offday-top,
    .appt-doc-offday-switch-row,
    .appt-patient-header-row,
    .appt-date-header-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .appt-patient-suggestions {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    .appt-patient-option {
        grid-template-columns: auto minmax(0, 1fr) !important;
        row-gap: 2px;
    }

    .appt-patient-search-combo input.classic-input,
    .appt-patient-search-combo .btn-find {
        height: 36px !important;
        min-height: 36px !important;
    }

    .appt-patient-verified {
        flex-wrap: wrap;
        gap: 8px;
    }

    .appt-vitals-compact-stack {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .appt-field-age,
    .appt-field-weight,
    .appt-unit-input-box {
        width: 100% !important;
        max-width: none !important;
    }

    .appt-unit-input-box {
        height: 36px !important;
    }

    .appt-form-footer {
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .appt-footer-right-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
    }

    .appt-footer-right-actions .appt-book-btn {
        flex: 1 1 auto;
        height: 38px !important;
        justify-content: center;
    }

    .appt-footer-right-actions .appt-btn {
        height: 38px !important;
    }

    .appt-drawer-panel {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .appt-drawer-header,
    .appt-queue-filter-strip {
        flex-wrap: wrap;
        gap: 6px;
    }

    .appt-queue-item {
        flex-wrap: wrap;
    }

    .appt-queue-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px dashed #e2e8f0;
        padding-top: 6px;
        margin-top: 2px;
    }
}

/* ==========================================================================
   IPD Bed Occupancy Board - Classic-Fit Design (Matches Appointments/Tickets)
   ========================================================================== */
.ipd-bed-top-left {
    flex-wrap: wrap;
    min-width: 0;
}

.ipd-bed-kpi-pills {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.ipd-kpi-pill {
    font-size: 11px;
    font-weight: 650;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    white-space: nowrap;
}

.ipd-kpi-pill strong {
    font-weight: 800;
}

.ipd-kpi-pill.total {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.ipd-kpi-pill.occupied {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.ipd-kpi-pill.available {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.ipd-kpi-pill.cleaning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.ipd-kpi-pill.rate {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
}

.ipd-bed-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ipd-bed-board-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.ipd-bed-filter-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ipd-bed-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ipd-bed-filter-title h2 {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
}

.ipd-bed-filter-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.ipd-bed-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 300px;
}

.ipd-bed-search-icon {
    position: absolute;
    left: 8px;
    font-size: 12px;
    pointer-events: none;
    line-height: 1;
}

.ipd-bed-search-input {
    width: 100%;
    height: 29px !important;
    min-height: 29px !important;
    padding: 3px 26px 3px 28px !important;
    font-size: 11.5px !important;
    border-radius: 5px !important;
}

.ipd-bed-search-clear {
    position: absolute;
    right: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    line-height: 1;
}

.ipd-bed-filter-select {
    height: 29px !important;
    min-height: 29px !important;
    padding: 2px 8px !important;
    font-size: 11.5px !important;
    font-weight: 600;
    border-radius: 5px !important;
    width: auto !important;
    min-width: 145px;
    cursor: pointer;
}

.ipd-bed-board-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px;
    background: #f8fafc;
}

.ipd-classic-occupancy-grid {
    margin-top: 0 !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 12px !important;
}

.ipd-bed-empty-state {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
}

.ipd-classic-bed-card {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

.ipd-classic-bed-card.occupied {
    border-top: 3.5px solid #ef4444 !important;
}

.ipd-classic-bed-card.available {
    border-top: 3.5px solid #10b981 !important;
}

.ipd-classic-bed-card .bed-card-header {
    padding: 9px 12px !important;
    margin-bottom: 0 !important;
}

.ipd-classic-bed-card .bed-number {
    font-size: 13.5px !important;
}

.ipd-classic-bed-card .bed-category {
    font-size: 10.5px !important;
}

.ipd-classic-bed-card .bed-card-body {
    padding: 10px 12px !important;
}

.ipd-classic-bed-card .occupant-details {
    gap: 6px !important;
}

.ipd-classic-bed-card .occupant-name b {
    font-size: 12.5px !important;
}

.ipd-classic-bed-card .occupant-name small {
    font-size: 10.5px !important;
}

.ipd-classic-bed-card .occupant-meta {
    padding: 7px 9px !important;
    gap: 3px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
}

.ipd-classic-bed-card .bed-vacant-info {
    padding: 6px 0 !important;
}

.ipd-classic-bed-card .rate-tag {
    font-size: 17px !important;
}

.ipd-classic-bed-card .bed-card-footer {
    padding: 8px 10px !important;
    margin-top: 0 !important;
    gap: 6px !important;
    flex-wrap: wrap;
}

.ipd-bed-action-btn {
    height: 28px !important;
    min-height: 28px !important;
    padding: 3px 9px !important;
    font-size: 11px !important;
    flex: 1 1 auto;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 992px) {
    html:has(.ipd-classic-fit),
    body:has(.ipd-classic-fit) {
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .main-content:has(.ipd-classic-fit) {
        height: auto !important;
        min-height: 100dvh !important;
        overflow: visible !important;
    }

    .main-content:has(.ipd-classic-fit) > .page-content {
        height: auto !important;
        overflow: visible !important;
        padding: 8px 10px 14px !important;
    }

    .ipd-classic-fit,
    .ipd-bed-workspace,
    .ipd-bed-board-card,
    .ipd-bed-board-scroll {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .ipd-classic-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
        height: auto;
    }

    .ipd-bed-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }

    .ipd-bed-filter-controls {
        justify-content: stretch;
    }
}

@media (max-width: 640px) {
    .ipd-bed-search-wrap {
        max-width: none;
        flex: 1 1 100%;
    }

    .ipd-bed-search-input,
    .ipd-bed-filter-select {
        height: 36px !important;
        min-height: 36px !important;
        font-size: 13px !important;
        flex: 1 1 100%;
        width: 100% !important;
    }

    .ipd-classic-occupancy-grid {
        grid-template-columns: 1fr !important;
    }

    .ipd-bed-board-scroll {
        padding: 10px;
    }

    .ipd-bed-action-btn {
        height: 34px !important;
        min-height: 34px !important;
        font-size: 12px !important;
    }
}

/* ==========================================================================
   Unified Modern Login & Patient Portal Login Shell (Non-Scrollable + Sticky Footer)
   ========================================================================== */
.login-shell:has(.login-card) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 15%, rgba(224, 242, 254, 0.85) 0%, transparent 40%),
        radial-gradient(circle at 84% 82%, rgba(204, 251, 241, 0.55) 0%, transparent 42%),
        linear-gradient(rgba(248, 250, 252, 0.84), rgba(241, 245, 249, 0.90)),
        url('/images/saas-medical-bg.jpg') no-repeat center center / cover;
}

.login-shell:has(.login-card) > .login-shell-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
}

.login-shell:has(.login-card) > .app-global-footer {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 8px 16px;
}

.login-shell:has(.login-card) .login-card {
    width: min(410px, 100%);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 20px;
    padding: 24px 26px;
    box-shadow: 0 22px 55px -12px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    box-sizing: border-box;
}

.login-swipe-left {
    animation: loginSwipeLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-swipe-right {
    animation: loginSwipeRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginSwipeLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes loginSwipeRight {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.login-brand-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.login-brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    padding: 2px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.login-brand-fallback {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 20px;
    flex-shrink: 0;
}

.login-brand-text {
    min-width: 0;
    flex: 1;
}

.login-brand-text strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.login-brand-text small {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.25;
}

.login-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    margin: 0 0 18px;
}

.login-split-layout {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 410px);
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
    position: relative;
    isolation: isolate;
}

.login-company-watermark {
    position: fixed;
    z-index: 0;
    right: 22px;
    top: 50%;
    color: rgba(14, 116, 144, 0.22);
    font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-size: clamp(35px, 3.9vw, 66px);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.09em;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    filter: blur(1.8px);
    opacity: 0.58;
    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
}

.login-hero-pane {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 8px 4px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.login-card {
    position: relative;
    z-index: 1;
}

.login-hero-logo {
    width: 132px;
    height: 132px;
    object-fit: contain;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    padding: 8px;
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.login-hero-fallback {
    width: 132px;
    height: 132px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0284c7 0%, #0f766e 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 46px;
    box-shadow: 0 14px 34px rgba(2, 132, 199, 0.28);
}

.login-hero-title {
    margin: 0;
    font-size: clamp(28px, 3.6vw, 42px);
    font-weight: 850;
    color: #0f172a;
    line-height: 1.12;
    letter-spacing: -0.9px;
    word-break: break-word;
}

.login-hero-motto {
    margin: 0;
    font-size: clamp(14px, 1.4vw, 17px);
    font-weight: 500;
    color: #475569;
    line-height: 1.5;
    max-width: 440px;
}

@media (max-width: 860px) {
    .login-split-layout {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 16px;
    }

    .login-hero-pane {
        align-items: center;
        text-align: center;
        gap: 8px;
        padding: 0;
    }

    .login-hero-logo,
    .login-hero-fallback {
        width: 84px;
        height: 84px;
        border-radius: 14px;
        font-size: 30px;
    }

    .login-hero-title {
        font-size: 24px;
    }

    .login-hero-motto {
        font-size: 13px;
    }

    .login-company-watermark {
        display: none;
    }
}

.login-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    transition: all 0.16s ease;
    white-space: nowrap;
}

.login-mode-tab:hover {
    color: #0f172a;
}

.login-mode-tab.active {
    background: #ffffff;
    color: #0284c7;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.login-mode-tab.active.patient-active {
    color: #0f766e;
}

.login-alert {
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
}

.login-alert.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.login-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.login-form-modern {
    display: grid;
    gap: 13px;
}

.login-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.login-field {
    display: grid;
    gap: 5px;
    margin: 0;
}

.login-field > span {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.login-input {
    width: 100%;
    height: 41px !important;
    min-height: 41px !important;
    padding: 8px 12px !important;
    border: 1.5px solid #dbe3ec !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    font-size: 13.5px !important;
    font-weight: 500;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.login-input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14) !important;
}

.login-input.has-toggle {
    padding-right: 40px !important;
}

.login-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.login-eye-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.login-eye-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 2px 0;
}

.login-remember input {
    width: 15px;
    height: 15px;
    min-height: unset;
    accent-color: #0284c7;
    cursor: pointer;
}

.login-remember span {
    font-size: 12.5px;
    color: #475569;
    font-weight: 500;
}

.login-submit-btn {
    width: 100%;
    height: 42px;
    margin-top: 4px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
    transition: all 0.15s ease;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.36);
}

.login-submit-btn.patient-submit {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
}

.login-submit-btn.patient-submit:hover {
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.36);
}
