/* ============================================================
   Evrostoshealth — Premium Dark Theme
   Brand: #169fed (blue) | Accent: #ef720c (orange)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Manrope:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --font-sans:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* Brand blue */
  --brand-300: #6cc2fb;
  --brand-400: #3bacf5;
  --brand-500: #169fed;
  --brand-600: #0d84ce;
  --brand-700: #0c6aa8;

  /* Accent orange */
  --accent-400: #f68d3a;
  --accent-500: #ef720c;
  --accent-600: #c25a09;

  /* Status */
  --danger:  #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --info:    #06b6d4;

  /* Sizing */
  --sidebar-w:  256px;
  --sidebar-wc: 70px;
  --header-h:   60px;

  /* ── Light mode ──────────────────────────────────────────── */
  --bg-base:        #f1f5f9;
  --bg-card:        #ffffff;
  --bg-sidebar:     #ffffff;
  --bg-header:      rgba(255, 255, 255, 0.85);
  --border-color:   #e2e8f0;
  --border-subtle:  #f1f5f9;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --hover-bg:       rgba(15, 23, 42, 0.04);
  --active-bg:      rgba(22, 159, 237, 0.08);
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.08);
}

/* ── Dark mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base:        #060a10;
  --bg-card:        #0e1520;
  --bg-sidebar:     #080d16;
  --bg-header:      rgba(6, 10, 16, 0.88);
  --border-color:   #1a2540;
  --border-subtle:  #111d30;
  --text-primary:   #e8f0fe;
  --text-secondary: #8899bb;
  --text-muted:     #445577;
  --hover-bg:       rgba(22, 159, 237, 0.05);
  --active-bg:      rgba(22, 159, 237, 0.12);
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.35);
  --shadow-md:      0 4px 28px rgba(0,0,0,0.55);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-sans); }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
p { margin: 0; }
[x-cloak] { display: none !important; }

/* ── Global theme transitions ────────────────────────────────── */
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: ease;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar            { width: 4px; height: 4px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: var(--border-color); border-radius: 99px; }

/* ── Focus ring ──────────────────────────────────────────────── */
/* :focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 6px;
} */

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  transition:
    width       260ms cubic-bezier(0.4, 0, 0.2, 1),
    transform   260ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 180ms ease,
    border-color     180ms ease;
}

[data-theme="dark"] .sidebar {
  box-shadow: inset -1px 0 0 var(--border-color), 0 0 40px rgba(0,0,0,0.4);
}

/* Collapsed */
.sidebar.is-collapsed { width: var(--sidebar-wc); }

/* Mobile: slide off screen */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-mobile-open { transform: translateX(0); box-shadow: var(--shadow-md); }
}

/* ── Brand ───────────────────────────────────────────────────── */
.sb-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow: hidden;
}

.sb-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  /* background: linear-gradient(135deg, var(--brand-500) 0%, var(--accent-500) 100%); */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* box-shadow: 0 3px 10px rgba(22, 159, 237, 0.35); */
  /* transition: box-shadow 200ms ease, transform 200ms ease, background-color 180ms ease !important; */
}
.sb-logo:hover {
  box-shadow: 0 5px 18px rgba(22, 159, 237, 0.5);
  transform: scale(1.05);
}
/* .sb-logo svg { transition: none !important; } */

.sb-brand-text {
  overflow: hidden;
  white-space: nowrap;
  transition:
    opacity   220ms ease,
    max-width 260ms cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 200px;
}
.sidebar.is-collapsed .sb-brand-text {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.sb-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  line-height: 1.2;
}
.sb-brand-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Search trigger inside sidebar ──────────────────────────── */
.sb-search-wrap {
  padding: 10px 10px 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.sb-search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.sb-search-btn:hover {
  background: var(--active-bg);
  border-color: var(--brand-500);
  color: var(--text-secondary);
}
.sb-search-text { flex: 1; text-align: left; }

/* Collapsed: hide text & kbd, center icon */
.sidebar.is-collapsed .sb-search-text,
.sidebar.is-collapsed .sb-search-kbd { display: none; }
.sidebar.is-collapsed .sb-search-btn { justify-content: center; padding: 8px; }

/* ── Navigation ──────────────────────────────────────────────── */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px 10px;
}

/* Group */
.sb-group { margin-bottom: 2px; }
.sb-group--manage { margin-top: 6px; }

/* Thin divider shown when collapsed (replaces the label) */
.sb-group::before {
  content: '';
  display: block;
  height: 0;
  background: var(--border-color);
  opacity: 0;
  margin: 0 10px;
  transition: height 0ms 260ms, opacity 200ms ease, margin 260ms ease;
}
.sidebar.is-collapsed .sb-group::before {
  height: 1px;
  opacity: 1;
  margin: 6px 14px;
  transition: height 0ms, opacity 200ms ease, margin 260ms ease;
}

