/* TrawLab Enterprise CSS Library */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Bootstrap 5 Theme Variable Overrides (Modern Medical Green & White) */
    --bs-primary: #15803d;
    --bs-primary-rgb: 21, 128, 61;
    --bs-success: #15803d;
    --bs-success-rgb: 21, 128, 61;
    --bs-link-color: #15803d;
    --bs-link-hover-color: #166534;
    --bs-body-bg: #f7faf8;
    --bs-body-color: #1f2937;
    --bs-border-color: #e2e8f0;

    /* Global Color System (Modern Medical Green & White) */
    --color-primary: #15803d;
    --color-primary-hover: #166534;
    --color-primary-active: #14532d;
    --color-primary-soft: #ecfdf5;
    --color-primary-border: #bbf7d0;
    --color-primary-rgb: 21, 128, 61;

    --color-success: #15803d;
    --color-success-hover: #166534;
    --color-success-soft: #ecfdf5;
    --color-success-rgb: 21, 128, 61;

    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-danger-soft: #fef2f2;
    --color-danger-rgb: 220, 38, 38;

    --color-warning: #d97706;
    --color-warning-hover: #b45309;
    --color-warning-soft: #fffbeb;
    --color-warning-rgb: 217, 119, 6;

    --color-info: #2563eb;
    --color-info-hover: #1d4ed8;
    --color-info-soft: #eff6ff;
    --color-info-rgb: 37, 99, 235;
    
    /* Layout & Card Colors (Clean White & Medical Off-White Canvas) */
    --bg-main: #f7faf8;
    --bg-card: #ffffff;
    --bg-navbar: #ffffff;
    --bg-navbar-rgb: 255, 255, 255;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text-main: #1f2937;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    
    /* Sidebar Styling (Modern Clean White SaaS Surface) */
    --bg-sidebar: #ffffff;
    --border-sidebar: #e2e8f0;
    --text-sidebar: #4b5563;
    --text-sidebar-hover: #15803d;
    --bg-sidebar-hover: #f1f5f9;
    --text-sidebar-active: #15803d;
    --bg-sidebar-active: #ecfdf5;
    --sidebar-accent-gradient: linear-gradient(135deg, #15803d 0%, #10b981 100%);

    /* Clinical Badges & Specimen Tube Standards (ISO 6710) */
    --tube-edta: #7c3aed;
    --tube-plain: #dc2626;
    --tube-fluoride: #64748b;
    --tube-heparin: #16a34a;
    --tube-citrate: #0284c7;

    --badge-purple-bg: #f3e8ff;
    --badge-purple-text: #7e22ce;
    --badge-teal-bg: #ccfbf1;
    --badge-teal-text: #0f766e;

    /* TrawLab Bento & Medical Forest Design System Tokens */
    --trawlab-canvas-bg: #F5F7F5;
    --trawlab-sidebar-bg: #F7FAF7;
    --trawlab-card-white: #FFFFFF;
    --trawlab-card-dark: #0A261D;              /* Deep Forest Medical Pine */
    --trawlab-card-dark-secondary: #10382B;    /* Lighter pine for sub-cards */
    --trawlab-card-dark-border: #164D3C;       /* Subtle dark emerald border */
    --trawlab-border-subtle: #E3E8E3;
    --trawlab-border-divider: #EFF3EF;

    --trawlab-primary: #15803D;                /* Core Brand Green (#15803d) */
    --trawlab-primary-hover: #166534;
    --trawlab-primary-active: #14532D;
    --trawlab-anchor-icon: #14532D;            /* KPI Icon Background */
    --trawlab-accent-lime: #52D645;            /* Active Nav / Peak Highlight */
    --trawlab-accent-lime-bg: #E8F9E4;
    --trawlab-accent-lime-text: #174212;

    --trawlab-text-main: #141A17;
    --trawlab-text-secondary: #535D56;
    --trawlab-text-muted: #6B7770;
    --trawlab-text-light-muted: #9AA0A4;
}

