:root {
  --primary: #087f80;
  --primary-dark: #075f6a;
  --primary-light: #e8f7f5;
  --secondary: #f1f5f9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #16a6a0;
  --dark: #0f172a;
  --sidebar-dark: #0b1120;
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --radius: 0.75rem;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* Dashboard refresh: a calm clinical control room built on the existing Bootstrap layout. */
.dashboard-shell { max-width: 1480px; margin: 0 auto; }
.dashboard-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.dashboard-heading h1 { margin:.35rem 0 .25rem; font-size:clamp(1.55rem,2.2vw,2.1rem); letter-spacing:-.03em; font-weight:700; color:var(--dark); }
.eyebrow { color:var(--primary-dark); font-size:.73rem; font-weight:700; letter-spacing:.11em; text-transform:uppercase; }
.status-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#16a6a0; box-shadow:0 0 0 4px rgba(22,166,160,.14); margin-right:.45rem; vertical-align:1px; }
.dashboard-notice { border:1px solid #cce9e5; background:linear-gradient(100deg,#effaf8,#f7fbfb); border-radius:var(--radius); padding:.85rem 1rem; margin-bottom:1.25rem; color:#28616a; font-size:.84rem; }
.dashboard-notice strong { color:#14505b; display:block; margin-bottom:.15rem; }
.notice-icon { color:var(--primary); font-size:1.2rem; }
.metric-card { background:#fff; border:1px solid var(--gray-200); border-radius:var(--radius); display:flex; align-items:center; gap:.85rem; padding:1rem; min-height:112px; box-shadow:var(--shadow-sm); transition:transform .18s ease,box-shadow .18s ease; }
.metric-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.metric-icon { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.15rem; flex:0 0 42px; }
.metric-blue .metric-icon { color:#087f80; background:#e4f7f4; }.metric-purple .metric-icon { color:#7358b7; background:#f0ebff; }.metric-green .metric-icon { color:#27844c; background:#e5f7ea; }.metric-orange .metric-icon { color:#b46a13; background:#fff2db; }
.metric-label { color:var(--gray-600); font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.045em; }
.metric-value { color:var(--dark); font-size:1.55rem; font-weight:700; line-height:1.2; margin:.22rem 0; letter-spacing:-.03em; }
.metric-foot { color:#82909d; font-size:.75rem; }.metric-foot span { color:var(--gray-700); font-weight:600; }
.panel-card { background:#fff; border:1px solid var(--gray-200); border-radius:var(--radius); box-shadow:var(--shadow-sm); overflow:hidden; }
.panel-header { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; padding:1.05rem 1.2rem; border-bottom:1px solid var(--gray-200); }
.panel-header h2 { color:var(--dark); font-size:.98rem; font-weight:700; margin:0 0 .18rem; }.panel-header p { color:#82909d; font-size:.77rem; margin:0; }.panel-link { color:var(--primary-dark); font-size:.78rem; font-weight:600; text-decoration:none; white-space:nowrap; }
.panel-body { padding:1.15rem 1.2rem; }
.flow-track { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; padding:.45rem 0 .7rem; }
.flow-step { min-width:0; }.flow-number { color:var(--dark); font-size:1.55rem; font-weight:700; }.flow-name { color:var(--gray-600); font-size:.77rem; margin:.15rem 0 .65rem; }.flow-bar { height:5px; background:#eef2f4; border-radius:99px; overflow:hidden; }.flow-bar span { display:block; height:100%; width:68%; background:var(--primary); border-radius:inherit; }.flow-step:nth-child(2) .flow-bar span { width:52%; background:#7b61c8; }.flow-step:nth-child(3) .flow-bar span { width:78%; background:#16a6a0; }.flow-step:nth-child(4) .flow-bar span { width:91%; background:#3a9d5d; }
.flow-summary { display:flex; justify-content:space-between; gap:1rem; border-top:1px solid var(--gray-200); padding-top:.85rem; color:#81909b; font-size:.75rem; }.flow-summary strong { color:var(--primary-dark); white-space:nowrap; }
.queue-row { display:flex; align-items:center; gap:.7rem; padding:.87rem 1.2rem; color:inherit; text-decoration:none; border-bottom:1px solid #eef1f3; transition:background .15s ease; }.queue-row:last-child { border-bottom:0; }.queue-row:hover { background:#f8fbfb; }.queue-row span:nth-child(2) { flex:1; }.queue-row strong,.queue-row small { display:block; }.queue-row strong { color:var(--gray-800); font-size:.82rem; }.queue-row small { color:#89959f; font-size:.7rem; margin-top:.12rem; }.queue-row b { color:var(--dark); font-size:.95rem; }.queue-icon { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; }.queue-amber { color:#ad6b11; background:#fff4dc; }.queue-green { color:#27844c; background:#e6f7ea; }.queue-blue { color:#087f80; background:#e4f7f4; }
.panel-card .table { --bs-table-bg:transparent; }.panel-card .table th { padding:.72rem 1rem; font-size:.68rem; }.panel-card .table td { padding:.78rem 1rem; font-size:.79rem; border-color:#eef1f3; }.empty-row { text-align:center; color:#8a969f; padding:1.5rem !important; font-size:.8rem !important; }.order-link { color:var(--primary-dark); font-weight:700; text-decoration:none; }.order-link:hover { text-decoration:underline; }
.status-chip { display:inline-flex; align-items:center; border-radius:99px; padding:.28rem .52rem; font-size:.68rem; font-weight:700; white-space:nowrap; }.status-success { color:#237a46; background:#e5f7ea; }.status-info { color:#137a83; background:#e2f7f6; }.status-primary { color:#4f40a2; background:#eeeaff; }.status-warning { color:#986113; background:#fff2d7; }.status-danger { color:#a44343; background:#fde7e7; }.status-muted { color:#64717c; background:#eef1f3; }
.legend-pill { color:#74828c; font-size:.7rem; white-space:nowrap; }.legend-pill span { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--primary); margin-right:.3rem; }
.sparkline-wrap { min-height:190px; }.sparkline { width:100%; height:160px; overflow:visible; }.sparkline-line { fill:none; stroke:#0a8d89; stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }.sparkline-area { fill:url(#revenueFill); stroke:none; }.sparkline-dot { fill:#fff; stroke:#087f80; stroke-width:3; }.sparkline-empty { fill:#9aa5ad; font-size:14px; }.sparkline-labels { display:flex; justify-content:space-between; color:#8a969f; font-size:.7rem; }
.report-progress { margin-bottom:1rem; }.report-progress-head { display:flex; justify-content:space-between; color:var(--gray-700); font-size:.78rem; margin-bottom:.42rem; }.report-progress-head strong { color:var(--dark); }.report-progress .progress { height:7px; background:#edf1f2; border-radius:99px; }.report-progress .progress-bar { border-radius:99px; }.report-meta { color:#81909b; font-size:.72rem; border-top:1px solid var(--gray-200); padding-top:.85rem; }
@media (max-width:767px) { .dashboard-heading { align-items:flex-start; flex-direction:column; }.dashboard-notice .btn { display:none; }.flow-track { gap:.55rem; }.flow-number { font-size:1.2rem; }.flow-name { font-size:.68rem; }.flow-summary { flex-direction:column; gap:.35rem; }.panel-header { padding:.95rem; }.panel-body { padding:.95rem; }.panel-card .table td,.panel-card .table th { padding:.65rem .7rem; } }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background-color: #f8fafc; color: #0f172a; }

a { text-decoration: none; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--sidebar-dark); color: #fff; min-height: 100vh; display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 1030; transition: width 0.2s ease; }
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.page-content { flex: 1; padding: 1.5rem; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* Sidebar brand */
.sidebar-brand { padding: 1rem 1.25rem; display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.15rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand i { font-size: 1.5rem; color: #60a5fa; }
.sidebar-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; object-position: center top; background: #fff; }

/* Sidebar menu */
.sidebar-menu { flex: 1; overflow-y: auto; padding: 0.75rem; }
.sidebar-menu::-webkit-scrollbar { width: 6px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.menu-section { margin-bottom: 0.5rem; }
.menu-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0.6rem 0.75rem; color: #94a3b8; border-radius: 0.5rem; background: transparent; border: none; font-size: 0.875rem; font-weight: 500; transition: all 0.15s ease; }
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { color: #fff; background: rgba(255,255,255,0.06); }
.menu-toggle i:first-child { margin-right: 0.625rem; font-size: 1rem; }
.menu-toggle .chevron { font-size: 0.75rem; transition: transform 0.2s; }
.menu-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.menu-link { display: flex; align-items: center; padding: 0.55rem 0.75rem 0.55rem 2.25rem; color: #94a3b8; border-radius: 0.5rem; font-size: 0.875rem; transition: all 0.15s ease; }
.menu-link:hover, .menu-link.active { color: #fff; background: rgba(255,255,255,0.08); }
.menu-link.active { font-weight: 500; }
.menu-link .badge { margin-left: auto; font-size: 0.65rem; }

/* User profile at bottom of sidebar */
.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.user-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; transition: background 0.15s; }
.user-card:hover { background: rgba(255,255,255,0.06); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.85rem; flex-shrink: 0; }
.user-info { overflow: hidden; }
.user-name { font-size: 0.875rem; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: #94a3b8; text-transform: capitalize; }

/* Mobile toggle */
.mobile-toggle { display: none; position: fixed; bottom: 1rem; right: 1rem; z-index: 1040; width: 48px; height: 48px; border-radius: 50%; align-items: center; justify-content: center; }
@media (max-width: 991px) { .mobile-toggle { display: flex; } }

/* Welcome banner */
.welcome-banner { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius); padding: 1.5rem 2rem; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; box-shadow: var(--shadow-lg); }
.welcome-banner h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.welcome-banner p { opacity: 0.9; margin: 0; font-size: 0.95rem; }
.welcome-actions { display: flex; gap: 0.75rem; }
.welcome-actions .btn { border-radius: 0.5rem; font-weight: 500; }
.welcome-actions .btn-light { color: var(--primary); }

/* Action pills */
.action-pills { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.action-pill { flex: 1; min-width: 160px; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.875rem 1rem; border-radius: var(--radius); color: #fff; font-weight: 500; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; border: none; }
.action-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }
.action-pill i { font-size: 1.1rem; }
.action-pill.blue { background: var(--primary); }
.action-pill.green { background: var(--success); }
.action-pill.orange { background: var(--warning); }
.action-pill.cyan { background: var(--info); }

/* KPI / stat cards */
.kpi-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-icon { width: 48px; height: 48px; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.kpi-icon.blue { background: #eff6ff; color: var(--primary); }
.kpi-icon.green { background: #f0fdf4; color: var(--success); }
.kpi-icon.orange { background: #fffbeb; color: var(--warning); }
.kpi-icon.cyan { background: #ecfeff; color: var(--info); }
.kpi-icon.purple { background: #faf5ff; color: #9333ea; }
.kpi-icon.red { background: #fef2f2; color: var(--danger); }
.kpi-label { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 0.25rem; }
.kpi-value { font-size: 1.35rem; font-weight: 700; color: var(--gray-800); line-height: 1.2; }
.kpi-meta { font-size: 0.75rem; color: var(--gray-600); margin-top: 0.25rem; }
.kpi-meta.success { color: var(--success); }

/* Cards */
.card { border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 1rem 1.25rem; font-weight: 600; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; color: var(--gray-800); }
.card-subtitle { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.25rem; }

/* Form cards */
.form-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.form-card h5 { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--gray-800); }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.4rem; }
.form-control { border-color: var(--gray-200); border-radius: 0.5rem; font-size: 0.9rem; padding: 0.6rem 0.85rem; }
.form-select { border-color: var(--gray-200); border-radius: 0.5rem; font-size: 0.9rem; padding: 0.6rem 2.25rem 0.6rem 0.85rem !important; appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15); }

/* Test catalog cards */
.test-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.test-card, .package-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: all 0.15s; display: flex; align-items: flex-start; justify-content: space-between; }
.test-card:hover, .package-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.test-card.selected, .package-card.selected { border-color: var(--primary); background: var(--primary-light); }
.test-card .test-info, .package-card .test-info { flex: 1; }
.test-card .test-name, .package-card .test-name { font-weight: 500; font-size: 0.95rem; color: var(--gray-800); margin-bottom: 0.25rem; }
.test-card .test-type, .package-card .test-type { font-size: 0.75rem; color: var(--gray-600); text-transform: capitalize; }
.test-card .test-price, .package-card .test-price { text-align: right; }
.test-card .price, .package-card .price { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.test-card .mrp, .package-card .mrp { font-size: 0.75rem; color: var(--gray-600); text-decoration: line-through; }
.test-card .check, .package-card .check { width: 20px; height: 20px; border: 2px solid var(--gray-300); border-radius: 50%; margin-top: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: #fff; }
.test-card.selected .check, .package-card.selected .check { background: var(--primary); border-color: var(--primary); }

/* Upload dropzone */
.upload-dropzone { border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; background: #fff; cursor: pointer; transition: all 0.15s; }
.upload-dropzone:hover, .upload-dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-dropzone i { font-size: 2.5rem; color: var(--gray-400); margin-bottom: 0.75rem; }
.upload-dropzone .upload-text { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 0.5rem; }
.upload-dropzone .upload-hint { font-size: 0.75rem; color: var(--gray-600); }

/* Tabs */
.nav-pills .nav-link { border-radius: 0.5rem; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); }
.nav-pills .nav-link.active { background: var(--primary); color: #fff; }

/* Tables */
.table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gray-600); background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.table td { font-size: 0.875rem; vertical-align: middle; }

/* Status badges */
.badge { font-weight: 500; padding: 0.4em 0.65em; border-radius: 0.375rem; }
.badge.bg-success-subtle { color: #15803d; background: #dcfce7; }
.badge.bg-warning-subtle { color: #a16207; background: #fef9c3; }
.badge.bg-danger-subtle { color: #991b1b; background: #fee2e2; }
.badge.bg-info-subtle { color: #0e7490; background: #cffafe; }
.badge.bg-secondary-subtle { color: #475569; background: #f1f5f9; }

/* Help footer */
.help-footer { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; }
.help-footer i { font-size: 1.5rem; color: var(--warning); margin-right: 1rem; }
.help-footer a { color: var(--gray-700); font-size: 0.875rem; }

/* Utilities */
.h-48 { height: 48px; }
.w-48 { width: 48px; }
.min-h-48 { min-height: 48px; }
.min-w-48 { min-width: 48px; }
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.7); display: none; align-items: center; justify-content: center; z-index: 2000; }
.loading-overlay.show { display: flex; }