.sb-main-group-label {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  max-height: 40px;
  transition:
    opacity    200ms ease,
    max-height 260ms ease,
    padding    260ms ease;
}
.sb-main-group-label span { flex: 1; }
.sidebar.is-collapsed .sb-main-group-label {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}
.sb-group-label {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  max-height: 40px;
  transition:
    opacity    200ms ease,
    max-height 260ms ease,
    padding    260ms ease;
}
.sb-group-label span { flex: 1; }
.sidebar.is-collapsed .sb-group-label {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* ── Shared icon styling ─────────────────────────────────────── */
.sb-icn {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: none !important;
}
.sb-icn--sm {
  width: 14px;
  height: 14px;
}

/* ── Chevron with rotation animation ────────────────────────── */
.sb-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), color 180ms ease !important;
}
.sb-chevron.is-open {
  transform: rotate(0deg);
}
.sb-chevron:not(.is-open) {
  transform: rotate(-90deg);
}
.sb-main-group-label:hover .sb-chevron {
  color: var(--text-secondary);
}
.sb-group-label:hover .sb-chevron {
  color: var(--text-secondary);
}

/* Nav item */
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.sb-item:hover { background: var(--hover-bg); color: var(--text-primary); }

.sb-item.is-active {
  background: var(--active-bg);
  color: var(--brand-500);
  font-weight: 600;
}
[data-theme="dark"] .sb-item.is-active { color: var(--brand-400); }

/* Active left indicator bar */
.sb-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-500);
  transition: none !important;
}

/* Icon */
.sb-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Submenu nested indentation ────────────────────────────────── */
.sb-group-nested .sb-item {
  padding-left: 18px;
}
.sb-group-nested .sb-group-nested .sb-item {
  padding-left: 26px;
}

/* Label */
.sb-item-label {
  flex: 1;
  overflow: hidden;
  transition:
    opacity   220ms ease,
    max-width 260ms cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 200px;
}
.sidebar.is-collapsed .sb-item-label { opacity: 0; max-width: 0; }

/* Badge */
.sb-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 1.5px 6px;
  border-radius: 99px;
  flex-shrink: 0;
  transition: opacity 200ms ease, background-color 180ms ease;
}
.sidebar.is-collapsed .sb-badge { opacity: 0; pointer-events: none; }

.sb-badge.neutral { background: var(--border-color); color: var(--text-muted); }
.sb-badge.critical { background: rgba(239, 114, 12, 0.15); color: var(--accent-500); }
[data-theme="dark"] .sb-badge.critical { background: rgba(239, 114, 12, 0.2); color: var(--accent-400); }

/* Tooltip on collapsed hover */
.sidebar.is-collapsed .sb-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  animation: tooltipIn 100ms ease;
  transition: none !important;
}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(-50%) translateX(-4px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* ── Sidebar bottom ──────────────────────────────────────────── */
.sb-bottom {
  border-top: 1px solid var(--border-color);
  padding: 6px 8px;
  flex-shrink: 0;
}

/* User chip */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: background 150ms ease;
}
.sb-user:hover { background: var(--hover-bg); }

.sb-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  transition: background-color 180ms ease;
}

.sb-user-info {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition:
    opacity   220ms ease,
    max-width 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.is-collapsed .sb-user-info { opacity: 0; max-width: 0; pointer-events: none; }

.sb-user-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.sb-user-role { font-size: 10.5px; color: var(--text-muted); margin-top: 0.5px; }

.sb-user-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: opacity 200ms ease, color 180ms ease;
}
.sidebar.is-collapsed .sb-user-chevron { opacity: 0; pointer-events: none; }

/* Collapse toggle (desktop only) */
.sb-collapse-btn {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  transition: background 150ms ease, color 150ms ease;
}
@media (min-width: 1024px) { .sb-collapse-btn { display: flex; } }
.sb-collapse-btn:hover { background: var(--hover-bg); color: var(--text-primary); }

.sb-collapse-label {
  max-width: 200px;
  overflow: hidden;
  transition:
    opacity   220ms ease,
    max-width 260ms ease;
}
.sidebar.is-collapsed .sb-collapse-label { opacity: 0; max-width: 0; }

.sb-collapse-icon {
  flex-shrink: 0;
  transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1), color 180ms ease !important;
}
.sidebar.is-collapsed .sb-collapse-icon { transform: rotate(180deg); }