/* Dark Theme Overrides */
html[data-theme="dark"] {
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-link-color: #34d399;
    --bs-link-hover-color: #6ee7b7;
    --bs-body-bg: #090d16;
    --bs-body-color: #f8fafc;
    --bs-border-color: #242c42;

    --color-primary: #10b981;
    --color-primary-hover: #059669;
    --color-primary-active: #047857;
    --color-primary-soft: rgba(16, 185, 129, 0.15);
    --color-primary-border: rgba(16, 185, 129, 0.3);
    --color-primary-rgb: 16, 185, 129;

    --bg-main: #090d16;
    --bg-card: #151b2c;
    --bg-navbar: #111625;
    --bg-navbar-rgb: 17, 22, 37;
    --border-color: #242c42;
    --border-subtle: #1e2538;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --bg-sidebar: #111625;
    --border-sidebar: #242c42;
    --text-sidebar: #94a3b8;
    --text-sidebar-hover: #f1f5f9;
    --bg-sidebar-hover: #1e293b;
    --text-sidebar-active: #ffffff;
    --bg-sidebar-active: rgba(16, 185, 129, 0.2);
    --sidebar-accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

    --badge-purple-bg: rgba(147, 51, 234, 0.2);
    --badge-purple-text: #c084fc;
    --badge-teal-bg: rgba(20, 184, 166, 0.2);
    --badge-teal-text: #5eead4;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

.bg-purple-subtle { background-color: var(--badge-purple-bg) !important; }
.text-purple { color: var(--badge-purple-text) !important; }
.bg-teal-subtle { background-color: var(--badge-teal-bg) !important; }
.text-teal { color: var(--badge-teal-text) !important; }

/* TrawLab Bento & Medical Forest Architecture */
.bento-card {
    background-color: var(--trawlab-card-white, #ffffff);
    border: 1px solid var(--trawlab-border-subtle, #E3E8E3);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
html[data-theme="dark"] .bento-card {
    background-color: var(--bg-card, #1e293b);
    border-color: var(--border-color, #334155);
}
.bento-card-dark {
    background-color: var(--trawlab-card-dark, #0A261D);
    border: 1px solid var(--trawlab-card-dark-border, #164D3C);
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(10, 38, 29, 0.18);
}
.kpi-anchor-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: var(--trawlab-anchor-icon, #14532D);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tnum {
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .sidebar-brand-text {
    color: #f8fafc;
}
html[data-theme="dark"] .menu-link.active i {
    color: #10b981 !important;
}
html[data-theme="dark"] .menu-group-items {
    border-left-color: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Hallmark Display Heads & Overflow Defense */
h1, h2, h3, h4, h5, h6, .app-page-title, .dashboard-title {
    overflow-wrap: break-word;
    min-width: 0;
}

/* Hallmark Tabular Numerics for Clinical & Financial Data */
.lims-table td, .app-table td, .font-monospace, .stat-value, .stat-number, .kpi-metric-card h3, .kpi-metric-card h4 {
    font-variant-numeric: tabular-nums lining-nums;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.25s ease, color 0.25s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout Architecture */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.app-body-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 64px);
    position: relative;
}

/* Sidebar Styling (Under Full-Width Top Header) */
.sidebar-wrapper {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    flex-shrink: 0;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    position: sticky;
    top: 64px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2026 SaaS Rail Mode (Collapsed Desktop Sidebar) */
@media (min-width: 992px) {
    .sidebar-wrapper.collapsed {
        width: 72px;
    }
    .sidebar-wrapper.collapsed .sidebar-brand {
        padding: 0 0.5rem;
        justify-content: center !important;
    }
    .sidebar-wrapper.collapsed .sidebar-top-bar {
        padding: 0.5rem 0.25rem !important;
        justify-content: center !important;
    }
    .sidebar-wrapper.collapsed .sidebar-top-bar .sidebar-search-box {
        max-width: 38px;
    }
    .sidebar-wrapper.collapsed .sidebar-top-bar .sidebar-search-box button {
        padding: 0.45rem !important;
        justify-content: center !important;
    }
    .sidebar-wrapper.collapsed .sidebar-brand-text,
    .sidebar-wrapper.collapsed .sidebar-text-hide,
    .sidebar-wrapper.collapsed .menu-link span,
    .sidebar-wrapper.collapsed .arrow-icon,
    .sidebar-wrapper.collapsed .menu-group-header > span > span {
        display: none !important;
    }
    .sidebar-wrapper.collapsed .sidebar-rail-toggle {
        display: none !important;
    }
    .sidebar-wrapper.collapsed .menu-header {
        font-size: 0;
        height: 1px;
        background: var(--border-sidebar);
        margin: 0.75rem 0.5rem;
        padding: 0;
    }
    .sidebar-wrapper.collapsed .menu-link {
        justify-content: center;
        padding: 0.65rem 0;
        margin: 0.2rem 0.35rem;
        border-radius: 8px;
    }
    .sidebar-wrapper.collapsed .menu-link i {
        margin-right: 0;
        font-size: 1.25rem;
    }
    .sidebar-wrapper.collapsed .menu-group-header {
        justify-content: center;
        padding: 0.65rem 0;
        margin: 0.2rem 0.35rem;
        border-radius: 8px;
    }
    .sidebar-wrapper.collapsed .menu-group-header i.group-icon {
        margin-right: 0;
        font-size: 1.25rem;
    }
    .sidebar-wrapper.collapsed .menu-group-items {
        padding-left: 0 !important;
        margin-left: 0 !important;
        border-left: none !important;
    }
    .sidebar-wrapper.collapsed .menu-group-items .menu-link {
        justify-content: center;
        padding: 0.5rem 0;
        margin: 0.15rem 0.35rem;
    }
    .sidebar-wrapper.collapsed .sidebar-user-footer {
        padding: 0.75rem 0.35rem !important;
        justify-content: center;
    }
    .sidebar-wrapper.collapsed .sidebar-user-footer .sidebar-text-hide {
        display: none !important;
    }
}

.sidebar-brand {
    height: 70px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-bottom: 1px solid var(--border-sidebar);
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main, #1f2937);
    letter-spacing: -0.025em;
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem 0.65rem;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.menu-header {
    font-size: 0.75rem;
    text-transform: none;
    font-weight: 600;
    letter-spacing: normal;
    color: #64748b;
    padding: 0.65rem 0.65rem 0.2rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Collapsible Accordion Sidebar Logic */
.menu-group-header {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    color: var(--text-sidebar);
    font-size: 0.81rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease, background-color 0.15s ease;
    margin-bottom: 0.1rem;
}

.menu-group-header:hover {
    color: var(--text-sidebar-hover);
    background-color: var(--bg-sidebar-hover);
}

.menu-group-header i.group-icon {
    font-size: 0.95rem;
    margin-right: 0.65rem;
}

.menu-group-header i.arrow-icon {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.menu-group-header.collapsed i.arrow-icon {
    transform: rotate(-90deg);
}

.menu-group-items {
    list-style: none;
    padding-left: 0.85rem;
    margin-left: 0.65rem;
    border-left: 1px solid var(--border-color, #e2e8f0);
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
    transition: max-height 0.25s ease-out;
    overflow: hidden;
}

.menu-group-items.collapsed {
    max-height: 0 !important;
    margin-top: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.42rem 0.65rem;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.81rem;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
    margin-bottom: 0.1rem;
}

.menu-link:hover {
    color: var(--text-sidebar-hover);
    background-color: var(--bg-sidebar-hover);
}

.menu-link i {
    font-size: 0.95rem;
    margin-right: 0.65rem;
    transition: color 0.15s ease;
}

.menu-link.active {
    color: var(--trawlab-accent-lime-text, #174212) !important;
    background: var(--trawlab-accent-lime, #52D645) !important;
    border-radius: 10px !important;
    border-left: none !important;
    box-shadow: 0 1px 4px rgba(82, 214, 69, 0.28);
    font-weight: 700;
}

.menu-link.active i {
    color: var(--trawlab-accent-lime-text, #174212) !important;
}

html[data-theme="dark"] .menu-link.active {
    color: #ffffff !important;
    background: rgba(16, 185, 129, 0.2) !important;
    border-left: 3px solid #10b981 !important;
}

html[data-theme="dark"] .menu-link.active i {
    color: #10b981 !important;
}

#app-sidebar.collapsed .sidebar-top-bar {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

#app-sidebar.collapsed .sidebar-top-bar #sidebar-collapse-btn {
    margin: 0 auto !important;
}

/* Main Area Layout (Alongside Sidebar Under Header) */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: calc(100vh - 64px);
    background-color: var(--bg-main);
    position: relative;
}

.top-navbar {
    height: 64px;
    width: 100%;
    background-color: rgba(var(--bg-navbar-rgb, 255, 255, 255), 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.tenant-workspace-bar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.status-pulse-dot {
    display: inline-block;
    border-radius: 50%;
}

.command-item {
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.command-item:hover {
    background-color: var(--bg-sidebar-hover, rgba(0, 0, 0, 0.05));
    transform: translateX(2px);
}
.hover-bg:hover {
    background-color: rgba(148, 163, 184, 0.12);
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* Enterprise Components */
.lims-card,
.card-premium,
.dashboard-card,
.app-card {
    background-color: var(--trawlab-card-white, #ffffff);
    border: 1px solid var(--trawlab-border-subtle, #E3E8E3);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    margin-bottom: 1.5rem;
}

.lims-card:hover,
.card-premium:hover,
.dashboard-card:hover,
.app-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Legacy Utility Color Aliasing to Modern Medical Green */
.text-indigo, .text-indigo-500, .text-indigo-600 { color: var(--color-primary, #15803d) !important; }
.bg-indigo { background-color: var(--color-primary, #15803d) !important; }
.bg-indigo-50 { background-color: var(--color-primary-soft, #ecfdf5) !important; }

.lims-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.lims-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

/* KPI Stat Cards */
.lims-stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
}

.lims-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: white;
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.stat-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.stat-change.up { color: var(--color-success); }
.stat-change.down { color: var(--color-danger); }

/* Premium Tables */
.lims-table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-card);
}

.lims-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.lims-table th {
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.lims-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.lims-table tr:last-child td {
    border-bottom: none;
}

.lims-table tr {
    transition: background-color 0.15s ease;
}

.lims-table tr:hover {
    background-color: rgba(21, 128, 61, 0.035);
}

/* Standardized Form Controls & Focus Rings */
.form-control, .form-select {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    background-color: var(--bg-card, #ffffff);
    color: var(--text-main, #1f2937);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary, #15803d) !important;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18) !important;
    outline: none !important;
}

/* Standardized Buttons & Hallmark Tactile Feedback */
.btn {
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:active {
    transform: scale(0.985);
}

/* Standardized Status Badges */
.badge {
    border-radius: var(--radius-pill, 9999px);
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

.badge.bg-primary {
    background-color: var(--color-primary-soft, #ecfdf5) !important;
    color: var(--color-primary, #15803d) !important;
    border: 1px solid var(--color-primary-border, #bbf7d0) !important;
}

.badge.bg-success {
    background-color: var(--color-success-soft, #ecfdf5) !important;
    color: var(--color-success, #15803d) !important;
    border: 1px solid var(--color-success-border, #bbf7d0) !important;
}

.badge.bg-warning {
    background-color: var(--color-warning-soft, #fffbeb) !important;
    color: var(--color-warning, #d97706) !important;
    border: 1px solid var(--color-warning-border, #fde68a) !important;
}

.badge.bg-danger {
    background-color: var(--color-danger-soft, #fef2f2) !important;
    color: var(--color-danger, #dc2626) !important;
    border: 1px solid var(--color-danger-border, #fecaca) !important;
}

.badge.bg-info {
    background-color: var(--color-info-soft, #eff6ff) !important;
    color: var(--color-info, #2563eb) !important;
    border: 1px solid var(--color-info-border, #bfdbfe) !important;
}

.badge.bg-secondary,
.badge.bg-light {
    background-color: #f8fafc !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
}

.lims-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2rem;
    text-transform: capitalize;
    line-height: 1;
}

/* LIMS Specific Badges */
.lims-badge-draft { background-color: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.lims-badge-verified { background-color: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.lims-badge-approved { background-color: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.lims-badge-final { background-color: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.lims-badge-corrected { background-color: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.lims-badge-cancelled { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.lims-badge-due { background-color: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.lims-badge-partial { background-color: #fefce8; color: #ca8a04; border: 1px solid #fef08a; }
.lims-badge-paid { background-color: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }

.lims-badge-pending { background-color: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.lims-badge-collected { background-color: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.lims-badge-received { background-color: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.lims-badge-rejected { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Buttons styling */
.lims-btn-primary {
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lims-btn-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.lims-btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lims-btn-outline:hover {
    background-color: var(--bg-main);
    border-color: var(--text-muted);
}

/* Theme Selector Toggle Button Custom */
.btn-theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.btn-theme-toggle:hover {
    background-color: var(--bg-main);
}

/* Toast System Styling */
.toast-container-custom {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-custom.border-success { border-left: 4px solid var(--color-success); }
.toast-custom.border-danger { border-left: 4px solid var(--color-danger); }
.toast-custom.border-warning { border-left: 4px solid var(--color-warning); }

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Auth split panel layout styling - TrawLab 2026 Enterprise */
:root {
    --traw-green: #37A15E;
    --traw-green-hover: #247C44;
    --traw-green-soft: rgba(55, 161, 94, 0.12);
    --traw-green-glow: rgba(55, 161, 94, 0.25);
    --traw-dark: #0c1a14;
    --traw-dark-gradient: linear-gradient(145deg, #07130e 0%, #0c1a14 45%, #132b1e 100%);
    --traw-slate: #516578;
}

.auth-split-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-main, #f8fafc);
}

.auth-brand-panel {
    flex: 1.25;
    background: var(--traw-dark-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem 4rem;
    position: relative;
    overflow: hidden;
}

.auth-form-panel {
    flex: 0.95;
    background-color: var(--bg-main, #f8fafc);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    min-height: 100vh;
}

/* Mobile Brand Header - Visible only on mobile/tablet viewports (<992px) */
.auth-mobile-header {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
    width: 100%;
    max-width: 440px;
}

.auth-mobile-header img {
    height: 44px;
    max-width: 220px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.auth-mobile-header .auth-mobile-subtitle {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
    margin: 0;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background-color: var(--bg-card, #ffffff);
    border: 1px solid rgba(55, 161, 94, 0.16);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 20px 45px -15px rgba(12, 26, 20, 0.1), 0 2px 12px rgba(0, 0, 0, 0.04);
}

.auth-card.auth-card-wide {
    max-width: 640px;
}

.btn-auth-primary {
    height: 48px;
    font-weight: 600;
    font-size: 0.9375rem;
    background: linear-gradient(135deg, #37A15E 0%, #247C44 100%);
    border: none;
    color: #ffffff !important;
    border-radius: 0.625rem;
    box-shadow: 0 4px 14px rgba(55, 161, 94, 0.28);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    cursor: pointer;
}

.btn-auth-primary:hover {
    background: linear-gradient(135deg, #2fa35b 0%, #1d6a38 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(55, 161, 94, 0.38);
    color: #ffffff !important;
}

.btn-auth-primary:active {
    transform: translateY(0);
}

/* Floating Form Control Adornments */
.adorned-input-wrapper {
    position: relative;
    width: 100%;
}

.adorned-input-wrapper > i {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 5;
}

.adorned-input-wrapper input {
    height: 48px;
    padding-left: 2.75rem;
    border-radius: 0.625rem;
    border: 1px solid #d1d5db;
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #ffffff;
}

.adorned-input-wrapper input:focus {
    border-color: #37A15E !important;
    box-shadow: 0 0 0 3px rgba(55, 161, 94, 0.18) !important;
    outline: none;
}

.auth-brand-panel {
    flex: 1.2;
    background: linear-gradient(135deg, #064e3b 0%, #14532d 40%, #15803d 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.22) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
}

.auth-form-panel {
    flex: 0.8;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-card.auth-card-wide {
    max-width: 580px;
}

/* Password Strength Meter */
.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
    display: flex;
    gap: 4px;
}

.password-strength-segment {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    background-color: var(--border-color, #e2e8f0);
    transition: background-color 0.2s ease;
}

.password-strength-segment.active-weak { background-color: var(--color-danger, #dc2626); }
.password-strength-segment.active-fair { background-color: var(--color-warning, #d97706); }
.password-strength-segment.active-good { background-color: #2563eb; }
.password-strength-segment.active-strong { background-color: var(--color-primary, #15803d); }

/* Floating Form Control Adornments */
.adorned-input-wrapper {
    position: relative;
}

.adorned-input-wrapper > i {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.adorned-input-wrapper input {
    padding-left: 2.75rem;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .auth-brand-panel {
        display: none !important;
    }
    .auth-form-panel {
        flex: 1;
        width: 100%;
        padding: 2.5rem 1.25rem;
    }
    .auth-mobile-header {
        display: flex !important;
    }
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 1rem;
    }
    .auth-card.auth-card-wide {
        max-width: 100%;
    }
    .sidebar-wrapper {
        transform: translateX(-100%) !important;
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 85vw !important;
        height: calc(100vh - 64px) !important;
        z-index: 1040 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        box-shadow: none !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s ease !important;
    }
    .sidebar-wrapper.show {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.35) !important;
    }
    .sidebar-wrapper:not(.show) {
        transform: translateX(-100%) !important;
        visibility: hidden !important;
        pointer-events: none !important;
        box-shadow: none !important;
    }

    /* Prevent rail-mode collapse styles from affecting mobile drawer */
    .sidebar-wrapper.collapsed {
        width: 280px !important;
        min-width: 280px !important;
    }
    .sidebar-wrapper.collapsed .sidebar-brand-text,
    .sidebar-wrapper.collapsed .sidebar-text-hide,
    .sidebar-wrapper.collapsed .menu-link span,
    .sidebar-wrapper.collapsed .arrow-icon,
    .sidebar-wrapper.collapsed .menu-group-header > span > span {
        display: inline !important;
    }
    .sidebar-wrapper.collapsed .menu-link {
        justify-content: flex-start !important;
        padding: 0.42rem 0.65rem !important;
    }
    .sidebar-wrapper.collapsed .menu-group-header {
        justify-content: space-between !important;
        padding: 0.45rem 0.65rem !important;
    }

    /* Mobile drawer: Fix negative left margin / text indent causing label clipping at 375px */
    .sidebar-nav,
    .sidebar-menu {
        padding-left: 1.25rem !important;
        margin-left: 0 !important;
        text-indent: 0 !important;
    }
    .sidebar-nav .menu-link,
    .sidebar-menu .menu-link {
        padding-left: 0.75rem !important;
        margin-left: 0 !important;
        text-indent: 0 !important;
    }
    .sidebar-nav .menu-group-header,
    .sidebar-menu .menu-group-header {
        padding-left: 0.75rem !important;
        margin-left: 0 !important;
        text-indent: 0 !important;
    }
    .content-body {
        padding: 1.25rem 1rem;
    }
    .top-navbar {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 1rem 0.75rem;
    }
    .app-page-header {
        padding: 1rem;
    }
    .lims-card {
        padding: 1rem;
    }
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }
}

/* Desktop table overflow: Remove rigid container widths forcing horizontal scrollbar on viewports >= 1280px */
@media (min-width: 1280px) {
    .table-responsive {
        overflow-x: visible !important;
    }
    .app-table-card .table-responsive,
    .app-form-section .table-responsive {
        overflow-x: visible !important;
    }
    .app-table {
        width: 100% !important;
    }
    .app-page-container {
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Standardized Table Typography, Cell Alignment & Text Wrapping Invariants
   ========================================================================== */
.app-table th,
.table thead th {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: #334155 !important;
    padding: 0.65rem 0.85rem !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

html[data-theme="dark"] .app-table th,
html[data-theme="dark"] .table thead th {
    color: #94a3b8 !important;
}

.app-table td,
.table tbody td {
    font-size: 0.84375rem !important;
    color: var(--text-main, #1e293b) !important;
    padding: 0.65rem 0.85rem !important;
    vertical-align: middle !important;
}

.col-nowrap,
.table td.col-nowrap,
.table th.col-nowrap {
    white-space: nowrap !important;
}

.col-actions {
    white-space: nowrap !important;
    width: 1%;
    text-align: right;
}

/* ==========================================================================
   Comprehensive Print Media Stylesheet (NABL / ISO 15189 Compliant)
   ========================================================================== */
@media screen {
    .print-only {
        display: none !important;
    }
}

@page {
    size: A4 portrait;
    margin: 10mm 12mm 12mm 12mm;
}

@media print {
    /* 1. Hide All Web Application Navigation Chrome */
    .top-navbar,
    .mobile-bottom-nav,
    .sidebar-wrapper,
    .sidebar-backdrop,
    .app-drawer,
    .app-drawer-backdrop,
    .btn,
    button,
    footer,
    .toast-container-custom,
    .app-command-trigger,
    .api-health-meter,
    .app-page-header,
    .breadcrumb,
    .no-print,
    .action-ribbon,
    .card-header,
    #processingOverlay,
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    /* 2. Show Print-Only Letterhead Elements */
    .print-only {
        display: block !important;
    }

    /* 3. Pre-Printed Stationery Mode Toggle */
    body.hide-letterhead .clinic-letterhead-header {
        visibility: hidden !important;
        height: 38mm !important; /* Preserves blank space for pre-printed letterhead */
        margin-bottom: 5mm !important;
    }

    /* 4. Canvas & Layout Reset */
    html, body, .app-wrapper, .main-wrapper, .content-body, .container-fluid, .col-12 {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #0f172a !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
        font-size: 8.5pt !important;
        line-height: 1.35 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .card, .app-table-card, .lims-card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card-body {
        padding: 0 !important;
    }

    /* 5. Patient Demographics Box */
    .patient-info-box {
        border: 1px solid #cbd5e1 !important;
        border-radius: 4px !important;
        background-color: #f8fafc !important;
        padding: 8px 12px !important;
        margin-bottom: 12px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 6. Medical Tables & Page-Break Governance */
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 12px !important;
    }

    thead {
        display: table-header-group !important; /* Repeats table header across pages */
    }

    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .table th {
        background-color: var(--color-primary, #15803d) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        font-size: 8.5pt !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        padding: 5px 8px !important;
        border: 1px solid var(--color-primary, #15803d) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .table td {
        border-bottom: 1px solid #e2e8f0 !important;
        border-top: none !important;
        border-left: none !important;
        border-right: none !important;
        padding: 4px 8px !important;
        font-size: 8pt !important;
    }

    .table-light, tr.table-light td {
        background-color: #f1f5f9 !important;
        color: var(--color-primary, #15803d) !important;
        font-weight: 600 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 7. Category & Signature Block Integrity */
    .category-block {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 12px !important;
    }

    .report-signatures {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-top: 24px !important;
        padding-top: 12px !important;
    }

    .page-break-avoid {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .page-break-before {
        page-break-before: always !important;
        break-before: page !important;
    }

    /* 8. Abnormal & Panic Highlight in Print */
    .text-danger, .badge.bg-danger {
        color: #b91c1c !important;
        font-weight: 800 !important;
    }
}

/* ==========================================================================
   2026 Mobile-First & User-Friendly UI/UX System
   ========================================================================== */

/* 1. Mobile App Bottom Navigation Bar (Thumb-Zone Navigation) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    background-color: rgba(var(--bg-navbar-rgb, 255, 255, 255), 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color, #e2e8f0);
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

.mobile-bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    background: transparent;
    border: none;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
    min-width: 58px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 0.2rem;
    transition: transform 0.15s ease;
}

.mobile-nav-item:active {
    transform: scale(0.92);
}

.mobile-nav-item.active {
    color: var(--color-primary, #15803d);
    font-weight: 700;
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
    color: var(--color-primary, #15803d);
}

/* Center Highlight FAB Item in Mobile Nav */
.mobile-nav-highlight {
    position: relative;
    top: -12px;
}

.mobile-nav-fab-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--sidebar-accent-gradient, linear-gradient(135deg, #15803d 0%, #10b981 100%));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(21, 128, 61, 0.4);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-fab-icon i {
    font-size: 1.4rem !important;
    margin-bottom: 0 !important;
    color: #ffffff;
}

.mobile-nav-highlight:active .mobile-nav-fab-icon {
    transform: scale(0.88);
}

/* 2. Mobile-Native Bottom Sheet Modals (< 576px) */
@media (max-width: 576px) {
    .modal.fade.modal-bottom-sheet .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal.show.modal-bottom-sheet .modal-dialog {
        transform: translateY(0);
    }

    .modal.modal-bottom-sheet .modal-content {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 20px !important;
        border-top-right-radius: 20px !important;
        border: none !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25) !important;
        max-height: 85vh;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .modal.modal-bottom-sheet .modal-content::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background-color: var(--border-color, #cbd5e1);
        margin: 8px auto 4px auto;
    }

    .modal.modal-bottom-sheet .modal-header {
        padding: 0.85rem 1.25rem 0.5rem 1.25rem !important;
    }

    .modal.modal-bottom-sheet .modal-body {
        padding: 1.25rem !important;
    }

    .modal.modal-bottom-sheet .modal-footer {
        padding: 0.85rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px)) 1.25rem !important;
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .modal.modal-bottom-sheet .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
        min-height: 44px;
    }
}

/* 3. Mobile Worklist Cards & Stack Layout */
@media (max-width: 768px) {
    /* Ensure content is never obscured by the sticky bottom nav */
    .content-body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* 44px Minimum Touch Target Standard */
    .btn,
    .form-control,
    .form-select,
    .app-input,
    .app-select {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.4rem 0.75rem;
    }

    /* Mobile Worklist Card Component */
    .mobile-worklist-card {
        background-color: var(--bg-card, #ffffff);
        border: 1px solid var(--border-color, #e2e8f0);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 0.875rem;
        box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .mobile-worklist-card:active {
        transform: scale(0.99);
    }

    .mobile-worklist-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 0.65rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px dashed var(--border-color, #e2e8f0);
    }

    .mobile-worklist-card-body {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        font-size: 0.825rem;
        margin-bottom: 0.75rem;
    }

    .mobile-worklist-card-footer {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color, #e2e8f0);
    }

    .mobile-worklist-metrics-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        background: var(--bg-body, #f8fafc);
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        margin: 0.35rem 0;
        font-size: 0.8rem;
    }

    .mobile-worklist-card-footer .btn {
        flex: 1;
        min-height: 44px;
        font-size: 0.825rem;
    }

    .mobile-worklist-card .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Sticky Mobile Action Ribbon on Long Forms */
    .mobile-sticky-actions {
        position: fixed;
        bottom: 64px;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        background-color: rgba(var(--bg-navbar-rgb, 255, 255, 255), 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-color, #e2e8f0);
        z-index: 1025;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
        display: flex;
        gap: 0.5rem;
    }

    .mobile-sticky-actions .btn {
        flex: 1;
        min-height: 42px;
    }

    /* Mobile Header Cleanup */
    .top-navbar {
        height: 56px;
        padding: 0 0.75rem;
    }

    .api-health-meter {
        padding: 0.25rem 0.5rem !important;
    }

    .api-health-meter #api-health-text,
    .api-health-meter #api-health-ms {
        display: none !important;
    }
}

/* ==========================================================================
   TrawLab Enterprise Brand Identity & Dual Mode Kanban Enhancements (v2.5.0)
   ========================================================================== */

/* Brand Logo Maximize vs Minimize (Rail Mode) */
.sidebar-logo-full,
.sidebar-tenant-full {
    display: flex;
    align-items: center;
}

.sidebar-logo-icon,
.sidebar-tenant-icon {
    display: none;
}

.light-mode-hidden {
    display: none !important;
}

.dark-mode-hidden {
    display: block !important;
}

html[data-theme="dark"] .light-mode-hidden {
    display: block !important;
}

html[data-theme="dark"] .dark-mode-hidden {
    display: none !important;
}

.sidebar-wrapper.collapsed .sidebar-logo-full,
.sidebar-wrapper.collapsed .sidebar-tenant-full {
    display: none !important;
}

.sidebar-wrapper.collapsed .sidebar-logo-icon,
.sidebar-wrapper.collapsed .sidebar-tenant-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Header Portal Brand Logo */
.header-portal-brand {
    transition: opacity 0.15s ease;
}

.header-portal-brand:hover {
    opacity: 0.88;
}

/* Active Tenant Diagnostic Workspace Header Badge */
.tenant-header-badge {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tenant-header-badge:hover {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background: var(--bg-hover, rgba(16, 185, 129, 0.04)) !important;
}

/* Dual View Mode: Table vs Unified Kanban / Card Grid */
.kanban-board-container {
    display: none;
    width: 100%;
    padding-bottom: 1.5rem;
}

.kanban-board-container.active-view {
    display: block !important;
}

.table-view-container.hidden-view {
    display: none !important;
}

.kanban-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.15rem;
    align-items: stretch;
}

.kanban-case-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.kanban-case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
    border-color: #10b981;
}

.kanban-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.kanban-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main, #0f172a);
    margin-bottom: 0.35rem;
}

.kanban-card-body {
    font-size: 0.825rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
    flex-grow: 1;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

/* ============================================================================
   TrawLab Branded Global Action Loader & Animations
   ============================================================================ */
.loader-spinner-ring {
    width: 72px;
    height: 72px;
    border: 3.5px solid var(--color-primary-soft, rgba(21, 128, 61, 0.15));
    border-top-color: var(--color-primary, #15803d);
    border-right-color: var(--color-primary, #15803d);
    border-radius: 50%;
    animation: loader-spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loader-brand-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

@keyframes loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loader-logo-pulse {
    0% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.92; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.92; }
}

#global-action-loader {
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

#global-action-loader .card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(0.95);
}

#global-action-loader.d-flex .card {
    transform: scale(1);
}