/* ── Mobile backdrop ─────────────────────────────────────────── */
.mob-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadein 200ms ease;
}
[data-theme="dark"] .mob-backdrop { background: rgba(0, 0, 0, 0.72); }
.mob-backdrop.is-visible { display: block; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   MAIN COLUMN
   ============================================================ */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-left: var(--sidebar-w);
  transition: padding-left 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.is-collapsed ~ .main-col { padding-left: var(--sidebar-wc); }
@media (max-width: 1023px) { .main-col { padding-left: 0 !important; } }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  flex-shrink: 0;
}

[data-theme="dark"] .header {
  box-shadow: 0 1px 0 var(--border-color), 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Mobile hamburger */
.hdr-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}
.hdr-menu-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
@media (max-width: 1023px) { .hdr-menu-btn { display: flex; } }

/* Breadcrumb */
.hdr-breadcrumb {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}
@media (min-width: 640px) { .hdr-breadcrumb { display: flex; } }
.hdr-bc-sep { opacity: 0.4; flex-shrink: 0; }
.hdr-bc-current { color: var(--text-primary); font-weight: 600; font-size: 13.5px; }

/* Mobile title */
.hdr-title-mob {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
@media (min-width: 640px) { .hdr-title-mob { display: none; } }

.hdr-spacer { flex: 1; min-width: 0; }

/* Search bar */
.hdr-search {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  min-width: 200px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, min-width 200ms ease, color 150ms ease;
}
.hdr-search:hover {
  background: var(--active-bg);
  border-color: var(--brand-500);
  color: var(--text-secondary);
  min-width: 240px;
}
@media (min-width: 768px) { .hdr-search { display: flex; } }
.hdr-search-text { flex: 1; text-align: left; }

/* Icon button */
.hdr-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}
.hdr-btn:hover { background: var(--hover-bg); color: var(--text-primary); }

/* Notification pulsing dot */
.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-500);
  border: 2px solid var(--bg-header);
  animation: notifPulse 2.5s ease-in-out infinite;
  transition: none !important;
}
@keyframes notifPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(239, 114, 12, 0.5); }
  50%       { box-shadow: 0 0 0 4px rgba(239, 114, 12, 0);   }
}

/* Vertical divider */
.hdr-sep {
  width: 1px;
  height: 22px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* Profile button */
.hdr-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms ease;
}
.hdr-profile:hover { background: var(--hover-bg); }

.hdr-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  transition: background-color 180ms ease;
}

.hdr-profile-meta { display: none; }
@media (min-width: 768px) { .hdr-profile-meta { display: block; } }
.hdr-profile-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; line-height: 1.3; }
.hdr-profile-role { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.hdr-profile-caret { color: var(--text-muted); flex-shrink: 0; }

/* ── Bootstrap dropdown overrides ───────────────────────────── */
.dropdown-menu {
  border-radius: 14px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06) !important;
  padding: 5px !important;
  min-width: 200px;
}
[data-theme="dark"] .dropdown-menu {
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 0 0 1px var(--border-color) !important;
}

.dropdown-item {
  border-radius: 9px !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans) !important;
  transition: background 130ms ease, color 130ms ease !important;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--hover-bg) !important;
  color: var(--text-primary) !important;
}
.dropdown-divider { border-color: var(--border-color) !important; margin: 4px 0 !important; }

/* Notification dropdown */
.dd-notif-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
}
.dd-notif-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.dd-notif-count {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(239, 114, 12, 0.15);
  color: var(--accent-500);
}
[data-theme="dark"] .dd-notif-count { background: rgba(239, 114, 12, 0.2); }

.dd-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 130ms ease;
}
.dd-notif-item:hover { background: var(--hover-bg); }

.dd-notif-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dd-notif-msg { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.dd-notif-time { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

.dd-notif-footer {
  padding: 6px 10px 4px;
  border-top: 1px solid var(--border-color);
  margin-top: 2px;
}
.dd-notif-footer button {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-500);
  padding: 5px 8px;
  border-radius: 7px;
  width: 100%;
  transition: background 130ms ease, color 130ms ease;
}
.dd-notif-footer button:hover { background: var(--active-bg); }

/* Profile dropdown */
.dd-profile-hdr { padding: 10px 12px 8px; }
.dd-profile-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.dd-profile-role { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ── Kbd chip ────────────────────────────────────────────────── */
.mh-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  border-radius: 5px;
  background: var(--hover-bg);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT — Blank
   ============================================================ */
.page-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-base);
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  animation: fadein 150ms ease;
}
[data-theme="dark"] .cmd-overlay { background: rgba(0, 0, 0, 0.72); }

.cmd-box {
  position: fixed;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
  z-index: 9001;
  animation: cmdIn 180ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
[data-theme="dark"] .cmd-box { box-shadow: 0 20px 80px rgba(0, 0, 0, 0.65); }
@keyframes cmdIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1);    }
}

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}
.cmd-input-row svg { color: var(--text-muted); flex-shrink: 0; }

.cmd-input {
  flex: 1;
  font-size: 15px;
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text-primary);
  border: none;
  outline: none;
}
.cmd-input::placeholder { color: var(--text-muted); }

.cmd-results { max-height: 320px; overflow-y: auto; padding: 6px; }

.cmd-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 100ms ease;
}
.cmd-result:hover,
.cmd-result.is-selected { background: var(--active-bg); }

.cmd-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 100ms ease, color 100ms ease;
}
.cmd-result.is-selected .cmd-result-icon {
  background: rgba(22, 159, 237, 0.15);
  color: var(--brand-500);
}

.cmd-result-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.cmd-result-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.cmd-group-title {
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cmd-empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}
.cmd-blank {
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.cmd-hints {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 18px;
  border-top: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-muted);
}
.cmd-hint { display: flex; align-items: center; gap: 5px; }

/* Canvas */
canvas { max-width: 100%; }

/* ============================================================
   ORG SELECTORS (Header)
   ============================================================ */
.hdr-org-selectors {
  display: none;
  align-items: center;
  gap: 0;
  height: 100%;
}
@media (min-width: 900px) { .hdr-org-selectors { display: flex; } }

.org-select-wrap {
  position: relative;
}

.org-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
.org-select-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.org-select-label { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

.org-sep {
  display: block;
  width: 1px;
  height: 5px;
  background: var(--border-color);
  flex-shrink: 0;
  margin: 0 2px;
}

.org-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 6px;
  animation: cmdIn 160ms cubic-bezier(0.34,1.4,0.64,1);
}
.org-dropdown.is-open { display: block; }

.org-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.org-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-sans);
}
.org-search-input::placeholder { color: var(--text-muted); }

.org-list { display: flex; flex-direction: column; gap: 1px; }
.org-option {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.org-option:hover { background: var(--hover-bg); color: var(--text-primary); }
.org-option.is-selected { background: var(--active-bg); color: var(--brand-500); font-weight: 600; }

/* Clinic: select tag only, same pill look as .org-select-btn, no search, no extra menu */
.org-select-wrap.org-select-native {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  transition: background 140ms ease;
}
.org-select-wrap.org-select-native:hover { background: var(--hover-bg); }
select.org-select-btn.org-native-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0 center;
  padding: 0 16px 0 0;
  margin: 0;
  max-width: 135px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
select.org-select-btn.org-native-select:hover { background: transparent; color: var(--text-primary); }
select.org-select-btn.org-native-select:focus { outline: none; box-shadow: none; background: transparent; color: var(--text-primary); }
select.org-select-btn.org-native-select option { color: #111827; background: #fff; font-size: 12.5px; }
/* Bootstrap 5.3 .is-invalid for borderless pill select: paint wrapper like .form-select.is-invalid */
.org-select-wrap.org-select-native:has(select.org-native-select.is-invalid) {
  border: 1px solid var(--bs-danger, #dc3545) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
  padding-right: calc(1.5em + 0.75rem);
}
.org-select-wrap.org-select-native:has(select.org-native-select.is-invalid:focus) {
  border-color: var(--bs-danger, #dc3545) !important;
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}
select.org-select-btn.org-native-select.is-invalid {
  color: var(--bs-danger, #dc3545);
}

/* ============================================================
   WELCOME SECTION
   ============================================================ */
.welcome-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 0;
  flex-wrap: wrap;
}

.welcome-left { flex: 1; min-width: 240px; }
.welcome-greeting {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.welcome-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  max-width: 480px;
  line-height: 1.55;
}

.welcome-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-add-patient {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--brand-500);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  box-shadow: 0 3px 12px rgba(22,159,237,0.35);
}
.btn-add-patient:hover {
  background: var(--brand-600);
  box-shadow: 0 5px 18px rgba(22,159,237,0.45);
  transform: translateY(-1px);
}

.date-controls { display: flex; align-items: center; gap: 6px; }
.dash-select {
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}
.dash-select:hover { border-color: var(--brand-500); }
.dash-select:focus { border-color: var(--brand-500); }

.time-range-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.trange-btn {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease;
}
.trange-btn:hover { color: var(--text-primary); background: var(--hover-bg); }
.trange-btn.is-active {
  background: var(--brand-500);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(22,159,237,0.3);
}

/* ============================================================
   DASHBOARD TABS
   ============================================================ */
.dash-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 18px 24px 0;
  border-bottom: 1px solid var(--border-color);
  /* position: sticky; */
  /* top: var(--header-h); */
  background: var(--bg-base);
  /* z-index: 10; */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }

.dash-tab {
  position: relative;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 10px 10px 0 0;
  transition: color 140ms ease, background 140ms ease;
  display: flex;
  align-items: center;
  gap: 7px;
}
.dash-tab:hover { color: var(--text-primary); background: var(--hover-bg); }
.dash-tab.is-active {
  color: var(--brand-500);
  font-weight: 600;
  background: transparent;
}
.dash-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-500);
  border-radius: 2px 2px 0 0;
}
[data-theme="dark"] .dash-tab.is-active { color: var(--brand-400); }
[data-theme="dark"] .dash-tab.is-active::after { background: var(--brand-400); }

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(239,114,12,0.15);
  color: var(--accent-500);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ============================================================
   TAB PANELS
   ============================================================ */
.tab-panel { display: none; padding: 20px 24px; }
.tab-panel.is-active { display: block; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--brand-500);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 160ms ease;
}
.dash-card:hover { box-shadow: var(--shadow-md); }

.dash-card-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.dash-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.view-all-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-500);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 130ms ease;
}
.view-all-link:hover { color: var(--brand-400); }

/* ============================================================
   DEVICE CARD HEADER — themed light to match the modern header
   ============================================================ */
.device-card-header {
  background: var(--active-bg);
  color: var(--brand-600);
  border-bottom: 1px solid var(--border-color);
}
.device-card-header h5 {
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.2px;
}
/* Dark mode: lighter brand tone for better contrast */
[data-theme="dark"] .device-card-header {
  color: var(--brand-400);
}

/* ============================================================
   CHART WRAPPER
   ============================================================ */
.chart-wrap {
  position: relative;
  height: 260px;
  min-height: 200px;
  width: 100%;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   RISK VISUALIZATION
   ============================================================ */
.risk-viz-wrap { display: flex; flex-direction: column; gap: 14px; }
.risk-arc-container { display: flex; justify-content: center; }
.risk-svg { width: 100%; max-width: 220px; }

.risk-legend { display: flex; flex-direction: column; gap: 8px; }
.risk-legend-item { display: flex; align-items: center; gap: 10px; }
.risk-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.risk-info { display: flex; justify-content: space-between; width: 120px; flex-shrink: 0; }
.risk-name { font-size: 12px; color: var(--text-secondary); }
.risk-count { font-size: 12px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.risk-bar-wrap { flex: 1; height: 5px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.risk-bar { height: 100%; border-radius: 99px; transition: width 600ms ease; }

/* ============================================================
   PERFORMANCE TABLE
   ============================================================ */
.perf-table-wrap { overflow-x: auto; }
.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.perf-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.perf-table td {
  padding: 9px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.perf-table tbody tr:last-child td { border-bottom: none; }
.perf-table tbody tr:hover td { background: var(--hover-bg); }

.perf-user { display: flex; align-items: center; gap: 8px; }
.perf-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  transition: transform 150ms ease;
}
.perf-avatar:hover { transform: scale(1.08); }

.perf-badge {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.perf-on   { background: rgba(34,197,94,.12);  color: #22c55e; }
.perf-warn { background: rgba(245,158,11,.12); color: #f59e0b; }
.perf-off  { background: rgba(239,68,68,.12);  color: #ef4444; }

/* ============================================================
   SCHEDULE TIMELINE
   ============================================================ */
.schedule-timeline { display: flex; flex-direction: column; position: relative; }
.sched-item {
  display: grid;
  grid-template-columns: 60px 14px 1fr;
  gap: 0 10px;
  align-items: start;
  padding-bottom: 14px;
  position: relative;
}
.sched-last { padding-bottom: 0; }
.sched-time {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding-top: 2px;
  text-align: right;
}
.sched-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sched-done    { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.sched-active  { background: var(--brand-500); box-shadow: 0 0 0 3px rgba(22,159,237,.25); animation: pulse 2s ease-in-out infinite; }
.sched-pending { background: var(--border-color); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(22,159,237,.25); }
  50%      { box-shadow: 0 0 0 6px rgba(22,159,237,.1); }
}
.sched-line {
  position: absolute;
  left: calc(60px + 6px + 5px);
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}
.sched-last .sched-line { display: none; }
.sched-body { padding-bottom: 4px; }
.sched-patient { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sched-detail { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.sched-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 5px;
}
.sched-completed { background: rgba(34,197,94,.12);   color: #22c55e; }
.sched-inprog    { background: rgba(22,159,237,.12);  color: var(--brand-500); }
.sched-upcoming  { background: var(--hover-bg);        color: var(--text-muted); }

/* ============================================================
   WORK QUEUE LIST
   ============================================================ */
.wq-list { display: flex; flex-direction: column; gap: 6px; }
.wq-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.wq-item:hover {
  background: var(--hover-bg);
  border-color: var(--border-color);
}
.wq-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--wqc, rgba(22,159,237,.12));
  color: var(--wqcc, #169fed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wq-body { flex: 1; min-width: 0; }
.wq-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.wq-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.wq-count {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ============================================================
   AI INSIGHTS
   ============================================================ */
.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #6366f1, #169fed);
  color: #fff;
}

.ai-insights-list { display: flex; flex-direction: column; gap: 8px; }
.ai-insight-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.ai-insight-card:hover {
  border-color: var(--border-color);
  transform: translateX(3px);
}
.ai-insight-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-risk     .ai-insight-icon { background: rgba(239,68,68,.1);   color: #ef4444; }
.ai-billing  .ai-insight-icon { background: rgba(34,197,94,.1);   color: #22c55e; }
.ai-followup .ai-insight-icon { background: rgba(22,159,237,.1);  color: #169fed; }
.ai-workload .ai-insight-icon { background: rgba(99,102,241,.1);  color: #6366f1; }
.ai-doc      .ai-insight-icon { background: rgba(245,158,11,.1);  color: #f59e0b; }

.ai-insight-body { flex: 1; min-width: 0; }
.ai-insight-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.ai-insight-sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.ai-action-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-500);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}
.ai-action-btn:hover {
  background: var(--active-bg);
  border-color: var(--brand-500);
}

/* ============================================================
   DATA TABLES (Patients, Billing)
   ============================================================ */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  /* padding: 14px 18px; */
  padding: 14px 0px;
  /* border-bottom: 1px solid var(--border-subtle); */
  flex-wrap: wrap;
}

.table-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  min-width: 200px;
  /* flex: 1; */
  color: var(--text-muted);
  transition: border-color 140ms ease;
}
.table-search-wrap:focus-within { border-color: var(--brand-500); }
.table-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-sans);
}
.table-search-input::placeholder { color: var(--text-muted); }
.table-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tbl-select {
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  transition: border-color 140ms ease;
}
.tbl-select:hover { border-color: var(--brand-500); }

.tbl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}
.tbl-add {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 2px 8px rgba(22,159,237,0.3);
}
.tbl-add:hover { background: var(--brand-600); border-color: var(--brand-600); }

.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead { position: sticky; top: 0; z-index: 2; }
.data-table th {
  background: var(--bg-card);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px !important;
  font-weight: 700;
  /* text-transform: uppercase; */
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--hover-bg); }

.tbl-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-500);
  cursor: pointer;
}

.pt-name-cell { display: flex; align-items: center; gap: 10px; }
.pt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.pt-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.pt-mrn   { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.pt-conditions { display: flex; gap: 4px; flex-wrap: wrap; }
.cond-tag {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--hover-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.risk-pill {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.risk-critical { background: rgba(239,68,68,.12);   color: #ef4444; }
.risk-high     { background: rgba(245,158,11,.12);  color: #f59e0b; }
.risk-low      { background: rgba(34,197,94,.12);   color: #22c55e; }

.adh-bar-wrap { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.adh-bar { height: 5px; border-radius: 99px; }
.adh-val { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); font-family: var(--font-mono); white-space: nowrap; }

.last-read { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; }
.read-today  { background: rgba(34,197,94,.1);  color: #22c55e; }
.read-warn   { background: rgba(245,158,11,.1); color: #f59e0b; }
.read-danger { background: rgba(239,68,68,.1);  color: #ef4444; }

.tbl-actions { display: flex; align-items: center; gap: 4px; }
.tbl-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.tbl-icon-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.tbl-delete-btn:hover { background: rgba(239,68,68,.1); color: #ef4444; border-color: rgba(239,68,68,.3); }

.tbl-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  /* border-top: 1px solid var(--border-subtle); */
  flex-wrap: wrap;
  gap: 10px;
}
.tbl-pagination-info { font-size: 12.5px; color: var(--text-muted); }
.tbl-pagination-btns { display: flex; align-items: center; gap: 4px; }
.tbl-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.tbl-page-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.tbl-page-btn.is-current {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
  font-weight: 700;
}
.tbl-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tbl-page-ellipsis { font-size: 13px; color: var(--text-muted); padding: 0 4px; }

/* Billing table specific */
.claim-id { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-primary); }
.cpt-tag {
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(22,159,237,.1);
  color: var(--brand-500);
}
.amount-cell { font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }
.status-badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-approved  { background: rgba(34,197,94,.12);  color: #22c55e; }
.status-pending   { background: rgba(245,158,11,.12); color: #f59e0b; }
.status-denied    { background: rgba(239,68,68,.12);  color: #ef4444; }
.status-submitted { background: rgba(22,159,237,.12); color: var(--brand-500); }

/* ============================================================
   WORK QUEUE TAB
   ============================================================ */
.queue-board { display: flex; flex-direction: column; gap: 16px; }
.queue-group { display: flex; flex-direction: column; gap: 8px; }
.queue-group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 0;
}
.queue-urgent { color: #ef4444; }
.queue-high   { color: #ef720c; }
.queue-medium { color: #f59e0b; }
.queue-low    { color: #22c55e; }
.queue-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.queue-task-card {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 12px 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.queue-task-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-sm); }
.queue-task-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.queue-patient { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.queue-detail  { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.queue-task-bottom { display: flex; align-items: center; gap: 10px; }
.queue-cm    { font-size: 11.5px; color: var(--text-muted); flex: 1; }
.queue-time  { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); font-family: var(--font-mono); }
.queue-action-btn {
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--brand-500);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 130ms ease;
}
.queue-action-btn:hover { background: var(--brand-600); }
.queue-priority {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 5px;
}
.queue-p-urgent { background: rgba(239,68,68,.12);  color: #ef4444; }
.queue-p-high   { background: rgba(239,114,12,.12); color: #ef720c; }
.queue-p-medium { background: rgba(245,158,11,.12); color: #f59e0b; }
.queue-p-low    { background: rgba(34,197,94,.12);  color: #22c55e; }

/* Activity Timeline */
.activity-timeline { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: grid;
  grid-template-columns: 50px 12px 1fr;
  gap: 0 10px;
  align-items: start;
  padding-bottom: 12px;
  position: relative;
}
.activity-time { font-size: 10.5px; font-family: var(--font-mono); font-weight: 600; color: var(--text-muted); padding-top: 2px; text-align: right; }
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.activity-done   .activity-dot { background: #22c55e; }
.activity-active .activity-dot { background: var(--brand-500); animation: pulse 2s ease-in-out infinite; }
.activity-pending .activity-dot { background: var(--border-color); border: 1px dashed var(--text-muted); }
.activity-text { font-size: 12.5px; color: var(--text-secondary); padding-top: 1px; line-height: 1.4; }
.activity-done   .activity-text { color: var(--text-secondary); }
.activity-active .activity-text { color: var(--text-primary); font-weight: 500; }
.activity-pending .activity-text { color: var(--text-muted); font-style: italic; }

/* Workload */
.workload-list { display: flex; flex-direction: column; gap: 10px; }
.workload-row { display: flex; align-items: center; gap: 10px; }
.workload-info { display: flex; align-items: center; gap: 8px; width: 120px; flex-shrink: 0; }
.workload-name { font-size: 12px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workload-bar-wrap { flex: 1; height: 6px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.workload-bar { height: 100%; border-radius: 99px; transition: width 600ms ease; }
.workload-val { font-size: 11.5px; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); width: 24px; text-align: right; flex-shrink: 0; }

/* Recent Activity */
.recent-activity-list { display: flex; flex-direction: column; gap: 6px; }
.ra-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 130ms ease;
}
.ra-item:hover { background: var(--hover-bg); }
.ra-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ra-body { flex: 1; }
.ra-msg  { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.ra-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   CARE TEAMS TAB
   ============================================================ */
.leader-rank { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.sat-stars { font-size: 12px; letter-spacing: 1px; color: #f59e0b; }
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.score-high { background: rgba(34,197,94,.12);   color: #22c55e; }
.score-med  { background: rgba(245,158,11,.12);  color: #f59e0b; }
.score-low  { background: rgba(239,68,68,.12);   color: #ef4444; }

/* Availability */
.availability-grid { display: flex; flex-direction: column; gap: 6px; }
.avail-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  transition: background 130ms ease;
}
.avail-card:hover { background: var(--hover-bg); }
.avail-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.avail-info { flex: 1; }
.avail-name   { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.avail-status { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Collab */
.collab-list { display: flex; flex-direction: column; gap: 6px; }
.collab-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  transition: background 130ms ease;
}
.collab-item:hover { background: var(--hover-bg); }
.collab-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.collab-body { flex: 1; }
.collab-msg  { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.collab-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Goals */
.goals-list { display: flex; flex-direction: column; gap: 16px; }
.goal-item {}
.goal-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.goal-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.goal-val   { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.goal-bar-wrap { height: 7px; background: var(--border-color); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.goal-bar { height: 100%; border-radius: 99px; transition: width 700ms ease; }
.goal-pct { font-size: 11px; font-weight: 700; color: var(--text-muted); font-family: var(--font-mono); }

/* Recognition */
.recognition-list { display: flex; flex-direction: column; gap: 10px; }
.rec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--border-color);
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.rec-card:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.rec-gold   { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.05); }
.rec-silver { border-color: rgba(148,163,184,.35); background: rgba(148,163,184,.04); }
.rec-bronze { border-color: rgba(180,83,9,.25); background: rgba(180,83,9,.04); }
.rec-badge-icon { font-size: 22px; flex-shrink: 0; }
.rec-info { flex: 1; }
.rec-name  { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.rec-title { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.rec-achievements { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rec-ach {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--hover-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ============================================================
   FOOTER
   ============================================================ */
.dash-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
  gap: 16px;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}
.footer-copy  { font-size: 12px; }
.footer-hipaa {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #22c55e;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(34,197,94,.1);
}
.footer-right { display: flex; align-items: center; gap: 16px; }
.footer-link {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 130ms ease;
}
.footer-link:hover { color: var(--text-primary); }
.footer-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
}

/* Date Picker UI */
#ui-datepicker-div { font-family: var(--font-sans); background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06); padding: 10px; width: 260px; z-index: 3000 !important; }
[data-theme="dark"] #ui-datepicker-div { box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 0 0 1px var(--border-color); } 
.ui-datepicker-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; background: transparent;color: var(--text-primary); border: none; }
.ui-datepicker-title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--text-primary); text-align: center; flex: 1; }
.ui-datepicker-prev,
.ui-datepicker-next { position: static; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; color: var(--text-muted); top: auto; transition: background 130ms ease, color 130ms ease; }
.ui-datepicker-prev:hover,
.ui-datepicker-next:hover { background: var(--hover-bg); color: var(--text-primary); }
.ui-datepicker-prev span,
.ui-datepicker-next span { display: none; }
.ui-datepicker-prev::before { content: '\2039'; font-size: 18px; }
.ui-datepicker-next::before { content: '\203A'; font-size: 18px; }
.ui-datepicker-prev.ui-state-disabled,
.ui-datepicker-next.ui-state-disabled { opacity: 0.3; cursor: not-allowed; }
.ui-datepicker-calendar { width: 100%; border-collapse: collapse; }
.ui-datepicker-calendar th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;color: var(--text-muted); padding: 6px 0; text-align: center; }
.ui-datepicker-calendar td { padding: 2px; text-align: center; }
.ui-datepicker-calendar td a,
.ui-datepicker-calendar td span { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 auto; border-radius: 8px; font-size: 12.5px; color: var(--text-secondary); text-decoration: none; transition: background 120ms ease, color 120ms ease; }
.ui-datepicker-calendar td a:hover { background: var(--hover-bg); color: var(--text-primary); } 
.ui-datepicker-calendar td .ui-state-active { background: var(--brand-500) !important; color: #fff !important; font-weight: 700; }
.ui-datepicker-calendar td .ui-state-highlight { background: var(--active-bg); color: var(--brand-500); font-weight: 600; }
.ui-datepicker-calendar td span.ui-state-disabled { color: var(--text-muted); opacity: 0.4; } 
.ui-datepicker-unselectable .ui-state-default { background: transparent; color: var(--text-muted); opacity: 0.35; }
.ui-datepicker-buttonpane { border-top: 1px solid var(--border-color); margin-top: 8px; padding-top: 8px; }
.ui-datepicker-buttonpane button { background: var(--hover-bg); color: var(--text-secondary); border: 1px solid var(--border-color); border-radius: 8px; font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer; } 
.ui-datepicker-buttonpane button:hover { background: var(--active-bg); color: var(--brand-500); }

.rounded-9 {
    border-radius: 9px !important;
}
/* ENROLLED */
.bg-custom-blue {
    background-color: #E0F2FE;
}

.text-custom-blue {
    color: #0369A1;
}


/* INCOMPLETE SIGNUP */
.bg-custom-dark-gray {
    background-color: #F3F4F6;
}

.text-custom-dark-gray {
    color: #374151;
}


/* INTERNAL ESCALATION */
.bg-custom-purple {
    background-color: #F0E9FA;
}

.text-custom-purple {
    color: #7048A8;
}


/* OFFICE ESCALATION */
.bg-custom-orange {
    background-color: #FFF0E8;
}

.text-custom-orange {
    color: #C45120;
}


/* NOT ENROLLED */
.bg-custom-gray {
    background-color: #F3F4F6;
}

.text-custom-gray {
    color: #4B5563;
}


/* PATIENT DECLINED */
.bg-custom-pastel-orange {
    background-color: #F8E8E3;
}

.text-custom-pastel-orange {
    color: #9A5947;
}


/* SIGNUP COMPLETED */
.bg-custom-green {
    background-color: #DCFCE7;
}

.text-custom-green {
    color: #15803D;
}


/* INACTIVE */
.bg-custom-red {
    background-color: #FEE2E2;
}

.text-custom-red {
    color: #C62828;
}


/* DECEASED */
.bg-custom-amber {
    background-color: #FEF3C7;
}

.text-custom-amber {
    color: #A16207;
}