/* ═══════════════════════════════════════════════════════
   AKITOCLINIC COGC - Design System
   Estética: clínico refinado. Aire, precisión, confianza.
   ═══════════════════════════════════════════════════════ */

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

/* ─── TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand — Akito */
  --blue-900:  #111d54;
  --blue-800:  #1a2a7a;
  --blue-700:  #2f3ec9;
  --blue-100:  #e8eaff;
  --blue-50:   #f0f2ff;

  --teal-800:  #0e7a77;
  --teal-700:  #17a89f;
  --teal-600:  #22d3cf;
  --teal-500:  #44dbd7;
  --teal-400:  #72e5e2;
  --teal-100:  #d8fafa;
  --teal-50:   #edfffe;

  /* Neutral */
  --n-900: #0d1b26;
  --n-800: #1e3040;
  --n-700: #2e4560;
  --n-600: #476176;
  --n-500: #607b93;
  --n-400: #8fa5b8;
  --n-300: #b8cad8;
  --n-200: #dae4ec;
  --n-150: #eaf0f5;
  --n-100: #f2f6f9;
  --n-50:  #f8fafc;
  --white: #ffffff;

  /* Turn states */
  --s-libre-bg:        transparent;
  --s-libre-bar:       #cbd5e1;
  --s-bloqueado-bg:    #f8fafc;
  --s-bloqueado-bar:   #475569;
  --s-reservado-bg:    #fef2f2;
  --s-reservado-bar:   #f87171;
  --s-confirmado-bg:   #eff6ff;
  --s-confirmado-bar:  #3b82f6;
  --s-entreturno-bg:   #fdf4ff;
  --s-entreturno-bar:  #c084fc;
  --s-control-bg:      #f8fafc;
  --s-control-bar:     #94a3b8;
  --s-preconf-bg:      #fffbeb;
  --s-preconf-bar:     #fbbf24;
  --s-atendido-bg:     #f0fdf4;
  --s-atendido-bar:    #4ade80;
  --s-evento-bg:       #f5f3ff;
  --s-evento-bar:      #a78bfa;

  /* Layout */
  --sidebar-w: 74px;
  --sidebar-w-expanded: 228px;
  --panel-w:   292px;
  --topbar-h:  56px;
  --statsbar-h: 42px;
  --mobile-nav-height: 88px;

  /* Sidebar palette */
  --sidebar-overlay: rgba(5, 16, 28, .08);
  --sidebar-sheen: rgba(150, 173, 194, .12);
  --sidebar-top: rgba(38, 55, 78, .95);
  --sidebar-bottom: rgba(16, 27, 43, .96);
  --sidebar-solid: rgba(18, 28, 44, .86);
  --sidebar-border: rgba(255,255,255,.10);
  --sidebar-border-strong: rgba(255,255,255,.14);
  --sidebar-shadow: 0 10px 28px rgba(3, 11, 22, .14);
  --sidebar-shadow-expanded: 18px 0 48px rgba(3, 11, 22, .24);
  --sidebar-icon: rgba(255,255,255,.56);
  --sidebar-hover-bg: rgba(255,255,255,.08);
  --sidebar-hover-text: rgba(255,255,255,.88);
  --sidebar-active-top: rgba(136, 156, 178, .24);
  --sidebar-active-bottom: rgba(92, 109, 130, .22);
  --sidebar-active-text: #edf2fa;
  --sidebar-logo-top: #8ea4bb;
  --sidebar-logo-bottom: #61758c;
  --sidebar-logo-shadow: rgba(44, 60, 78, .24);
  --sidebar-user-ring: rgba(148, 168, 191, .22);

  /* Typography */
  --font:  'Sora', system-ui, sans-serif;
  --mono:  'JetBrains Mono', monospace;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,30,54,.05);
  --shadow-sm: 0 1px 4px rgba(0,30,54,.08), 0 0 0 1px rgba(0,30,54,.04);
  --shadow-md: 0 4px 16px rgba(0,30,54,.10), 0 0 0 1px rgba(0,30,54,.04);
  --shadow-lg: 0 12px 40px rgba(0,30,54,.14), 0 0 0 1px rgba(0,30,54,.05);
  --shadow-xl: 0 24px 64px rgba(0,30,54,.18);

  /* Transitions */
  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-base: 180ms cubic-bezier(.4,0,.2,1);
  --t-slow: 280ms cubic-bezier(.4,0,.2,1);
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.55;
  color: var(--n-900);
  background: var(--n-50);
  -webkit-font-smoothing: antialiased;
}
body.theme-dark {
  color-scheme: dark;
  --blue-900: #0a0f2e;
  --blue-800: #111d54;
  --blue-700: #1f2d8a;
  --blue-100: #1c2460;
  --blue-50:  #141b4a;

  --teal-800: #b2eef0;
  --teal-700: #96e4e8;
  --teal-600: #74c8d0;
  --teal-500: #8fd9e0;
  --teal-400: #a9e5ea;
  --teal-100: #1a3444;
  --teal-50: #132a37;

  --n-900: #e6edf3;
  --n-800: #ced9e4;
  --n-700: #b4c2d1;
  --n-600: #9baec1;
  --n-500: #8ea2b6;
  --n-400: #7b8fa2;
  --n-300: #5f7388;
  --n-200: #304459;
  --n-150: #25394e;
  --n-100: #1b2e42;
  --n-50: #0f1f31;
  --white: #16283a;

  --s-bloqueado-bg: rgba(71, 85, 105, .22);
  --s-reservado-bg: rgba(248, 113, 113, .13);
  --s-confirmado-bg: rgba(59, 130, 246, .14);
  --s-entreturno-bg: rgba(192, 132, 252, .14);
  --s-control-bg: rgba(148, 163, 184, .12);
  --s-preconf-bg: rgba(251, 191, 36, .12);
  --s-atendido-bg: rgba(74, 222, 128, .13);
  --s-evento-bg: rgba(167, 139, 250, .14);

  color: var(--n-900);
  background:
    radial-gradient(circle at 12% -18%, rgba(143, 217, 224, .16), transparent 28%),
    radial-gradient(circle at 88% -22%, rgba(20, 67, 109, .34), transparent 34%),
    linear-gradient(180deg, #081522 0%, #0b1826 44%, #0e1d2d 100%);
}
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, select, textarea { font-family: var(--font); }
a { text-decoration: none; color: inherit; }

/* ─── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--n-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--n-300); }

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

/* ─── ICON SIDEBAR ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: transparent;
  display: block;
  flex-shrink: 0;
  z-index: 220;
  position: relative;
  overflow: visible;
}

.sidebar::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--sidebar-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 0;
}

.sidebar:hover::after,
.sidebar:focus-within::after {
  opacity: 1;
}

.sidebar-panel {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: calc(var(--sidebar-w) - 16px);
  min-height: calc(100% - 16px);
  background:
    linear-gradient(180deg, var(--sidebar-sheen), rgba(150, 173, 194, 0) 28%),
    linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom)),
    var(--sidebar-solid);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 2px 14px;
  gap: 6px;
  border: 1px solid var(--sidebar-border);
  border-radius: 24px;
  transition: width 180ms cubic-bezier(.22,1,.36,1), box-shadow 160ms cubic-bezier(.22,1,.36,1), background 160ms ease, border-color 160ms ease, padding 180ms cubic-bezier(.22,1,.36,1);
  will-change: width;
  box-shadow: var(--sidebar-shadow);
  z-index: 2;
}

.sidebar:hover .sidebar-panel,
.sidebar:focus-within .sidebar-panel {
  width: var(--sidebar-w-expanded);
  box-shadow: var(--sidebar-shadow-expanded);
  border-color: var(--sidebar-border-strong);
  padding: 12px 10px 14px;
}

.sidebar-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin: 0 auto 18px;
  flex-shrink: 0;
  color: #fff;
  cursor: pointer;
  transition: background var(--t-base), transform var(--t-base), width 220ms cubic-bezier(.22,1,.36,1);
  position: relative;
}
.sidebar-logo::before {
  content: '';
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(180deg, var(--sidebar-logo-top), var(--sidebar-logo-bottom));
  border: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 10px 18px var(--sidebar-logo-shadow);
}
.sidebar-logo:hover { background: var(--sidebar-hover-bg); }
.sidebar-logo:focus-visible {
  outline: 2px solid rgba(255,255,255,.7);
  outline-offset: 3px;
}
.sidebar-logo .sidebar-logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 0;
  z-index: 1;
  flex-shrink: 0;
  margin-left: 0;
}
.sidebar:hover .sidebar-logo,
.sidebar:focus-within .sidebar-logo {
  width: 100%;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 12px;
  margin: 0 0 18px;
}
.sidebar:hover .sidebar-logo::before,
.sidebar:focus-within .sidebar-logo::before {
  left: 6px;
  transform: none;
}
.sidebar:hover .sidebar-logo .sidebar-logo-icon,
.sidebar:focus-within .sidebar-logo .sidebar-logo-icon {
  margin-left: 0;
}

.nav-btn {
  position: relative;
  width: 54px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin: 0 auto;
  border-radius: 16px;
  color: var(--sidebar-icon);
  transition: background var(--t-fast), color var(--t-fast), transform 180ms cubic-bezier(.22,1,.36,1), width 220ms cubic-bezier(.22,1,.36,1), gap 180ms ease;
}
.sidebar:hover .nav-btn,
.sidebar:focus-within .nav-btn {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 14px;
}
.nav-btn:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-text); }
.sidebar:hover .nav-btn:hover,
.sidebar:focus-within .nav-btn:hover {
  transform: translateX(2px);
}
.nav-btn.active {
  background: linear-gradient(180deg, var(--sidebar-active-top), var(--sidebar-active-bottom));
  color: var(--sidebar-active-text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 10px 20px rgba(4, 10, 20, .10);
}
.nav-btn.has-unread .nav-icon {
  color: rgba(255,255,255,.86);
}
.nav-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}

.nav-badge {
  position: absolute;
  top: -8px;
  right: -11px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(10, 18, 32, 0.92);
  pointer-events: none;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  margin: 0;
}

.sidebar:hover .nav-icon,
.sidebar:focus-within .nav-icon {
  margin-left: 8px;
}

.nav-label {
  display: inline-block;
  max-width: 0;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1px;
  color: rgba(255,255,255,.9);
  clip-path: inset(0 100% 0 0);
  pointer-events: none;
  transition: opacity 150ms ease, transform 220ms cubic-bezier(.22,1,.36,1), clip-path 220ms cubic-bezier(.22,1,.36,1), max-width 220ms cubic-bezier(.22,1,.36,1);
}
.sidebar:hover .nav-label,
.sidebar:focus-within .nav-label {
  max-width: 160px;
  opacity: 1;
  transform: translateX(0);
  clip-path: inset(0 0 0 0);
  pointer-events: auto;
}

/* Tooltip */
.nav-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%; transform: translateY(-50%) translateX(-4px);
  background: var(--n-900);
  color: #fff;
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 999;
}
.nav-btn:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.sidebar:hover .nav-btn::after,
.sidebar:focus-within .nav-btn::after {
  opacity: 0;
}

.sidebar-spacer { flex: 1; }

.settings-wrap {
  position: relative;
  width: 54px;
  margin: 0 auto;
}

.sidebar:hover .settings-wrap,
.sidebar:focus-within .settings-wrap {
  width: 100%;
  margin: 0;
}

.settings-menu {
  position: absolute;
  left: calc(100% + 12px);
  bottom: 0;
  min-width: 210px;
  background: var(--white);
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 950;
}
.settings-menu.open { display: block; }
.sidebar:hover .settings-menu,
.sidebar:focus-within .settings-menu {
  left: 10px;
  right: 10px;
  bottom: 46px;
}

.settings-item {
  width: 100%;
  border-radius: var(--r-sm);
  padding: 9px 11px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--n-700);
  transition: background var(--t-fast), color var(--t-fast);
}
.settings-item:hover {
  background: var(--n-100);
  color: var(--n-900);
}
.settings-item.danger {
  color: #dc2626;
}
.settings-item.danger:hover {
  background: #fee2e2;
}

.sidebar-user-row {
  width: 54px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin: 0 auto;
}
.sidebar-user-row:hover {
  background: var(--sidebar-hover-bg);
}
.sidebar:hover .sidebar-user-row,
.sidebar:focus-within .sidebar-user-row {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 12px;
}

.sidebar-user {
  width: 38px; height: 38px;
  aspect-ratio: 1 / 1;
  flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sidebar-logo-top), var(--sidebar-logo-bottom));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  margin-left: 0;
  box-shadow: 0 10px 18px var(--sidebar-logo-shadow);
}
.sidebar:hover .sidebar-user,
.sidebar:focus-within .sidebar-user {
  margin-left: 3px;
}
.sidebar-user:hover {
  transform: scale(1.08);
  box-shadow:
    0 10px 18px var(--sidebar-logo-shadow),
    0 0 0 3px var(--sidebar-user-ring);
}
.sidebar-user-name {
  color: rgba(255,255,255,.9);
  font-size: 12px;
}

/* ─── CENTER COLUMN ──────────────────────────────────── */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── TOPBAR ─────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--n-150);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-left {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--blue-800);
  cursor: pointer;
  user-select: none;
}

.topbar-brand:focus-visible {
  outline: 2px solid rgba(18, 82, 130, .28);
  outline-offset: 4px;
  border-radius: 12px;
}

.topbar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08)),
    linear-gradient(180deg, var(--sidebar-logo-top), var(--sidebar-logo-bottom));
  box-shadow: 0 10px 18px var(--sidebar-logo-shadow);
}

.topbar-brand-icon img {
  width: 24px;
  height: 24px;
  display: block;
}

.topbar-brand-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
}

/* Page title */
.page-title {
  font-size: 14px; font-weight: 700;
  color: var(--blue-800); letter-spacing: -.3px;
  white-space: nowrap;
  padding-right: 10px;
  border-right: 1px solid var(--n-200);
  margin-right: 2px;
  cursor: pointer;
  transition: color var(--t-fast), opacity var(--t-fast);
}
.page-title:hover { color: var(--blue-900); opacity: .85; }
.page-title:focus-visible {
  outline: 2px solid rgba(18, 82, 130, .28);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Date navigation */
.date-nav { display: flex; align-items: center; gap: 2px; }

.date-nav-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--n-400);
  transition: background var(--t-fast), color var(--t-fast);
}
.date-nav-btn:hover { background: var(--n-100); color: var(--n-700); }
.date-nav-btn svg { width: 13px; height: 13px; }

.date-display {
  padding: 5px 13px;
  background: var(--n-50);
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600;
  color: var(--n-800);
  cursor: pointer;
  white-space: nowrap;
  min-width: 148px; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast);
  letter-spacing: -.1px;
}
.date-display:hover { border-color: var(--teal-500); background: var(--teal-50); color: var(--teal-600); }

.today-btn {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600;
  color: var(--n-500);
  letter-spacing: .2px;
  text-transform: uppercase;
  transition: all var(--t-fast);
}
.today-btn:hover { border-color: var(--teal-500); color: var(--teal-600); background: var(--teal-50); }

/* Week day pills */
.week-pills {
  display: flex; gap: 2px;
  background: var(--n-100);
  border-radius: var(--r-md);
  padding: 3px;
}
.week-pill {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600;
  color: var(--n-400);
  cursor: pointer;
  transition: all var(--t-fast);
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
}
.week-pill:hover { background: var(--white); color: var(--n-700); }
.week-pill.active { background: var(--white); color: var(--blue-800); box-shadow: var(--shadow-xs); }
.week-pill.is-today .pill-day { color: var(--teal-500); }
.week-pill .pill-num { font-size: 13px; font-weight: 700; }
.week-pill .pill-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--teal-500);
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
}

/* Search */
.search-wrap { position: relative; }
.search-wrap input {
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  background: var(--n-50);
  color: var(--n-800);
  outline: none;
  width: 200px;
  transition: border-color var(--t-fast), width var(--t-base), background var(--t-fast), box-shadow var(--t-fast);
}
.search-wrap input:focus {
  border-color: var(--teal-500);
  background: var(--white);
  width: 250px;
  box-shadow: 0 0 0 3px rgba(98,188,197,.12);
}
.search-wrap input::placeholder { color: var(--n-400); }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--n-400); pointer-events: none;
}
.search-kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 9px; font-weight: 600; letter-spacing: .3px;
  color: var(--n-400); background: var(--n-150);
  padding: 1px 5px; border-radius: 4px; pointer-events: none;
  font-family: var(--mono);
}

/* ─── Topbar clock + search wrapper ─────────────────────── */
.topbar-clock-search {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-clock {
  display: flex;
  align-items: baseline;
  gap: 1px;
  background: var(--n-100);
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  padding: 5px 11px 5px 10px;
  cursor: default;
  user-select: none;
  line-height: 1;
}
.topbar-clock-time {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--n-600);
}
.topbar-clock-secs {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--n-300);
  letter-spacing: .5px;
}
body.theme-dark .topbar-clock {
  background: rgba(12, 24, 38, .72);
  border-color: rgba(255,255,255,.1);
}
body.theme-dark .topbar-clock-time {
  color: #d0eef8;
}
body.theme-dark .topbar-clock-secs {
  color: var(--n-500);
}

/* Action buttons */
.topbar-actions { display: flex; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600;
  letter-spacing: -.1px;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn svg { width: 13px; height: 13px; }

.btn-ghost {
  background: var(--white);
  color: var(--n-600);
  border: 1px solid var(--n-200);
}
.btn-ghost:hover { border-color: var(--n-300); color: var(--n-800); background: var(--n-50); }

.btn-teal {
  background: linear-gradient(135deg, #2d5a8d 0%, #18385c 100%);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(24,56,92,.20);
}
.btn-teal:hover {
  background: linear-gradient(135deg, #3569a0 0%, #1c426a 100%);
  box-shadow: 0 8px 18px rgba(24,56,92,.24);
}

.btn-blue {
  background: var(--blue-700);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(47,62,201,.35);
}
.btn-blue:hover { background: var(--blue-800); }

/* ─── STATS BAR ──────────────────────────────────────── */
.statsbar {
  height: var(--statsbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--n-150);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
  flex-shrink: 0;
  overflow-x: auto;
}

.stat {
  display: flex; align-items: center; gap: 7px;
  padding: 0 18px; height: 100%;
  border-right: 1px solid var(--n-150);
  white-space: nowrap;
  flex-shrink: 0;
}
.stat:first-child { padding-left: 0; }

.stat-indicator {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stat-name { font-size: 11px; color: var(--n-400); font-weight: 500; letter-spacing: .1px; }
.stat-count {
  font-family: var(--mono);
  font-size: 13px; font-weight: 500;
  color: var(--n-800);
  min-width: 20px;
}
.stat.is-total .stat-count { color: var(--blue-800); font-weight: 700; }

/* Prof filter on stats bar */
.statsbar-prof {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding-left: 18px; flex-shrink: 0;
}
.statsbar-prof-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--n-400);
}
.statsbar-select {
  padding: 4px 9px;
  border: 1px solid rgba(214,223,232,.96);
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600;
  color: #334861;
  background: linear-gradient(180deg, rgba(248,249,251,.96), rgba(241,244,248,.96));
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.statsbar-select:focus {
  border-color: rgba(45,90,141,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 0 0 3px rgba(45,90,141,.10);
}

/* ─── MAIN BODY ──────────────────────────────────────── */
.main-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Patients view */
.patients-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(98,188,197,.18), transparent 24%),
    radial-gradient(circle at top right, rgba(0,53,87,.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.62), rgba(242,246,249,.92)),
    var(--n-50);
}

.patients-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 24px 10px;
  background:
    linear-gradient(135deg, rgba(98,188,197,.16), rgba(98,188,197,0) 42%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88)),
    var(--white);
  border-bottom: 1px solid rgba(218,228,236,.85);
  position: relative;
  overflow: hidden;
}

.patients-toolbar::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98,188,197,.22), rgba(98,188,197,0) 70%);
  pointer-events: none;
}

.patients-toolbar-copy,
.patients-toolbar-actions {
  position: relative;
  z-index: 1;
}

.patients-toolbar-copy {
  min-width: min(100%, 540px);
}

.patients-toolbar-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(98,188,197,.14);
  border: 1px solid rgba(98,188,197,.24);
  color: var(--teal-600);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  box-shadow: 0 6px 14px rgba(98,188,197,.10);
  animation: patientsKickerGlow 4s ease-in-out infinite;
}

.patients-toolbar h3 {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
}

.patients-toolbar p {
  margin-top: 2px;
  font-size: 11px;
  color: var(--n-500);
}

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

.patients-action-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 13px;
  gap: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: 0 8px 18px rgba(0,30,54,.06);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base), background var(--t-base);
}

.patients-action-btn span,
.patients-action-btn svg {
  position: relative;
  z-index: 1;
}

.patients-action-btn svg {
  width: 14px;
  height: 14px;
}

.patients-action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.24) 50%, rgba(255,255,255,0) 80%);
  transform: translateX(-140%);
  transition: transform 520ms cubic-bezier(.22,1,.36,1);
}

.patients-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0,30,54,.12);
}

.patients-action-btn:hover::after {
  transform: translateX(140%);
}

.patients-action-btn--primary {
  box-shadow: 0 14px 28px rgba(0,53,87,.18);
}

.patients-action-btn--sync {
  color: var(--blue-800);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,246,251,.94)),
    var(--white);
  border-color: rgba(218,228,236,.9);
}

.patients-action-btn--refresh {
  box-shadow: 0 14px 28px rgba(98,188,197,.18);
}

.patients-search-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 24px 0;
}

.patients-search-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(240,246,251,.72)),
    rgba(255,255,255,.64);
  border: 1px solid rgba(218,228,236,.9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    0 16px 34px rgba(0,30,54,.10);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base), background var(--t-base);
}

.patients-search-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 50%, rgba(98,188,197,.24), transparent 20%),
    linear-gradient(120deg, rgba(98,188,197,0) 18%, rgba(98,188,197,.18) 50%, rgba(0,53,87,0) 82%);
  opacity: .7;
  transform: translateX(-12%);
  pointer-events: none;
}


.patients-search-wrap input {
  width: 100%;
  min-height: 54px;
  padding: 14px 124px 14px 48px;
  border: 1px solid rgba(218,228,236,.86);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.1px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    var(--white);
  color: var(--blue-900);
  outline: none;
  box-sizing: border-box;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.68),
    inset 0 -1px 0 rgba(218,228,236,.55);
  position: relative;
  z-index: 1;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.patients-search-wrap input:focus {
  border-color: var(--teal-500);
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(242,249,251,.98)),
    var(--white);
  color: var(--blue-900);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 0 0 4px rgba(98,188,197,.16),
    0 18px 34px rgba(98,188,197,.14);
}

.patients-search-wrap:focus-within {
  border-color: rgba(98,188,197,.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.68),
    0 20px 36px rgba(0,30,54,.12);
}

.patients-search-wrap input::placeholder {
  color: var(--n-500);
  font-weight: 500;
}

.patients-search-wrap input::selection {
  background: rgba(98,188,197,.28);
  color: var(--blue-900);
}

.patients-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--teal-700);
  pointer-events: none;
  z-index: 2;
  transition: color var(--t-fast), filter var(--t-fast);
}

.patients-search-submit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,53,87,.14);
  background:
    linear-gradient(135deg, rgba(0,53,87,.10), rgba(98,188,197,.18)),
    var(--white);
  color: var(--blue-800);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1px;
  box-shadow: 0 10px 22px rgba(0,53,87,.10);
  z-index: 2;
  transition: box-shadow var(--t-base), border-color var(--t-base), color var(--t-base), background var(--t-base);
}

.patients-search-submit:hover {
  border-color: rgba(98,188,197,.34);
  box-shadow: 0 14px 26px rgba(0,53,87,.14);
}

.patients-filters-panel {
  border-radius: 24px;
  border: 1px solid rgba(218,228,236,.82);
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(248,250,252,.82)),
    rgba(255,255,255,.72);
  box-shadow: 0 16px 34px rgba(0,30,54,.08);
}

.patients-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.patients-filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.patients-filter-field span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--n-400);
}

.patients-filter-field .field-input {
  min-height: 44px;
  border-radius: 14px;
  border-color: rgba(218,228,236,.92);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94)),
    var(--white);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.66);
}

.patients-filter-field .field-input:focus {
  border-color: rgba(98,188,197,.44);
  box-shadow: 0 0 0 3px rgba(98,188,197,.12);
}

.patients-filter-actions {
  display: none;
}

.patients-active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 0;
}

.patients-active-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(98,188,197,.22);
  background: rgba(98,188,197,.12);
  color: var(--teal-800);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1px;
}

.patients-filter-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.patients-filter-clear {
  min-height: 40px;
  border-radius: 999px;
}

body.theme-dark .patients-search-wrap input {
  background:
    linear-gradient(180deg, rgba(18, 37, 55, .96), rgba(14, 29, 44, .98)),
    rgba(14, 29, 44, .96);
  border-color: rgba(143, 217, 224, .18);
  color: #eef9ff;
  -webkit-text-fill-color: #eef9ff;
  caret-color: #9fe8ee;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 -1px 0 rgba(143,217,224,.08);
}

body.theme-dark .patients-search-wrap input:focus {
  background:
    linear-gradient(180deg, rgba(22, 43, 63, .98), rgba(16, 34, 51, .98)),
    rgba(16, 34, 51, .98);
  border-color: var(--teal-500);
  color: #f4fcff;
  -webkit-text-fill-color: #f4fcff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 0 0 4px rgba(143, 217, 224, .18),
    0 20px 40px rgba(4, 12, 24, .36);
}

body.theme-dark .patients-search-wrap {
  background:
    linear-gradient(135deg, rgba(21, 42, 62, .92), rgba(12, 27, 41, .90)),
    rgba(13, 27, 41, .82);
  border-color: rgba(143, 217, 224, .14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 18px 34px rgba(0, 10, 22, .26);
}

body.theme-dark .patients-search-wrap::before {
  background:
    radial-gradient(circle at 12% 50%, rgba(143,217,224,.20), transparent 22%),
    linear-gradient(120deg, rgba(143,217,224,0) 18%, rgba(143,217,224,.14) 50%, rgba(10,39,64,0) 82%);
}

body.theme-dark .patients-search-wrap::after {
  background: rgba(143,217,224,.08);
  border-color: rgba(143,217,224,.16);
  color: #a8edf1;
}

body.theme-dark .patients-search-wrap input::placeholder {
  color: #88a1b7;
}

body.theme-dark .patients-search-wrap input::selection {
  background: rgba(143,217,224,.26);
  color: #f4fcff;
}

body.theme-dark .patients-search-icon {
  color: #9fe8ee;
  filter: drop-shadow(0 0 10px rgba(143,217,224,.18));
}

body.theme-dark .patients-search-submit {
  border-color: rgba(143,217,224,.16);
  background:
    linear-gradient(135deg, rgba(19, 40, 58, .96), rgba(17, 65, 82, .84)),
    rgba(15, 29, 45, .92);
  color: #ddfbff;
  box-shadow: 0 16px 30px rgba(0, 8, 18, .26);
}

body.theme-dark .patients-search-submit:hover {
  border-color: rgba(143,217,224,.26);
  box-shadow: 0 18px 34px rgba(0, 8, 18, .30);
}

body.theme-dark .patients-filters-panel {
  border-color: rgba(143, 217, 224, .14);
  background:
    linear-gradient(180deg, rgba(18, 37, 55, .86), rgba(12, 27, 41, .88)),
    rgba(12, 24, 38, .76);
  box-shadow: 0 18px 34px rgba(0, 10, 22, .24);
}

body.theme-dark .patients-filter-field span {
  color: var(--n-500);
}

body.theme-dark .patients-filter-field .field-input {
  border-color: rgba(143, 217, 224, .14);
  background: rgba(15, 29, 45, .84);
}

body.theme-dark .patients-filter-field .field-input:focus {
  box-shadow: 0 0 0 3px rgba(143, 217, 224, .12);
}

body.theme-dark .patients-filter-actions {
  border-top-color: rgba(143, 217, 224, .12);
}

body.theme-dark .patients-active-chip {
  border-color: rgba(143,217,224,.18);
  background: rgba(143,217,224,.10);
  color: #c8faff;
}

body.theme-dark .patients-search-wrap:focus-within .patients-search-icon,
.patients-search-wrap:hover .patients-search-icon,
.patients-search-wrap:focus-within .patients-search-icon {
  transform: translateY(-50%);
}

.patients-action-btn--primary {
  color: #f8feff;
  background-color: #4eb6c3;
  background-image: linear-gradient(135deg, #0b4970 0%, #2e89a2 52%, #4eb6c3 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-color: transparent;
  box-shadow:
    0 14px 28px rgba(0,53,87,.18);
}

.patients-action-btn--primary:hover {
  background-color: #62c4d0;
  background-image: linear-gradient(135deg, #0e577f 0%, #3794ad 52%, #62c4d0 100%);
}

.patients-action-btn--primary::after {
  display: none;
}

body.theme-dark .patients-action-btn--primary {
  color: #f3fdff;
  background-color: #74cad3;
  background-image: linear-gradient(135deg, #144f78 0%, #357f9f 52%, #74cad3 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-color: transparent;
  box-shadow:
    0 18px 34px rgba(2, 12, 24, .34);
}

body.theme-dark .patients-action-btn--primary:hover {
  background-color: #88d9df;
  background-image: linear-gradient(135deg, #1c628d 0%, #468eb0 52%, #88d9df 100%);
}

body.theme-dark .patients-action-btn--primary::after {
  display: none;
}

body.theme-dark .patients-action-btn--primary span,
body.theme-dark .patients-action-btn--primary svg {
  color: inherit;
}

body.theme-dark .patients-search-wrap input:-webkit-autofill,
body.theme-dark .patients-search-wrap input:-webkit-autofill:hover,
body.theme-dark .patients-search-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: #eef9ff;
  transition: background-color 9999s ease-out 0s;
  -webkit-box-shadow: 0 0 0 1000px rgba(18, 37, 55, .98) inset;
}

.patients-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 24px 0;
}

.patients-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 58px;
  border-radius: 12px;
  border: 1px solid rgba(218,228,236,.88);
  padding: 8px 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.94)),
    var(--white);
  box-shadow: 0 10px 20px rgba(0,30,54,.06);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.patients-stat-card::before {
  content: '';
  position: absolute;
  inset: auto -10px -18px auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  opacity: .4;
  pointer-events: none;
}

.patients-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0,30,54,.08);
}

.patients-stat-card--visible::before {
  background: radial-gradient(circle, rgba(0,53,87,.18), rgba(0,53,87,0) 70%);
}

.patients-stat-card--cell::before {
  background: radial-gradient(circle, rgba(98,188,197,.26), rgba(98,188,197,0) 70%);
}

.patients-stat-card--email::before {
  background: radial-gradient(circle, rgba(59,130,246,.22), rgba(59,130,246,0) 70%);
}

.patients-stat-card--birth::before {
  background: radial-gradient(circle, rgba(245,158,11,.20), rgba(245,158,11,0) 70%);
}

.patients-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
}

.patients-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.5px;
}

.patients-stat-meta {
  display: none;
}

.patients-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: clamp(320px, 46vh, 560px);
  margin: 10px 24px 18px;
  padding: 8px 12px 12px;
  border-radius: 26px;
  border: 1px solid rgba(218,228,236,.82);
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.62)),
    rgba(255,255,255,.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0,30,54,.10);
}

.patients-table-scale-shell {
  width: max-content;
  max-width: none;
  transform-origin: top center;
}

.patients-empty-panel {
  margin: 14px 24px 0;
  padding: 28px 26px;
  border-radius: 26px;
  border: 1px dashed rgba(218,228,236,.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(248,250,252,.86)),
    var(--white);
  box-shadow: 0 18px 38px rgba(0,30,54,.08);
  color: var(--n-500);
}

.patients-empty-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.2px;
}

.patients-empty-panel p {
  max-width: 760px;
  font-size: 12.5px;
}

.patients-empty-panel .patients-active-filters {
  margin-top: 14px;
}

.patients-empty-panel .btn {
  margin-top: 16px;
}

.patients-table {
  width: 100%;
  min-width: 1620px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.patients-table thead th:nth-child(1),
.patients-table tbody td:nth-child(1) { width: 300px; }
.patients-table thead th:nth-child(2),
.patients-table tbody td:nth-child(2) { width: 90px; }
.patients-table thead th:nth-child(3),
.patients-table tbody td:nth-child(3) { width: 110px; }
.patients-table thead th:nth-child(4),
.patients-table tbody td:nth-child(4) { width: 120px; }
.patients-table thead th:nth-child(5),
.patients-table tbody td:nth-child(5) { width: 120px; }
.patients-table thead th:nth-child(6),
.patients-table tbody td:nth-child(6) { width: 200px; }
.patients-table thead th:nth-child(7),
.patients-table tbody td:nth-child(7) { width: 120px; }
.patients-table thead th:nth-child(8),
.patients-table tbody td:nth-child(8) { width: 120px; }
.patients-table thead th:nth-child(9),
.patients-table tbody td:nth-child(9) { width: 150px; }
.patients-table thead th:nth-child(10),
.patients-table tbody td:nth-child(10) { width: 360px; }

.patients-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
  padding: 0 12px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--n-400);
}

.patients-table tbody tr {
  animation: patientRowEnter .42s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--row-index, 0) * 26ms);
}

.patients-table tbody tr:hover td,
.patients-table tbody tr:focus-within td {
  border-color: rgba(98,188,197,.30);
  box-shadow: none;
}

.patients-table tbody td {
  padding: 13px 12px;
  font-size: 12.5px;
  color: var(--n-700);
  vertical-align: middle;
  white-space: nowrap;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94)),
    var(--white);
  border-top: 1px solid rgba(218,228,236,.88);
  border-bottom: 1px solid rgba(218,228,236,.88);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.patients-table tbody td:first-child {
  border-left: 1px solid rgba(218,228,236,.88);
  border-radius: 18px 0 0 18px;
}

.patients-table tbody td:last-child {
  border-right: 1px solid rgba(218,228,236,.88);
  border-radius: 0 18px 18px 0;
  text-align: right;
  white-space: nowrap;
}

.patient-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  white-space: normal;
}

.patient-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-800), var(--teal-500));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 20px rgba(0,53,87,.18);
}

.patient-main-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.patient-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.patients-table .p-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--n-900);
  letter-spacing: -.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patients-table .p-muted {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0,53,87,.06);
  border: 1px solid rgba(0,53,87,.10);
  color: var(--blue-800);
  font-size: 11px;
  font-family: var(--mono);
}

.patient-inline-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.patient-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(218,228,236,.96);
  background: var(--n-50);
  color: var(--n-700);
  font-size: 11px;
  font-weight: 600;
}

.patient-chip.is-highlight {
  background: rgba(98,188,197,.14);
  border-color: rgba(98,188,197,.22);
  color: var(--teal-600);
}

.patient-chip.is-soft {
  background: rgba(148,163,184,.10);
  border-style: dashed;
  color: var(--n-500);
}

.patient-audit-card {
  background:
    linear-gradient(135deg, rgba(98,188,197,.10), rgba(98,188,197,0) 42%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,250,252,.96));
  border: 1px solid rgba(190,214,224,.92);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.patient-audit-card--info {
  margin: 14px 0 18px;
}

.patient-audit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.patient-audit-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(98,188,197,.14);
  border: 1px solid rgba(98,188,197,.24);
  color: var(--teal-600);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.patient-audit-note {
  flex: 1;
  min-width: min(100%, 260px);
  color: var(--n-600);
  font-size: 12px;
  line-height: 1.45;
}

.patient-audit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.patient-audit-item {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(218,228,236,.96);
  background: rgba(255,255,255,.86);
}

.patient-audit-item.is-empty {
  background: rgba(248,250,252,.92);
}

.patient-audit-label {
  color: var(--n-500);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.patient-audit-value {
  margin-top: 6px;
  color: var(--blue-800);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.patient-audit-item.is-empty .patient-audit-value {
  color: var(--n-600);
  font-weight: 600;
}

.patient-audit-hint {
  margin-top: 5px;
  color: var(--n-500);
  font-size: 11px;
  line-height: 1.45;
}

.patient-value-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(218,228,236,.96);
  background: rgba(248,250,252,.96);
  color: var(--n-700);
  font-size: 11.5px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-value-chip.is-social {
  background: rgba(0,53,87,.06);
  border-color: rgba(0,53,87,.12);
  color: var(--blue-800);
}

.patient-value-chip.is-female {
  background: rgba(244,63,94,.08);
  border-color: rgba(244,63,94,.14);
  color: #be123c;
}

.patient-value-chip.is-male {
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.14);
  color: #1d4ed8;
}

.patient-value-chip.is-neutral {
  background: rgba(148,163,184,.10);
  border-color: rgba(148,163,184,.16);
  color: var(--n-700);
}

.patient-birth {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patient-birth strong {
  color: var(--n-800);
  font-size: 12.5px;
}

.patient-birth small {
  color: var(--teal-600);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.patient-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,53,87,.14);
  background:
    linear-gradient(135deg, rgba(0,53,87,.10), rgba(98,188,197,.18)),
    var(--white);
  color: var(--blue-800);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1px;
  box-shadow: 0 10px 22px rgba(0,53,87,.10);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base), color var(--t-base);
  white-space: nowrap;
}

.patient-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.patient-edit-btn svg {
  width: 15px;
  height: 15px;
}

.patient-edit-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(98,188,197,.34);
  box-shadow: 0 14px 26px rgba(0,53,87,.14);
}

.patient-delete-btn {
  border-color: rgba(220,38,38,.20);
  background:
    linear-gradient(135deg, rgba(220,38,38,.08), rgba(254,226,226,.72)),
    var(--white);
  color: #b91c1c;
}

.patient-delete-btn:hover {
  border-color: rgba(220,38,38,.34);
  box-shadow: 0 14px 26px rgba(127,29,29,.12);
}

.patients-empty {
  text-align: center;
  color: var(--n-500);
  padding: 30px 10px;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  border: 1px dashed rgba(218,228,236,.96);
}

@media (max-width: 1180px) {
  .patients-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .patients-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .patients-search-shell {
    padding: 16px 16px 0;
  }

  .patients-search-wrap {
    padding: 8px;
    border-radius: 24px;
  }

  .patients-search-wrap input {
    min-height: 56px;
    padding: 14px 18px 14px 44px;
    border-radius: 18px;
  }

  .patients-search-submit {
    position: static;
    width: 100%;
    margin-top: 10px;
    transform: none;
  }

  .patients-filters-panel {
    padding: 14px;
  }

  .patients-filter-grid {
    grid-template-columns: 1fr;
  }

  .patients-summary,
  .patients-empty-panel {
    margin-left: 16px;
    margin-right: 16px;
  }

  .patients-summary {
    padding-left: 0;
    padding-right: 0;
  }

  .patients-table-wrap {
    margin: 14px 16px 16px;
  }
}

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

@keyframes patientsKickerGlow {
  0%, 100% {
    box-shadow: 0 10px 22px rgba(98,188,197,.12);
  }
  50% {
    box-shadow: 0 14px 26px rgba(98,188,197,.20);
  }
}

@keyframes patientsSearchSweep {
  0%, 100% {
    transform: translateX(-42%);
    opacity: .72;
  }
  50% {
    transform: translateX(42%);
    opacity: 1;
  }
}

.messages-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(98,188,197,.12), transparent 26%),
    linear-gradient(180deg, rgba(0,53,87,.03), transparent 44%),
    var(--n-50);
}

.messages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--n-150);
}

.messages-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
}

.messages-toolbar p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--n-500);
}

.messages-toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.messages-source-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--n-150);
}

.messages-source-btn {
  min-height: 34px;
  border: none;
  border-radius: 999px;
  padding: 0 12px;
  background: transparent;
  color: var(--n-500);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.messages-source-btn.active {
  background: linear-gradient(180deg, rgba(98,188,197,.18), rgba(98,188,197,.1));
  color: var(--blue-800);
  box-shadow: inset 0 0 0 1px rgba(98,188,197,.3);
}

.messages-status-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.messages-status-filter span {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
}

.messages-status-filter .field-input {
  min-width: 150px;
  min-height: 36px;
  padding: 6px 10px;
  border-width: 1px;
  font-size: 12.5px;
  background: rgba(255,255,255,.94);
}

.messages-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  padding: 14px;
}

.messages-list-wrap {
  border: 1px solid rgba(212, 227, 236, .9);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(98,188,197,.14), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,253,.92));
  box-shadow: 0 22px 44px rgba(15, 23, 42, .06);
  overflow-y: auto;
  padding: 14px;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messages-empty-card {
  border: 1px dashed var(--n-200);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  color: var(--n-500);
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.55;
}

.message-conversation-item {
  width: 100%;
  border: 1px solid var(--n-150);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, var(--message-accent-soft, rgba(98,188,197,.16)), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(247,250,252,.95)),
    var(--white);
  padding: 14px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.message-conversation-item:hover {
  border-color: var(--message-accent-ring, var(--n-300));
  box-shadow: 0 14px 28px rgba(15,23,42,.08);
}

.message-conversation-item:active {
  transform: none;
}

.message-conversation-item.active {
  border-color: var(--message-accent-ring, rgba(98,188,197,.78));
  box-shadow: 0 0 0 2px var(--message-accent-soft, rgba(98,188,197,.18)), 0 20px 34px rgba(15,23,42,.09);
  background:
    radial-gradient(circle at top right, var(--message-accent-strong, rgba(98,188,197,.18)), transparent 44%),
    linear-gradient(180deg, rgba(240,251,252,.98), rgba(255,255,255,.95)),
    var(--white);
}

.message-conversation-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--message-accent, var(--teal-500)), transparent 82%);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.message-conversation-item.is-unread::before,
.message-conversation-item.active::before {
  opacity: 1;
}

.message-conversation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.message-conversation-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-conversation-identity > div:last-child {
  min-width: 0;
}

.message-conversation-avatar {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  background:
    linear-gradient(135deg, var(--message-accent, var(--teal-500)), #9ddfe4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: inset 0 -10px 18px rgba(255,255,255,.18), 0 10px 20px var(--message-accent-soft, rgba(98,188,197,.2));
}

.message-conversation-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--n-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-conversation-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--n-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-unread-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.message-conversation-preview {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--n-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

.message-conversation-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.message-conversation-foot-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.message-conversation-time {
  font-size: 10.5px;
  color: var(--n-400);
  flex: 0 0 auto;
  white-space: nowrap;
}

.message-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--n-150);
  background: var(--n-50);
  color: var(--n-600, var(--n-700));
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .45px;
}

.message-status-pill.open {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.message-status-pill.pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.message-status-pill.resolved {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #15803d;
}

.message-status-pill.snoozed {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.message-status-pill.internal {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0f766e;
}

.message-read-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18px;
}

.messages-detail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages-detail-header {
  min-height: 84px;
  padding: 18px 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.92));
  border: 1px solid rgba(212, 227, 236, .9);
  border-radius: 28px 28px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.messages-detail-main {
  min-width: 0;
  flex: 1 1 auto;
}

.messages-detail-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.messages-detail-name-row > div:last-child {
  min-width: 0;
}

.messages-detail-back {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(212, 227, 236, .9);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  color: var(--blue-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.messages-detail-back:hover {
  transform: translateX(-1px);
  border-color: rgba(98,188,197,.34);
  background: rgba(240,251,252,.94);
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}

.messages-detail-back svg {
  width: 17px;
  height: 17px;
}

.messages-detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--message-accent, var(--teal-500)), #9ddfe4);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 14px 28px var(--message-accent-soft, rgba(98,188,197,.18));
}

.messages-detail-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-detail-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--n-500);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-detail-read {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18px;
}

.messages-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.messages-label-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--n-100);
  border: 1px solid var(--n-150);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--n-700);
}

.messages-thread {
  flex: 1;
  overflow: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at top left, rgba(98,188,197,.10), transparent 26%),
    radial-gradient(circle at bottom right, rgba(0,53,87,.06), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.72)),
    var(--n-50);
  border-left: 1px solid rgba(212, 227, 236, .84);
  border-right: 1px solid rgba(212, 227, 236, .84);
}

.messages-day-sep {
  align-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--n-150);
  color: var(--n-400);
  font-size: 10.5px;
  font-weight: 700;
}

.message-bubble-row {
  display: flex;
  animation: messageRowRise .34s ease both;
}

.message-bubble-row.incoming {
  justify-content: flex-start;
}

.message-bubble-row.outgoing,
.message-bubble-row.private {
  justify-content: flex-end;
}

.message-bubble-row.activity {
  justify-content: center;
}

.message-bubble {
  max-width: min(720px, 78%);
  min-width: 0;
  border-radius: 22px;
  border: 1px solid var(--n-150);
  padding: 12px 14px;
  box-shadow: 0 14px 24px rgba(15,23,42,.05);
  position: relative;
}

.message-bubble.incoming {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,253,.94));
  border-color: var(--message-accent-soft, var(--n-150));
  color: var(--n-800);
}

.message-bubble.outgoing {
  background:
    radial-gradient(circle at top right, var(--message-accent-soft, rgba(98,188,197,.16)), transparent 44%),
    linear-gradient(180deg, rgba(240,251,252,.96), rgba(255,255,255,.92));
  border-color: var(--message-accent-ring, rgba(98,188,197,.32));
  color: var(--blue-800);
}

.message-bubble.private {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.message-bubble.activity {
  max-width: none;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  color: var(--n-400);
}

.message-bubble-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  min-width: 0;
}

.message-bubble-author {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble-time {
  font-size: 10px;
  color: var(--n-400);
  white-space: nowrap;
}

.message-bubble-content {
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.message-bubble-status {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
}

.message-bubble-status.sent {
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.22);
  color: var(--n-500);
}

.message-bubble-status.seen {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.message-bubble-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.message-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid var(--n-150);
  background: rgba(255,255,255,.84);
  color: var(--blue-800);
  font-size: 11px;
  font-weight: 700;
}

.message-note-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.messages-composer {
  border: 1px solid rgba(212, 227, 236, .9);
  border-top: none;
  border-radius: 0 0 28px 28px;
  background: rgba(255,255,255,.97);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.messages-compose-input {
  min-width: 0;
  min-height: 52px;
  max-height: 140px;
  padding: 15px 18px;
  resize: none;
  overflow-y: auto;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,253,.94));
}

.messages-send-btn.btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  gap: 0;
}

.messages-send-btn.btn:disabled {
  box-shadow: none;
  opacity: .64;
}

.messages-send-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.messages-send-btn span {
  display: none;
}

@keyframes messageCardFloat {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.messages-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.messages-compose-hint {
  display: none;
  font-size: 11px;
  color: var(--n-500);
}

.messages-disabled-note {
  color: var(--n-400);
}

.doctors-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(98,188,197,.10), transparent 28%),
    linear-gradient(180deg, rgba(0,53,87,.03), transparent 40%),
    var(--n-50);
}

.doctors-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--n-150);
}

.doctors-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
}

.doctors-toolbar p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--n-500);
}

.doctors-toolbar-actions {
  display: flex;
  gap: 8px;
}

.doctors-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px 20px 0;
}

.doctors-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doctors-filter span {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
}

.doctors-filter .field-input {
  min-height: 36px;
  padding: 6px 10px;
  border-width: 1px;
  font-size: 12.5px;
  background: rgba(255,255,255,.92);
}

.doctors-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px 0;
}

.doctor-stat-card {
  border: 1px solid var(--n-150);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  padding: 8px 12px;
  box-shadow: var(--shadow-xs);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.doctor-stat-label {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
  margin-bottom: 0;
}

.doctor-stat-card strong {
  font-size: 15px;
  letter-spacing: -.3px;
  line-height: 1;
  color: var(--blue-800);
}

.doctors-grid {
  flex: 1;
  overflow: auto;
  padding: 12px 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-content: start;
}

.doctor-card {
  border: 1px solid var(--n-150);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.95)),
    var(--white);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.doctor-card.is-inactive {
  background:
    linear-gradient(180deg, rgba(241,245,249,.98), rgba(248,250,252,.94)),
    var(--white);
}

.doctor-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.doctor-card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.doctor-card-identity > div {
  min-width: 0;
}

.doctor-card-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--n-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doctor-card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--n-500);
}

.doctor-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.doctor-metric {
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  background: var(--n-50);
  padding: 10px 11px;
}

.doctor-metric-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
  margin-bottom: 6px;
}

.doctor-metric strong {
  font-size: 14px;
  color: var(--blue-800);
}

.doctor-card-block {
  margin-top: 14px;
}

.doctor-card-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
  margin-bottom: 8px;
}

.doctor-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doctor-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: var(--blue-800);
  font-size: 11px;
  font-weight: 600;
}

.doctor-card-calendar {
  border: 1px dashed var(--n-200);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.74);
  padding: 10px 12px;
  color: var(--n-500);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
}

.doctor-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Obras sociales view */
.obras-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(0,53,87,.09), transparent 26%),
    radial-gradient(circle at top right, rgba(98,188,197,.18), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.68), rgba(242,246,249,.94)),
    var(--n-50);
}

.professionals-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--n-50);
}

.professionals-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--n-150);
}

.professionals-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
}

.professionals-toolbar p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--n-500);
}

.professionals-content {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}

.professionals-list-wrap {
  border-right: 1px solid var(--n-150);
  background: var(--white);
  overflow-y: auto;
  padding: 12px;
}

.professionals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-tab-item {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background:
    linear-gradient(180deg, rgba(98,188,197,.14), rgba(98,188,197,0)) ,
    var(--white);
  padding: 12px;
  text-align: left;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.settings-tab-item:hover {
  transform: translateY(-1px);
  border-color: var(--n-300);
  box-shadow: var(--shadow-sm);
}

.settings-tab-item.active {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 1px rgba(98,188,197,.2), var(--shadow-sm);
}

.settings-tab-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-800);
}

.settings-tab-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--n-500);
}

.settings-secondary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--n-150);
}

.settings-secondary-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-sm {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 11.5px;
}

.professional-item {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: var(--white);
  padding: 12px;
  text-align: left;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.professional-item:hover {
  transform: translateY(-1px);
  border-color: var(--n-300);
  box-shadow: var(--shadow-sm);
}

.professional-item.active {
  border-color: var(--teal-500);
  background: var(--teal-50);
  box-shadow: 0 0 0 1px rgba(98,188,197,.2), var(--shadow-sm);
}

.professional-item.is-inactive {
  background: linear-gradient(180deg, rgba(148,163,184,.08), rgba(148,163,184,.02)), var(--white);
}

.professional-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.professional-item-copy {
  min-width: 0;
}

.professional-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.professional-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: inset 0 -10px 20px rgba(255,255,255,.08);
  flex-shrink: 0;
}

.professional-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 14px;
}

.professional-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--n-900);
}

.professional-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--n-500);
}

.professional-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--n-100);
  border: 1px solid var(--n-150);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--n-700);
  letter-spacing: .1px;
}

.professional-pill.is-active {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #15803d;
}

.professional-pill.is-inactive {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.professionals-editor {
  overflow-y: auto;
  padding: 16px 20px;
}

.prof-empty {
  margin-top: 14px;
  border: 1px dashed var(--n-200);
  border-radius: var(--r-md);
  background: var(--white);
  padding: 16px;
  font-size: 12.5px;
  color: var(--n-500);
}

.prof-card {
  background: var(--white);
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 12px;
}

.prof-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-800);
  margin-bottom: 10px;
}

.professional-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(98,188,197,.16), transparent 36%),
    linear-gradient(180deg, rgba(0,53,87,.02), transparent),
    var(--white);
}

.professional-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.professional-hero-copy h4 {
  margin-bottom: 4px;
  font-size: 18px;
  letter-spacing: -.4px;
}

.professional-hero-kicker {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--n-400);
  margin-bottom: 4px;
}

.professional-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

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

.professional-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.professional-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.professional-shortcut-card {
  width: 100%;
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,248,252,.98));
  padding: 16px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.professional-shortcut-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(98, 188, 197, .18), transparent 42%),
    linear-gradient(135deg, rgba(32, 57, 84, .02), rgba(98, 188, 197, .05));
  opacity: .9;
  z-index: -1;
}

.professional-shortcut-card:hover {
  transform: translateY(-3px);
  border-color: rgba(98, 188, 197, .48);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .12);
}

.professional-shortcut-card:focus-visible {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(98,188,197,.16), 0 16px 32px rgba(15, 23, 42, .14);
}

.professional-shortcut-topline,
.professional-shortcut-bottomline {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.professional-shortcut-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(98, 188, 197, .12);
  border: 1px solid rgba(98, 188, 197, .18);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-800);
}

.professional-shortcut-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--n-500);
}

.professional-shortcut-value {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--n-900);
}

.professional-shortcut-meta {
  font-size: 11px;
  line-height: 1.45;
  color: var(--n-500);
}

.professional-shortcut-arrow {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(32, 57, 84, .08);
  color: var(--blue-800);
  font-size: 14px;
  font-weight: 900;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.professional-shortcut-card:hover .professional-shortcut-arrow,
.professional-shortcut-card:focus-visible .professional-shortcut-arrow {
  transform: translateX(2px);
  background: var(--teal-500);
  color: var(--white);
}

.prof-section-card {
  border: 1px solid var(--n-150);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.prof-section-card[open] {
  box-shadow: var(--shadow-sm);
}

.prof-section-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: background var(--t-fast);
}

.prof-section-summary:hover {
  background: var(--n-50);
}

.prof-section-summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(98,188,197,.18);
}

.prof-section-summary::-webkit-details-marker {
  display: none;
}

.prof-section-summary-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.prof-section-summary-copy {
  display: grid;
  gap: 3px;
}

.prof-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--blue-800);
}

.prof-section-sub {
  font-size: 11px;
  line-height: 1.4;
  color: var(--n-500);
}

.prof-section-meta {
  font-size: 12px;
  line-height: 1.45;
  color: var(--n-600);
}

.prof-section-summary-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.prof-section-chevron {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--n-150);
  background: var(--n-50);
  color: var(--n-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.prof-section-chevron::before {
  content: '>';
  font-weight: 800;
  transition: transform var(--t-fast);
}

.prof-section-card[open] .prof-section-chevron::before {
  transform: rotate(90deg);
}

.prof-section-body {
  border-top: 1px solid var(--n-100);
  padding: 0 18px 18px;
}

.prof-section-body .prof-socialworks-panel {
  margin-top: 0;
}

.prof-section-stack {
  display: grid;
  gap: 12px;
}

.prof-section-note {
  padding: 10px 12px;
  border: 1px solid var(--n-150);
  border-radius: 8px;
  background: var(--n-50);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--n-600);
}

.prof-field-help {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--n-500);
}

.prof-card-sub {
  margin-top: -6px;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--n-500);
}

.prof-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--n-700);
}

.prof-toggle-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal-500);
}

.prof-active-switch-card {
  position: relative;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .12), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.98) 0%, rgba(244, 249, 252, .98) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}

.prof-active-switch-card:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, .32);
  box-shadow: 0 14px 28px rgba(14, 165, 233, .14);
}

.prof-active-switch-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.prof-active-switch-card.is-active {
  border-color: rgba(8, 145, 178, .38);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, .18), transparent 40%),
    linear-gradient(145deg, rgba(240, 253, 250, .98) 0%, rgba(236, 254, 255, .98) 100%);
  box-shadow: 0 16px 32px rgba(8, 145, 178, .16);
}

.prof-active-switch-card input:focus-visible + .prof-active-switch-ui {
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, .15),
    0 0 0 4px rgba(14, 165, 233, .16);
}

.prof-active-switch-ui {
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .34);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}

.prof-active-switch-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
  transition: transform var(--t-fast), background var(--t-fast);
}

.prof-active-switch-card.is-active .prof-active-switch-ui {
  background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
}

.prof-active-switch-card.is-active .prof-active-switch-thumb {
  transform: translateX(24px);
  background: #f0fdfa;
}

.prof-active-switch-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prof-active-switch-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #64748b;
}

.prof-active-switch-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.prof-active-switch-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.prof-active-switch-card.is-active .prof-active-switch-title,
.prof-active-switch-card.is-active .prof-active-switch-meta {
  color: #0f766e;
}

.prof-days-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.prof-day-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.prof-day-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--n-700);
}

.prof-day-label input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal-500);
}

.prof-time-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  background: var(--n-50);
  color: var(--n-800);
  font-size: 12px;
}

.prof-time-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(98,188,197,.12);
}

/* ═══════════════════════════════════════════════════════════════════
   CONFIGURACIÓN DE HORARIOS — REDISEÑO PREMIUM
   ═══════════════════════════════════════════════════════════════════ */

.prof-schedule-shell {
  --prof-schedule-card-bg:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,252,.98));
  --prof-schedule-card-border: rgba(15,23,42,.08);
  --prof-schedule-card-shadow: 0 20px 42px rgba(15,23,42,.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: psh-in 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes psh-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HEADER / OVERVIEW ─────────────────────────────────────────── */
.prof-schedule-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: stretch;
  gap: 20px;
  padding: 26px 28px;
  border: 1px solid var(--prof-schedule-card-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.10), transparent 32%),
    radial-gradient(circle at bottom left, rgba(20,184,166,.08), transparent 28%),
    var(--prof-schedule-card-bg);
  box-shadow: var(--prof-schedule-card-shadow);
}

.prof-schedule-overview-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.prof-schedule-overview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal-600, #0d9488);
}

.prof-schedule-overview-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.prof-schedule-overview-sub {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--n-500);
  max-width: 620px;
}

.prof-schedule-overview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prof-schedule-overview-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(15,23,42,.07);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 24px rgba(15,23,42,.05);
  min-width: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.prof-schedule-overview-stat:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.20);
  box-shadow: 0 16px 28px rgba(14,165,233,.10);
}

.prof-schedule-overview-stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--n-400);
}

.prof-schedule-overview-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--blue-900);
  line-height: 1;
  letter-spacing: -.02em;
}

.prof-schedule-overview-stat-meta {
  font-size: 11px;
  color: var(--n-500);
}

.prof-schedule-quickbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--prof-schedule-card-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(14,165,233,.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(20,184,166,.08), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  box-shadow: var(--prof-schedule-card-shadow);
}

.prof-schedule-quickbar-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 16px;
  align-items: start;
}

.prof-schedule-quickbar-copy {
  min-width: 0;
}

.prof-schedule-quickbar-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-600, #0d9488);
}

.prof-schedule-quickbar-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -.02em;
}

.prof-schedule-quickbar-sub {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--n-500);
}

.prof-schedule-clipboard-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.8);
  box-shadow: 0 14px 28px rgba(15,23,42,.05);
}

.prof-schedule-clipboard-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--n-400);
}

.prof-schedule-clipboard-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--n-800);
  line-height: 1.45;
}

.prof-schedule-quickbar-controls {
  display: grid;
  gap: 12px;
}

.prof-schedule-bulk-days,
.prof-schedule-bulk-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prof-schedule-bulk-chip,
.prof-schedule-mini-action,
.prof-schedule-day-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: var(--n-600);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.prof-schedule-bulk-chip:hover,
.prof-schedule-mini-action:hover,
.prof-schedule-day-action:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.22);
  color: var(--blue-800);
  box-shadow: 0 12px 22px rgba(14,165,233,.08);
}

.prof-schedule-bulk-chip.is-active,
.prof-schedule-day-action.is-active {
  border-color: rgba(13,148,136,.24);
  background: rgba(13,148,136,.08);
  color: #0f766e;
  box-shadow: 0 12px 24px rgba(13,148,136,.10);
}

.prof-schedule-day-action:disabled {
  opacity: .52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.prof-schedule-bulk-form {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(120px, 150px) auto auto;
  gap: 10px;
  align-items: stretch;
}

.prof-schedule-segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(241,245,249,.85);
}

.prof-schedule-segmented-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: transparent;
  color: var(--n-500);
  font-size: 11px;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.prof-schedule-segmented-btn.is-active {
  background: linear-gradient(180deg, rgba(14,165,233,.12), rgba(14,165,233,.06));
  color: var(--blue-800);
  box-shadow: inset 0 0 0 1px rgba(14,165,233,.08);
}

.prof-schedule-bulk-apply {
  min-width: 148px;
  justify-content: center;
}

.prof-schedule-quickbar-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--n-500);
}

/* ── BOARD (sin inspector lateral, full-width) ─────────────────── */
.prof-schedule-board {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--prof-schedule-card-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(14,165,233,.05), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  box-shadow: var(--prof-schedule-card-shadow);
}

/* ─── Preservamos estas clases aunque ya no se usen activamente ──── */
.prof-schedule-layout { display: block; }
.prof-schedule-inspector-wrap { display: none; }
.prof-schedule-inspector { display: none; }
.prof-schedule-inspector-head { display: none; }
.prof-schedule-inspector-kicker { display: none; }
.prof-schedule-inspector-section { display: none; }
.prof-schedule-inspector-section-head { display: none; }
.prof-schedule-inspector-section-title { display: none; }
.prof-schedule-inspector-section-sub { display: none; }
.prof-schedule-inspector-empty { display: none; }
.prof-schedule-inspector-foot { display: none; }
.prof-schedule-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.prof-schedule-board-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -.01em;
}
.prof-schedule-board-sub {
  display: block;
  max-width: 640px;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--n-500);
}
.prof-schedule-board-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.prof-schedule-board-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.07);
  background: rgba(255,255,255,.82);
  color: var(--n-600);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}
.prof-schedule-board-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.prof-schedule-board-legend-dot.is-create {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
}
.prof-schedule-board-legend-dot.is-edit {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}
.prof-schedule-board-legend-dot.is-resize {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

/* ── BARRA DE TRATAMIENTOS / BLOQUE SELECCIONADO ──────────────── */
.psb-bar {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.08), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.95));
  box-shadow: 0 18px 34px rgba(15,23,42,.06);
}

.psb-bar-empty {
  font-size: 12px;
  color: var(--n-400);
}

.psb-bar-copy {
  display: grid;
  gap: 4px;
}

.psb-bar-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--n-400);
}

.psb-bar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -.02em;
}

.psb-bar-sub {
  max-width: 900px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--n-500);
}

.psb-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.psb-bar-empty-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px dashed rgba(148,163,184,.32);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  color: var(--n-500);
}

.psb-bar-empty-card strong {
  font-size: 13px;
  color: var(--blue-900);
}

.psb-bar-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--n-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.psb-bar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Editor de bloque seleccionado (inline en la barra) */
.psb-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  flex-wrap: wrap;
}

.psb-editor-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 160px;
}

.psb-editor-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--n-400);
}

.psb-editor-time {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-900);
}

.psb-editor-dur {
  font-size: 10.5px;
  color: var(--n-500);
}

.psb-editor-fields {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 320px;
}

/* Toggle sobreturno compacto */
.psb-overbook-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 7px;
  border: 1px solid var(--n-200);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--n-500);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  margin-left: auto;
}

.psb-overbook-btn:hover {
  border-color: rgba(14,165,233,.3);
  color: var(--blue-800);
}

.psb-overbook-btn.is-active {
  border-color: rgba(13,148,136,.35);
  background: rgba(13,148,136,.07);
  color: #0f766e;
}

.psb-overbook-switch {
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--n-250, #cbd5e1);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.psb-overbook-btn.is-active .psb-overbook-switch {
  background: #14b8a6;
}

.psb-overbook-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform 0.15s;
}

.psb-overbook-btn.is-active .psb-overbook-thumb {
  transform: translateX(12px);
}

.psb-overbook-label {
  white-space: nowrap;
}

.psb-treatments {
  display: grid;
  gap: 10px;
}

.psb-treatments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.psb-treatments-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--n-400);
}

/* ── PALETTE / INSPECTOR CONTENIDO ────────────────────────────── */
.prof-schedule-palette-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.prof-schedule-palette-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--n-600);
}

.prof-schedule-palette-sub,
.prof-schedule-palette-summary,
.prof-schedule-palette-empty {
  font-size: 11px;
  color: var(--n-400);
  line-height: 1.45;
}

.prof-schedule-palette-summary {
  text-align: right;
}

.prof-schedule-palette-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Chips de tratamientos */
.prof-schedule-treatment-chip {
  border: 1px solid var(--n-150);
  background: rgba(255,255,255,.95);
  color: var(--blue-800);
  border-radius: 999px;
  min-height: 30px;
  padding: 5px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  cursor: pointer;
}

.prof-schedule-treatment-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.3);
  box-shadow: 0 2px 8px rgba(14,165,233,.1);
}

.prof-schedule-treatment-chip.is-active {
  border-color: rgba(13,148,136,.4);
  background: rgba(13,148,136,.08);
  box-shadow: 0 0 0 1px rgba(13,148,136,.12);
  color: #0f766e;
}

.prof-schedule-treatment-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Toggle sobreturno */
.prof-schedule-overbook-card {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}

.prof-schedule-overbook-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.24);
  box-shadow: 0 4px 14px rgba(14,165,233,.1);
}

.prof-schedule-overbook-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14,165,233,.16);
}

.prof-schedule-overbook-card.is-active {
  border-color: rgba(13,148,136,.3);
  background: linear-gradient(145deg, rgba(240,253,250,.98), rgba(236,254,255,.98));
  box-shadow: 0 4px 16px rgba(13,148,136,.1);
}

.prof-schedule-overbook-card.is-disabled,
.prof-schedule-overbook-card:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.prof-schedule-overbook-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--n-200);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  transition: background var(--t-fast);
}

.prof-schedule-overbook-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.18);
  transition: transform var(--t-fast);
}

.prof-schedule-overbook-card.is-active .prof-schedule-overbook-switch {
  background: linear-gradient(135deg, #14b8a6, #06b6d4);
}

.prof-schedule-overbook-card.is-active .prof-schedule-overbook-thumb {
  transform: translateX(20px);
}

.prof-schedule-overbook-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prof-schedule-overbook-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--n-400);
}

.prof-schedule-overbook-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-900);
}

.prof-schedule-overbook-meta {
  font-size: 10.5px;
  color: var(--n-500);
  line-height: 1.4;
}

.prof-schedule-overbook-card.is-active .prof-schedule-overbook-title { color: #0f766e; }
.prof-schedule-overbook-card.is-active .prof-schedule-overbook-meta  { color: #0d9488; }

/* Hint del editor */
.prof-schedule-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: var(--n-400);
  background: rgba(14,165,233,.04);
  border: 1px solid rgba(14,165,233,.12);
  border-radius: 9px;
  padding: 9px 12px;
  line-height: 1.5;
  margin: 12px 20px 0;
}

.prof-schedule-hint svg {
  color: rgba(14,165,233,.6);
  flex-shrink: 0;
  margin-top: 1px;
}

.prof-schedule-hint span { color: var(--n-500); }
.prof-schedule-hint b { color: var(--n-600); font-weight: 700; }

/* ── EDITOR SEMANAL ────────────────────────────────────────────── */
.prof-schedule-editor {
  --prof-schedule-head-h: 74px;
  --prof-schedule-grid-h: 640px;
  display: grid;
  grid-template-columns: 56px minmax(1192px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding: 6px 2px 4px;
}

.prof-schedule-editor.is-manual-entry {
  --prof-schedule-head-h: 196px;
}

/* Rail de horas */
.prof-schedule-rail {
  position: relative;
  margin-top: calc(var(--prof-schedule-head-h) + 14px);
  height: var(--prof-schedule-grid-h);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,247,250,.92));
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.prof-schedule-rail-label {
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transform: translateY(-50%);
  padding-right: 9px;
  font-size: 10px;
  font-weight: 800;
  color: var(--n-500);
  pointer-events: none;
}

.prof-schedule-rail-label.is-first {
  transform: none;
  align-items: flex-start;
  padding-top: 5px;
}

.prof-schedule-rail-label.is-last {
  transform: translateY(-100%);
  align-items: flex-end;
  padding-bottom: 5px;
}

/* Grilla de días */
.prof-schedule-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 12px;
  min-width: 1192px;
}

.prof-schedule-day {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.15s;
}

/* Header de cada día */
.prof-schedule-day-top {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: var(--prof-schedule-head-h);
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: 0 16px 32px rgba(15,23,42,.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.prof-schedule-day-top::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(14,165,233,.56), rgba(20,184,166,.44));
  opacity: .45;
}

.prof-schedule-day.is-selected-day .prof-schedule-day-top {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.24);
  box-shadow: 0 0 0 1px rgba(14,165,233,.08), 0 22px 36px rgba(14,165,233,.12);
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.10), transparent 32%),
    linear-gradient(180deg, rgba(240,249,255,.98), rgba(255,255,255,.98));
}

.prof-schedule-day-top-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  flex-shrink: 0;
}

.prof-schedule-day-top > div { min-width: 0; }

.prof-schedule-day-top-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: center;
}

.prof-schedule-day-copy {
  min-width: 0;
}

.prof-schedule-day-block-list {
  display: grid;
  gap: 6px;
  min-height: 44px;
  max-height: 52px;
  overflow: auto;
}

.prof-schedule-block-chip {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.82);
  color: var(--n-700);
  text-align: left;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.prof-schedule-block-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.22);
  box-shadow: 0 14px 24px rgba(14,165,233,.08);
}

.prof-schedule-block-chip.is-selected {
  border-color: rgba(14,165,233,.26);
  background: linear-gradient(180deg, rgba(240,249,255,.98), rgba(255,255,255,.98));
  box-shadow: 0 16px 28px rgba(14,165,233,.10);
}

.prof-schedule-block-chip-time {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-900);
}

.prof-schedule-block-chip-meta {
  font-size: 9.5px;
  color: var(--n-500);
}

.prof-schedule-day-chip-empty {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 14px;
  border: 1px dashed rgba(148,163,184,.28);
  background: rgba(248,250,252,.9);
  color: var(--n-400);
  font-size: 10px;
  line-height: 1.4;
}

.prof-schedule-day-controls-head { display: none; }

.prof-schedule-day-controls-kicker { display: none; }

.prof-schedule-day-controls-note { display: none; }

/* Controles DESDE / HASTA + botón Agregar — compactos */
.prof-schedule-day-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  flex-shrink: 0;
}

.prof-schedule-time-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 10px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.prof-schedule-time-field:focus-within {
  border-color: rgba(14,165,233,.26);
  box-shadow: 0 0 0 3px rgba(14,165,233,.10);
  transform: translateY(-1px);
}

.prof-schedule-time-field span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--n-400);
  white-space: nowrap;
}

.prof-schedule-time-field .prof-schedule-time-input {
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-900);
  width: 100%;
  box-sizing: border-box;
}

.prof-schedule-time-field .prof-schedule-time-input:focus {
  border: 0 !important;
  box-shadow: none !important;
}

.prof-schedule-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 40px;
  background: linear-gradient(180deg, #0ea5e9, #0284c7);
  border: 1px solid rgba(2,132,199,.26);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  border-radius: 14px;
  padding: 0 14px;
  white-space: nowrap;
  box-shadow: 0 16px 28px rgba(2,132,199,.18);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.prof-schedule-add-btn:hover {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  border-color: rgba(14,165,233,.36);
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(2,132,199,.24);
}

/* Nombre del día */
.prof-schedule-day-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.prof-schedule-day-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -.01em;
}

.prof-schedule-day-meta {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--n-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge Libre / Activo */
.prof-schedule-day-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--n-400);
  background: rgba(148,163,184,.14);
  border-radius: 999px;
  padding: 4px 8px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.prof-schedule-day-badge::before { content: 'Libre'; }

.prof-schedule-day.is-enabled .prof-schedule-day-badge {
  color: #0369a1;
  background: rgba(14,165,233,.12);
}

.prof-schedule-day.is-enabled .prof-schedule-day-badge::before { content: 'Activo'; }

.prof-schedule-day:not(.is-enabled) .prof-schedule-day-range { display: none; }

.prof-schedule-day-range {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--n-500);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Botón limpiar día */
.prof-schedule-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  color: var(--n-400);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.1s, box-shadow 0.12s;
}

.prof-schedule-clear:hover {
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.28);
  color: var(--red-600);
  box-shadow: 0 12px 22px rgba(239,68,68,.12);
  transform: translateY(-1px);
}

.prof-schedule-day-action {
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
  box-shadow: none;
}

/* Grilla draggable */
.prof-schedule-grid {
  position: relative;
  height: var(--prof-schedule-grid-h);
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(148,163,184,.10) 0,
      rgba(148,163,184,.10) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(15,23,42,.08) 0,
      rgba(15,23,42,.08) 1px,
      transparent 1px,
      transparent 40px
    ),
    linear-gradient(180deg, rgba(244,251,255,.92), rgba(255,255,255,.98));
  cursor: crosshair;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 18px 32px rgba(15,23,42,.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.prof-schedule-grid:hover {
  border-color: rgba(14,165,233,.16);
}

.prof-schedule-day.is-enabled .prof-schedule-grid {
  border-color: rgba(14,165,233,.18);
}

.prof-schedule-day.is-enabled .prof-schedule-grid:hover {
  border-color: rgba(14,165,233,.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 22px 34px rgba(14,165,233,.08);
}

.prof-schedule-day.is-selected-day .prof-schedule-grid {
  border-color: rgba(14,165,233,.30);
  box-shadow: 0 0 0 1px rgba(14,165,233,.06), 0 22px 36px rgba(14,165,233,.08);
}

/* Día libre: fondo con pattern de rayas */
.prof-schedule-day:not(.is-enabled) .prof-schedule-grid {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(148,163,184,.06) 10px,
      rgba(148,163,184,.06) 11px
    ),
    linear-gradient(180deg, rgba(248,250,252,.94), rgba(244,247,250,.88));
  border-style: dashed;
}

/* Hint vacío en la grilla */
.prof-schedule-empty-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  color: var(--n-300, #cbd5e1);
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
  pointer-events: none;
  z-index: 0;
  transition: color 0.15s, opacity 0.15s;
}

.prof-schedule-empty-hint-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--n-400);
}

.prof-schedule-empty-hint-text {
  max-width: 130px;
}

.prof-schedule-grid:hover .prof-schedule-empty-hint {
  color: rgba(14,165,233,.45);
}

.prof-schedule-day.is-enabled .prof-schedule-empty-hint { display: none; }

/* ── BLOQUES DE HORARIO ────────────────────────────────────────── */
.prof-schedule-block {
  position: absolute;
  z-index: 1;
  border-radius: 16px;
  box-shadow: 0 16px 30px var(--prof-schedule-accent-shadow, rgba(14,165,233,.18));
  display: grid;
  grid-template-rows: 12px 1fr 12px;
  align-items: center;
  user-select: none;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--prof-schedule-accent-border, rgba(14,165,233,.22));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94)),
    var(--prof-schedule-accent-surface, linear-gradient(135deg, rgba(14,165,233,.1), rgba(14,165,233,.06)));
  will-change: top, height, left, right, transform;
  transition:
    top 140ms cubic-bezier(.22,1,.36,1),
    height 140ms cubic-bezier(.22,1,.36,1),
    left 140ms cubic-bezier(.22,1,.36,1),
    right 140ms cubic-bezier(.22,1,.36,1),
    transform 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
  animation: psb-in 0.14s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes psb-in {
  from { opacity: 0; transform: scaleY(0.88); }
  to   { opacity: 1; transform: scaleY(1); }
}

.prof-schedule-block::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: var(--prof-schedule-accent-line, #0ea5e9);
}

.prof-schedule-block::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0) 40%);
  pointer-events: none;
}

.prof-schedule-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px var(--prof-schedule-accent-shadow, rgba(14,165,233,.24));
}

.prof-schedule-block.is-selected {
  z-index: 12;
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(14,165,233,.18), 0 24px 38px var(--prof-schedule-accent-shadow, rgba(14,165,233,.24));
}

.prof-schedule-block.hidden,
.prof-schedule-clear.hidden {
  display: none;
}

.prof-schedule-block-body {
  border: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}

.prof-schedule-block-body:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(14,165,233,.18);
  border-radius: 12px;
}

.prof-schedule-block-copy {
  display: grid;
  gap: 5px;
  width: 100%;
}

.prof-schedule-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prof-schedule-block-time {
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

.prof-schedule-block-flag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--n-500);
}

.prof-schedule-block-overbook-toggle {
  align-self: flex-start;
  margin: 2px 0;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: var(--n-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.prof-schedule-block-overbook-toggle:hover {
  transform: translateY(-1px);
}

.prof-schedule-block-overbook-toggle.is-active {
  background: rgba(22, 163, 74, .12);
  border-color: rgba(22, 163, 74, .18);
  color: #166534;
}

.prof-schedule-block-label {
  display: block;
  color: var(--n-700);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.prof-schedule-block-meta {
  display: block;
  font-size: 10px;
  color: var(--n-500);
  line-height: 1.4;
}

.prof-schedule-block-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.prof-schedule-block-duration {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.86);
  color: var(--blue-900);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(15,23,42,.06);
}

.prof-schedule-block-capacity {
  font-size: 10px;
  font-weight: 700;
  color: var(--n-500);
}

.prof-schedule-block.is-compact .prof-schedule-block-meta { display: none; }
.prof-schedule-block.is-compact .prof-schedule-block-capacity { display: none; }

.prof-schedule-block.is-tight .prof-schedule-block-body {
  gap: 4px;
  padding: 10px 10px 8px;
}

.prof-schedule-block.is-tight .prof-schedule-block-flag,
.prof-schedule-block.is-tight .prof-schedule-block-capacity,
.prof-schedule-block.is-tight .prof-schedule-block-label { display: none; }

/* Handles de resize */
.prof-schedule-handle {
  width: 100%;
  height: 11px;
  border: 0;
  background: transparent;
  cursor: ns-resize;
  position: relative;
}

.prof-schedule-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 3px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(15,23,42,.20);
  transition: width 120ms ease, background 120ms ease;
}

.prof-schedule-block:hover .prof-schedule-handle::after,
.prof-schedule-block.is-selected .prof-schedule-handle::after {
  width: 30px;
  background: rgba(15,23,42,.38);
}

/* Botón eliminar bloque */
.prof-schedule-block-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.92);
  color: var(--n-400);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  z-index: 2;
  padding: 0;
  transition: opacity 120ms ease, background 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.prof-schedule-block:hover .prof-schedule-block-remove,
.prof-schedule-block.is-selected .prof-schedule-block-remove {
  opacity: 1;
}

.prof-schedule-block-remove:hover {
  background: rgba(254,226,226,.98);
  border-color: rgba(220,38,38,.22);
  color: #b91c1c;
  transform: scale(1.08);
}

body.is-prof-schedule-dragging,
body.is-prof-schedule-dragging * {
  user-select: none !important;
}

body.is-prof-schedule-dragging .prof-schedule-block {
  transition: none !important;
}

body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="move"],
body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="move"] * {
  cursor: grabbing !important;
}

body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="resize-start"],
body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="resize-start"] *,
body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="resize-end"],
body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="resize-end"] * {
  cursor: ns-resize !important;
}

body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="create"],
body.is-prof-schedule-dragging[data-prof-schedule-drag-mode="create"] * {
  cursor: crosshair !important;
}

/* ── BLOCK TOOLS (inspector cuando un bloque está seleccionado) ── */
.prof-schedule-block-tools {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--n-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: psh-in 0.16s ease both;
}

.prof-schedule-block-tools-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prof-schedule-block-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.prof-schedule-block-tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prof-schedule-board.is-stack-layout {
  gap: 14px;
}

.prof-schedule-editor.is-list-layout {
  display: block;
  padding: 0;
  overflow: visible;
}

.prof-schedule-day-stack {
  display: grid;
  gap: 14px;
}

.prof-schedule-day-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.08), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(248,250,252,.97));
  box-shadow: 0 18px 34px rgba(15,23,42,.06);
}

.prof-schedule-day-card.is-selected-day {
  border-color: rgba(14,165,233,.24);
  box-shadow: 0 0 0 1px rgba(14,165,233,.08), 0 24px 38px rgba(14,165,233,.12);
}

.prof-schedule-day-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.prof-schedule-day-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.prof-schedule-day-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.prof-schedule-day-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr);
  gap: 14px;
  align-items: start;
}

.prof-schedule-day-card-column {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.prof-schedule-day-card-column.is-setup {
  background:
    radial-gradient(circle at top right, rgba(20,184,166,.08), transparent 28%),
    linear-gradient(180deg, rgba(247,253,252,.98), rgba(255,255,255,.94));
}

.prof-schedule-day-card-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--n-400);
}

.prof-schedule-day-card-help {
  font-size: 12px;
  line-height: 1.6;
  color: var(--n-500);
}

.prof-schedule-editor.is-list-layout .prof-schedule-day-block-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.prof-schedule-editor.is-list-layout .prof-schedule-block-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
}

.prof-schedule-block-chip-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  text-align: left;
}

.prof-schedule-editor.is-list-layout .prof-schedule-block-chip-time {
  font-size: 15px;
  font-weight: 800;
}

.prof-schedule-block-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--n-700);
}

.prof-schedule-editor.is-list-layout .prof-schedule-block-chip-meta {
  font-size: 11px;
}

.prof-schedule-block-chip-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prof-schedule-block-chip-badge,
.prof-schedule-block-chip-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.prof-schedule-block-chip-badge {
  border: 1px solid rgba(245,158,11,.20);
  background: rgba(245,158,11,.10);
  color: #b45309;
}

.prof-schedule-block-chip-cta {
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.88);
  color: var(--n-500);
}

.prof-schedule-block-chip.is-selected .prof-schedule-block-chip-cta {
  border-color: rgba(13,148,136,.24);
  background: rgba(13,148,136,.10);
  color: #0f766e;
}

.prof-schedule-editor.is-list-layout .prof-schedule-day-chip-empty {
  min-height: 0;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 12px;
}

.prof-schedule-editor.is-list-layout .prof-schedule-day-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prof-schedule-editor.is-list-layout .prof-schedule-add-btn {
  min-height: 44px;
}

.prof-schedule-day-visual {
  border-top: 1px solid rgba(15,23,42,.08);
  padding-top: 12px;
}

.prof-schedule-day-visual > summary {
  list-style: none;
}

.prof-schedule-day-visual > summary::-webkit-details-marker {
  display: none;
}

.prof-schedule-day-visual-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  cursor: pointer;
}

.prof-schedule-day-visual-toggle::after {
  content: "Abrir";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.88);
  color: var(--n-500);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.prof-schedule-day-visual[open] .prof-schedule-day-visual-toggle::after {
  content: "Ocultar";
}

.prof-schedule-day-visual-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-900);
}

.prof-schedule-day-visual-sub {
  font-size: 11.5px;
  color: var(--n-500);
  line-height: 1.5;
}

.prof-schedule-day-visual-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-top: 12px;
}

.prof-schedule-day-visual-rail {
  position: relative;
  height: var(--prof-schedule-grid-h);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,247,250,.92));
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.prof-schedule-day-visual-grid {
  min-width: 0;
}

/* ── OBRAS SOCIALES ────────────────────────────────────────────── */
.prof-socialworks-panel {
  margin-top: 8px;
  border: 1px solid rgba(15,23,42,.07);
  border-radius: 12px;
  background: linear-gradient(180deg, #fafcff, #f5fafd);
  padding: 14px;
  box-shadow: 0 1px 4px rgba(15,23,42,.04);
}

.prof-socialworks-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.prof-socialworks-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.prof-socialworks-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.prof-socialworks-toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .34);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}

.prof-socialworks-toggle-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
  transition: transform var(--t-fast), background var(--t-fast);
}

.prof-socialworks-toggle input:checked + .prof-socialworks-toggle-switch {
  background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
}

.prof-socialworks-toggle input:checked + .prof-socialworks-toggle-switch .prof-socialworks-toggle-thumb {
  transform: translateX(24px);
  background: #f0fdfa;
}

.prof-socialworks-toggle input:focus-visible + .prof-socialworks-toggle-switch {
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, .15),
    0 0 0 4px rgba(14, 165, 233, .16);
}

.prof-socialworks-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.prof-socialworks-toggle-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.prof-socialworks-toggle-sub {
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.prof-socialworks-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.prof-socialworks-toolbar {
  margin-bottom: 12px;
}

.prof-socialworks-search {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}

.prof-socialworks-search .field-input {
  height: 42px;
}

.prof-works-grid {
  max-height: 320px;
  overflow: auto;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}

.prof-work-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248, 250, 252, .98));
  font-size: 13px;
  color: var(--n-700);
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), opacity var(--t-fast);
}

.prof-work-item:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, .26);
  box-shadow: 0 10px 20px rgba(14, 165, 233, .10);
}

.prof-work-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal-500);
  flex: 0 0 auto;
}

.prof-work-item-name {
  min-width: 0;
  font-weight: 700;
  line-height: 1.35;
}

.prof-work-item.is-hidden {
  display: none;
}

.prof-work-item:has(input:checked) {
  border-color: rgba(8, 145, 178, .28);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .10), transparent 36%),
    linear-gradient(180deg, #f0fdfa 0%, #ecfeff 100%);
  box-shadow: 0 12px 24px rgba(8, 145, 178, .12);
}

.prof-work-item:has(input:disabled) {
  opacity: .72;
}

.prof-socialworks-empty {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed rgba(148, 163, 184, .32);
  border-radius: 14px;
  background: rgba(248, 250, 252, .9);
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.prof-save-hint {
  font-size: 11px;
  color: var(--n-500);
}

.btn-danger {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.btn-danger:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.config-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-inline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-inline-head .prof-card-sub {
  margin-bottom: 0;
}

.config-inline-item {
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  background: var(--n-50);
  overflow: hidden;
}

.config-inline-item.is-open {
  border-color: rgba(98,188,197,.45);
  box-shadow: 0 0 0 1px rgba(98,188,197,.14);
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  background: var(--n-50);
}

.config-row-action {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
}

.config-row-action:hover {
  background: rgba(255,255,255,.62);
}

.config-row-action:focus-visible {
  outline: 2px solid rgba(98,188,197,.45);
  outline-offset: -2px;
}

.config-row strong {
  display: block;
  color: var(--n-800);
}

.config-row-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(98,188,197,.24);
  background: rgba(98,188,197,.12);
  color: var(--blue-800);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.config-inline-editor {
  padding: 0 14px 14px;
  border-top: 1px solid var(--n-150);
  background: var(--white);
}

.config-inline-editor .form-grid {
  padding-top: 14px;
}

.treatment-whatsapp-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #d9f99d;
  border-radius: var(--r-md);
  background:
    radial-gradient(circle at top right, rgba(34,197,94,.14), transparent 42%),
    linear-gradient(180deg, #f7fee7 0%, #f0fdf4 100%);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.treatment-whatsapp-toggle:hover {
  border-color: #86efac;
  box-shadow: 0 10px 24px rgba(34,197,94,.10);
}

.treatment-whatsapp-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.treatment-whatsapp-toggle-switch {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.15);
  flex-shrink: 0;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}

.treatment-whatsapp-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.18);
  transition: transform var(--t-fast);
}

.treatment-whatsapp-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.treatment-whatsapp-toggle-title {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  letter-spacing: -.1px;
}

.treatment-whatsapp-toggle-sub {
  font-size: 11.5px;
  color: #4b5563;
  line-height: 1.35;
}

.treatment-whatsapp-toggle input:focus-visible + .treatment-whatsapp-toggle-switch {
  box-shadow:
    inset 0 1px 2px rgba(15,23,42,.15),
    0 0 0 4px rgba(34,197,94,.16);
}

.treatment-whatsapp-toggle input:checked + .treatment-whatsapp-toggle-switch {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.treatment-whatsapp-toggle input:checked + .treatment-whatsapp-toggle-switch .treatment-whatsapp-toggle-knob {
  transform: translateX(20px);
}

.treatment-whatsapp-toggle input:checked ~ .treatment-whatsapp-toggle-copy .treatment-whatsapp-toggle-title {
  color: #14532d;
}

@media (max-width: 640px) {
  .treatment-whatsapp-toggle {
    align-items: flex-start;
  }
}

.obras-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 22px 16px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0,53,87,.10), rgba(0,53,87,0) 44%),
    linear-gradient(135deg, rgba(98,188,197,.18), rgba(98,188,197,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88)),
    var(--white);
  border-bottom: 1px solid rgba(218,228,236,.85);
}

.obras-toolbar::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -98px;
  top: -148px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98,188,197,.24), rgba(98,188,197,0) 72%);
  pointer-events: none;
}

.obras-toolbar-copy,
.obras-toolbar-actions {
  position: relative;
  z-index: 1;
}

.obras-toolbar-copy {
  flex: 1 1 320px;
  min-width: 220px;
}

.obras-toolbar-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,53,87,.07);
  border: 1px solid rgba(0,53,87,.12);
  color: var(--blue-800);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  box-shadow: 0 10px 22px rgba(0,53,87,.08);
}

.obras-toolbar h3 {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
}

.obras-toolbar p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--n-500);
}

.obras-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  justify-content: end;
  gap: 12px;
  width: min(720px, 54vw);
  max-width: 100%;
  margin-left: auto;
}

.obras-search-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
}

.obras-search-wrap .field-input {
  width: 100%;
  min-height: 44px;
  padding-left: 40px;
  border-radius: 15px;
  box-shadow: 0 12px 24px rgba(0,30,54,.06);
}

.obras-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--n-500);
  pointer-events: none;
  z-index: 1;
}

.obras-action-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 15px;
  gap: 8px;
  justify-content: center;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: 0 12px 24px rgba(0,30,54,.06);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base), background var(--t-base);
}

.obras-action-btn span,
.obras-action-btn svg {
  position: relative;
  z-index: 1;
}

.obras-action-btn svg {
  width: 16px;
  height: 16px;
}

.obras-action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.24) 50%, rgba(255,255,255,0) 80%);
  transform: translateX(-140%);
  transition: transform 520ms cubic-bezier(.22,1,.36,1);
}

.obras-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0,30,54,.12);
}

.obras-action-btn:hover::after {
  transform: translateX(140%);
}

.obras-action-btn--primary {
  box-shadow: 0 14px 28px rgba(0,53,87,.18);
}

.obras-action-btn--refresh {
  color: var(--blue-800);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,246,251,.94)),
    var(--white);
  border-color: rgba(218,228,236,.9);
}

.obras-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 14px;
}

.obras-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  border-radius: 22px;
  border: 1px solid rgba(218,228,236,.88);
  padding: 12px 16px 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.94)),
    var(--white);
  box-shadow: 0 16px 34px rgba(0,30,54,.08);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.obras-stat-card::before {
  content: '';
  position: absolute;
  inset: auto -18px -30px auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  opacity: .78;
  pointer-events: none;
}

.obras-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px rgba(0,30,54,.12);
}

.obras-stat-card--total::before {
  background: radial-gradient(circle, rgba(0,53,87,.18), rgba(0,53,87,0) 70%);
}

.obras-stat-card--enabled::before {
  background: radial-gradient(circle, rgba(34,197,94,.24), rgba(34,197,94,0) 70%);
}

.obras-stat-card--blocked::before {
  background: radial-gradient(circle, rgba(239,68,68,.20), rgba(239,68,68,0) 70%);
}

.obras-stat-card--copay::before {
  background: radial-gradient(circle, rgba(245,158,11,.22), rgba(245,158,11,0) 70%);
}

.obras-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--n-400);
  line-height: 1.1;
}

.obras-stat-value {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.9px;
}

.obras-stat-meta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--n-500);
}

.obras-form-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--n-150);
  padding: 14px 20px;
}

.obras-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.obras-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.obras-table-wrap {
  flex: 1;
  overflow: auto;
  margin: 0 20px 22px;
  padding: 12px 14px 14px;
  border-radius: 26px;
  border: 1px solid rgba(218,228,236,.82);
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.62)),
    rgba(255,255,255,.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0,30,54,.10);
}

.obras-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.obras-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
  padding: 0 12px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--n-400);
}

.obras-table thead th:last-child {
  text-align: right;
}

.obras-table tbody tr {
  animation: obrasRowEnter .42s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--row-index, 0) * 26ms);
}

.obras-table tbody tr:hover td,
.obras-table tbody tr:focus-within td {
  transform: translateY(-2px);
  border-color: rgba(98,188,197,.30);
  box-shadow: 0 16px 28px rgba(0,30,54,.10);
}

.obras-table tbody td {
  padding: 13px 12px;
  font-size: 12.5px;
  color: var(--n-700);
  vertical-align: middle;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94)),
    var(--white);
  border-top: 1px solid rgba(218,228,236,.88);
  border-bottom: 1px solid rgba(218,228,236,.88);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.obras-table tbody td:first-child {
  border-left: 1px solid rgba(218,228,236,.88);
  border-radius: 18px 0 0 18px;
}

.obras-table tbody td:last-child {
  border-right: 1px solid rgba(218,228,236,.88);
  border-radius: 0 18px 18px 0;
  text-align: right;
  white-space: nowrap;
}

.os-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.os-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  background:
    linear-gradient(135deg, rgba(0,53,87,.92), rgba(98,188,197,.88));
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .6px;
  box-shadow: 0 14px 26px rgba(0,53,87,.16);
}

.os-main-copy {
  min-width: 0;
}

.os-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.os-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--n-900);
  letter-spacing: -.2px;
}

.os-inline-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.20);
  color: #b45309;
  font-size: 10.5px;
  font-weight: 700;
}

.os-inline-pill--money {
  background: rgba(15,118,110,.10);
  border-color: rgba(15,118,110,.16);
  color: #0f766e;
}

.os-sub {
  margin-top: 5px;
  font-size: 11px;
  color: var(--n-500);
}

.os-state-stack,
.os-cut-cell,
.os-copay-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.os-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
  box-shadow: 0 10px 20px rgba(15,23,42,.06);
}

.os-state-pill.enabled {
  background: rgba(220,252,231,.86);
  border-color: rgba(34,197,94,.20);
  color: #166534;
}

.os-state-pill.disabled {
  background: rgba(254,226,226,.88);
  border-color: rgba(239,68,68,.16);
  color: #991b1b;
}

.os-state-pill.inactive {
  background: rgba(241,245,249,.92);
  border-color: rgba(148,163,184,.24);
  color: #475569;
}

.os-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.os-state-pill.enabled .os-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

.os-state-pill.disabled .os-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}

.os-state-pill.inactive .os-dot {
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100,116,139,.12);
}

.os-state-meta,
.os-cut-meta {
  font-size: 11px;
  color: var(--n-500);
  line-height: 1.45;
}

.os-cut-value {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--n-800);
}

.os-copay-value {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f766e;
}

.os-notes {
  max-width: 320px;
  color: var(--n-600);
  line-height: 1.5;
  word-break: break-word;
}

.os-empty {
  text-align: center;
  color: var(--n-500);
  padding: 34px 14px;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  border: 1px dashed rgba(218,228,236,.96);
}

.obras-row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.obras-row-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  justify-content: center;
}

.os-actions-muted {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(241,245,249,.92);
  border: 1px solid rgba(203,213,225,.9);
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
}

.os-active-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(203,213,225,.9);
  background: rgba(248,250,252,.96);
  color: #475569;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.os-active-switch:hover {
  border-color: rgba(98,188,197,.42);
  box-shadow: 0 10px 20px rgba(15,23,42,.08);
}

.os-active-switch.is-active {
  background: rgba(236,253,245,.96);
  border-color: rgba(34,197,94,.22);
  color: #166534;
}

.os-active-switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  box-shadow: inset 0 2px 4px rgba(15,23,42,.10);
  flex: 0 0 36px;
}

.os-active-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.16);
  transition: transform var(--t-fast), background var(--t-fast);
}

.os-active-switch.is-active .os-active-switch-track {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.os-active-switch.is-active .os-active-switch-thumb {
  transform: translateX(16px);
  background: #f0fdf4;
}

.os-active-switch-label {
  font-size: 11px;
  font-weight: 700;
}

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

/* ════════════════════════════════════════════════════════
   AGENDA GRID
   ════════════════════════════════════════════════════════ */
.grid-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: auto;
  background: var(--n-50);
}

.agenda-overview {
  min-height: 100%;
  padding: 18px 18px 20px;
  background:
    radial-gradient(1200px 380px at -10% -25%, rgba(98,188,197,.16), transparent 70%),
    linear-gradient(180deg, #f8fcfe 0%, #f7fafc 100%);
}
.agenda-overview-head h2 {
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -.4px;
  color: var(--blue-800);
}
.agenda-overview-head p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--n-500);
}
.agenda-overview-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.agenda-overview-grid.agenda-overview-grid-month {
  grid-template-columns: 1fr;
}
.agenda-month-empty {
  border: 1px dashed var(--n-300);
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  color: var(--n-500);
  padding: 18px;
  text-align: center;
}
.agenda-month-day {
  border: 1px solid var(--n-200);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(0,30,54,.05);
  overflow: hidden;
}
.agenda-month-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(14,165,233,.08) 0%, rgba(255,255,255,.7) 100%);
  border-bottom: 1px solid var(--n-150);
}
.agenda-month-day-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-900);
}
.agenda-month-day-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--n-500);
}
.agenda-month-day-body {
  display: flex;
  flex-direction: column;
}
.agenda-month-row {
  display: grid;
  grid-template-columns: 62px 190px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--n-100);
  background: transparent;
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.agenda-month-row:first-child {
  border-top: 0;
}
.agenda-month-row:hover {
  background: #eefbfd;
  transform: translateY(-1px);
}
.agenda-month-row.is-blocked {
  background: #f8fafc;
}
.agenda-month-row.is-blocked:hover {
  background: #eef2f7;
}
.agenda-month-time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-800);
}
.agenda-month-prof {
  color: var(--prof-color, var(--blue-800));
  font-size: 12px;
  font-weight: 700;
}
.agenda-month-patient {
  font-size: 13px;
  font-weight: 700;
  color: var(--n-900);
  display: block;
}
.agenda-month-meta {
  grid-column: 2 / -1;
  font-size: 11px;
  color: var(--n-500);
  display: block;
  margin-top: 2px;
}
.agenda-monthly-area {
  padding: 6px 0 0;
}
.agenda-monthly-shell {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .10), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,249,252,.96));
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
  padding: 18px;
}
.agenda-monthly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.agenda-monthly-kicker {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.agenda-monthly-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  color: var(--blue-900);
}
.agenda-monthly-head p {
  margin: 8px 0 0;
  color: var(--n-500);
  font-size: 13px;
}
.agenda-monthly-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.agenda-monthly-search {
  flex: 1 1 340px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.agenda-monthly-search svg {
  width: 18px;
  height: 18px;
  color: var(--n-500);
  flex: 0 0 auto;
}
.agenda-monthly-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--n-900);
  font: inherit;
}
.agenda-monthly-search input::placeholder {
  color: var(--n-500);
}
.agenda-monthly-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.agenda-monthly-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 999px;
  background: rgba(248,250,252,.88);
}
.agenda-monthly-mode-btn {
  border: 0;
  background: transparent;
  color: var(--n-500);
  font-size: 12px;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.agenda-monthly-mode-btn.is-active {
  background: rgba(255,255,255,.98);
  color: var(--blue-900);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.agenda-monthly-clear {
  white-space: nowrap;
}
.agenda-monthly-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.agenda-monthly-stat {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  padding: 14px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.agenda-monthly-stat-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--n-500);
}
.agenda-monthly-stat-value {
  font-size: 28px;
  line-height: 1;
  color: var(--blue-900);
}
.agenda-monthly-stat-meta {
  font-size: 12px;
  color: var(--n-500);
}
.agenda-monthly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.agenda-monthly-legend-item {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--n-200);
  background: rgba(255,255,255,.82);
  font-size: 12px;
  color: var(--n-700);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.agenda-monthly-legend-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, .08);
}
.agenda-monthly-legend-item.is-active {
  border-color: rgba(14, 165, 233, .26);
  background: rgba(240,249,255,.98);
  box-shadow: 0 10px 20px rgba(14, 165, 233, .10);
}
.agenda-monthly-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--prof-color, var(--teal-500));
  box-shadow: 0 0 0 3px rgba(255,255,255,.85);
}
.agenda-monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.agenda-monthly-weekday {
  padding: 0 4px 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--n-500);
}
.agenda-monthly-day {
  min-height: 188px;
  border: 1px solid var(--n-200);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}
.agenda-monthly-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, .08);
}
.agenda-monthly-day.is-other-month {
  background: rgba(248,250,252,.72);
  opacity: .72;
}
.agenda-monthly-day.is-today {
  border-color: rgba(14, 165, 233, .34);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12), 0 14px 28px rgba(14, 165, 233, .10);
}
.agenda-monthly-day.is-selected {
  border-color: rgba(8, 145, 178, .42);
}
.agenda-monthly-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.agenda-monthly-day-head-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agenda-monthly-day-number {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--blue-900);
  background: rgba(240,249,255,.96);
}
.agenda-monthly-day.is-today .agenda-monthly-day-number {
  background: linear-gradient(180deg, rgba(14,165,233,.18), rgba(6,182,212,.14));
}
.agenda-monthly-day-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--n-500);
}
.agenda-monthly-day-link {
  border: 0;
  background: transparent;
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
}
.agenda-monthly-day-link:hover {
  color: var(--blue-900);
}
.agenda-monthly-day-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.agenda-monthly-empty {
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed var(--n-300);
  border-radius: 16px;
  text-align: center;
  color: var(--n-500);
  background: rgba(248,250,252,.86);
}
.agenda-monthly-turno {
  --prof-color: var(--teal-500);
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(15, 23, 42, .07);
  border-left: 4px solid var(--prof-color);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  text-align: left;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.agenda-monthly-turno:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, .10);
}
.agenda-monthly-turno.is-blocked {
  border-left-color: #64748b;
  background: rgba(248,250,252,.96);
}
.agenda-monthly-turno-time {
  flex: 0 0 auto;
  min-width: 78px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-800);
}
.agenda-monthly-turno-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agenda-monthly-turno-patient {
  font-size: 12px;
  font-weight: 700;
  color: var(--n-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-monthly-turno-prof,
.agenda-monthly-turno-meta {
  font-size: 11px;
  color: var(--n-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-monthly-turno-prof {
  color: var(--prof-color, var(--teal-700));
  font-weight: 700;
}
.agenda-monthly-more {
  width: 100%;
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px dashed var(--n-300);
  border-radius: 12px;
  background: rgba(248,250,252,.8);
  font-size: 11px;
  font-weight: 700;
  color: var(--n-500);
  text-align: center;
  cursor: pointer;
}
.agenda-monthly-day-sheet {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 22px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agenda-monthly-day-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.agenda-monthly-day-sheet-kicker {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.agenda-monthly-day-sheet-head h3 {
  margin: 0;
  font-size: 22px;
  color: var(--blue-900);
}
.agenda-monthly-day-sheet-head p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--n-500);
}
.agenda-monthly-day-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.agenda-monthly-day-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agenda-monthly-detail-row {
  width: 100%;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--n-200);
  border-left: 4px solid var(--prof-color, var(--teal-500));
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  text-align: left;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.agenda-monthly-detail-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, .08);
}
.agenda-monthly-detail-row.is-blocked {
  border-left-color: #64748b;
  background: rgba(248,250,252,.96);
}
.agenda-monthly-detail-time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-800);
}
.agenda-monthly-detail-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.agenda-monthly-detail-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--n-900);
}
.agenda-monthly-detail-meta,
.agenda-monthly-detail-note {
  font-size: 12px;
  color: var(--n-500);
}
.agenda-monthly-detail-action {
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.ov-card {
  --doc-color: var(--teal-500);
  border: 1px solid var(--n-200);
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(255,255,255,.98) 0%, rgba(248,251,253,.95) 100%);
  box-shadow: 0 8px 24px rgba(0,30,54,.07);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 314px;
  position: relative;
  overflow: hidden;
}
.ov-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--doc-color), rgba(255,255,255,0));
}
.ov-card.active {
  border-color: rgba(98,188,197,.65);
  box-shadow: 0 0 0 2px rgba(98,188,197,.18), 0 8px 24px rgba(0,30,54,.08);
}
.ov-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ov-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.ov-main {
  min-width: 0;
  flex: 1;
}
.ov-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--n-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-esp {
  margin-top: 1px;
  font-size: 11px;
  color: var(--n-500);
}
.ov-kpis {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}
.ov-kpi {
  border: 1px solid var(--n-150);
  background: rgba(255,255,255,.78);
  border-radius: 10px;
  padding: 8px 7px;
}
.ov-kpi-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--n-400);
}
.ov-kpi-value {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-800);
}
.ov-next {
  margin-top: 12px;
}
.ov-next-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .45px;
  text-transform: uppercase;
  color: var(--n-400);
}
.ov-next-list {
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  scroll-padding-bottom: 14px;
  padding-right: 2px;
}
.ov-next-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ov-next-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 9px;
  padding: 6px 7px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--n-150);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.ov-next-row.can-edit {
  cursor: pointer;
}
.ov-next-row.can-edit:hover {
  border-color: var(--teal-500);
  background: #eefbfd;
  transform: translateY(-1px);
}
.ov-next-row.is-editing {
  border-color: rgba(98,188,197,.72);
  box-shadow: 0 0 0 2px rgba(98,188,197,.2);
}
.ov-next-row.is-waiting {
  border-color: #fed7aa;
  background: #fff7ed;
}
.ov-next-row.is-studies {
  border-color: #fed7aa;
  background: #fff7ed;
}
.ov-next-row.is-studies.is-in-studies {
  position: relative;
  animation: ov-studies-live-glow 1.8s ease-in-out infinite;
}
.ov-next-row.is-in-attention {
  position: relative;
  border-color: #86efac;
  background: linear-gradient(120deg, #ecfdf3 0%, #f7fef9 100%);
  animation: ov-live-glow 1.8s ease-in-out infinite;
}
.ov-next-row.is-absent {
  border-color: #fecdd3;
  background: #fff1f2;
}
.ov-next-row.is-confirmed {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.ov-next-row.is-akito {
  border-color: rgba(79, 146, 236, .62);
  background: linear-gradient(120deg, rgba(201, 223, 255, .98) 0%, rgba(219, 233, 255, .98) 100%);
}
.ov-next-row.is-blocked {
  border-color: rgba(148, 163, 184, .5);
  background: #f8fafc;
}
.ov-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--n-500);
}
.ov-patient-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ov-patient {
  font-size: 12px;
  color: var(--n-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-note {
  font-size: 10px;
  color: var(--n-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.ov-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  max-width: 100%;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(191, 203, 217, .9);
  background: rgba(248, 250, 252, .95);
  color: var(--n-600);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-meta-chip.is-akito {
  border-color: rgba(59, 130, 246, .24);
  background: rgba(214, 228, 255, .98);
  color: #1d4ed8;
}
.ov-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.ov-studies-action {
  min-height: 23px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid #fed7aa;
  background: #ffffff;
  color: #c2410c;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(194, 65, 12, .10);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.ov-studies-action:hover {
  background: #ffedd5;
  border-color: #fdba74;
  transform: translateY(-1px);
}
.ov-edit-card {
  border: 1px solid rgba(185, 202, 222, .7);
  border-radius: 12px;
  background: linear-gradient(170deg, #ffffff 0%, #f7fbff 100%);
  padding: 9px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  animation: ov-edit-slide-in .16s ease-out;
  scroll-margin: 12px;
}
@keyframes ov-edit-slide-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ov-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ov-edit-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #4f5f74;
}
.ov-edit-close {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .4);
  background: #f8fbff;
  color: #5f748c;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.ov-edit-close:hover {
  border-color: rgba(59, 130, 246, .45);
  color: #1d4ed8;
}
.ov-edit-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ov-edit-option {
  width: 100%;
  border: 1px solid rgba(191, 209, 229, .8);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  align-content: start;
  gap: 4px 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.ov-edit-option:hover {
  border-color: rgba(56, 189, 199, .65);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .14);
  transform: translateY(-1px);
}
.ov-edit-option.active {
  border-color: rgba(14, 116, 144, .5);
  background: linear-gradient(160deg, #eef8ff 0%, #f7fdff 100%);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .28);
}
.ov-edit-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 4px;
}
.ov-edit-dot.confirmado { background: #2563eb; }
.ov-edit-dot.programado { background: #94a3b8; }
.ov-edit-dot.listo_estudios { background: #d97706; }
.ov-edit-dot.listo_medico { background: #0891b2; }
.ov-edit-dot.ausente { background: #e11d48; }
.ov-edit-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ov-edit-option-label {
  font-size: 12px;
  font-weight: 700;
  color: #1f2f43;
  line-height: 1.3;
}
.ov-edit-option-hint {
  font-size: 10.5px;
  color: #63758b;
  line-height: 1.35;
}
.ov-edit-current {
  margin-left: 0;
  grid-column: 2;
  justify-self: start;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, .45);
  background: rgba(14, 165, 233, .1);
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  min-height: 16px;
}
.ov-edit-current:empty {
  display: none;
}
.ov-row-hint {
  border: 1px solid rgba(98,188,197,.45);
  background: #f0fbfc;
  color: #0f766e;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.ov-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  margin-right: 5px;
  box-shadow: 0 0 0 0 rgba(22,163,74,.55);
  animation: ov-dot-pulse 1.4s infinite;
}
.ov-live-dot.is-studies {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245,158,11,.55);
  animation-name: ov-studies-dot-pulse;
}
@keyframes ov-dot-pulse {
  70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
@keyframes ov-studies-dot-pulse {
  70% { box-shadow: 0 0 0 7px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
@keyframes ov-live-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(22,163,74,.28), 0 0 0 0 rgba(34,197,94,0);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(22,163,74,.42), 0 0 0 6px rgba(34,197,94,.16);
  }
}
@keyframes ov-studies-live-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(245,158,11,.28), 0 0 0 0 rgba(251,191,36,0);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(245,158,11,.42), 0 0 0 6px rgba(251,191,36,.16);
  }
}
.ov-next-empty {
  margin-top: 8px;
  border: 1px dashed var(--n-200);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--n-500);
  background: rgba(255,255,255,.72);
}
.ov-foot {
  margin-top: auto;
  padding-top: 12px;
}
.ov-open-btn {
  width: 100%;
  border: 1px solid var(--n-200);
  background: #fff;
  color: var(--blue-800);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  border-radius: 10px;
  padding: 8px 10px;
  text-transform: uppercase;
  transition: all var(--t-fast);
}
.ov-open-btn:hover {
  border-color: var(--blue-700);
  color: #fff;
  background: linear-gradient(140deg, var(--blue-700), var(--blue-800));
  box-shadow: 0 6px 14px rgba(20,67,109,.24);
}

/* The table */
.agenda-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

/* Header */
.agenda-table thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--n-150);
  padding: 9px 12px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--n-400);
  text-align: left;
  white-space: nowrap;
}
.agenda-table thead th:first-child {
  width: 64px; text-align: center;
  border-right: 1px solid var(--n-150);
}
.agenda-table thead th.col-bar { width: 6px; padding: 0; }
.agenda-table thead th.col-pac { min-width: 175px; }
.agenda-table thead th.col-tel { width: 135px; }
.agenda-table thead th.col-os  { width: 140px; }
.agenda-table thead th.col-prest { min-width: 140px; }
.agenda-table thead th.col-obs { width: 170px; }
.agenda-table thead th.col-op  { width: 80px; }
.agenda-table thead th.col-conf { width: 95px; }
.agenda-table thead th.col-act { width: 118px; }

/* Row base */
.agenda-table tbody tr {
  border-bottom: 1px solid var(--n-150);
  cursor: pointer;
  transition: background var(--t-fast);
}
.agenda-table tbody tr:hover { background: rgba(98,188,197,.05); }
.agenda-table tbody tr.row-selected { background: var(--teal-50) !important; }
.agenda-table tbody tr.row-occupied:hover { background: rgba(98,188,197,.07); }
.agenda-table tbody tr.row-outside-schedule {
  background:
    linear-gradient(90deg, rgba(245, 158, 11, .08), transparent 18%);
}
.agenda-table tbody tr.row-outside-schedule:hover {
  background:
    linear-gradient(90deg, rgba(245, 158, 11, .14), transparent 22%),
    rgba(98,188,197,.07);
}

/* Hour separator — thick top border every full hour */
.agenda-table tbody tr.sep-hour { border-top: 1.5px solid var(--n-200); }

/* Now line */
.agenda-table tbody tr.row-now { border-top: 2px solid var(--teal-500); }
.agenda-table tbody tr.row-now td.cell-hora::before {
  content: '▸';
  font-size: 8px;
  color: var(--teal-500);
  position: absolute;
  left: 4px; top: 50%;
  transform: translateY(-50%);
}

/* Cells */
.cell-hora {
  text-align: center;
  padding: 0;
  border-right: 1px solid var(--n-150);
  vertical-align: middle;
  position: relative;
}
.hora-inner {
  display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  height: 38px;
  padding: 0 6px;
}
.hora-text {
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 500;
  color: var(--n-400);
  letter-spacing: -.3px;
  line-height: 1.2;
}
.hora-text.hora-bold { color: var(--blue-800); font-weight: 700; }

/* Rango horario para turnos de más de 15 min */
.hora-end-text {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  color: var(--n-300);
  letter-spacing: -.3px;
  line-height: 1.2;
}
.hora-end-text::before {
  content: '–';
  margin-right: 1px;
  color: var(--n-200);
}
.agenda-table tbody tr.row-multiblock td.cell-hora .hora-inner {
  height: auto;
  min-height: 38px;
  padding: 4px 6px;
  gap: 1px;
}

/* State bar */
.cell-bar { padding: 0; width: 4px; }
.state-bar {
  width: 3px; height: 100%;
  min-height: 38px;
  border-radius: 0 2px 2px 0;
}

/* Row states */
.agenda-table tbody tr.s-libre     .state-bar { background: var(--n-200); opacity: .5; }
.agenda-table tbody tr.s-bloqueado .state-bar { background: var(--s-bloqueado-bar); }
.agenda-table tbody tr.s-reservado .state-bar { background: var(--s-reservado-bar); }
.agenda-table tbody tr.s-confirmado .state-bar { background: var(--s-confirmado-bar); }
.agenda-table tbody tr.s-entreturno .state-bar { background: var(--s-entreturno-bar); }
.agenda-table tbody tr.s-control    .state-bar { background: var(--s-control-bar); }
.agenda-table tbody tr.s-preconf    .state-bar { background: var(--s-preconf-bar); }
.agenda-table tbody tr.s-ausente    .state-bar { background: #e11d48; }
.agenda-table tbody tr.s-atendido   .state-bar { background: var(--s-atendido-bar); }
.agenda-table tbody tr.s-evento     .state-bar { background: var(--s-evento-bar); }

.agenda-table tbody tr.s-bloqueado { background: var(--s-bloqueado-bg); }
.agenda-table tbody tr.s-reservado  { background: var(--s-reservado-bg); }
.agenda-table tbody tr.s-confirmado { background: var(--s-confirmado-bg); }
.agenda-table tbody tr.s-entreturno { background: var(--s-entreturno-bg); }
.agenda-table tbody tr.s-ausente   { background: #fff1f2; }
.agenda-table tbody tr.s-atendido   { background: var(--s-atendido-bg); }
.agenda-table tbody tr.row-flow-attended { background: #ecfdf3 !important; }
.agenda-table tbody tr.row-flow-attended .state-bar { background: #22c55e !important; }
.agenda-table tbody tr.row-flow-in-attention .state-bar { background: #16a34a !important; }
.agenda-table tbody tr.row-flow-waiting .state-bar { background: #f59e0b !important; }
.agenda-table tbody tr.row-flow-studies .state-bar { background: #f59e0b !important; }
.agenda-table tbody tr.row-flow-ready .state-bar { background: #0891b2 !important; }
.agenda-table tbody tr.row-flow-absent .state-bar { background: #e11d48 !important; }

/* Data cells */
td.cell-data {
  padding: 0 12px;
  vertical-align: middle;
  height: 38px;
  font-size: 12.5px;
}
.agenda-table tbody tr.row-slot-split td.cell-data {
  height: auto;
  padding: 0;
}
td.cell-libre {
  padding: 0 12px;
  vertical-align: middle;
  height: 38px;
  font-size: 11.5px;
  color: var(--n-300);
  font-style: italic;
  letter-spacing: .1px;
}

.pac-name { font-weight: 600; color: var(--n-900); }
.pac-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.agenda-inline-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.pac-hc {
  font-family: var(--mono);
  font-size: 10px; color: var(--n-400);
  margin-top: 0px;
}
.overbook-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2px;
  background: #f3e8ff;
  color: #7e22ce;
  box-shadow: inset 0 0 0 1px rgba(126, 34, 206, .15);
}
.schedule-mismatch-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2px;
  background: #fff7ed;
  color: #c2410c;
  box-shadow: inset 0 0 0 1px rgba(194, 65, 12, .16);
  white-space: nowrap;
}
.flow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.flow-badge.is-scheduled {
  background: var(--n-100);
  color: var(--n-500);
}
.flow-badge.is-waiting {
  background: #fff7ed;
  color: #c2410c;
}
.flow-badge.is-studies {
  background: #fff7ed;
  color: #c2410c;
}
.flow-badge.is-ready {
  background: #ecfeff;
  color: #0f766e;
}
.flow-badge.is-in-attention {
  background: #dcfce7;
  color: #166534;
}
.flow-badge.is-absent {
  background: #ffe4e6;
  color: #9f1239;
  box-shadow: inset 0 0 0 1px rgba(190, 24, 93, .2);
}
.flow-badge.is-attended {
  background: #dcfce7;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, .18);
}
.flow-badge.is-confirmed {
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, .18);
}
.flow-badge.is-blocked {
  background: #e2e8f0;
  color: #334155;
  box-shadow: inset 0 0 0 1px rgba(71, 85, 105, .16);
}
.blocked-name { color: #1f2937; }
.blocked-note { color: var(--n-500); max-width: 240px; }
.cell-tel-text {
  font-family: var(--mono);
  font-size: 11px; color: var(--n-500);
  letter-spacing: -.3px;
}
.cell-os-text {
  font-size: 11.5px; color: var(--n-600);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; max-width: 130px;
}
.col-os {
  vertical-align: middle;
}
.cell-prest-text { font-size: 11.5px; color: var(--n-600); }
.cell-obs-text {
  display: block;
  max-width: 170px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  color: var(--n-600);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-obs-text.is-empty {
  display: inline-block;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--n-300);
}
.cell-op-text { font-size: 11px; color: var(--n-500); font-weight: 500; }
.cell-conf-text {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono);
  font-size: 11px; color: var(--n-300);
}
.cell-conf-text.is-conf {
  color: var(--s-confirmado-bar);
  font-weight: 500;
}
.cell-conf-text svg { width: 11px; height: 11px; }
.agenda-cell-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 100%;
}
.agenda-cell-split.is-pair {
  grid-template-columns: minmax(0, 1fr);
}
.agenda-cell-segment {
  min-width: 0;
  position: relative;
}
.agenda-cell-segment:not(.is-last) {
  border-bottom: 1px solid rgba(148, 163, 184, .24);
}
.agenda-cell-segment-inner {
  min-width: 0;
  min-height: 56px;
  height: 100%;
  padding: 7px 10px;
  display: flex;
  align-items: flex-start;
  background: rgba(248, 250, 252, .72);
}
.agenda-cell-segment.is-standard .agenda-cell-segment-inner {
  background: linear-gradient(180deg, rgba(240, 249, 255, .9), rgba(248, 250, 252, .86));
}
.agenda-cell-segment.is-overbook .agenda-cell-segment-inner {
  background: linear-gradient(180deg, rgba(250, 245, 255, .96), rgba(245, 243, 255, .9));
}
.agenda-table tbody tr.row-slot-split td.col-pac .agenda-cell-segment-inner {
  align-items: stretch;
}
.agenda-table tbody tr.row-slot-split td.cell-data {
  vertical-align: top;
}
.agenda-table tbody tr.row-slot-split td:not(.col-pac) .agenda-cell-segment-inner {
  align-items: center;
}
.agenda-table tbody tr.row-slot-split .pac-meta-row {
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.agenda-table tbody tr.row-slot-split .agenda-inline-badges {
  justify-content: flex-start;
}
.agenda-table tbody tr.row-slot-split .cell-os-text,
.agenda-table tbody tr.row-slot-split .cell-prest-text,
.agenda-table tbody tr.row-slot-split .cell-obs-text,
.agenda-table tbody tr.row-slot-split .cell-op-text,
.agenda-table tbody tr.row-slot-split .cell-conf-text,
.agenda-table tbody tr.row-slot-split .cell-tel-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
}
.agenda-table tbody tr.row-slot-split .cell-obs-text:not(.is-empty) {
  max-width: 160px;
  border-radius: 12px;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.agenda-patient-segment-btn {
  width: 100%;
  min-height: 100%;
  padding: 0;
  margin: 0;
  display: block;
  text-align: left;
  background: transparent;
  color: inherit;
  border: none;
}
.agenda-patient-card {
  min-height: 100%;
}
.agenda-patient-card.is-draggable,
.agenda-patient-segment-btn.is-draggable {
  cursor: grab;
}
.agenda-patient-card.is-draggable:active,
.agenda-patient-segment-btn.is-draggable:active {
  cursor: grabbing;
}
.agenda-patient-segment-btn:hover .pac-name {
  color: var(--teal-700);
}
.agenda-patient-card.is-draggable:hover .pac-name {
  color: var(--teal-700);
}
.agenda-table tbody tr.row-slot-split td.col-conf .agenda-cell-segment-inner {
  justify-content: flex-start;
}
.agenda-table tbody tr.row-slot-split td.col-prest .cell-prest-text,
.agenda-table tbody tr.row-slot-split td.col-op .cell-op-text,
.agenda-table tbody tr.row-slot-split td.col-conf .cell-conf-text {
  width: 100%;
}

/* Row action button */
.cell-act { padding: 0 6px; vertical-align: middle; text-align: center; }
.row-act-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
}
.row-act-btn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs);
  color: var(--n-300);
  opacity: 0;
  transition: background var(--t-fast), color var(--t-fast), opacity var(--t-fast);
}
tr:hover .row-act-btn { opacity: 1; }
.row-act-btn:hover { background: var(--teal-100); color: var(--teal-600); }
.row-act-btn svg { width: 12px; height: 12px; }
.row-act-stack .row-act-btn {
  width: 28px;
  align-self: center;
}
.row-overbook-btn {
  min-height: 28px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  border: 1px solid rgba(192, 132, 252, .35);
  background: rgba(243, 232, 255, .95);
  color: #7e22ce;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}
.row-overbook-btn:hover:not(:disabled) {
  background: #e9d5ff;
  border-color: rgba(126, 34, 206, .45);
}
.row-overbook-btn.is-inactive {
  opacity: .58;
  border-style: dashed;
}
.row-act-placeholder {
  display: inline-block;
  width: 26px;
  height: 26px;
}
.agenda-table tbody tr.agenda-drop-origin {
  opacity: .64;
}
.agenda-table tbody tr.agenda-drop-target {
  background: rgba(34, 197, 94, .12) !important;
  outline: 2px solid rgba(34, 197, 94, .45);
  outline-offset: -2px;
}
.agenda-table tbody tr.agenda-drop-invalid {
  background: rgba(225, 29, 72, .08) !important;
  outline: 2px dashed rgba(225, 29, 72, .35);
  outline-offset: -2px;
}
body.agenda-drag-active .agenda-table tbody tr[data-slot-blocked="false"] {
  transition: background var(--t-fast), outline-color var(--t-fast), opacity var(--t-fast);
}

/* Empty state */
.grid-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 32px; gap: 10px; text-align: center;
}
.grid-empty svg { width: 40px; height: 40px; color: var(--n-200); }
.grid-empty h3 { font-size: 14px; font-weight: 600; color: var(--n-500); }
.grid-empty p { font-size: 12.5px; color: var(--n-400); }

/* ════════════════════════════════════════════════════════
   RIGHT PANEL
   ════════════════════════════════════════════════════════ */
.right-panel {
  width: var(--panel-w);
  flex-shrink: 0;
  background: var(--white);
  border-left: 1px solid var(--n-150);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.rp-block {
  padding: 16px;
  border-bottom: 1px solid var(--n-100);
}
.rp-block:last-child { border-bottom: none; }

.rp-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--n-400);
  margin-bottom: 12px;
}

/* Quick action buttons */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: var(--n-50);
  font-size: 11px; font-weight: 600; color: var(--n-600);
  text-align: center; cursor: pointer;
  transition: all var(--t-fast);
}
.qa-btn:hover { border-color: var(--n-300); color: var(--n-800); background: var(--white); box-shadow: var(--shadow-xs); }
.qa-btn svg { width: 16px; height: 16px; }
.qa-btn.qa-primary { background: var(--blue-800); border-color: var(--blue-800); color: #fff; }
.qa-btn.qa-primary:hover { background: var(--blue-700); }
.qa-btn.qa-teal { background: var(--teal-500); border-color: var(--teal-500); color: #fff; box-shadow: 0 1px 4px rgba(98,188,197,.35); }
.qa-btn.qa-teal:hover { background: var(--teal-600); }

/* Mini calendar */
.rp-block #mc-container {
  padding: 14px;
  border: 1px solid rgba(139, 163, 191, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(98, 188, 197, .14), transparent 52%),
    linear-gradient(180deg, rgba(247, 251, 255, .96), rgba(255, 255, 255, .98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 10px 24px rgba(24, 63, 96, .06);
}
.mc-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.mc-month-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--n-800);
  letter-spacing: -.2px;
}
.mc-nav-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--n-500);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(139, 163, 191, .18);
  box-shadow: 0 4px 10px rgba(16, 42, 67, .05);
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.mc-nav-btn:hover {
  background: rgba(98, 188, 197, .12);
  color: var(--blue-800);
  border-color: rgba(98, 188, 197, .28);
  box-shadow: 0 8px 16px rgba(27, 76, 111, .10);
  transform: translateY(-1px);
}
.mc-nav-btn svg { width: 12px; height: 12px; }

.mc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.mc-day-header {
  text-align: center;
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px;
  color: var(--n-400);
  padding: 2px 0 7px;
}
.mc-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 11.5px; font-weight: 600; color: var(--n-700);
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
  border: 1px solid transparent;
  background: rgba(255,255,255,.55);
}
.mc-day:hover {
  background: linear-gradient(180deg, rgba(98, 188, 197, .18), rgba(98, 188, 197, .10));
  color: var(--blue-800);
  border-color: rgba(98, 188, 197, .26);
  box-shadow: 0 10px 18px rgba(56, 113, 151, .12);
  transform: translateY(-2px) scale(1.03);
}
.mc-day:focus-visible {
  outline: none;
  border-color: rgba(51, 108, 180, .36);
  box-shadow: 0 0 0 3px rgba(98, 188, 197, .18);
}
.mc-day.mc-today {
  font-weight: 800;
  color: var(--blue-700);
  background: linear-gradient(180deg, rgba(232,234,255,.96), rgba(240,242,255,.92));
  border-color: rgba(47,62,201,.18);
}
.mc-day.mc-selected {
  background: linear-gradient(180deg, var(--blue-700), var(--blue-800));
  color: #fff;
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(47,62,201,.28);
}
.mc-day.mc-selected:hover {
  background: linear-gradient(180deg, #3a4fd4, #2240a0);
  color: #fff;
}
.mc-day.mc-today.mc-selected {
  background: linear-gradient(180deg, var(--blue-700), var(--blue-900));
  box-shadow: 0 12px 24px rgba(47,62,201,.32);
}
.mc-day.mc-other {
  color: var(--n-300);
  background: rgba(247, 250, 252, .72);
}
.mc-day.mc-has-turns::after {
  content: '';
  width: 12px; height: 3px; border-radius: 999px;
  background: var(--blue-700);
  position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(47,62,201,.10);
  opacity: .72;
}
.mc-day.mc-has-turns:hover::after {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(47,62,201,.14);
}
.mc-day.mc-selected.mc-has-turns::after {
  background: rgba(255,255,255,.94);
  box-shadow: 0 0 0 2px rgba(255,255,255,.16);
}

/* Legend */
.legend-list { display: flex; flex-direction: column; gap: 6px; }
.legend-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--n-600);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.legend-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  color: var(--n-400);
}

/* ════════════════════════════════════════════════════════
   DETAIL DRAWER
   ════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 27, 45, .26);
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
}
.drawer-overlay.open { display: flex; }

.drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(1000px, calc(100vw - 32px));
  max-height: min(96vh, 960px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,255,.98));
  border: 1px solid rgba(152, 183, 209, .28);
  border-radius: 28px;
  display: flex; flex-direction: column;
  z-index: 150;
  transform: translate(-50%, calc(-50% + 18px)) scale(.98);
  transition: transform var(--t-slow), opacity var(--t-fast);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 28px 72px rgba(15, 34, 51, .22);
  overflow: hidden;
}
.drawer.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  position: relative;
  padding: 18px 28px 16px;
  border-bottom: 1px solid var(--n-100);
  background:
    linear-gradient(180deg, rgba(14,165,233,.08), rgba(14,165,233,0) 56%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.94));
}
.drawer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(241,245,249,.85);
  color: var(--n-400);
  transition: background var(--t-fast), color var(--t-fast);
  margin: 0;
}
.drawer-close:hover { background: var(--n-100); color: var(--n-700); }
.drawer-close svg { width: 15px; height: 15px; }

.drawer-patient {
  display: inline-flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-800);
  letter-spacing: -.7px;
  margin-bottom: 2px;
  max-width: calc(100% - 68px);
  width: fit-content;
  line-height: 1.08;
}
.drawer-patient-text {
  flex: 0 1 auto;
  min-width: 0;
  user-select: text;
}
.drawer-patient .drawer-patient-copy.detail-copy-btn.is-icon-only {
  margin-top: 2px;
  border-color: rgba(14, 165, 233, .18);
  background: rgba(255, 255, 255, .88);
  color: var(--blue-700);
  box-shadow: 0 8px 18px rgba(148, 163, 184, .12);
}
.drawer-patient:hover .drawer-patient-copy.detail-copy-btn.is-icon-only,
.drawer-patient:focus-within .drawer-patient-copy.detail-copy-btn.is-icon-only {
  opacity: 1;
  transform: translateY(0);
}
.drawer-time {
  font-size: 12px;
  color: var(--n-500);
  margin-top: 4px;
}
#dd-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.state-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  margin-top: 0;
}
.state-pill .spill-dot { width: 6px; height: 6px; border-radius: 50%; }

/* State pill colors */
.sp-reservado  { background: var(--s-reservado-bg);  color: var(--s-reservado-bar); }
.sp-bloqueado  { background: var(--s-bloqueado-bg);  color: var(--s-bloqueado-bar); }
.sp-confirmado { background: var(--s-confirmado-bg); color: var(--s-confirmado-bar); }
.sp-entreturno { background: var(--s-entreturno-bg); color: var(--s-entreturno-bar); }
.sp-control    { background: var(--s-control-bg);    color: var(--s-control-bar); }
.sp-preconf    { background: var(--s-preconf-bg);    color: var(--s-preconf-bar); }
.sp-atendido   { background: var(--s-atendido-bg);   color: var(--s-atendido-bar); }
.sp-evento     { background: var(--s-evento-bg);     color: var(--s-evento-bar); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  background:
    linear-gradient(180deg, rgba(252,254,255,.95), rgba(248,251,255,.92));
}

.drawer-overview {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(14, 165, 233, .14);
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.12), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,250,252,.92));
  box-shadow: 0 14px 36px rgba(148, 163, 184, .10);
}
.drawer-overview-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--n-400);
}
.drawer-overview-time {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--n-900);
}
.drawer-overview-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--n-500);
}
.drawer-overview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.detail-summary-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(226, 232, 240, .55);
  color: var(--n-700);
}
.detail-summary-chip.is-akito {
  border-color: rgba(96, 165, 250, .24);
  background: rgba(191, 219, 254, .64);
  color: #1d4ed8;
}
/* Chip en la celda de OS de la tabla de agenda */
.col-os .cell-payment-chip {
  display: block;
  margin-top: 4px;
  min-height: 20px;
  padding: 0 7px;
  font-size: 10px;
  width: fit-content;
}

.payment-state-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
}
.payment-state-chip.is-auto {
  background: rgba(226, 232, 240, .72);
  border-color: rgba(148, 163, 184, .18);
  color: var(--n-700);
}
.payment-state-chip.is-unset {
  background: rgba(226, 232, 240, .78);
  border-color: rgba(148, 163, 184, .22);
  color: #475569;
}
.payment-state-chip.is-pending {
  background: rgba(254, 240, 138, .38);
  border-color: rgba(245, 158, 11, .26);
  color: #92400e;
}
.payment-state-chip.is-partial {
  background: rgba(191, 219, 254, .56);
  border-color: rgba(59, 130, 246, .22);
  color: #1d4ed8;
}
.payment-state-chip.is-deposit {
  background: rgba(204, 251, 241, .8);
  border-color: rgba(20, 184, 166, .24);
  color: #0f766e;
}
.payment-state-chip.is-paid {
  background: rgba(220, 252, 231, .9);
  border-color: rgba(34, 197, 94, .22);
  color: #166534;
}
.payment-state-chip.is-none {
  background: rgba(241, 245, 249, .88);
  border-color: rgba(148, 163, 184, .18);
  color: #64748b;
}

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

.detail-card {
  border: 1px solid var(--n-120);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,250,252,.94));
  padding: 12px 14px;
  box-shadow: 0 6px 16px rgba(148, 163, 184, .08);
}
.detail-card.detail-card-payment {
  border-color: rgba(45, 212, 191, .20);
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, .12), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(240,253,250,.96));
}
.detail-card-full { grid-column: 1 / -1; }
.detail-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.detail-card-head-copy h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--n-400);
}
.detail-card-payment .detail-card-head-copy h3 {
  color: #0f766e;
}
.detail-card-head-copy p {
  display: none;
}
.detail-card-link,
.detail-card-note-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.detail-card-link {
  border: 1px solid rgba(14, 165, 233, .20);
  background: rgba(14, 165, 233, .10);
  color: var(--blue-800);
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.detail-card-link:hover {
  background: rgba(14, 165, 233, .16);
  border-color: rgba(14, 165, 233, .28);
  transform: translateY(-1px);
}
.detail-card-note-pill {
  border: 1px dashed var(--n-200);
  background: var(--n-50);
  color: var(--n-500);
}
.detail-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.detail-card-grid.is-single { grid-template-columns: 1fr; }
.detail-card-item { min-width: 0; }
.detail-card-item.is-full { grid-column: 1 / -1; }
.detail-card-key {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--n-400);
}
.detail-card-value-shell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.detail-card-value-shell.has-copy .detail-card-value {
  flex: 1;
  min-width: 0;
  user-select: text;
}
.detail-card-value-shell.is-multiline .detail-card-value {
  white-space: normal;
}
.detail-card-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--n-900);
  word-break: break-word;
}
.detail-card-value.is-mono {
  font-family: var(--mono);
  font-size: 13px;
}
.detail-card-value.is-muted {
  color: var(--n-500);
  font-weight: 500;
}
.detail-card-value a {
  color: var(--blue-700);
  text-decoration: none;
}
.detail-card-value a:hover { text-decoration: underline; }
.detail-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(248, 250, 252, .92);
  color: var(--n-500);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(148, 163, 184, .10);
  transition:
    opacity var(--t-fast),
    transform var(--t-fast),
    border-color var(--t-fast),
    background var(--t-fast),
    color var(--t-fast),
    box-shadow var(--t-fast);
}
.detail-copy-btn svg {
  width: 14px;
  height: 14px;
}
.detail-copy-btn span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.detail-copy-btn.is-icon-only {
  width: 30px;
  padding: 0;
  opacity: 0;
  transform: translateY(4px);
  box-shadow: none;
}
.detail-copy-btn.is-icon-only span {
  display: none;
}
.detail-card-item:hover .detail-copy-btn.is-icon-only,
.detail-card-item:focus-within .detail-copy-btn.is-icon-only {
  opacity: 1;
  transform: translateY(0);
}
.detail-copy-btn.is-compact {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(14, 165, 233, .20);
  background: rgba(14, 165, 233, .08);
  color: var(--blue-800);
}
.detail-copy-btn:hover {
  background: rgba(255,255,255,.98);
  border-color: rgba(100, 116, 139, .24);
  color: var(--n-700);
  box-shadow: 0 8px 18px rgba(148, 163, 184, .16);
}
.detail-copy-btn.is-compact:hover {
  background: rgba(14, 165, 233, .14);
  border-color: rgba(14, 165, 233, .26);
  color: var(--blue-900);
}
.detail-copy-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
}
.detail-copy-btn[data-copied="1"] {
  background: rgba(16, 185, 129, .12);
  border-color: rgba(16, 185, 129, .28);
  color: #047857;
  opacity: 1;
  transform: translateY(0);
}
.detail-card-empty {
  font-size: 13px;
  color: var(--n-500);
}
.turno-patient-editor-card .detail-card-grid {
  gap: 9px 12px;
}
.turno-patient-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.turno-patient-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: var(--n-900);
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.25;
  box-shadow: 0 3px 10px rgba(148, 163, 184, .08);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.turno-patient-input:focus {
  outline: none;
  border-color: rgba(14, 165, 233, .46);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
}
.turno-patient-input:disabled {
  opacity: .68;
  cursor: wait;
}
.turno-patient-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, .9);
}
.turno-patient-card-actions .turno-patient-editor-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.turno-patient-edit-btn,
.turno-patient-save-btn,
.turno-patient-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.turno-patient-edit-btn,
.turno-patient-save-btn {
  border: 1px solid rgba(37, 99, 235, .22);
  background: rgba(37, 99, 235, .10);
  color: var(--blue-800);
}
.turno-patient-cancel-btn {
  border: 1px solid rgba(148, 163, 184, .24);
  background: rgba(248, 250, 252, .92);
  color: var(--n-600);
}
.turno-patient-edit-btn svg,
.turno-patient-save-btn svg {
  width: 14px;
  height: 14px;
}
.turno-patient-edit-btn:hover,
.turno-patient-save-btn:hover {
  background: rgba(37, 99, 235, .16);
  border-color: rgba(37, 99, 235, .30);
  transform: translateY(-1px);
}
.turno-patient-cancel-btn:hover {
  background: #fff;
  border-color: rgba(100, 116, 139, .30);
  transform: translateY(-1px);
}
.turno-patient-edit-btn:disabled,
.turno-patient-save-btn:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.detail-list { display: flex; flex-direction: column; }
.detail-section { margin-bottom: 16px; }
.detail-section-label {
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--n-400); margin-bottom: 8px;
}
.detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--n-100);
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 12px; color: var(--n-400); }
.detail-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--n-800);
  text-align: right;
  max-width: 62%;
  line-height: 1.45;
}
.detail-val.mono { font-family: var(--mono); font-size: 12px; }
.detail-divider { display: none; }

.drawer-actions {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--n-100);
  display: flex; flex-direction: column; gap: 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(247,250,252,.95));
}
.daction-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.daction-row.is-single { grid-template-columns: 1fr; }
.daction-row .daction-btn { flex: 1; }

.daction-btn {
  width: 100%; padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.daction-btn svg { width: 13px; height: 13px; }
.daction-confirm  { background: #dcfce7; color: #15803d; }
.daction-confirm:hover  { background: #bbf7d0; }
.daction-reprogram { background: var(--blue-50); color: var(--blue-800); }
.daction-reprogram:hover { background: var(--blue-100); }
.daction-info { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.daction-info:hover { background: #e0e7ff; }
.daction-cancel   { background: #fee2e2; color: #dc2626; }
.daction-cancel:hover   { background: #fecaca; }
.daction-wa       { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.daction-wa:hover       { background: #dcfce7; }
.daction-wait-on,
.daction-studies-on  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.daction-wait-on:hover,
.daction-studies-on:hover  { background: #ffedd5; }
.daction-ready-on  { background: #ecfeff; color: #0f766e; border: 1px solid #a5f3fc; }
.daction-ready-on:hover  { background: #cffafe; }
.daction-wait-off { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.daction-wait-off:hover { background: #e2e8f0; }
.daction-attended-action { background: #ecfdf5; color: #047857; border: 1px solid #86efac; }
.daction-attended-action:hover { background: #d1fae5; }
.daction-in-attention {
  background: #dcfce7;
  color: #15803d;
  opacity: .75;
  cursor: not-allowed;
}
.daction-attended {
  background: #dcfce7;
  color: #166534;
  opacity: .85;
  cursor: not-allowed;
}

/* ════════════════════════════════════════════════════════
   MODALS
   ════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,28,50,.35);
  backdrop-filter: blur(6px);
  z-index: 400;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%; max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modal-in .2s cubic-bezier(.34,1.2,.64,1);
}
.modal-lg { max-width: 760px; }
.modal-clinical-history { max-width: 1040px; }
.modal-clinical-history.has-editor-active {
  width: min(1540px, 98vw);
  max-width: 1540px;
  height: min(92vh, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.clinical-history-modal-body,
.clinical-history-workspace,
.clinical-history-pane,
.clinical-history-pane-body {
  min-width: 0;
}
.clinical-history-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.clinical-history-current-pane {
  order: -1;
}
.clinical-history-pane-head {
  display: none;
}
.modal-clinical-history.has-editor-active .clinical-history-head {
  flex: 0 0 auto;
}
.modal-clinical-history.has-editor-active .clinical-history-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal-clinical-history.has-editor-active .clinical-history-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
  gap: 16px;
  overflow: hidden;
}
.modal-clinical-history.has-editor-active .clinical-history-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.96));
}
.modal-clinical-history.has-editor-active .clinical-history-history-pane {
  order: 1;
}
.modal-clinical-history.has-editor-active .clinical-history-current-pane {
  order: 2;
}
.modal-clinical-history.has-editor-active .clinical-history-pane-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 53, 87, 0.10);
}
.clinical-history-pane-head span {
  color: var(--text-3, #607b93);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.clinical-history-pane-head strong {
  color: var(--text-1, #1e3040);
  font-size: 13px;
}
.modal-clinical-history.has-editor-active .clinical-history-pane-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
.modal-clinical-history.has-editor-active .clinical-history-toolbar,
.modal-clinical-history.has-editor-active .clinical-editor-shell {
  margin-bottom: 0;
}
.modal-clinical-history.has-editor-active .clinical-history-toolbar {
  margin-bottom: 14px;
}
.modal-clinical-history.has-editor-active .clinical-history-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.modal-clinical-history.has-editor-active .clinical-history-stat {
  padding: 9px 10px;
  border-radius: 10px;
}
.modal-clinical-history.has-editor-active .clinical-history-stat-value {
  margin-top: 2px;
  font-size: 22px;
}
.modal-clinical-history.has-editor-active .clinical-history-item {
  padding: 10px;
  border-radius: 12px;
}
.modal-clinical-history.has-editor-active .clinical-history-detail-grid {
  grid-template-columns: 1fr;
}
.modal-clinical-history.has-editor-active .clinical-history-detail-row.is-wide {
  grid-column: span 1;
}
.modal-clinical-history.has-editor-active .modal-actions,
.modal-clinical-history.has-editor-active .modal-foot {
  flex: 0 0 auto;
  margin-top: 14px;
}
.modal-patient-info-panel { max-width: 860px; }

.pi-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}
.pi-stat-card {
  min-width: 0;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(218,228,236,.96);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.pi-stat-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.pi-stat-number.ok  { color: #059669; }
.pi-stat-number.err { color: #dc2626; }
.pi-stat-number.neutral { color: #2563eb; }
.pi-stat-label {
  font-size: 11px;
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
}
.pi-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--n-500);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(218,228,236,.96);
}
.pi-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(218,228,236,.96);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.pi-row--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}
.pi-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pi-row-date-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pi-row-date {
  font-weight: 600;
  color: var(--n-800);
  min-width: 90px;
}
.pi-row-hora {
  color: var(--n-500);
  min-width: 48px;
  font-size: 12px;
}
.pi-row-notes {
  color: var(--n-500);
  flex: 1;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pi-row-title {
  color: var(--n-800);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.pi-row-detail {
  color: var(--n-600);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.pi-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pi-row-meta--audit {
  padding-top: 2px;
  border-top: 1px dashed rgba(218,228,236,.96);
}
.pi-row-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15,23,42,.04);
  color: var(--n-600);
  font-size: 12px;
  line-height: 1.45;
}
.pi-row-note--danger {
  background: rgba(220,38,38,.08);
  color: #b91c1c;
}
.pi-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(241,245,249,.96);
  border: 1px solid rgba(218,228,236,.96);
  color: var(--n-600);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}
.pi-chip.is-audit {
  background: rgba(98,188,197,.10);
  border-color: rgba(98,188,197,.22);
  color: var(--teal-600);
}
.pi-badge {
  font-size: 10px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pi-badge.ok  { background: rgba(5,150,105,.12); color: #059669; }
.pi-badge.err { background: rgba(220,38,38,.10); color: #dc2626; }
.pi-badge.info { background: rgba(37,99,235,.12); color: #2563eb; }
.pi-badge.warn { background: rgba(245,158,11,.14); color: #b45309; }
.pi-badge.soft { background: rgba(148,163,184,.14); color: #64748b; }
.pi-empty {
  text-align: center;
  color: var(--n-400);
  font-size: 13px;
  padding: 18px 0;
}

@media (max-width: 780px) {
  .patient-audit-grid {
    grid-template-columns: 1fr;
  }
  .pi-row,
  .pi-row-head,
  .pi-row-date-group {
    flex-direction: column;
    align-items: flex-start;
  }
  .pi-row-date,
  .pi-row-hora {
    min-width: 0;
  }
  .pi-row-notes {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    width: 100%;
  }
  .pi-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .patient-readonly-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .patient-readonly-actions {
    justify-content: stretch;
  }
  .patient-readonly-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .patient-form-grid {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
  .patient-form-grid .span2 {
    grid-column: auto;
  }
  .modal-patient .modal-foot .btn {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 560px) {
  .pi-stats {
    grid-template-columns: 1fr;
  }
  .patient-audit-card,
  .patient-readonly-banner {
    padding: 12px;
    border-radius: 14px;
  }
  .patient-audit-item {
    padding: 10px;
    border-radius: 12px;
  }
  .modal-patient .modal-foot .btn {
    flex: 1 1 100%;
  }
}

.modal-sm { max-width: 380px; }
.modal-os { max-width: 620px; }
.modal-schedule { max-width: 1140px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.modal-inner { padding: 30px 32px; }

.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--n-100);
}
.modal-head-text h2 { font-size: 22px; font-weight: 700; color: var(--n-900); letter-spacing: -.4px; }
.modal-head-text p  { font-size: 13px; color: var(--n-500); margin-top: 4px; }

.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--n-100); color: var(--n-500);
  transition: all var(--t-fast); flex-shrink: 0;
}
.modal-close:hover { background: var(--n-200); color: var(--n-800); }
.modal-close svg { width: 14px; height: 14px; }

.clinical-history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.clinical-history-head-copy h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--n-900);
}

.clinical-history-head-copy p {
  margin: 6px 0 0;
  color: var(--n-500);
  font-size: 13px;
}

.clinical-history-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--n-150);
  background: var(--white);
  color: var(--n-500);
}

.clinical-history-close:hover {
  background: var(--n-50);
  color: var(--n-800);
}

.clinical-history-close svg {
  width: 15px;
  height: 15px;
}

.clinical-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.clinical-history-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(98, 188, 197, 0.14), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(98, 188, 197, 0.2);
  color: var(--n-700);
  font-size: 12px;
  font-weight: 600;
}

.clinical-history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.clinical-history-stat {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--n-100);
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.clinical-history-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--n-500);
}

.clinical-history-stat-value {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  color: var(--n-900);
}

.clinical-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clinical-history-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--n-100);
  border-radius: 12px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.98);
  padding: 12px 12px 12px 14px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base), background var(--t-base);
}

.clinical-history-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.72), rgba(15, 118, 110, 0.72));
}

.clinical-history-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: flex-start;
}

.clinical-history-item-copy {
  min-width: 0;
}

.clinical-history-item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.clinical-history-item-date {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(0, 86, 122, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, #eef8fd, #f8fcff);
  color: var(--n-700);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.clinical-history-item-date span {
  color: #0f6f89;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.clinical-history-item-date strong {
  color: var(--n-900);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
}

.clinical-history-item-date em {
  color: var(--n-500);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.clinical-history-item-title {
  flex: 1 1 150px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--n-900);
  line-height: 1.25;
}

.clinical-history-item-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--n-500);
}

.clinical-history-audit-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.clinical-history-audit-line span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.16);
  background: rgba(14, 165, 233, 0.07);
  color: var(--n-600);
  font-size: 9.5px;
  font-weight: 700;
}

.clinical-history-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--n-100);
  color: var(--n-700);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.clinical-history-item-actions {
  display: grid;
  gap: 5px;
  justify-items: end;
  min-width: 92px;
}

.clinical-history-item-tags,
.clinical-history-item-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.clinical-history-item-action-buttons .tb-btn {
  min-width: 54px;
  min-height: 24px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1;
}

.clinical-history-item-body {
  margin-top: 6px;
  color: var(--n-700);
  line-height: 1.38;
  font-size: 12px;
  white-space: pre-wrap;
}

.clinical-history-details {
  margin-top: 6px;
  border-top: 1px dashed var(--n-150);
  padding-top: 6px;
}

.clinical-history-item-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.clinical-history-item-compact-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid rgba(0, 86, 122, 0.12);
  border-radius: 999px;
  background: rgba(240, 247, 254, 0.92);
  color: var(--n-500);
  font-size: 9.5px;
  font-weight: 750;
  line-height: 1;
}

.clinical-history-item.is-sparse {
  padding: 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.96));
}

.clinical-history-item.is-sparse::before {
  opacity: 0.45;
}

.clinical-history-item.is-sparse .clinical-history-item-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.clinical-history-item.is-sparse .clinical-history-item-title {
  font-size: 13px;
}

.clinical-history-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.clinical-history-attachment-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  border: 1px solid var(--n-150);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.clinical-history-attachment-card:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 100, 152, 0.28);
  box-shadow: 0 14px 28px rgba(14, 31, 53, 0.08);
}

.clinical-history-attachment-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(18, 56, 84, 0.08);
}

.clinical-history-attachment-thumb.is-file {
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--n-900);
}

.clinical-history-attachment-thumb.is-pdf {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.13), rgba(255, 255, 255, 0.82));
  color: #9f1239;
}

.clinical-history-attachment-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.clinical-history-attachment-copy strong {
  font-size: 12px;
  color: var(--n-900);
}

.clinical-history-attachment-copy span {
  font-size: 11px;
  color: var(--n-500);
}

body.theme-dark .clinical-history-attachment-card {
  background: rgba(15, 29, 45, 0.84);
  border-color: rgba(143, 217, 224, 0.12);
}

body.theme-dark .clinical-history-attachment-card:hover {
  border-color: rgba(143, 217, 224, 0.26);
  box-shadow: 0 14px 28px rgba(0, 8, 18, 0.26);
}

body.theme-dark .clinical-history-attachment-thumb {
  background: rgba(8, 18, 29, 0.92);
}

body.theme-dark .clinical-history-attachment-thumb.is-file,
body.theme-dark .clinical-history-attachment-copy strong {
  color: #f3fbff;
}

body.theme-dark .clinical-history-attachment-copy span {
  color: var(--n-500);
}

.clinical-attachment-viewer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 18, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.clinical-attachment-viewer.open {
  display: flex;
}

.clinical-attachment-viewer-panel {
  width: min(1180px, 96vw);
  height: min(820px, 92vh);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(190, 215, 238, 0.24);
  border-radius: 8px;
  background: #07111f;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.clinical-attachment-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(190, 215, 238, 0.18);
  background: rgba(13, 27, 38, 0.96);
}

.clinical-attachment-viewer-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.clinical-attachment-viewer-copy strong {
  color: #f4f8fb;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clinical-attachment-viewer-copy span {
  color: #9fb6ca;
  font-size: 11px;
  font-weight: 700;
}

.clinical-attachment-viewer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.clinical-attachment-viewer-actions .tb-btn,
.clinical-attachment-viewer-actions .btn {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(190, 215, 238, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #edf7ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.clinical-attachment-viewer-actions .tb-btn:hover,
.clinical-attachment-viewer-actions .btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(190, 215, 238, 0.38);
}

.clinical-attachment-viewer-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    #030811;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.clinical-attachment-viewer.is-pdf .clinical-attachment-viewer-stage {
  padding: 0;
  cursor: default;
  touch-action: auto;
  user-select: auto;
}

.clinical-attachment-viewer-stage:active {
  cursor: grabbing;
}

.clinical-attachment-viewer-stage img {
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.08s ease;
}

.clinical-attachment-viewer-stage iframe {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.clinical-attachment-viewer.is-pdf .clinical-attachment-viewer-stage img,
.clinical-attachment-viewer.is-pdf [data-attachment-viewer-zoom] {
  display: none;
}

.clinical-attachment-viewer.is-pdf .clinical-attachment-viewer-stage iframe {
  display: block;
}

.clinical-attachment-viewer-fallback {
  display: none;
  color: #d8e7f4;
  font-size: 13px;
  font-weight: 700;
}

.clinical-attachment-viewer.is-broken .clinical-attachment-viewer-stage img {
  display: none;
}

.clinical-attachment-viewer.is-broken .clinical-attachment-viewer-fallback {
  display: block;
}

.clinical-history-detail-grid {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid rgba(140, 175, 208, 0.12);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.70);
}

.clinical-history-detail-row {
  display: grid;
  grid-template-columns: minmax(96px, 132px) 1fr;
  gap: 7px;
  align-items: start;
  padding: 5px 7px;
  border: 1px solid rgba(140, 175, 208, 0.10);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.54);
}

.clinical-history-detail-row.is-wide {
  grid-template-columns: 1fr;
  gap: 6px;
}

.clinical-history-detail-key {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--n-500);
}

.clinical-history-detail-value {
  font-size: 11.5px;
  color: var(--n-700);
  line-height: 1.32;
  word-break: break-word;
}

.clinical-structured-summary {
  display: grid;
  gap: 10px;
}

.clinical-structured-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.88), rgba(255, 255, 255, 0.96));
}

.clinical-structured-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clinical-structured-section-head strong {
  color: var(--n-900);
  font-size: 12.5px;
  font-weight: 850;
}

.clinical-structured-section-head span {
  flex: 0 0 auto;
  color: var(--teal-800);
  font-size: 10px;
  font-weight: 850;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.16);
}

.clinical-structured-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px;
  margin: 0;
}

.clinical-structured-compact-grid div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.clinical-structured-compact-grid dt {
  color: var(--n-500);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.clinical-structured-compact-grid dd {
  margin: 2px 0 0;
  color: var(--n-900);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.clinical-structured-menu2-summary {
  display: grid;
  gap: 8px;
}

.clinical-structured-subsection {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.clinical-structured-subtitle {
  color: var(--n-900);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.clinical-eye-table {
  display: grid;
  gap: 3px;
}

.clinical-eye-table-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(54px, 0.75fr) minmax(54px, 0.75fr);
  gap: 3px;
  align-items: stretch;
}

.clinical-eye-table-row > span,
.clinical-eye-table-row > strong {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  background: rgba(248, 252, 255, 0.86);
  color: var(--n-700);
  font-size: 11.5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.clinical-eye-table-row > span:first-child {
  color: var(--n-500);
  font-size: 9.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.clinical-eye-table-row > strong {
  color: var(--n-900);
  font-weight: 850;
}

.clinical-eye-table-row.is-head > span {
  padding: 3px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--n-500);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.clinical-structured-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 4px;
  margin: 0;
}

.clinical-structured-mini-grid div {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  background: rgba(248, 252, 255, 0.86);
}

.clinical-structured-mini-grid dt {
  color: var(--n-500);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
}

.clinical-structured-mini-grid dd {
  margin: 2px 0 0;
  color: var(--n-900);
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.clinical-measurements-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
}

.clinical-measurements-list div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.clinical-measurements-list dt {
  color: var(--n-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.clinical-measurements-list dd {
  margin: 0;
  color: var(--n-900);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  word-break: break-word;
  white-space: nowrap;
}

.clinical-measurements-list div.is-note {
  flex-basis: 100%;
  align-items: flex-start;
  margin-top: 2px;
}

.clinical-measurements-list div.is-note dd {
  white-space: normal;
  overflow-wrap: anywhere;
}

.clinical-history-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--n-200);
  background: var(--n-50);
  color: var(--n-500);
  font-size: 13px;
  line-height: 1.5;
}

.clinical-history-empty.is-error {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(254, 242, 242, 0.95);
  color: #b91c1c;
}

.patient-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-800);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.patient-source-badge.is-local {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-800);
}

.patient-edit-btn.is-readonly {
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-800);
}

.patient-history-btn {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
  color: var(--teal-800);
  box-shadow: 0 10px 22px rgba(15,118,110,.10);
}

.patient-history-btn:hover {
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 14px 26px rgba(15,118,110,.14);
}

.patient-readonly-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(96, 165, 250, 0.08));
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.patient-readonly-banner.show {
  display: flex;
}

.patient-readonly-copy {
  min-width: 0;
}

.patient-readonly-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--n-900);
}

.patient-readonly-text {
  margin-top: 4px;
  color: var(--n-600);
  font-size: 12px;
  line-height: 1.45;
}

.patient-readonly-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Form fields */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid > * { min-width: 0; }
.modal-patient {
  max-width: 860px;
}
.patient-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 14px;
  align-items: start;
}
.patient-social-work-select {
  appearance: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    var(--white);
}
.patient-form-grid textarea.field-input {
  min-height: 84px;
  resize: vertical;
}
.modal-patient .modal-foot {
  flex-wrap: wrap;
}
.modal-patient .modal-foot .btn {
  min-width: 0;
}

#app-patient-info-body {
  display: grid;
  gap: 14px;
}
.turno-form-grid {
  grid-template-columns: minmax(180px, .82fr) minmax(260px, 1.18fr);
  column-gap: 14px;
  row-gap: 14px;
  align-items: start;
}

.field-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--n-400); margin-bottom: 6px;
}
.field-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1.5px solid var(--n-200);
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--n-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-input:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(98,188,197,.12);
}
.field-input.has-error { border-color: #f87171; }
.field-input[readonly] {
  background: var(--n-50);
  color: var(--n-500);
  cursor: not-allowed;
}
.field-error {
  font-size: 10.5px; color: #dc2626;
  margin-top: 3px; display: none;
}
.field-error.show { display: block; }

.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(236, 253, 245, 0.92));
  border: 1px solid rgba(20, 184, 166, 0.18);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.08);
  margin-bottom: 16px;
}
.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid rgba(14, 116, 144, 0.16);
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  color: #0f4c81;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-summary-meta { min-width: 0; }
.profile-summary-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--n-900);
  line-height: 1.2;
}
.profile-summary-role {
  font-size: 11.5px;
  color: var(--n-500);
  margin-top: 2px;
}
.profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--n-100);
}
.profile-actions .btn {
  flex: 1;
  justify-content: center;
}

.profile-password-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--n-100);
}
.profile-password-block h4 {
  margin: 0 0 12px;
  color: var(--n-900);
  font-size: 14px;
  font-weight: 800;
}
.profile-password-block .btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.field-checkbox {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 12.5px; color: var(--n-600);
}
.field-checkbox input { width: 14px; height: 14px; accent-color: var(--teal-500); cursor: pointer; }
.turno-overbook-control {
  position: relative;
}
.turno-overbook-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(192,132,252,.12), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  text-align: left;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.turno-overbook-toggle:hover {
  border-color: rgba(94, 234, 212, .45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}
.turno-overbook-toggle:focus-visible {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(98,188,197,.15);
}
.turno-overbook-control.is-active .turno-overbook-toggle {
  border-color: rgba(168, 85, 247, .42);
  background:
    radial-gradient(circle at top right, rgba(192,132,252,.22), transparent 44%),
    linear-gradient(180deg, rgba(250,245,255,.98), rgba(245,243,255,.98));
  box-shadow: 0 14px 28px rgba(168, 85, 247, .14);
}
.turno-overbook-switch {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, .12);
  flex-shrink: 0;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.turno-overbook-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #e2e8f0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
  transition: transform var(--t-fast), background var(--t-fast);
}
.turno-overbook-control.is-active .turno-overbook-switch {
  background: linear-gradient(135deg, #d8b4fe, #a855f7);
  box-shadow: inset 0 2px 6px rgba(126, 34, 206, .18);
}
.turno-overbook-control.is-active .turno-overbook-thumb {
  transform: translateX(24px);
  background: linear-gradient(180deg, #ffffff, #f3e8ff);
}
.turno-overbook-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.turno-overbook-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--n-400);
}
.turno-overbook-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--n-900);
}
.turno-overbook-meta {
  font-size: 12px;
  color: var(--n-500);
}
.turno-overbook-control.is-active .turno-overbook-title {
  color: #6b21a8;
}
.turno-overbook-control.is-active .turno-overbook-meta {
  color: #7e22ce;
  font-weight: 600;
}
.turno-payment-panel {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(45, 212, 191, .24);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, .18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: 0 16px 30px rgba(15, 23, 42, .08);
}
.turno-payment-panel[hidden] {
  display: none;
}
.turno-payment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.turno-payment-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.turno-payment-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--n-400);
}
.turno-payment-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--n-900);
}
.turno-payment-meta {
  font-size: 12px;
  color: var(--n-500);
  line-height: 1.45;
}
.turno-payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.turno-payment-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.turno-payment-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.turno-payment-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--n-400);
}
.turno-payment-stat-value {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--n-900);
  word-break: break-word;
}
.turno-form-grid textarea.field-input {
  min-height: 92px;
  resize: vertical;
}

/* Coseguro: campo total de sólo lectura */
.field-input--readonly {
  background: rgba(241, 245, 249, .72);
  cursor: default;
  color: var(--n-600);
  pointer-events: none;
}

/* Drawer: advertencia de coseguro pendiente */
.coseguro-debt-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(254, 240, 138, .32);
  border: 1px solid rgba(245, 158, 11, .28);
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  line-height: 1.4;
}
.coseguro-debt-warning svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  stroke: #d97706;
}

/* Drawer: botones de acción de coseguro */
.coseguro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.coseguro-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.coseguro-btn:hover { opacity: .82; }
.coseguro-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.coseguro-btn--paid {
  background: rgba(220, 252, 231, .9);
  border-color: rgba(34, 197, 94, .3);
  color: #166534;
}
.coseguro-btn--pending {
  background: rgba(254, 240, 138, .5);
  border-color: rgba(245, 158, 11, .3);
  color: #92400e;
}
.coseguro-btn--undo {
  background: rgba(241, 245, 249, .9);
  border-color: rgba(148, 163, 184, .3);
  color: #475569;
}

body.theme-dark .coseguro-debt-warning {
  background: rgba(92, 70, 10, .35);
  border-color: rgba(245, 158, 11, .22);
  color: #fcd34d;
}
body.theme-dark .coseguro-debt-warning svg { stroke: #fcd34d; }
body.theme-dark .coseguro-btn--paid {
  background: rgba(20, 83, 45, .5);
  border-color: rgba(34, 197, 94, .22);
  color: #86efac;
}
body.theme-dark .coseguro-btn--pending {
  background: rgba(92, 70, 10, .45);
  border-color: rgba(245, 158, 11, .22);
  color: #fcd34d;
}
body.theme-dark .coseguro-btn--undo {
  background: rgba(30, 41, 59, .6);
  border-color: rgba(100, 116, 139, .22);
  color: #94a3b8;
}
body.theme-dark .field-input--readonly {
  background: rgba(30, 41, 59, .6);
  color: var(--n-400);
}

.st-warning {
  display: none;
  align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: #fffbeb; border: 1px solid #fde68a;
  font-size: 12px; font-weight: 500; color: #92400e;
  margin-top: 8px;
}
.st-warning.show { display: flex; }
.st-warning svg { width: 14px; height: 14px; flex-shrink: 0; }

.turno-availability-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
}
.turno-availability-panel[data-tone="success"] {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}
.turno-availability-panel[data-tone="danger"] {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fff5f5 0%, #fef2f2 100%);
}
.turno-availability-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.turno-availability-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--n-900);
}
.turno-availability-schedule {
  font-size: 11.5px;
  color: var(--n-500);
}
.turno-availability-note {
  font-size: 12px;
  color: var(--n-600);
  line-height: 1.45;
}
.turno-availability-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.turno-availability-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--n-700);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.turno-availability-chip:hover {
  transform: translateY(-1px);
  border-color: var(--teal-300);
  color: var(--teal-700);
}
.turno-availability-chip.is-active {
  border-color: var(--teal-500);
  background: rgba(98, 188, 197, 0.14);
  color: var(--teal-700);
}
.turno-availability-empty {
  font-size: 12px;
  color: var(--n-500);
}

.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--n-100);
}

#os-delete-btn {
  margin-right: auto;
}

.schedule-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.schedule-modal-meta {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: linear-gradient(180deg, rgba(98,188,197,.08), rgba(98,188,197,0)), var(--n-50);
  color: var(--n-700);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.schedule-modal-section {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: linear-gradient(180deg, rgba(0,53,87,.015), transparent), var(--white);
}

.schedule-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.schedule-section-head h4 {
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--blue-800);
}

.schedule-section-head p {
  font-size: 12px;
  color: var(--n-500);
}

.schedule-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.schedule-date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.schedule-exception-draft-summary {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(14,165,233,.14);
  background: linear-gradient(180deg, rgba(240,249,255,.96), rgba(248,250,252,.96));
  color: var(--n-700);
  font-size: 12px;
  line-height: 1.55;
}

.schedule-exception-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .95fr);
  gap: 14px;
}

.schedule-exception-editor {
  min-width: 0;
}

.schedule-exception-technical-fields {
  display: none;
}

.schedule-block-composer {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(20,184,166,.24);
  background:
    radial-gradient(circle at top right, rgba(20,184,166,.16), transparent 36%),
    linear-gradient(135deg, rgba(240,253,250,.98), rgba(255,255,255,.98) 58%, rgba(255,251,235,.72));
  box-shadow: 0 18px 36px rgba(15,23,42,.07);
}

.schedule-block-composer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.schedule-block-composer-head span:first-child {
  display: block;
  color: var(--teal-700, #0f766e);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.schedule-block-composer-head strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-900);
  font-size: 18px;
}

.schedule-block-composer-head p {
  margin-top: 5px;
  color: var(--n-600);
  font-size: 12px;
  line-height: 1.5;
}

.schedule-block-composer-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(20,184,166,.26);
  background: rgba(255,255,255,.82);
  color: #0f766e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.schedule-block-composer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-block-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.schedule-block-scope label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.76);
  color: var(--n-700);
  font-size: 12px;
  font-weight: 800;
}

.schedule-block-scope input {
  accent-color: var(--teal-600, #0d9488);
}

.schedule-block-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(14,165,233,.28);
  background: rgba(248,250,252,.82);
  color: var(--n-600);
  font-size: 12px;
  line-height: 1.55;
}

.schedule-block-preview strong {
  color: var(--blue-900);
}

.schedule-block-preview span {
  display: block;
  margin-top: 4px;
  font-weight: 800;
}

.schedule-block-preview.is-ok {
  border-color: rgba(20,184,166,.32);
  background: rgba(240,253,250,.82);
  color: #0f766e;
}

.schedule-block-preview.is-warning {
  border-color: rgba(245,158,11,.42);
  background: rgba(255,251,235,.9);
  color: #92400e;
}

.schedule-block-preview.is-danger {
  border-color: rgba(239,68,68,.38);
  background: rgba(254,242,242,.9);
  color: #991b1b;
}

.schedule-block-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.schedule-exception-tip {
  margin: 2px 0 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: var(--n-50);
  font-size: 12px;
  line-height: 1.55;
  color: var(--n-600);
}

.schedule-exception-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.schedule-exception-status,
.schedule-modal-status {
  font-size: 12px;
  color: var(--n-500);
}

.schedule-exception-status[data-tone="dirty"],
.schedule-modal-status[data-tone="dirty"] {
  color: #b45309;
}

.schedule-exception-status[data-tone="ok"],
.schedule-modal-status[data-tone="ok"] {
  color: #15803d;
}

.schedule-exception-status[data-tone="err"],
.schedule-modal-status[data-tone="err"] {
  color: #b91c1c;
}

.schedule-exception-status[data-tone="saving"],
.schedule-modal-status[data-tone="saving"] {
  color: var(--blue-700);
}

.schedule-exception-list-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: var(--n-50);
}

.schedule-exception-list-head {
  padding: 12px;
  border-bottom: 1px solid var(--n-150);
}

.schedule-exception-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-800);
}

.schedule-exception-list-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--n-500);
}

.schedule-exception-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 12px;
}

.schedule-exception-card {
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-150);
  background: var(--white);
}

.schedule-exception-card.is-editing {
  border-color: rgba(98,188,197,.7);
  box-shadow: 0 0 0 3px rgba(98,188,197,.12);
}

.schedule-exception-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.schedule-exception-card h5 {
  font-size: 14px;
  color: var(--n-900);
}

.schedule-exception-card-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--n-500);
}

.schedule-exception-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--n-150);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-exception-badge[data-tone="closed"] {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.schedule-exception-badge[data-tone="replace"] {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.schedule-exception-badge[data-tone="remove"] {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.schedule-exception-badge[data-tone="add"] {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.schedule-exception-summary {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--n-700);
}

.schedule-exception-notes {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--n-500);
}

.schedule-exception-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.schedule-exception-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.schedule-exception-preview-card {
  min-height: 100%;
}

.schedule-exception-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.schedule-exception-shortcut {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.08), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  text-align: left;
  box-shadow: 0 14px 28px rgba(15,23,42,.05);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.schedule-exception-shortcut:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.24);
  box-shadow: 0 18px 30px rgba(14,165,233,.10);
}

.schedule-exception-shortcut.is-block {
  border-color: rgba(20,184,166,.18);
  background:
    radial-gradient(circle at top right, rgba(20,184,166,.14), transparent 42%),
    linear-gradient(180deg, rgba(240,253,250,.98), rgba(255,255,255,.98));
}

.schedule-exception-shortcut-kicker {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-600, #0d9488);
}

.schedule-exception-shortcut-title {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--blue-900);
}

.schedule-exception-shortcut-meta {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--n-500);
}

.schedule-exception-empty {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px dashed var(--n-200);
  background: var(--white);
  color: var(--n-500);
  font-size: 12px;
  line-height: 1.6;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--n-700);
  font-weight: 800;
  line-height: 1;
}

.btn-icon:hover {
  border-color: rgba(14,165,233,.35);
  color: var(--blue-700);
  background: #f8fafc;
}

.schedule-period-panel {
  display: grid;
  gap: 10px;
}

.schedule-period-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(430px, .8fr);
  gap: 8px;
  align-items: start;
}

.schedule-period-calendar-panel,
.schedule-period-editor {
  min-width: 0;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: var(--white);
  padding: 8px;
}

.schedule-period-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.schedule-period-month {
  width: 142px;
}

.period-calendar-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
  color: var(--n-500);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.period-calendar-head span {
  text-align: center;
}

.period-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.period-calendar-day {
  min-width: 0;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  text-align: left;
  overflow: hidden;
}

.period-calendar-day:hover {
  border-color: rgba(14,165,233,.45);
  background: #f8fafc;
}

.period-calendar-day.is-muted {
  opacity: .45;
}

.period-calendar-day.is-selected {
  border-color: #0ea5e9;
  box-shadow: inset 0 0 0 1px #0ea5e9;
  background: #f0f9ff;
}

.period-calendar-day.has-period {
  border-color: rgba(20,184,166,.45);
}

.period-calendar-day.is-closed .period-calendar-chip {
  background: #fee2e2;
  color: #991b1b;
}

.period-calendar-date {
  font-size: 11px;
  font-weight: 800;
  color: var(--n-800);
}

.period-calendar-chip {
  max-width: 100%;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-calendar-chip.has-overbook {
  border: 1px solid rgba(79,70,229,.3);
}

.period-calendar-chip-head {
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.period-calendar-overbook-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 13px;
  padding: 0 4px;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
}

.period-calendar-chip-time,
.period-calendar-chip-meta {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-calendar-chip-meta {
  color: rgba(22,101,52,.72);
  font-size: 8.5px;
  line-height: 1;
}


.period-calendar-source {
  max-width: 100%;
  color: var(--n-500);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-period-editor {
  display: grid;
  gap: 6px;
}

.schedule-period-editor-head,
.schedule-period-day-actions,
.schedule-period-days,
.schedule-period-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-period-editor-head {
  gap: 6px;
}

.schedule-period-form-grid {
  display: grid;
  grid-template-columns: minmax(130px, .9fr) minmax(130px, .9fr) minmax(210px, 1.35fr);
  gap: 6px;
  align-items: end;
}

.schedule-period-form-grid .span2 {
  grid-column: span 2;
}

.schedule-period-form-grid .span3 {
  grid-column: 1 / -1;
}

.schedule-period-form-grid .field-label {
  margin-bottom: 4px;
  font-size: 10.5px;
}

.schedule-period-form-grid .field-input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.schedule-period-form-grid .schedule-period-day-actions {
  min-height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.schedule-period-form-grid .schedule-period-day-actions .btn {
  min-height: 34px;
  padding: 6px 10px;
}

.schedule-period-days {
  gap: 5px;
}

.schedule-period-week-editor {
  display: grid;
  gap: 3px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #f8fafc;
  padding: 5px;
}

.schedule-period-week-head,
.schedule-period-week-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
}

.schedule-period-week-head {
  padding: 0 5px;
  color: var(--n-500);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-period-week-row {
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: var(--white);
  padding: 3px 5px;
}

.schedule-period-week-row.is-active {
  border-color: rgba(14,165,233,.3);
  background: #f8fbff;
}

.schedule-period-week-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 30px;
}

.schedule-period-week-day {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--n-800);
  font-size: 12px;
  font-weight: 900;
}

.schedule-period-week-day input {
  accent-color: #0ea5e9;
}

.schedule-period-week-day span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-period-add-block {
  min-width: 26px;
  padding: 4px 7px;
}

.schedule-period-blocks {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.schedule-period-day-empty {
  min-height: 30px;
  display: flex;
  align-items: center;
  color: var(--n-400);
  font-size: 11.5px;
  font-weight: 800;
}

.schedule-period-block-row {
  display: grid;
  grid-template-columns: 84px 84px minmax(118px, 1fr) 42px auto;
  align-items: start;
  gap: 5px;
  min-width: 0;
}

.schedule-period-time-input {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 12px;
}

.schedule-period-block-filter-btn {
  min-height: 30px;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--n-700);
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-period-block-filter-btn:hover {
  border-color: rgba(14,165,233,.45);
  background: #f0f9ff;
}

.schedule-period-hidden-filter {
  display: none;
}

.schedule-period-overbook-toggle {
  position: relative;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #fff;
  color: var(--n-500);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.schedule-period-overbook-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-period-overbook-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  border-radius: 7px;
}

.schedule-period-overbook-toggle:hover {
  border-color: rgba(14,165,233,.45);
  background: #f0f9ff;
}

.schedule-period-overbook-toggle input:checked + span {
  background: #eef2ff;
  color: #3730a3;
}

.schedule-period-remove-block {
  width: 30px;
  height: 30px;
}

.schedule-period-filter-overlay {
  z-index: 1200;
}

.schedule-period-filter-modal {
  max-width: 720px;
}

.schedule-period-filter-modal .modal-inner {
  padding: 18px;
}

.schedule-period-filter-head {
  margin-bottom: 12px;
}

.schedule-period-filter-body {
  min-width: 0;
}

.schedule-period-filter-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-period-filter-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.schedule-period-filter-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.schedule-period-filter-group-head strong {
  color: var(--n-800);
  font-size: 12px;
}

.schedule-period-filter-group-head span {
  color: var(--n-500);
  font-size: 11px;
  font-weight: 800;
}

.schedule-period-filter-options {
  display: grid;
  gap: 5px;
  max-height: min(42vh, 320px);
  overflow: auto;
  padding-right: 2px;
}

.schedule-period-filter-search {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.schedule-period-filter-option {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px;
  color: var(--n-700);
  font-size: 12px;
  font-weight: 800;
}

.schedule-period-filter-option input {
  accent-color: #0ea5e9;
}

.schedule-period-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-period-filter-option.hidden,
.schedule-period-filter-empty.hidden {
  display: none;
}

.schedule-period-filter-empty {
  color: var(--n-500);
  font-size: 12px;
}

.schedule-period-treatment-panel {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #f8fafc;
}

.schedule-period-treatment-title {
  color: var(--n-700);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-period-treatment-matrix {
  display: grid;
  grid-template-columns: minmax(98px, 1fr) repeat(var(--period-day-count), minmax(30px, 34px));
  gap: 3px;
  max-height: 148px;
  overflow: auto;
  padding-right: 2px;
}

.schedule-period-treatment-cell,
.schedule-period-treatment-check {
  min-width: 0;
  border: 1px solid var(--n-200);
  background: var(--white);
}

.schedule-period-treatment-cell {
  min-height: 26px;
  display: flex;
  align-items: center;
  padding: 3px 5px;
  color: var(--n-700);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.schedule-period-treatment-cell.is-head,
.schedule-period-treatment-cell.is-day {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef6ff;
  color: var(--n-700);
}

.schedule-period-treatment-cell.is-head {
  left: 0;
  z-index: 3;
}

.schedule-period-treatment-cell.is-day {
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  padding: 3px;
}

.schedule-period-treatment-cell.is-day strong {
  font-size: 10.5px;
  line-height: 1;
}

.schedule-period-treatment-cell.is-day span {
  color: var(--n-500);
  font-size: 9.5px;
  line-height: 1;
}

.schedule-period-treatment-cell.is-treatment {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.schedule-period-treatment-check {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  cursor: pointer;
}

.schedule-period-treatment-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-period-treatment-check span {
  width: 14px;
  height: 14px;
  border: 1px solid var(--n-300);
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #fff;
}

.schedule-period-treatment-check:hover span {
  border-color: #0ea5e9;
}

.schedule-period-treatment-check input:checked + span {
  border-color: #0ea5e9;
  background: #0ea5e9;
}

.schedule-period-treatment-check input:checked + span::after {
  content: "";
  display: block;
  width: 5px;
  height: 8px;
  margin: 1px 0 0 4px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.schedule-period-treatment-check:focus-within {
  outline: 2px solid rgba(14,165,233,.32);
  outline-offset: -2px;
}

.schedule-period-save-row {
  justify-content: flex-end;
  padding-top: 2px;
}

.schedule-period-save-row .btn-blue {
  min-width: 178px;
}

.schedule-period-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--n-700);
}

.schedule-period-day-toggle input {
  accent-color: #0ea5e9;
}

.schedule-period-list {
  display: grid;
  gap: 8px;
}

.schedule-period-card,
.schedule-period-empty {
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
}

.schedule-period-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-period-card.is-editing {
  border-color: #0ea5e9;
  background: #f0f9ff;
}

.schedule-period-card-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.schedule-period-card-main strong,
.schedule-period-card-main span,
.schedule-period-card-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-period-card-main strong {
  color: var(--n-900);
  font-size: 13px;
}

.schedule-period-card-main span,
.schedule-period-card-main em,
.schedule-period-empty {
  color: var(--n-500);
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 980px) {
  .schedule-period-layout {
    grid-template-columns: 1fr;
  }

  .period-calendar-grid,
  .period-calendar-head {
    gap: 4px;
  }

  .period-calendar-day {
    min-height: 72px;
    padding: 6px;
  }

  .schedule-period-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-period-form-grid .span2 {
    grid-column: span 2;
  }

  .schedule-period-form-grid .span3 {
    grid-column: 1 / -1;
  }

  .schedule-period-form-grid .schedule-period-day-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .schedule-period-week-head,
  .schedule-period-week-row {
    grid-template-columns: 1fr;
  }

  .schedule-period-block-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 42px auto;
  }

  .schedule-period-block-filter-btn {
    grid-column: 1 / -1;
  }

  .schedule-period-filter-modal {
    width: calc(100vw - 22px);
    max-width: none;
  }

  .schedule-period-filter-columns {
    grid-template-columns: 1fr;
  }

  .schedule-period-filter-options {
    max-height: 30vh;
  }

  .schedule-period-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

.schedule-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Confirm modal */
.confirm-center { text-align: center; }
.confirm-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.ci-danger { background: #fee2e2; }
.ci-danger svg { width: 22px; height: 22px; color: #dc2626; }
.confirm-center h2 { font-size: 16px; font-weight: 700; }
.confirm-center p  { font-size: 12.5px; color: var(--n-500); margin-top: 6px; line-height: 1.6; }

/* ════════════════════════════════════════════════════════
   TOASTS
   ════════════════════════════════════════════════════════ */
.toast-stack {
  position: fixed; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 900; pointer-events: none;
}

.toast-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  background: var(--white);
  border: 1px solid var(--n-150);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 270px; max-width: 340px;
  pointer-events: all;
  animation: toast-in .22s cubic-bezier(.34,1.2,.64,1);
}
.toast-item.toast-out {
  animation: toast-out .18s var(--t-base) forwards;
}
@keyframes toast-in  { from { opacity:0; transform: translateX(18px) scale(.97); } }
@keyframes toast-out { to   { opacity:0; transform: translateX(18px) scale(.97); } }

.toast-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.toast-icon svg { width: 12px; height: 12px; }
.toast-ok  .toast-icon { background: #dcfce7; color: #16a34a; }
.toast-err .toast-icon { background: #fee2e2; color: #dc2626; }
.toast-inf .toast-icon { background: var(--blue-50); color: var(--blue-800); }

.toast-body { flex: 1; }
.toast-title { font-size: 12.5px; font-weight: 700; color: var(--n-900); }
.toast-msg   { font-size: 11.5px; color: var(--n-500); margin-top: 1px; line-height: 1.4; }

.toast-item.toast-live {
  align-items: stretch;
  gap: 12px;
  border-color: #bfdbfe;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  cursor: pointer;
}

.toast-live-mark {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0ea5e9, #14b8a6);
  flex-shrink: 0;
}

.toast-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.toast-live-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0369a1;
}

.toast-live-time {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--n-400);
}

.toast-live .toast-msg {
  margin-top: 3px;
  color: var(--n-600);
}

.toast-live-meta {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.35;
}

.toast-live-facts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.toast-live-fact {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 11px;
  line-height: 1.35;
}

.toast-live-fact-label {
  color: #0f766e;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.toast-live-fact-value {
  color: var(--n-700);
  font-weight: 600;
  word-break: break-word;
}

.toast-live-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.toast-live-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  background: #eff6ff;
  color: #075985;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .right-panel { display: none; }
}
@media (max-width: 1280px) {
  .agenda-overview-grid { grid-template-columns: 1fr; }
  .doctors-filters,
  .doctors-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .obras-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .messages-layout {
    grid-template-columns: 280px 1fr;
  }
}
@media (max-width: 640px) {
  .ov-edit-options {
    grid-template-columns: 1fr;
  }
  .ov-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ov-kpi {
    min-width: 0;
  }
  .ov-kpi-label,
  .ov-kpi-value {
    word-break: break-word;
  }
}
@media (max-width: 820px) {
  .drawer {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
  }
  .drawer-header,
  .drawer-body,
  .drawer-actions {
    padding-left: 20px;
    padding-right: 20px;
  }
  .drawer-patient {
    font-size: 24px;
  }
  .drawer-grid,
  .detail-card-grid,
  .daction-row {
    grid-template-columns: 1fr;
  }
  .doctors-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .doctors-toolbar-actions {
    width: 100%;
  }
  .obras-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .obras-toolbar-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-left: 0;
  }
  .obras-search-wrap {
    min-width: 0;
    width: 100%;
  }
  .obras-action-btn {
    width: auto;
    justify-content: center;
  }
  .messages-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  }
  .messages-toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "source source"
      "status refresh";
    gap: 8px;
    align-items: end;
  }
  .messages-source-switch {
    grid-area: source;
    width: 100%;
  }
  .messages-source-btn {
    flex: 1 1 0;
    min-width: 0;
  }
  .messages-status-filter {
    grid-area: status;
    min-width: 0;
  }
  .messages-status-filter .field-input {
    width: 100%;
    min-width: 0;
  }
  .messages-toolbar-actions > .btn {
    grid-area: refresh;
    white-space: nowrap;
  }
  .messages-layout {
    display: block;
    position: relative;
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }
  .messages-list-wrap,
  .messages-detail {
    position: absolute;
    inset: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transition: transform .24s ease, opacity .24s ease;
  }
  .messages-list-wrap {
    max-height: none;
    overflow-y: auto;
    padding: 10px 10px calc(92px + env(safe-area-inset-bottom, 0px));
    background: transparent;
  }
  .messages-list {
    gap: 10px;
  }
  .message-conversation-item {
    padding: 13px 14px;
    border-radius: 22px;
    box-shadow: 0 10px 20px rgba(15,23,42,.06);
  }
  .message-conversation-item:hover {
    transform: none;
  }
  .messages-detail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateX(100%);
  }
  .messages-area.messages-mobile-thread-open .messages-toolbar {
    display: none;
  }
  .messages-area.messages-mobile-thread-open .messages-list-wrap {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-12%);
  }
  .messages-area.messages-mobile-thread-open .messages-detail {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
  .messages-detail-header {
    min-height: 74px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
    border: none;
    border-radius: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .messages-detail-badges {
    justify-content: flex-start;
  }
  .messages-thread {
    padding: 12px 10px 14px;
    border: none;
    background:
      radial-gradient(circle at 18% 12%, rgba(98,188,197,.12), transparent 26%),
      radial-gradient(circle at 82% 14%, rgba(15,23,42,.05), transparent 22%),
      linear-gradient(180deg, rgba(247,250,252,.98), rgba(241,245,249,.96));
  }
  .message-bubble {
    max-width: min(86%, 380px);
    padding: 10px 12px;
    border-radius: 20px;
  }
  .message-bubble.incoming {
    border-bottom-left-radius: 8px;
  }
  .message-bubble.outgoing,
  .message-bubble.private {
    border-bottom-right-radius: 8px;
  }
  .messages-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border: none;
    border-top: 1px solid rgba(212, 227, 236, .84);
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(233,239,244,.98), rgba(226,233,239,.96));
    box-shadow: 0 -10px 24px rgba(255,255,255,.4);
  }
  .messages-compose-input {
    min-width: 0;
    min-height: 52px;
    max-height: 132px;
    padding: 14px 18px;
    border-radius: 26px;
    border-color: rgba(212, 227, 236, .96);
    background:
      linear-gradient(180deg, rgba(255,255,255,.99), rgba(250,252,253,.98));
    box-shadow:
      0 10px 24px rgba(15,23,42,.08),
      inset 0 1px 0 rgba(255,255,255,.88);
    resize: none;
  }
  .messages-compose-actions {
    margin-top: 0;
    min-width: auto;
    align-items: flex-end;
    justify-content: flex-end;
  }
  .messages-compose-hint {
    display: none;
  }
  .messages-compose-actions .messages-send-btn.btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 999px;
    justify-content: center;
    background: linear-gradient(135deg, #1fb99d 0%, #0e7a77 100%);
    box-shadow: 0 14px 28px rgba(14,122,119,.26);
  }
  .messages-compose-actions .messages-send-btn span {
    display: none;
  }
  .messages-compose-actions .messages-send-btn svg {
    width: 18px;
    height: 18px;
    display: block;
  }
  .messages-compose-actions .messages-send-btn:disabled {
    box-shadow: none;
    opacity: .72;
  }
  .doctors-toolbar-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .doctors-filters,
  .doctor-card-metrics {
    grid-template-columns: 1fr;
  }
  .doctors-grid {
    grid-template-columns: 1fr;
    padding: 14px 14px 24px;
  }
  .doctor-card-head,
  .doctor-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-overlay {
    align-items: flex-start;
    padding: 12px;
  }
  .modal-lg {
    max-width: 100%;
  }
  .modal-inner {
    padding: 22px 18px;
  }
  .turno-form-grid,
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .modal-patient {
    max-width: 100%;
  }
  .modal-patient .modal-foot .btn {
    flex: 1 1 100%;
  }
  .agenda-overview {
    padding: 12px;
  }
  .agenda-overview-head h2 {
    font-size: 16px;
  }
  .agenda-month-row {
    grid-template-columns: 56px 1fr;
  }
  .agenda-month-patient {
    grid-column: 2 / -1;
  }
  .agenda-month-meta {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .agenda-monthly-head {
    flex-direction: column;
  }
  .agenda-monthly-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .agenda-monthly-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .agenda-monthly-mode-switch {
    width: 100%;
  }
  .agenda-monthly-mode-btn {
    flex: 1 1 0;
    text-align: center;
  }
  .agenda-monthly-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agenda-monthly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .agenda-monthly-weekday {
    display: none;
  }
  .agenda-monthly-day {
    min-height: 0;
  }
  .agenda-monthly-day-head {
    flex-direction: column;
  }
  .agenda-monthly-day-link {
    padding-top: 0;
  }
  .agenda-monthly-day-sheet-head {
    flex-direction: column;
  }
  .agenda-monthly-day-sheet-actions {
    width: 100%;
  }
  .agenda-monthly-day-sheet-actions .btn {
    flex: 1 1 100%;
  }
  .agenda-monthly-detail-row {
    grid-template-columns: 1fr;
  }
  .agenda-monthly-detail-action {
    display: none;
  }
  .ov-card {
    min-height: 0;
  }
  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within {
    width: var(--sidebar-w);
    box-shadow: none;
  }
  .sidebar .nav-btn {
    justify-content: center;
    padding: 0;
  }
  .sidebar .sidebar-logo {
    justify-content: center;
    padding: 0;
  }
  .sidebar .sidebar-logo .sidebar-logo-icon {
    margin-left: 0;
  }
  .sidebar .sidebar-user-row {
    justify-content: center;
    padding: 0;
  }
  .sidebar .nav-label {
    display: none;
  }
  .sidebar .settings-menu,
  .sidebar:hover .settings-menu,
  .sidebar:focus-within .settings-menu {
    left: calc(100% + 8px);
    right: auto;
    bottom: 0;
  }

  .week-pills { display: none; }
  .agenda-table thead th.col-tel,
  .agenda-table thead th.col-os,
  .agenda-table thead th.col-obs,
  .agenda-table thead th.col-op,
  .agenda-table thead th.col-conf { display: none; }
  td.col-tel, td.col-os, td.col-obs, td.col-op, td.col-conf { display: none; }
  .patients-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .patients-toolbar-actions {
    width: 100%;
  }
  .patients-action-btn {
    flex: 1 1 180px;
    justify-content: center;
  }
  .patients-search-shell {
    padding: 16px 14px 0;
  }
  .patients-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 14px 0;
  }
  .obras-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 14px 14px;
  }
  .patients-empty-panel {
    margin: 14px 14px 0;
  }
  .patients-table-wrap {
    margin: 14px 14px 18px;
  }
  .obras-table-wrap {
    margin: 0 14px 18px;
  }
  .obras-table-wrap {
    overflow: visible;
    padding: 10px;
  }
  .obras-table {
    min-width: 0;
    border-spacing: 0;
  }
  .obras-table thead {
    display: none;
  }
  .obras-table,
  .obras-table tbody {
    display: block;
  }
  .obras-table tbody {
    display: grid;
    gap: 12px;
  }
  .obras-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid rgba(218,228,236,.88);
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94)),
      var(--white);
    box-shadow: 0 14px 28px rgba(0,30,54,.08);
  }
  .obras-table tbody tr:hover td,
  .obras-table tbody tr:focus-within td {
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }
  .professionals-content {
    grid-template-columns: 1fr;
  }
  .professionals-list-wrap {
    border-right: none;
    border-bottom: 1px solid var(--n-150);
    max-height: 220px;
  }
  .prof-schedule-overview {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .prof-schedule-quickbar-main {
    grid-template-columns: 1fr;
  }
  .prof-schedule-clipboard-card {
    min-width: 0;
  }
  .prof-schedule-bulk-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .prof-schedule-overview-stats {
    width: 100%;
  }
  .prof-schedule-overview-stat {
    min-width: 0;
  }
  .prof-schedule-layout {
    grid-template-columns: 1fr;
  }
  .prof-schedule-inspector-wrap {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--n-150);
    max-height: 300px;
    overflow-y: auto;
  }
  .prof-schedule-board-head {
    flex-direction: column;
    align-items: stretch;
  }
  .prof-schedule-board-legend {
    justify-content: flex-start;
  }
  .prof-schedule-day-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .prof-schedule-day-card-actions {
    justify-content: flex-start;
  }
  .prof-schedule-day-card-main {
    grid-template-columns: 1fr;
  }
  .prof-schedule-day-visual-body {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .psb-editor {
    align-items: stretch;
  }
  .psb-overbook-btn {
    margin-left: 0;
  }
  .prof-schedule-day-top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
  .professional-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .professional-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .prof-section-summary {
    flex-direction: column;
    align-items: stretch;
  }
  .prof-section-summary-side {
    justify-content: flex-start;
  }
  .prof-socialworks-head {
    flex-direction: column;
  }
  .prof-socialworks-stats {
    justify-content: flex-start;
  }
  .prof-works-grid {
    grid-template-columns: 1fr;
    max-height: 420px;
  }
  .prof-day-row {
    grid-template-columns: 1fr;
  }
  .prof-schedule-editor {
    grid-template-columns: 44px minmax(1192px, 1fr);
  }
  .prof-schedule-editor.is-manual-entry {
    --prof-schedule-head-h: 214px;
  }
  .prof-schedule-days {
    min-width: 1192px;
  }
  .prof-schedule-inspector-section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .prof-schedule-block-tools-grid {
    grid-template-columns: 1fr;
  }
  .schedule-modal-head,
  .schedule-modal-foot,
  .schedule-exception-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .schedule-modal-meta {
    min-width: 0;
    text-align: left;
  }
  .schedule-exception-layout {
    grid-template-columns: 1fr;
  }
  .schedule-quick-actions {
    justify-content: flex-start;
  }
  .schedule-action-buttons {
    justify-content: stretch;
  }
}

@media (max-width: 720px) {
  .psb-bar {
    padding: 14px;
  }
  .prof-schedule-day-card {
    padding: 14px;
  }
  .prof-schedule-day-card-actions .prof-schedule-day-action,
  .prof-schedule-day-card-actions .prof-schedule-clear {
    flex: 1 1 120px;
  }
  .prof-schedule-editor.is-list-layout .prof-schedule-day-controls {
    grid-template-columns: 1fr;
  }
  .prof-schedule-day-visual-body {
    grid-template-columns: 1fr;
  }
  .prof-schedule-day-visual-rail {
    display: none;
  }
  .psb-editor-fields {
    flex: 1 1 100%;
  }
  .psb-editor-fields .prof-schedule-time-field,
  .psb-editor-fields .btn {
    width: 100%;
  }
  .psb-overbook-btn {
    width: 100%;
    justify-content: center;
  }
  .prof-schedule-quickbar {
    padding: 16px;
  }
  .prof-schedule-bulk-form {
    grid-template-columns: 1fr;
  }
  .prof-schedule-segmented {
    width: 100%;
  }
  .prof-schedule-bulk-apply {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .drawer-overlay {
    padding: 10px;
  }
  .drawer {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }
  .drawer-header {
    padding: 22px 18px 18px;
  }
  .drawer-body {
    padding: 18px;
  }
  .drawer-actions {
    padding: 16px 18px 18px;
  }
  .drawer-close {
    top: 16px;
    right: 16px;
  }
  .drawer-patient {
    font-size: 22px;
    max-width: calc(100% - 52px);
  }
  .drawer-overview-time {
    font-size: 20px;
  }
  .detail-card {
    padding: 16px;
    border-radius: 18px;
  }
  .detail-card-head {
    flex-direction: column;
  }
  .detail-card-link,
  .detail-card-note-pill,
  .detail-copy-btn.is-compact {
    width: 100%;
  }
  .detail-card-value-shell {
    gap: 10px;
  }
  .detail-copy-btn.is-icon-only {
    opacity: 1;
    transform: translateY(0);
  }
  .detail-row {
    flex-direction: column;
    gap: 6px;
  }
  .detail-val {
    max-width: 100%;
    text-align: left;
  }
  .professional-overview-grid {
    grid-template-columns: 1fr;
  }
  .prof-schedule-overview-stats {
    grid-template-columns: 1fr;
  }
  .patients-search-wrap {
    max-width: 100%;
    padding: 8px;
  }
  .patients-search-wrap::after {
    display: none;
  }
  .patients-search-wrap input {
    min-height: 56px;
    padding: 12px 16px 12px 44px;
  }
  .patients-search-submit {
    position: static;
    width: 100%;
    margin-top: 10px;
    transform: none;
  }
  .patients-summary {
    grid-template-columns: 1fr;
    padding: 14px 10px 0;
  }
  .obras-toolbar-actions {
    grid-template-columns: 1fr;
  }
  .obras-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 10px 10px;
  }
  .patients-empty-panel {
    margin: 14px 10px 0;
  }
  .patients-table-wrap {
    margin: 14px 10px 14px;
    padding: 10px;
    border-radius: 20px;
  }
  .obras-table-wrap {
    margin: 0 10px 14px;
    padding: 10px;
    border-radius: 20px;
  }
  .patients-table tbody td {
    padding: 12px 10px;
  }
  .obras-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .obras-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .55px;
    color: var(--n-400);
  }
  .obras-table tbody td:first-child,
  .obras-table tbody td:last-child {
    text-align: left;
    white-space: normal;
  }
  .os-cell--main,
  .os-cell--notes,
  .os-cell--actions {
    grid-column: 1 / -1;
  }
  .os-cell--main::before {
    display: none;
  }
  .patient-main {
    align-items: center;
  }
  .patient-row-actions {
    flex-direction: row;
  }
  .os-main {
    align-items: flex-start;
  }
  .os-main-copy,
  .os-state-stack,
  .os-cut-cell,
  .os-copay-cell,
  .os-notes {
    min-width: 0;
  }
  .os-state-pill {
    max-width: 100%;
  }
  .os-notes {
    max-width: none;
  }
  .obras-row-actions {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }
  .patient-edit-btn,
  .patients-action-btn {
    width: 100%;
  }
  .obras-action-btn,
  .obras-row-btn,
  .os-active-switch {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .patients-toolbar-kicker,
  .patients-search-wrap::before,
  .patients-table tbody tr,
  .obras-table tbody tr {
    animation: none !important;
  }
  .patients-action-btn,
  .patients-search-wrap,
  .patients-search-wrap input,
  .patients-search-icon,
  .patients-stat-card,
  .patients-table tbody td,
  .patient-edit-btn,
  .obras-action-btn,
  .obras-stat-card,
  .obras-table tbody td {
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════════
   SALA DE ESPERA
   ═══════════════════════════════════════════════════════ */
.sala-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--n-50);
}
.sala-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 18px 24px 16px;
  background: var(--white); border-bottom: 1px solid var(--n-150);
  flex-shrink: 0;
}
.sala-toolbar h3 { font-size: 16px; font-weight: 700; color: var(--blue-800); margin: 0 0 2px; }
.sala-toolbar p  { font-size: 13px; color: var(--n-500); margin: 0; }
.sala-content { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sala-empty   { padding: 48px 24px; text-align: center; color: var(--n-400); font-size: 14px; }
.sala-prof-group { background: var(--white); border-radius: 12px; border: 1px solid var(--n-150); overflow: hidden; box-shadow: var(--shadow-xs); }
.sala-prof-head  {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 13px; font-weight: 700;
  color: var(--n-800); background: var(--n-50);
  border-bottom: 1px solid var(--n-150);
  border-left: 4px solid var(--prof-color, var(--teal-500));
}
.sala-prof-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sala-table-wrap { overflow-x: auto; }
.sala-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sala-table thead th {
  padding: 8px 12px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--n-400);
  border-bottom: 1px solid var(--n-150); white-space: nowrap;
}
.sala-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--n-100); vertical-align: middle; }
.sala-table tbody tr:last-child td { border-bottom: none; }
.sala-hora    { font-weight: 600; color: var(--blue-800); white-space: nowrap; font-size: 14px; }
.sala-patient { font-weight: 600; color: var(--n-800); }
.sala-os      { color: var(--n-700); font-size: 13px; }
.sala-prest   { font-size: 11px; color: var(--n-400); }
.sala-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════
   REPORTES
   ═══════════════════════════════════════════════════════ */
.reports-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--n-50);
}
.reports-toolbar {
  display: flex; flex-direction: column;
  gap: 0; padding: 0;
  background: var(--white); border-bottom: 1px solid var(--n-150);
  flex-shrink: 0;
}
.reports-toolbar-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.reports-toolbar-top {
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--n-100);
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(248,250,252,1), rgba(255,255,255,1));
}
.reports-toolbar-bottom {
  padding: 10px 24px 10px;
  justify-content: space-between;
  background: var(--white);
}
.reports-toolbar-heading {
  display: flex; align-items: center; gap: 11px;
}
.reports-toolbar-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(14,165,233,.14), rgba(13,148,136,.10));
  border: 1px solid rgba(14,165,233,.16);
  display: grid; place-items: center;
  color: #0891b2;
  flex-shrink: 0;
}
.reports-toolbar h3 { font-size: 15px; font-weight: 700; color: var(--blue-800); margin: 0 0 1px; }
.reports-toolbar p  { font-size: 12px; color: var(--n-400); margin: 0; }
.reports-toolbar-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto;
}
.reports-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reports-filters-divider {
  width: 1px; height: 28px;
  background: var(--n-150);
  margin: 0 2px;
  flex-shrink: 0;
}
.reports-filter {
  display: grid;
  gap: 5px;
  min-width: 132px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--n-400);
}
.reports-date-input {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--n-200); border-radius: 8px;
  font-size: 13px; color: var(--n-800); background: var(--white);
}
.reports-date-input:focus { outline: none; border-color: var(--teal-500); }
.reports-content { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.reports-overview-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(14, 165, 233, .12);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .16), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,.98) 0%, rgba(241, 248, 252, .98) 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}
.reports-overview-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #0891b2;
  margin-bottom: 8px;
}
.reports-overview-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -.04em;
  color: var(--blue-900);
}
.reports-overview-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--n-500);
  max-width: 720px;
}
.reports-overview-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.reports-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, .14);
  background: rgba(255,255,255,.76);
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 700;
}
.reports-graphic-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 16px;
}
.reports-card-future {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, .10), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(246, 250, 255, .98));
}
.reports-card-future::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255,255,255,.26), transparent 24%, transparent 76%, rgba(56,189,248,.08)),
    repeating-linear-gradient(90deg, transparent 0, transparent 18px, rgba(56,189,248,.03) 18px, rgba(56,189,248,.03) 19px);
  pointer-events: none;
}
.reports-ring-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.reports-ring-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  animation: reportsFadeUp .42s ease both;
}
.reports-ring {
  --ring-pct: 0;
  --ring-color: #14b8a6;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.12) 0 34%, transparent 35%),
    conic-gradient(var(--ring-color) 0 calc(var(--ring-pct) * 1%), rgba(148,163,184,.16) 0 100%);
  box-shadow:
    inset 0 0 28px rgba(15, 23, 42, .08),
    0 0 22px color-mix(in srgb, var(--ring-color) 22%, transparent);
}
.reports-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.75), rgba(248,250,252,.96) 48%, rgba(241,245,249,.98) 100%);
  border: 1px solid rgba(148, 163, 184, .18);
}
.reports-ring-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
}
.reports-ring-center strong {
  font-size: 22px;
  line-height: 1;
  color: var(--blue-900);
}
.reports-ring-center span {
  margin-top: 5px;
  font-size: 11px;
  color: var(--n-500);
  font-weight: 700;
}
.reports-ring-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--n-500);
  text-align: center;
}
.reports-holo-list {
  display: grid;
  gap: 12px;
}
.reports-holo-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(120px, 1fr) 48px;
  align-items: center;
  gap: 10px;
  animation: reportsFadeUp .44s ease both;
}
.reports-holo-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.reports-holo-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reports-holo-meta {
  font-size: 11px;
  color: var(--n-500);
}
.reports-holo-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15,23,42,.04), rgba(148,163,184,.14));
  border: 1px solid rgba(148,163,184,.14);
}
.reports-holo-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 10px, rgba(255,255,255,.08) 10px, rgba(255,255,255,.08) 11px);
  pointer-events: none;
}
.reports-holo-bar {
  position: relative;
  height: 100%;
  border-radius: inherit;
  min-width: 10px;
  box-shadow: 0 0 18px rgba(56, 189, 248, .24);
}
.reports-holo-bar.is-cyan {
  background: linear-gradient(90deg, #22d3ee, #0ea5e9);
}
.reports-holo-bar.is-violet {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
  box-shadow: 0 0 18px rgba(167, 139, 250, .24);
}
.reports-holo-bar.is-amber {
  background: linear-gradient(90deg, #fbbf24, #f97316);
  box-shadow: 0 0 18px rgba(251, 191, 36, .24);
}
.reports-holo-value {
  text-align: right;
  font-size: 12px;
  font-weight: 900;
  color: var(--blue-800);
}
.reports-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.reports-spotlight-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(14, 165, 233, .10);
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, .12), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247, 250, 252, .98));
  box-shadow: 0 14px 28px rgba(15, 23, 42, .06);
  transform: translateY(0);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  animation: reportsFadeUp .38s ease both;
}
.reports-spotlight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, .22);
  box-shadow: 0 20px 34px rgba(14, 165, 233, .12);
}
.reports-spotlight-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #64748b;
}
.reports-spotlight-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--blue-900);
}
.reports-spotlight-meta {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--n-500);
}
.reports-loading, .reports-error, .reports-empty-row {
  padding: 40px 24px; text-align: center; color: var(--n-400); font-size: 14px;
}
.reports-error { color: #ef4444; }
.reports-empty-row { padding: 12px; }

/* KPIs */
.reports-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.reports-kpi {
  flex: 1; min-width: 110px; padding: 16px 18px;
  border-radius: 12px; background: var(--white);
  border: 1px solid var(--n-150); box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  animation: reportsFadeUp .42s ease both;
}
.reports-kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 28px rgba(15, 23, 42, .08); }
.reports-kpi.ok     { border-color: #4ade80; background: #f0fdf4; }
.reports-kpi.info   { border-color: #60a5fa; background: #eff6ff; }
.reports-kpi.warn   { border-color: #fbbf24; background: #fffbeb; }
.reports-kpi.danger { border-color: #f87171; background: #fef2f2; }
.reports-kpi-val  { font-size: 30px; font-weight: 700; color: var(--blue-800); line-height: 1; }
.reports-kpi-lbl  { font-size: 11px; font-weight: 600; color: var(--n-500); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.reports-kpi-pct  { font-size: 12px; color: #16a34a; font-weight: 600; margin-top: 2px; }

/* Card base */
.reports-card { background: var(--white); border-radius: 16px; border: 1px solid var(--n-150); padding: 16px 20px; box-shadow: var(--shadow-xs); transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); }
.reports-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px rgba(15, 23, 42, .08); border-color: rgba(14, 165, 233, .14); }
.reports-animated-block { animation: reportsFadeUp .46s ease both; }
.reports-card-title {
  font-size: 13px; font-weight: 700; color: var(--blue-800);
  margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.reports-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 400; color: var(--n-500); }
.rep-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rep-legend-dot.total { background: var(--teal-400, #5eead4); }
.rep-legend-dot.att   { background: var(--teal-600, #0d9488); }

/* Chart */
.rep-chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-bottom: 20px; }
.rep-bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; min-width: 0; }
.rep-bar-wrap { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.rep-bar { border-radius: 4px 4px 0 0; min-height: 2px; flex: 1; transition: height .3s ease; }
.rep-bar.rep-bar-total { background: var(--teal-500); opacity: .5; }
.rep-bar.rep-bar-att   { background: var(--teal-500); }
.rep-bar-lbl { font-size: 10px; color: var(--n-400); margin-top: 4px; white-space: nowrap; }

/* Tables */
.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reports-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reports-table-wrap {
  overflow: auto;
  border-radius: 12px;
}
.reports-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.reports-table thead th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 700; color: var(--n-400); border-bottom: 1px solid var(--n-150); background: rgba(248, 250, 252, .98); }
.reports-table thead th.num { text-align: right; }
.reports-table tbody td { padding: 8px 10px; border-bottom: 1px solid var(--n-100); }
.reports-table tbody tr:last-child td { border-bottom: none; }
.reports-table tbody tr:hover td { background: rgba(14, 165, 233, .04); }
.reports-table td.num { text-align: right; color: var(--n-700); }
.reports-table td.fw  { font-weight: 700; color: var(--blue-800); }
.reports-table-primary {
  font-weight: 700;
  color: var(--blue-800);
}
.reports-table-secondary {
  margin-top: 3px;
  font-size: 11px;
  color: var(--n-500);
}

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

/* ═══════════════════════════════════════════
   AKITO TOKEN CARD
   ═══════════════════════════════════════════ */
.akito-token-card {
  border-color: rgba(14,165,233,.2) !important;
  background: linear-gradient(135deg, rgba(14,165,233,.04), transparent 60%) !important;
}
.akito-token-header {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px;
}
.akito-token-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: white; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.akito-token-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--n-50); border: 1px solid var(--n-200);
  border-radius: 10px; margin-bottom: 10px;
  overflow: hidden;
}
.akito-token-value {
  flex: 1; font-size: 12px; font-family: 'JetBrains Mono', monospace;
  color: var(--n-700); word-break: break-all; overflow-wrap: anywhere;
  min-width: 0;
}
.akito-token-hint {
  font-size: 12px; color: var(--n-400); line-height: 1.5;
}
.akito-token-hint strong { color: var(--n-600); }
body.theme-dark .akito-token-box {
  background: rgba(15,23,42,.5); border-color: rgba(255,255,255,.1);
}
body.theme-dark .akito-token-value { color: #93c5fd; }

/* ═══════════════════════════════════════════
   AUDITORÍA DE TURNOS
   ═══════════════════════════════════════════ */

.btn-audit {
  display: inline-flex; align-items: center;
  height: 34px; padding: 0 14px;
  background: #1e293b; color: #f8fafc;
  border: 1px solid #334155; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .02em; cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.btn-audit:hover { background: #0f172a; box-shadow: 0 4px 12px rgba(15,23,42,.24); }

.audit-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(4px);
  z-index: 9900;
}
.audit-modal {
  position: fixed;
  top: 3vh; left: 50%;
  transform: translateX(-50%);
  width: min(96vw, 1180px);
  max-height: 94vh;
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--n-150);
  box-shadow: 0 32px 80px rgba(15, 23, 42, .22);
  z-index: 9901;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.audit-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--n-100);
  background: linear-gradient(135deg, rgba(15,23,42,.03), transparent 60%);
  flex-shrink: 0;
}
.audit-modal-kicker {
  font-size: 10px; font-weight: 900; letter-spacing: .18em;
  text-transform: uppercase; color: #0891b2; margin-bottom: 4px;
}
.audit-modal-title {
  margin: 0; font-size: 22px; font-weight: 800;
  letter-spacing: -.03em; color: var(--blue-900);
}
.audit-modal-close {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--n-150); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--n-500); flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.audit-modal-close:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }

.audit-modal-filters {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--n-50);
  border-bottom: 1px solid var(--n-100);
  flex-shrink: 0;
}
.audit-filter-label {
  display: grid; gap: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--n-400);
}
.audit-filter-input {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--n-200); border-radius: 8px;
  font-size: 13px; color: var(--n-800);
  background: var(--white); min-width: 150px;
}
.audit-filter-input:focus { outline: none; border-color: var(--teal-500); }

.audit-modal-body {
  flex: 1; overflow-y: auto; overflow-x: auto;
}
.audit-modal-footer {
  border-top: 1px solid var(--n-100);
  padding: 12px 24px;
  flex-shrink: 0;
  background: var(--white);
}

.audit-placeholder, .audit-loading, .audit-error {
  padding: 60px 24px; text-align: center;
  color: var(--n-400); font-size: 14px;
}
.audit-error { color: #ef4444; }

.audit-summary-row {
  padding: 10px 20px;
  font-size: 13px; color: var(--n-500);
  background: var(--n-50);
  border-bottom: 1px solid var(--n-100);
}

.audit-table-wrap { overflow-x: auto; }
.audit-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.audit-table thead tr {
  background: var(--n-50);
  border-bottom: 2px solid var(--n-150);
}
.audit-table th {
  padding: 10px 14px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--n-500);
  text-align: left; white-space: nowrap;
}
.audit-table tbody tr {
  border-bottom: 1px solid var(--n-100);
  transition: background var(--t-fast);
}
.audit-table tbody tr:hover { background: var(--n-50); }
.audit-row-deleted { opacity: .55; background: #fef2f2 !important; }
.audit-table td { padding: 9px 14px; vertical-align: top; }

.audit-td-date { white-space: nowrap; }
.audit-date-main { font-weight: 700; color: var(--blue-800); }
.audit-date-sub  { font-size: 12px; color: var(--n-400); }

.audit-patient-name { font-weight: 600; color: var(--n-800); }
.audit-patient-sub  { font-size: 12px; color: var(--n-400); }

.audit-td-prof { color: var(--n-700); font-weight: 500; white-space: nowrap; }

.audit-pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.audit-pill-amber  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.audit-pill-blue   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.audit-pill-green  { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; }
.audit-pill-red    { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.audit-pill-violet { background: #f5f3ff; color: #4c1d95; border: 1px solid #c4b5fd; }
.audit-pill-default{ background: var(--n-100); color: var(--n-600); border: 1px solid var(--n-200); }

.audit-operator-name   { font-weight: 600; color: var(--n-700); }
.audit-operator-source { font-size: 11px; color: var(--n-400); }

.audit-td-timestamps { white-space: nowrap; }
.audit-ts-row  { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.audit-ts-label {
  display: inline-block; min-width: 72px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--n-400);
}
.audit-ts-label.audit-ts-cancel  { color: #dc2626; }
.audit-ts-label.audit-ts-confirm { color: #16a34a; }
.audit-ts-val { font-size: 12px; color: var(--n-600); font-variant-numeric: tabular-nums; }

.audit-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.audit-badge-deleted   { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.audit-badge-cancelled { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: #fef2f2; color: #92400e; border: 1px solid #fde68a; }
.audit-badge-over      { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: #f5f3ff; color: #4c1d95; border: 1px solid #c4b5fd; }
.audit-cancel-reason   { font-size: 12px; color: #dc2626; font-style: italic; max-width: 200px; }

.audit-pagination {
  display: flex; align-items: center; gap: 12px; justify-content: center;
}
.audit-page-info { font-size: 13px; color: var(--n-500); font-weight: 600; }

/* Dark mode - auditoría */
body.theme-dark .audit-modal {
  background: linear-gradient(180deg, rgba(21,38,56,.98), rgba(15,29,45,.99));
  border-color: rgba(255,255,255,.08);
}
body.theme-dark .audit-modal-header {
  border-bottom-color: rgba(255,255,255,.07);
}
body.theme-dark .audit-modal-title { color: #e2e8f0; }
body.theme-dark .audit-modal-close {
  background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: #94a3b8;
}
body.theme-dark .audit-modal-close:hover { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(248,113,113,.3); }
body.theme-dark .audit-modal-filters { background: rgba(15,23,42,.4); border-bottom-color: rgba(255,255,255,.07); }
body.theme-dark .audit-filter-input {
  background: rgba(30,41,59,.8); border-color: rgba(255,255,255,.12); color: #e2e8f0;
}
body.theme-dark .audit-table thead tr { background: rgba(15,23,42,.5); border-bottom-color: rgba(255,255,255,.1); }
body.theme-dark .audit-table tbody tr { border-bottom-color: rgba(255,255,255,.06); }
body.theme-dark .audit-table tbody tr:hover { background: rgba(255,255,255,.04); }
body.theme-dark .audit-row-deleted { background: rgba(239,68,68,.08) !important; }
body.theme-dark .audit-summary-row { background: rgba(15,23,42,.4); border-bottom-color: rgba(255,255,255,.07); color: #64748b; }
body.theme-dark .audit-modal-footer { background: rgba(15,23,42,.6); border-top-color: rgba(255,255,255,.07); }
body.theme-dark .audit-date-main { color: #93c5fd; }
body.theme-dark .audit-patient-name { color: #e2e8f0; }
body.theme-dark .audit-td-prof { color: #cbd5e1; }
body.theme-dark .audit-ts-val { color: #94a3b8; }
body.theme-dark .audit-operator-name { color: #cbd5e1; }
body.theme-dark .audit-placeholder,
body.theme-dark .audit-loading { color: #475569; }

/* Dark mode - reception dashboard */
body.theme-dark .topbar,
body.theme-dark .statsbar,
body.theme-dark .right-panel,
body.theme-dark .drawer,
body.theme-dark .modal,
body.theme-dark .reports-card,
body.theme-dark .reports-kpi {
  background:
    linear-gradient(180deg, rgba(21, 38, 56, .96), rgba(15, 29, 45, .98)),
    var(--white);
  border-color: rgba(143, 217, 224, .10);
  box-shadow: 0 18px 40px rgba(0, 8, 18, .34);
}

body.theme-dark .drawer-overlay {
  background: rgba(2, 10, 19, .58);
}

body.theme-dark .drawer {
  background:
    radial-gradient(circle at top right, rgba(74, 200, 208, .14), transparent 34%),
    linear-gradient(180deg, rgba(21, 38, 56, .98), rgba(12, 25, 39, .98));
  border-color: rgba(143, 217, 224, .14);
  box-shadow: 0 28px 72px rgba(0, 8, 18, .45);
}

body.theme-dark .drawer-header {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .16), rgba(37, 99, 235, 0) 58%),
    linear-gradient(180deg, rgba(21, 39, 58, .96), rgba(14, 28, 44, .98));
}

body.theme-dark .drawer-overview,
body.theme-dark .detail-card {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(24, 43, 62, .92), rgba(16, 31, 47, .92)),
    rgba(15, 29, 45, .82);
  box-shadow: 0 18px 40px rgba(0, 8, 18, .28);
}
body.theme-dark .turno-patient-input {
  background: rgba(15, 23, 42, .78);
  border-color: rgba(148, 163, 184, .22);
  color: #e2e8f0;
  box-shadow: none;
}
body.theme-dark .turno-patient-input:focus {
  background: rgba(15, 23, 42, .94);
  border-color: rgba(56, 189, 248, .46);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .14);
}
body.theme-dark .turno-patient-editor-actions {
  border-top-color: rgba(148, 163, 184, .14);
}
body.theme-dark .turno-patient-edit-btn,
body.theme-dark .turno-patient-save-btn,
body.theme-dark .daction-info {
  background: rgba(59, 130, 246, .16);
  border-color: rgba(96, 165, 250, .24);
  color: #bfdbfe;
}
body.theme-dark .turno-patient-cancel-btn {
  background: rgba(15, 23, 42, .64);
  border-color: rgba(148, 163, 184, .20);
  color: #cbd5e1;
}

body.theme-dark .detail-summary-chip,
body.theme-dark .detail-card-note-pill {
  background: rgba(15, 29, 45, .74);
  border-color: rgba(143, 217, 224, .12);
  color: var(--n-700);
}

body.theme-dark .detail-summary-chip.is-akito {
  background: rgba(30, 64, 175, .24);
  border-color: rgba(96, 165, 250, .26);
  color: #bfdbfe;
}

body.theme-dark .detail-card-link {
  background: rgba(15, 118, 110, .16);
  border-color: rgba(74, 200, 208, .24);
  color: var(--teal-700);
}

body.theme-dark .detail-card-link:hover {
  background: rgba(15, 118, 110, .24);
  border-color: rgba(74, 200, 208, .32);
}

body.theme-dark .topbar,
body.theme-dark .statsbar {
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

body.theme-dark .topbar {
  background:
    linear-gradient(120deg, rgba(143, 217, 224, .08), rgba(143, 217, 224, 0) 32%),
    linear-gradient(180deg, rgba(18, 37, 58, .94), rgba(12, 25, 39, .98));
}

body.theme-dark .statsbar {
  background:
    linear-gradient(120deg, rgba(143, 217, 224, .06), rgba(143, 217, 224, 0) 28%),
    linear-gradient(180deg, rgba(17, 33, 51, .96), rgba(12, 24, 38, .98));
}

body.theme-dark .page-title,
body.theme-dark .topbar-brand,
body.theme-dark .drawer-patient,
body.theme-dark .reports-card-title,
body.theme-dark .patients-toolbar h3 {
  color: #f3fbff;
}

body.theme-dark .date-display,
body.theme-dark .today-btn,
body.theme-dark .statsbar-select,
body.theme-dark .search-wrap input,
body.theme-dark .field-input,
body.theme-dark .ov-open-btn,
body.theme-dark .clinical-history-source-chip,
body.theme-dark .toast-item,
body.theme-dark .settings-menu {
  background: rgba(15, 29, 45, .82);
  border-color: rgba(143, 217, 224, .14);
  color: var(--n-800);
}

body.theme-dark .profile-summary {
  border-color: rgba(126, 216, 225, .16);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, .10), rgba(59, 130, 246, .08)),
    rgba(13, 27, 45, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

body.theme-dark .profile-avatar {
  border-color: rgba(126, 216, 225, .18);
  background: linear-gradient(135deg, rgba(34, 211, 238, .30), rgba(96, 165, 250, .22));
  color: #f3fbff;
}

body.theme-dark .date-nav-btn,
body.theme-dark .mc-nav-btn,
body.theme-dark .drawer-close,
body.theme-dark .modal-close {
  color: var(--n-500);
}

body.theme-dark .drawer-close {
  background: rgba(15, 29, 45, .78);
  border: 1px solid rgba(143, 217, 224, .12);
}

body.theme-dark .date-nav-btn:hover,
body.theme-dark .mc-nav-btn:hover,
body.theme-dark .drawer-close:hover,
body.theme-dark .modal-close:hover,
body.theme-dark .today-btn:hover,
body.theme-dark .ov-open-btn:hover {
  background: rgba(143, 217, 224, .10);
  color: #f3fbff;
}

body.theme-dark .rp-block #mc-container {
  border-color: rgba(118, 170, 214, .18);
  background:
    radial-gradient(circle at top, rgba(98, 188, 197, .12), transparent 48%),
    linear-gradient(180deg, rgba(13, 24, 39, .96), rgba(9, 18, 31, .94));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 12px 28px rgba(2, 8, 18, .34);
}

body.theme-dark .date-display:hover,
body.theme-dark .statsbar-select:hover,
body.theme-dark .search-wrap input:focus,
body.theme-dark .field-input:focus {
  background: rgba(18, 38, 58, .94);
  border-color: rgba(143, 217, 224, .42);
  color: #f4fbff;
  box-shadow: 0 0 0 3px rgba(143, 217, 224, .14);
}

body.theme-dark .week-pills,
body.theme-dark .search-kbd,
body.theme-dark .flow-badge.is-scheduled,
body.theme-dark .flow-badge.is-blocked,
body.theme-dark .mc-day.mc-other,
body.theme-dark .field-input[readonly] {
  background: rgba(12, 24, 38, .72);
  color: var(--n-500);
}

body.theme-dark .week-pill:hover,
body.theme-dark .week-pill.active,
body.theme-dark .mc-day:hover,
body.theme-dark .qa-btn:hover,
body.theme-dark .settings-item:hover {
  background: rgba(143, 217, 224, .10);
  color: #f3fbff;
}

body.theme-dark .mc-nav-btn {
  background: rgba(15, 31, 49, .88);
  border-color: rgba(118, 170, 214, .18);
  box-shadow: 0 6px 14px rgba(2, 8, 18, .24);
}

body.theme-dark .mc-day {
  background: rgba(14, 28, 44, .70);
  color: #cfe2f3;
}

body.theme-dark .mc-day.mc-other {
  background: rgba(10, 21, 34, .86);
  color: #6f88a3;
}

body.theme-dark .mc-day:hover {
  border-color: rgba(143, 217, 224, .24);
  box-shadow: 0 10px 20px rgba(2, 8, 18, .28);
  transform: translateY(-2px) scale(1.03);
}

body.theme-dark .mc-day.mc-today {
  background: linear-gradient(180deg, rgba(31, 63, 104, .94), rgba(20, 45, 79, .90));
  border-color: rgba(143, 217, 224, .18);
  color: #f2f8ff;
}

body.theme-dark .mc-day.mc-selected {
  background: linear-gradient(180deg, #52b9c3, #3e9fa9);
  color: #08131d;
}

body.theme-dark .mc-day.mc-today.mc-selected {
  background: linear-gradient(180deg, #5a91d1, #3f74b4);
  color: #f4f9ff;
}

body.theme-dark .mc-day.mc-has-turns::after {
  box-shadow: 0 0 0 2px rgba(143, 217, 224, .16);
}

body.theme-dark .payment-state-chip.is-auto,
body.theme-dark .payment-state-chip.is-unset {
  background: rgba(30, 41, 59, .88);
  border-color: rgba(118, 170, 214, .18);
  color: #cbd5e1;
}

body.theme-dark .payment-state-chip.is-pending {
  background: rgba(133, 77, 14, .26);
  border-color: rgba(245, 158, 11, .24);
  color: #fde68a;
}

body.theme-dark .payment-state-chip.is-partial {
  background: rgba(30, 64, 175, .26);
  border-color: rgba(96, 165, 250, .24);
  color: #bfdbfe;
}

body.theme-dark .payment-state-chip.is-deposit {
  background: rgba(13, 148, 136, .24);
  border-color: rgba(45, 212, 191, .24);
  color: #99f6e4;
}

body.theme-dark .payment-state-chip.is-paid {
  background: rgba(21, 128, 61, .26);
  border-color: rgba(74, 222, 128, .22);
  color: #bbf7d0;
}

body.theme-dark .payment-state-chip.is-none {
  background: rgba(15, 23, 42, .88);
  border-color: rgba(100, 116, 139, .22);
  color: #94a3b8;
}

body.theme-dark .detail-card.detail-card-payment {
  border-color: rgba(45, 212, 191, .18);
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, .10), transparent 44%),
    linear-gradient(180deg, rgba(11, 28, 41, .98), rgba(8, 21, 34, .96));
  box-shadow: 0 10px 24px rgba(2, 8, 18, .28);
}

body.theme-dark .detail-card-payment .detail-card-head-copy h3 {
  color: #7dd3c8;
}

body.theme-dark .turno-payment-panel {
  border-color: rgba(45, 212, 191, .18);
  background:
    radial-gradient(circle at top right, rgba(45, 212, 191, .12), transparent 42%),
    linear-gradient(180deg, rgba(11, 28, 41, .98), rgba(8, 21, 34, .96));
  box-shadow: 0 18px 32px rgba(2, 8, 18, .26);
}

body.theme-dark .turno-payment-title,
body.theme-dark .turno-payment-stat-value {
  color: #f3fbff;
}

body.theme-dark .turno-payment-meta {
  color: #9db5c9;
}

body.theme-dark .turno-payment-stat {
  border-color: rgba(118, 170, 214, .16);
  background: rgba(10, 24, 38, .80);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

body.theme-dark .settings-item {
  color: var(--n-700);
}

body.theme-dark .settings-item.danger {
  color: #fda4af;
}

body.theme-dark .settings-item.danger:hover {
  background: rgba(190, 24, 93, .16);
  color: #fecdd3;
}

body.theme-dark .btn-ghost,
body.theme-dark .qa-btn,
body.theme-dark .patient-edit-btn,
body.theme-dark .daction-wait-off {
  background:
    linear-gradient(180deg, rgba(21, 39, 58, .98), rgba(15, 29, 45, .98));
  border-color: rgba(143, 217, 224, .14);
  color: var(--n-700);
  box-shadow: 0 10px 24px rgba(0, 8, 18, .22);
}

body.theme-dark .btn-ghost:hover,
body.theme-dark .patient-edit-btn:hover,
body.theme-dark .daction-wait-off:hover {
  border-color: rgba(143, 217, 224, .30);
  color: #f3fbff;
  background:
    linear-gradient(180deg, rgba(25, 46, 68, .98), rgba(16, 32, 49, .98));
}

body.theme-dark .patients-area {
  background:
    radial-gradient(circle at top left, rgba(143, 217, 224, .12), transparent 26%),
    radial-gradient(circle at top right, rgba(31, 64, 102, .20), transparent 30%),
    linear-gradient(180deg, rgba(9, 20, 31, .30), rgba(8, 18, 29, .16)),
    transparent;
}

body.theme-dark .patients-toolbar {
  background:
    linear-gradient(135deg, rgba(143, 217, 224, .10), rgba(143, 217, 224, 0) 46%),
    linear-gradient(180deg, rgba(21, 39, 58, .94), rgba(14, 28, 44, .98));
  border-bottom-color: rgba(143, 217, 224, .10);
}

body.theme-dark .patients-toolbar p,
body.theme-dark .drawer-time,
body.theme-dark .drawer-overview-kicker,
body.theme-dark .drawer-overview-meta,
body.theme-dark .detail-card-head-copy p,
body.theme-dark .detail-card-key,
body.theme-dark .detail-card-empty,
body.theme-dark .toast-msg,
body.theme-dark .reports-legend,
body.theme-dark .reports-kpi-lbl,
body.theme-dark .rep-bar-lbl {
  color: var(--n-500);
}

body.theme-dark .patients-table-wrap,
body.theme-dark .obras-table-wrap {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(22, 40, 58, .78), rgba(12, 25, 39, .72)),
    rgba(15, 28, 42, .72);
  box-shadow: 0 24px 54px rgba(0, 8, 18, .28);
}

body.theme-dark .patients-stat-card,
body.theme-dark .patients-empty-panel {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(22, 40, 58, .78), rgba(12, 25, 39, .72)),
    rgba(15, 28, 42, .72);
  box-shadow: 0 24px 54px rgba(0, 8, 18, .24);
}

body.theme-dark .patients-empty-panel strong,
body.theme-dark .patients-stat-value {
  color: #f3fbff;
}

body.theme-dark .patients-table thead th,
body.theme-dark .obras-table thead th,
body.theme-dark .agenda-table thead th,
body.theme-dark .reports-table thead th,
body.theme-dark .sala-table thead th {
  background: rgba(12, 24, 38, .88);
  color: var(--n-500);
  border-color: rgba(143, 217, 224, .08);
}

body.theme-dark .patients-table tbody td,
body.theme-dark .obras-table tbody td {
  color: var(--n-700);
  background:
    linear-gradient(180deg, rgba(24, 43, 62, .96), rgba(16, 32, 48, .96)),
    var(--white);
  border-top-color: rgba(143, 217, 224, .10);
  border-bottom-color: rgba(143, 217, 224, .10);
}

body.theme-dark .patients-table tbody td:first-child,
body.theme-dark .obras-table tbody td:first-child {
  border-left-color: rgba(143, 217, 224, .10);
}

body.theme-dark .patients-table tbody td:last-child,
body.theme-dark .obras-table tbody td:last-child {
  border-right-color: rgba(143, 217, 224, .10);
}

body.theme-dark .patients-table tbody tr:hover td,
body.theme-dark .obras-table tbody tr:hover td,
body.theme-dark .obras-table tbody tr:focus-within td {
  border-color: rgba(143, 217, 224, .26);
  box-shadow: none;
}

body.theme-dark .patients-table .p-name,
body.theme-dark .pac-name,
body.theme-dark .profile-summary-name,
body.theme-dark .profile-password-block h4,
body.theme-dark .modal-head-text h2,
body.theme-dark .clinical-history-head-copy h2,
body.theme-dark .clinical-history-item-title,
body.theme-dark .reports-kpi-val,
body.theme-dark .detail-val,
body.theme-dark .drawer-overview-time,
body.theme-dark .detail-card-head-copy h3,
body.theme-dark .detail-card-value {
  color: #f3fbff;
}

body.theme-dark .patients-table .p-muted,
body.theme-dark .patient-value-chip.is-social,
body.theme-dark .patient-source-badge.is-local {
  background: rgba(59, 130, 246, .14);
  border-color: rgba(96, 165, 250, .22);
  color: #bfdbfe;
}

body.theme-dark .patient-chip,
body.theme-dark .patient-value-chip,
body.theme-dark .clinical-history-summary-chip,
body.theme-dark .patient-readonly-banner,
body.theme-dark .ov-next-empty {
  background: rgba(15, 29, 45, .74);
  border-color: rgba(143, 217, 224, .12);
  color: var(--n-700);
}

body.theme-dark .patient-chip.is-highlight,
body.theme-dark .patient-source-badge,
body.theme-dark .patient-history-btn,
body.theme-dark .patient-edit-btn.is-readonly,
body.theme-dark .detail-card-link {
  background: rgba(15, 118, 110, .16);
  border-color: rgba(74, 200, 208, .24);
  color: var(--teal-700);
}

body.theme-dark .detail-copy-btn {
  background: rgba(15, 23, 42, .62);
  border-color: rgba(143, 217, 224, .14);
  color: #94a3b8;
  box-shadow: none;
}

body.theme-dark .detail-copy-btn.is-compact {
  background: rgba(15, 118, 110, .16);
  border-color: rgba(74, 200, 208, .24);
  color: var(--teal-700);
}

body.theme-dark .detail-copy-btn:hover {
  background: rgba(30, 41, 59, .88);
  border-color: rgba(148, 163, 184, .24);
  color: #e2e8f0;
}

body.theme-dark .detail-copy-btn.is-compact:hover {
  background: rgba(15, 118, 110, .24);
  border-color: rgba(74, 200, 208, .32);
  color: #ccfbf1;
}

body.theme-dark .detail-copy-btn[data-copied="1"] {
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .34);
  color: #86efac;
}

body.theme-dark .drawer-patient .drawer-patient-copy.detail-copy-btn.is-icon-only {
  background: rgba(15, 23, 42, .74);
  border-color: rgba(74, 200, 208, .22);
  color: #bfdbfe;
  box-shadow: none;
}

body.theme-dark .agenda-table tbody tr,
body.theme-dark .reports-table tbody td,
body.theme-dark .sala-table tbody td,
body.theme-dark .detail-row,
body.theme-dark .drawer-header,
body.theme-dark .drawer-actions,
body.theme-dark .modal-head,
body.theme-dark .profile-actions,
body.theme-dark .profile-password-block,
body.theme-dark .clinical-history-details {
  border-color: rgba(143, 217, 224, .10);
}

body.theme-dark .agenda-table tbody tr:hover {
  background: rgba(143, 217, 224, .05);
}

body.theme-dark .agenda-table tbody tr.row-selected {
  background: rgba(143, 217, 224, .12) !important;
}

body.theme-dark .agenda-cell-segment:not(.is-last) {
  border-right-color: rgba(143, 217, 224, .10);
}

body.theme-dark .agenda-cell-segment-inner {
  background: rgba(16, 31, 47, .72);
}

body.theme-dark .agenda-cell-segment.is-standard .agenda-cell-segment-inner {
  background: linear-gradient(180deg, rgba(18, 39, 59, .92), rgba(15, 29, 45, .88));
}

body.theme-dark .agenda-cell-segment.is-overbook .agenda-cell-segment-inner,
body.theme-dark .overbook-chip,
body.theme-dark .row-overbook-btn {
  background: rgba(126, 34, 206, .16);
  border-color: rgba(192, 132, 252, .28);
  color: #e9d5ff;
}

body.theme-dark .schedule-mismatch-chip {
  background: rgba(194, 65, 12, .18);
  border-color: rgba(251, 191, 36, .24);
  color: #fdba74;
}

body.theme-dark .flow-badge.is-waiting,
body.theme-dark .flow-badge.is-studies,
body.theme-dark .daction-wait-on,
body.theme-dark .daction-studies-on,
body.theme-dark .ov-studies-action {
  background: rgba(194, 65, 12, .16);
  border-color: rgba(251, 191, 36, .22);
  color: #fdba74;
}

body.theme-dark .flow-badge.is-ready,
body.theme-dark .daction-ready-on {
  background: rgba(8, 145, 178, .16);
  border-color: rgba(34, 211, 238, .22);
  color: #67e8f9;
}

body.theme-dark .flow-badge.is-in-attention,
body.theme-dark .flow-badge.is-attended,
body.theme-dark .daction-confirm,
body.theme-dark .daction-in-attention,
body.theme-dark .daction-attended,
body.theme-dark .daction-attended-action,
body.theme-dark .daction-wa {
  background: rgba(22, 163, 74, .16);
  border-color: rgba(74, 222, 128, .24);
  color: #86efac;
}

body.theme-dark .flow-badge.is-absent,
body.theme-dark .daction-cancel,
body.theme-dark .clinical-history-empty.is-error {
  background: rgba(190, 24, 93, .16);
  border-color: rgba(244, 114, 182, .20);
  color: #f9a8d4;
}

body.theme-dark .flow-badge.is-confirmed {
  background: rgba(37, 99, 235, .16);
  border-color: rgba(96, 165, 250, .20);
  color: #93c5fd;
}

body.theme-dark .agenda-table tbody tr.row-outside-schedule {
  background:
    linear-gradient(90deg, rgba(251, 191, 36, .12), transparent 18%);
}
body.theme-dark .agenda-table tbody tr.row-outside-schedule:hover {
  background:
    linear-gradient(90deg, rgba(251, 191, 36, .18), transparent 22%),
    rgba(98,188,197,.08);
}

body.theme-dark .blocked-name,
body.theme-dark .hora-text.hora-bold,
body.theme-dark .mc-day.mc-today,
body.theme-dark .confirm-center h2,
body.theme-dark .toast-title {
  color: #f3fbff;
}

body.theme-dark .blocked-note,
body.theme-dark .cell-tel-text,
body.theme-dark .cell-os-text,
body.theme-dark .cell-prest-text,
body.theme-dark .cell-obs-text,
body.theme-dark .cell-op-text,
body.theme-dark .cell-conf-text,
body.theme-dark .detail-key,
body.theme-dark .confirm-center p,
body.theme-dark .clinical-history-item-meta,
body.theme-dark .clinical-history-detail-key,
body.theme-dark .clinical-history-detail-value,
body.theme-dark .clinical-history-head-copy p,
body.theme-dark .patient-readonly-text,
body.theme-dark .profile-summary-role {
  color: var(--n-500);
}

body.theme-dark .cell-obs-text:not(.is-empty) {
  background: rgba(15, 23, 42, .42);
  border-color: rgba(148, 163, 184, .24);
}

body.theme-dark .detail-card-value a {
  color: #93c5fd;
}

body.theme-dark .modal-clinical-history {
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .10), transparent 24%),
    radial-gradient(circle at top left, rgba(24, 70, 112, .18), transparent 28%),
    linear-gradient(180deg, rgba(20, 38, 56, .98), rgba(12, 25, 39, .99));
  border: 1px solid rgba(143, 217, 224, .12);
  box-shadow:
    0 36px 72px rgba(0, 6, 16, .48),
    inset 0 1px 0 rgba(255,255,255,.04);
}

body.theme-dark .modal-clinical-history .modal-inner {
  padding: 32px 32px 26px;
}

body.theme-dark .clinical-history-head {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(143, 217, 224, .10);
}

body.theme-dark .clinical-history-head-copy p {
  color: #9bb1c5;
}

body.theme-dark .clinical-history-close {
  background: rgba(15, 29, 45, .84);
  border-color: rgba(143, 217, 224, .12);
  color: #9bb1c5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

body.theme-dark .clinical-history-close:hover {
  background: rgba(22, 43, 65, .94);
  border-color: rgba(143, 217, 224, .24);
  color: #f3fbff;
}

body.theme-dark .clinical-history-summary {
  gap: 10px;
  margin-bottom: 18px;
}

body.theme-dark .clinical-history-summary-chip {
  background:
    linear-gradient(135deg, rgba(18, 58, 76, .84), rgba(17, 35, 56, .84));
  border-color: rgba(143, 217, 224, .16);
  color: #d7f6f8;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 10px 22px rgba(0, 8, 18, .16);
}

body.theme-dark .clinical-history-stats {
  gap: 8px;
  margin-bottom: 10px;
}

body.theme-dark .clinical-history-stat {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-color: rgba(143, 217, 224, .12);
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .14), transparent 42%),
    linear-gradient(180deg, rgba(24, 44, 64, .98), rgba(16, 32, 48, .98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 16px 32px rgba(0, 8, 18, .24);
}

body.theme-dark .clinical-history-stat-label {
  color: #8ea6ba;
}

body.theme-dark .clinical-history-stat-value {
  color: #f3fbff;
  text-shadow: 0 0 18px rgba(143, 217, 224, .08);
}

body.theme-dark .clinical-history-timeline {
  gap: 8px;
}

body.theme-dark .clinical-history-item {
  position: relative;
  border-color: rgba(143, 217, 224, .12);
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .05), transparent 28%),
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.03),
    0 18px 36px rgba(0, 8, 18, .24);
}

body.theme-dark .clinical-history-item:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 217, 224, .24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 22px 42px rgba(0, 8, 18, .28);
}

body.theme-dark .clinical-history-item-meta {
  color: #8ea6ba;
}

body.theme-dark .clinical-history-item-date {
  background: rgba(48, 179, 202, 0.08);
  border-color: rgba(103, 232, 249, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

body.theme-dark .clinical-history-item-date span {
  color: #92e2e8;
}

body.theme-dark .clinical-history-item-date strong {
  color: #f3fbff;
}

body.theme-dark .clinical-history-item-date em {
  color: #8ea6ba;
}

body.theme-dark .clinical-history-item-compact-meta span {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(140, 175, 208, 0.13);
  color: #8ea6ba;
}

body.theme-dark .clinical-history-item.is-sparse {
  background: linear-gradient(180deg, rgba(23, 42, 61, .82), rgba(15, 30, 46, .82));
}

body.theme-dark .clinical-history-source-chip {
  background:
    linear-gradient(135deg, rgba(71, 85, 105, .82), rgba(51, 65, 85, .88));
  border: 1px solid rgba(148, 163, 184, .12);
  color: #eef4fb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

body.theme-dark .clinical-history-item-body {
  color: #d6e1ed;
}

body.theme-dark .clinical-history-details {
  margin-top: 6px;
  padding-top: 6px;
  border-top-color: rgba(143, 217, 224, .10);
}

body.theme-dark .clinical-history-details summary {
  color: #92e2e8;
}

body.theme-dark .clinical-history-detail-grid {
  gap: 5px;
  margin-top: 6px;
}

body.theme-dark .clinical-history-detail-row {
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid rgba(143, 217, 224, .08);
  background: rgba(12, 24, 38, .50);
}

body.theme-dark .clinical-history-detail-key {
  color: #87a0b5;
}

body.theme-dark .clinical-history-detail-value {
  color: #deebf5;
}

body.theme-dark .clinical-structured-section {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(18, 37, 55, .92), rgba(13, 27, 41, .92));
}

body.theme-dark .clinical-structured-section-head strong {
  color: #f3fbff;
}

body.theme-dark .clinical-structured-section-head span {
  background: rgba(45, 212, 191, .14);
  color: #9ff4e8;
}

body.theme-dark .clinical-structured-compact-grid div {
  border-color: rgba(143, 217, 224, .10);
  background: rgba(12, 24, 38, .58);
}

body.theme-dark .clinical-structured-compact-grid dt {
  color: #87a0b5;
}

body.theme-dark .clinical-structured-compact-grid dd {
  color: #f3fbff;
}

body.theme-dark .clinical-structured-subsection {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(12, 24, 38, .50);
}

body.theme-dark .clinical-structured-subtitle,
body.theme-dark .clinical-eye-table-row > strong,
body.theme-dark .clinical-structured-mini-grid dd {
  color: #f3fbff;
}

body.theme-dark .clinical-eye-table-row > span,
body.theme-dark .clinical-eye-table-row > strong,
body.theme-dark .clinical-structured-mini-grid div {
  border-color: rgba(143, 217, 224, .10);
  background: rgba(12, 24, 38, .58);
}

body.theme-dark .clinical-eye-table-row > span:first-child,
body.theme-dark .clinical-eye-table-row.is-head > span,
body.theme-dark .clinical-structured-mini-grid dt {
  color: #87a0b5;
}

body.theme-dark .clinical-history-empty {
  border-color: rgba(143, 217, 224, .14);
  background:
    linear-gradient(180deg, rgba(18, 37, 55, .96), rgba(13, 27, 41, .96));
  color: #9fb3c6;
}

body.theme-dark .modal-clinical-history .modal-foot {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(143, 217, 224, .10);
}

body.theme-dark .clinical-history-toolbar {
  background:
    radial-gradient(circle at top right, rgba(36, 107, 137, .18), transparent 36%),
    linear-gradient(180deg, rgba(15, 28, 47, .86), rgba(11, 22, 37, .84));
  border-color: rgba(143, 217, 224, .12);
  box-shadow: 0 24px 44px rgba(0, 0, 0, .18);
}

body.theme-dark .clinical-history-pane {
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .08), transparent 32%),
    linear-gradient(180deg, rgba(17, 33, 51, .92), rgba(11, 23, 38, .92));
  border-color: rgba(143, 217, 224, .12);
}

body.theme-dark .clinical-history-pane-head {
  border-color: rgba(143, 217, 224, .10);
}

body.theme-dark .clinical-history-pane-head span {
  color: #8ea6ba;
}

body.theme-dark .clinical-history-pane-head strong {
  color: #f3fbff;
}

body.theme-dark .clinical-history-item::before {
  background: linear-gradient(180deg, rgba(103, 232, 249, .82), rgba(45, 212, 191, .82));
}

body.theme-dark .clinical-editor-guide-card,
body.theme-dark .clinical-editor-panel,
body.theme-dark .clinical-editor-callout,
body.theme-dark .clinical-table-wrap {
  border-color: rgba(143, 217, 224, .12);
  box-shadow: 0 24px 42px rgba(0, 0, 0, .18);
}

body.theme-dark .clinical-editor-guide-card {
  background: linear-gradient(180deg, rgba(14, 28, 46, .92), rgba(10, 20, 34, .88));
}

body.theme-dark .clinical-editor-guide-card.is-share,
body.theme-dark .clinical-editor-callout.is-share {
  border-color: rgba(74, 222, 128, .18);
  background: linear-gradient(180deg, rgba(15, 52, 46, .88), rgba(9, 29, 27, .84));
}

body.theme-dark .clinical-editor-guide-card strong,
body.theme-dark .clinical-editor-panel-title,
body.theme-dark .clinical-form-field-label {
  color: #f3fbff;
}

body.theme-dark .clinical-editor-guide-card span,
body.theme-dark .clinical-editor-panel-kicker,
body.theme-dark .clinical-editor-panel-copy,
body.theme-dark .clinical-editor-callout span,
body.theme-dark .clinical-form-field-hint {
  color: #9bb1c5;
}

body.theme-dark .clinical-editor-callout strong {
  color: #d9fbff;
}

body.theme-dark .clinical-editor-panel {
  background: linear-gradient(180deg, rgba(13, 25, 43, .94), rgba(9, 18, 32, .92));
}

body.theme-dark .clinical-editor-panel[open] .clinical-editor-panel-summary {
  background: rgba(255, 255, 255, .02);
  border-bottom-color: rgba(143, 217, 224, .10);
}

body.theme-dark .clinical-editor-panel-pill,
body.theme-dark .clinical-form-field-badge {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
  color: #c1d2e1;
}

body.theme-dark .clinical-editor-panel-pill.is-filled {
  background: rgba(56, 189, 248, .10);
  border-color: rgba(56, 189, 248, .18);
  color: #b9ecf7;
}

body.theme-dark .clinical-editor-panel-pill.is-muted {
  background: rgba(148, 163, 184, .10);
  border-color: rgba(148, 163, 184, .16);
  color: #9bb1c5;
}

body.theme-dark .clinical-editor-panel-pill.is-accent {
  background: rgba(45, 212, 191, .10);
  border-color: rgba(45, 212, 191, .18);
  color: #b5f3e7;
}

body.theme-dark .clinical-editor-panel-pill.is-share,
body.theme-dark .clinical-form-field-badge.is-share,
body.theme-dark .clinical-form-field-hint.is-share {
  background: rgba(74, 222, 128, .10);
  border-color: rgba(74, 222, 128, .18);
  color: #b7f7c7;
}

body.theme-dark .clinical-editor-panel-chevron {
  border-right-color: #9bb1c5;
  border-bottom-color: #9bb1c5;
}

body.theme-dark .clinical-form-card {
  background: rgba(12, 23, 42, .88);
  border-color: rgba(143, 217, 224, .10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

body.theme-dark .clinical-form-card.soft {
  background: rgba(15, 28, 47, .66);
}

body.theme-dark .clinical-form-input {
  background: rgba(18, 31, 53, .90);
  border-color: rgba(143, 217, 224, .12);
  color: #f3fbff;
}

body.theme-dark .clinical-form-input:focus {
  border-color: rgba(56, 189, 248, .36);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .10);
  background: rgba(20, 35, 58, .94);
}

body.theme-dark .clinical-av-combobox-menu {
  border-color: rgba(125, 211, 252, 0.22);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 42%),
    rgba(11, 22, 37, 0.98);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.30);
}

body.theme-dark .clinical-av-combobox-option {
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(255, 255, 255, 0.05);
  color: #bbd0df;
}

body.theme-dark .clinical-av-combobox-option:hover,
body.theme-dark .clinical-av-combobox-option:focus-visible {
  border-color: rgba(56, 189, 248, 0.48);
  background: rgba(56, 189, 248, 0.14);
  color: #f3fbff;
}

body.theme-dark .clinical-table-wrap {
  background: rgba(255, 255, 255, .02);
}

.clinical-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.10), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 254, 0.96));
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.06);
}

.clinical-history-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clinical-history-toolbar-copy strong {
  font-size: 13px;
  color: var(--text-1, #1e3040);
}

.clinical-history-toolbar-copy span,
.clinical-form-card-copy,
.clinical-form-subtitle,
.clinical-form-mini-title {
  color: var(--text-3, #607b93);
}

.clinical-history-toolbar-actions,
.clinical-editor-actions,
.clinical-editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clinical-history-action-btn {
  --clinical-action-bg: rgba(255, 255, 255, 0.96);
  --clinical-action-border: rgba(0, 53, 87, 0.16);
  --clinical-action-color: #12334b;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--clinical-action-border);
  border-radius: 14px;
  background: var(--clinical-action-bg);
  color: var(--clinical-action-color);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(25, 88, 128, 0.10);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.clinical-history-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.30);
  box-shadow: 0 16px 30px rgba(25, 88, 128, 0.14);
}

.clinical-history-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(25, 88, 128, 0.10);
}

.clinical-history-action-btn:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.28);
  outline-offset: 2px;
}

.clinical-history-action-btn.is-primary {
  --clinical-action-bg: linear-gradient(135deg, #2563eb, #22c7d7);
  --clinical-action-border: rgba(37, 99, 235, 0.22);
  --clinical-action-color: #ffffff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.clinical-history-action-btn.is-secondary {
  --clinical-action-bg: rgba(255, 255, 255, 0.96);
  --clinical-action-border: rgba(0, 53, 87, 0.16);
  --clinical-action-color: #12334b;
}

.clinical-history-action-btn.is-subtle {
  --clinical-action-bg: rgba(255, 255, 255, 0.74);
  --clinical-action-border: rgba(0, 53, 87, 0.12);
  --clinical-action-color: #48667c;
  box-shadow: none;
}

.clinical-history-action-btn.is-subtle:hover {
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(25, 88, 128, 0.08);
}

.clinical-history-action-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.clinical-history-action-btn.is-secondary .clinical-history-action-mark {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.clinical-history-action-btn.is-subtle .clinical-history-action-mark {
  background: rgba(72, 102, 124, 0.10);
  color: #48667c;
}

.clinical-history-action-mark.is-pdf {
  width: auto;
  min-width: 28px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.clinical-history-edit-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 54px;
  padding: 0 8px;
  border: 1px solid rgba(37, 99, 235, 0.30);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), rgba(14, 165, 233, 0.07));
  color: #1d4ed8;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.clinical-history-edit-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.46);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.10));
  color: #1e3a8a;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.16);
}

.clinical-history-edit-btn:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.28);
  outline-offset: 2px;
}

.clinical-history-item-pdf-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(72, 102, 124, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #607b93;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.clinical-history-item-pdf-btn:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(239, 246, 255, 0.86);
  color: #2563eb;
}

.clinical-history-item-pdf-btn:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.22);
  outline-offset: 2px;
}

.clinical-editor-actions {
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.clinical-editor-action-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.clinical-editor-action-btn.is-secondary {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 53, 87, 0.16);
  color: #36566f;
  box-shadow: 0 6px 16px rgba(25, 88, 128, 0.08);
}

.clinical-editor-action-btn.is-secondary:hover {
  background: #ffffff;
  border-color: rgba(0, 86, 122, 0.30);
  color: #0d1b26;
  box-shadow: 0 10px 22px rgba(25, 88, 128, 0.12);
}

.clinical-editor-action-btn.is-primary {
  min-width: 150px;
  justify-content: center;
  border-color: rgba(14, 165, 233, 0.34);
  background: linear-gradient(135deg, #0ea5e9, #7dd3fc);
  color: #052033;
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.24);
}

.clinical-editor-action-btn.is-primary:hover {
  border-color: rgba(2, 132, 199, 0.45);
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 16px 34px rgba(14, 165, 233, 0.30);
  transform: translateY(-1px);
}

.clinical-history-editor.hidden {
  display: none;
}

.clinical-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.clinical-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.clinical-editor-head h4 {
  margin: 0 0 4px;
  font-size: 19px;
}

.clinical-editor-head p {
  margin: 0;
  color: var(--text-3, #607b93);
  font-size: 12px;
}

.clinical-editor-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.clinical-editor-guide-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.96));
}

.clinical-editor-guide-card strong {
  font-size: 13px;
  color: var(--text-1, #1e3040);
}

.clinical-editor-guide-card span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3, #607b93);
}

.clinical-editor-guide-card.is-share {
  border-color: rgba(22, 163, 74, 0.16);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 42%),
    linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(236, 253, 245, 0.94));
}

.clinical-editor-panel {
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 254, 0.97));
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.clinical-editor-panel.is-accent {
  border-color: rgba(8, 145, 178, 0.16);
}

.clinical-editor-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.clinical-editor-panel-summary::-webkit-details-marker {
  display: none;
}

.clinical-editor-panel-summary::marker {
  content: "";
}

.clinical-editor-panel-summary:focus-visible {
  outline: 2px solid rgba(8, 145, 178, 0.28);
  outline-offset: -2px;
}

.clinical-editor-panel[open] .clinical-editor-panel-summary {
  border-bottom: 1px solid rgba(0, 53, 87, 0.10);
  background: rgba(242, 248, 254, 0.86);
}

.clinical-editor-panel-head {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clinical-editor-panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3, #607b93);
}

.clinical-editor-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1, #1e3040);
}

.clinical-editor-panel-copy {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3, #607b93);
}

.clinical-editor-panel-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.clinical-editor-panel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 53, 87, 0.12);
  border-radius: 999px;
  background: rgba(240, 247, 254, 0.96);
  color: #36516a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.clinical-editor-panel-pill.is-filled {
  background: rgba(223, 242, 255, 0.96);
  border-color: rgba(8, 145, 178, 0.18);
  color: #0f5c70;
}

.clinical-editor-panel-pill.is-muted {
  background: rgba(244, 247, 250, 0.96);
  border-color: rgba(0, 53, 87, 0.10);
  color: #6c8498;
}

.clinical-editor-panel-pill.is-accent {
  background: rgba(223, 242, 255, 0.96);
  border-color: rgba(8, 145, 178, 0.18);
  color: #0f5c70;
}

.clinical-editor-panel-pill.is-share {
  background: rgba(236, 253, 245, 0.96);
  border-color: rgba(22, 163, 74, 0.16);
  color: #166534;
}

.clinical-editor-panel-chevron {
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border-right: 2px solid #5a7e98;
  border-bottom: 2px solid #5a7e98;
  transform: rotate(45deg);
  transition: transform 0.18s ease, margin 0.18s ease;
}

.clinical-editor-panel[open] .clinical-editor-panel-chevron {
  transform: rotate(-135deg);
  margin-top: 6px;
}

.clinical-editor-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
}

.clinical-editor-callout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 16px;
  background: rgba(244, 248, 252, 0.88);
}

.clinical-editor-callout strong {
  font-size: 12px;
  color: #104b5f;
}

.clinical-editor-callout span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3, #607b93);
}

.clinical-editor-callout.is-share {
  border-color: rgba(22, 163, 74, 0.16);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 42%),
    linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(236, 253, 245, 0.94));
}

.clinical-form-card {
  padding: 16px;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.clinical-form-card.soft {
  background: rgba(245, 249, 252, 0.9);
}

.clinical-menu1-description-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clinical-form-disclosure {
  padding: 0;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.clinical-form-disclosure:hover {
  border-color: rgba(8, 145, 178, 0.24);
  box-shadow: 0 12px 28px rgba(25, 88, 128, 0.10);
}

.clinical-form-disclosure[open] {
  border-color: rgba(8, 145, 178, 0.30);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(25, 88, 128, 0.12);
}

.clinical-form-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
  transition: background 0.18s ease;
}

.clinical-form-disclosure-summary::-webkit-details-marker {
  display: none;
}

.clinical-form-disclosure-summary::marker {
  content: "";
}

.clinical-form-disclosure-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-1, #1e3040);
}

.clinical-form-disclosure-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-3, #607b93);
  border-bottom: 2px solid var(--text-3, #607b93);
  transform: rotate(45deg);
  transition: transform 0.18s ease, margin 0.18s ease;
}

.clinical-form-disclosure[open] .clinical-form-disclosure-chevron {
  margin-top: 5px;
  transform: rotate(-135deg);
}

.clinical-form-disclosure[open] .clinical-form-disclosure-summary {
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.74), rgba(255, 255, 255, 0.72));
}

.clinical-form-disclosure-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
}

.clinical-form-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.clinical-form-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1, #1e3040);
}

.clinical-form-card-copy {
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 12px;
}

.clinical-form-subsection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clinical-form-subtitle {
  font-size: 13px;
  font-weight: 700;
}

.clinical-form-mini-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}

.clinical-form-grid {
  display: grid;
  gap: 12px;
}

.clinical-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinical-form-grid.diagnosis {
  grid-template-columns: 180px minmax(0, 1fr);
}

.clinical-form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clinical-menu1-stack {
  padding-top: 14px;
}

.clinical-menu2-stack {
  gap: 14px;
  padding-top: 8px;
}

.clinical-menu2-stack .clinical-form-grid.two {
  align-items: flex-start;
}

.clinical-attachment-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clinical-attachment-study {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.clinical-attachment-input {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  overflow: hidden;
  border: 1px dashed rgba(8, 145, 178, 0.22);
  border-radius: 14px;
  background: rgba(224, 242, 254, 0.38);
  color: var(--text-2, #41576d);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.clinical-attachment-input:hover {
  border-color: rgba(8, 145, 178, 0.42);
  background: rgba(224, 242, 254, 0.62);
  color: var(--text-1, #0d1b26);
}

.clinical-attachment-input:has(input:focus-visible) {
  border-color: rgba(8, 145, 178, 0.56);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.clinical-attachment-input:has(input:disabled) {
  cursor: not-allowed;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-3, #607b93);
}

.clinical-attachment-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.clinical-attachment-input input:disabled {
  cursor: not-allowed;
}

.clinical-attachment-input-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(8, 145, 178, 0.20);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #0891b2;
}

.clinical-attachment-input-icon svg {
  width: 21px;
  height: 21px;
}

.clinical-attachment-input-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.clinical-attachment-input-title {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-1, #0d1b26);
}

.clinical-attachment-input-hint {
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3, #607b93);
}

.clinical-attachment-input-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(8, 145, 178, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-1, #0d1b26);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.clinical-attachment-input:has(input:disabled) .clinical-attachment-input-icon,
.clinical-attachment-input:has(input:disabled) .clinical-attachment-input-action {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-3, #607b93);
}

.clinical-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.clinical-attachment-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
}

.clinical-attachment-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(226, 232, 240, 0.70);
}

.clinical-attachment-thumb.is-file {
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  color: #9f1239;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.13), rgba(248, 250, 252, 0.96));
}

.clinical-attachment-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
}

.clinical-attachment-copy strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  color: var(--text-1, #0d1b26);
}

.clinical-attachment-copy span,
.clinical-attachment-empty {
  font-size: 11px;
  color: var(--text-3, #607b93);
}

.clinical-attachment-empty {
  padding: 12px;
  border: 1px solid var(--line, #d7e1ea);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.clinical-attachment-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.clinical-form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.clinical-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clinical-form-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.clinical-form-field-label {
  font-size: 12px;
  color: var(--text-2, #41576d);
  font-weight: 700;
}

.clinical-form-field-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 53, 87, 0.12);
  background: rgba(240, 247, 254, 0.96);
  color: #36516a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.clinical-form-field-badge.is-share {
  border-color: rgba(22, 163, 74, 0.16);
  background: rgba(236, 253, 245, 0.96);
  color: #166534;
}

.clinical-form-field-hint {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-3, #607b93);
}

.clinical-form-field-hint.is-share {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(22, 163, 74, 0.16);
  background: rgba(236, 253, 245, 0.96);
  color: #166534;
}

.clinical-form-input {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--line, #d7e1ea);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-1, #1e3040);
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.clinical-form-input:focus {
  outline: none;
  border-color: rgba(0, 145, 178, 0.45);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.10);
  background: #fff;
}

.clinical-av-combobox-field {
  position: relative;
  min-width: 0;
}

.clinical-av-combobox {
  position: relative;
  min-width: 0;
}

.clinical-av-combobox-input {
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.clinical-av-combobox-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: max(100%, 304px);
  max-width: min(360px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 7px;
  max-height: 268px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  border: 1px solid rgba(0, 53, 87, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.clinical-av-combobox:focus-within .clinical-av-combobox-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.clinical-form-pair .clinical-av-combobox-field:nth-child(2) .clinical-av-combobox-menu,
.clinical-quick-row.four .clinical-av-combobox-field:nth-child(3) .clinical-av-combobox-menu,
.clinical-quick-row.four .clinical-av-combobox-field:nth-child(4) .clinical-av-combobox-menu {
  left: auto;
  right: 0;
}

.clinical-av-combobox-option {
  appearance: none;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 53, 87, 0.12);
  border-radius: 11px;
  background: rgba(240, 247, 254, 0.82);
  color: #24465f;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.clinical-av-combobox-option:hover,
.clinical-av-combobox-option:focus-visible {
  border-color: rgba(0, 119, 182, 0.28);
  background: rgba(224, 242, 254, 0.96);
  color: #003557;
  outline: none;
  transform: translateY(-1px);
}

.clinical-av-combobox-option.is-long {
  grid-column: 1 / -1;
}

.clinical-form-input.is-textarea,
.clinical-form-input.is-table-textarea {
  min-height: 78px;
  resize: vertical;
}

.clinical-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0, 53, 87, 0.12);
  border-radius: 16px;
  background: rgba(250, 252, 255, 0.92);
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.clinical-table th,
.clinical-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: top;
}

.clinical-table th {
  text-align: left;
  font-size: 11px;
  color: var(--text-3, #607b93);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clinical-table-actions {
  width: 1%;
  white-space: nowrap;
}

.clinical-paq-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.78);
}

.clinical-paq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clinical-paq-eye {
  color: #17324a;
  font-size: 12px;
  font-weight: 900;
}

.clinical-paq-caption {
  color: #6d879d;
  font-size: 10px;
  font-weight: 800;
}

.clinical-paq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.clinical-paq-input {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  text-align: center;
  font-weight: 800;
}

.clinical-history-detail-value-wrap {
  display: block;
  flex: 1;
}

.clinical-history-detail-grid.is-nested {
  display: grid;
  gap: 8px;
}

.clinical-history-detail-block {
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
}

.clinical-history-nested-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clinical-history-nested-card {
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
}

.clinical-history-nested-card-title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2, #41576d);
}

.clinical-history-audit-disclosure {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.clinical-history-audit-disclosure summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--blue-900);
  cursor: pointer;
  list-style: none;
}

.clinical-history-audit-disclosure summary::-webkit-details-marker {
  display: none;
}

.clinical-history-audit-disclosure summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #0284c7;
  border-bottom: 2px solid #0284c7;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.clinical-history-audit-disclosure[open] summary::before {
  transform: rotate(45deg);
}

.clinical-history-audit-disclosure summary span {
  font-size: 12px;
  font-weight: 850;
}

.clinical-history-audit-disclosure summary strong {
  margin-left: auto;
  color: #6d879d;
  font-size: 11px;
  font-weight: 800;
}

.clinical-history-audit-detail-list {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.clinical-history-audit-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.96), rgba(255, 255, 255, 0.94));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.clinical-history-audit-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.clinical-history-audit-detail-head strong {
  display: block;
  margin-top: 2px;
  color: var(--blue-900);
  font-size: 13.5px;
  font-weight: 850;
}

.clinical-history-audit-detail-kicker,
.clinical-history-audit-fields-label,
.clinical-history-audit-mini span {
  display: block;
  color: #6d879d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.55px;
  line-height: 1.15;
  text-transform: uppercase;
}

.clinical-history-audit-date {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.9);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.clinical-history-audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.clinical-history-audit-mini {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
}

.clinical-history-audit-mini.is-wide {
  grid-column: 1 / -1;
}

.clinical-history-audit-mini strong {
  display: block;
  margin-top: 4px;
  color: #29435a;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.35;
  word-break: break-word;
}

.clinical-history-audit-fields {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.clinical-history-audit-field-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.clinical-history-audit-field-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 999px;
  background: rgba(236, 253, 245, 0.82);
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 860px) {
  .modal-clinical-history.has-editor-active {
    height: auto;
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }

  .modal-clinical-history.has-editor-active .clinical-history-workspace {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .modal-clinical-history.has-editor-active .clinical-history-pane,
  .modal-clinical-history.has-editor-active .clinical-history-pane-body {
    overflow: visible;
  }

  .clinical-editor-guide {
    grid-template-columns: 1fr;
  }

  .clinical-history-toolbar,
  .clinical-editor-head,
  .clinical-editor-panel-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .clinical-form-grid.two,
  .clinical-form-pair,
  .clinical-form-grid.diagnosis {
    grid-template-columns: 1fr;
  }

  .clinical-history-audit-detail-head {
    flex-direction: column;
  }

  .clinical-history-audit-detail-grid {
    grid-template-columns: 1fr;
  }

  .clinical-attachment-input {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .clinical-attachment-input-action {
    grid-column: 2;
    justify-self: start;
  }

  .clinical-editor-panel-body {
    padding: 0 16px 16px;
  }
}

body.theme-dark .clinical-history-audit-detail-card {
  border-color: rgba(143, 217, 224, .14);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, .10), transparent 34%),
    linear-gradient(145deg, rgba(18, 37, 55, .94), rgba(13, 27, 41, .94));
  box-shadow: 0 12px 28px rgba(0, 8, 18, .22);
}

body.theme-dark .clinical-history-audit-disclosure {
  background: rgba(12, 24, 38, .54);
}

body.theme-dark .clinical-history-audit-detail-head strong,
body.theme-dark .clinical-history-audit-mini strong {
  color: #e3edf7;
}

body.theme-dark .clinical-history-audit-detail-kicker,
body.theme-dark .clinical-history-audit-fields-label,
body.theme-dark .clinical-history-audit-mini span {
  color: #87a0b5;
}

body.theme-dark .clinical-history-audit-date {
  border-color: rgba(96, 165, 250, .22);
  background: rgba(37, 99, 235, .14);
  color: #bfdbfe;
}

body.theme-dark .clinical-history-audit-mini {
  border-color: rgba(143, 217, 224, .10);
  background: rgba(12, 24, 38, .54);
}

body.theme-dark .clinical-history-audit-field-chips span {
  border-color: rgba(45, 212, 191, .20);
  background: rgba(20, 184, 166, .12);
  color: #99f6e4;
}

body.theme-dark .row-act-btn {
  color: var(--n-400);
}

body.theme-dark .row-act-btn:hover {
  background: rgba(143, 217, 224, .12);
  color: #f3fbff;
}

body.theme-dark .toast-item.toast-live {
  border-color: rgba(96, 165, 250, .26);
  background:
    linear-gradient(180deg, rgba(22, 40, 58, .98), rgba(15, 29, 45, .98));
  box-shadow: 0 20px 42px rgba(0, 8, 18, .36);
}

body.theme-dark .reports-kpi.ok {
  border-color: rgba(74, 222, 128, .32);
  background: rgba(22, 163, 74, .14);
}

body.theme-dark .reports-kpi.info {
  border-color: rgba(96, 165, 250, .32);
  background: rgba(37, 99, 235, .14);
}

body.theme-dark .reports-kpi.warn {
  border-color: rgba(251, 191, 36, .32);
  background: rgba(202, 138, 4, .14);
}

body.theme-dark .reports-kpi.danger {
  border-color: rgba(248, 113, 113, .30);
  background: rgba(220, 38, 38, .14);
}

body.theme-dark .reports-overview-card {
  border-color: rgba(143, 217, 224, .14);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, .14), transparent 32%),
    linear-gradient(145deg, rgba(21, 38, 56, .98) 0%, rgba(15, 29, 45, .98) 100%);
  box-shadow: 0 22px 44px rgba(0, 8, 18, .30);
}

body.theme-dark .reports-overview-kicker {
  color: #67e8f9;
}

body.theme-dark .reports-overview-title,
body.theme-dark .reports-table-primary {
  color: #f3fbff;
}

body.theme-dark .reports-overview-sub,
body.theme-dark .reports-filter,
body.theme-dark .reports-table-secondary {
  color: var(--n-500);
}

body.theme-dark .reports-filter-chip {
  border-color: rgba(143, 217, 224, .14);
  background: rgba(12, 24, 38, .68);
  color: #d8f6ff;
}

body.theme-dark .reports-card-future {
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, .12), transparent 28%),
    linear-gradient(180deg, rgba(20, 36, 54, .98), rgba(14, 28, 42, .98));
}

body.theme-dark .reports-ring {
  background:
    radial-gradient(circle at center, rgba(255,255,255,.06) 0 34%, transparent 35%),
    conic-gradient(var(--ring-color) 0 calc(var(--ring-pct) * 1%), rgba(71,85,105,.32) 0 100%);
  box-shadow:
    inset 0 0 28px rgba(0, 8, 18, .24),
    0 0 26px color-mix(in srgb, var(--ring-color) 24%, transparent);
}

body.theme-dark .reports-ring::after {
  background:
    radial-gradient(circle at top, rgba(26,43,62,.95), rgba(14,28,42,.98) 60%, rgba(10,20,31,.98) 100%);
  border-color: rgba(143, 217, 224, .10);
}

body.theme-dark .reports-ring-center strong,
body.theme-dark .reports-holo-name {
  color: #f3fbff;
}

body.theme-dark .reports-ring-center span,
body.theme-dark .reports-ring-label,
body.theme-dark .reports-holo-meta {
  color: var(--n-500);
}

body.theme-dark .reports-holo-track {
  background: linear-gradient(90deg, rgba(8,18,29,.48), rgba(71,85,105,.28));
  border-color: rgba(143,217,224,.10);
}

body.theme-dark .reports-holo-value {
  color: #d8f6ff;
}

body.theme-dark .reports-spotlight-card {
  border-color: rgba(143, 217, 224, .12);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, .12), transparent 36%),
    linear-gradient(180deg, rgba(20, 36, 54, .98), rgba(14, 28, 42, .98));
  box-shadow: 0 20px 36px rgba(0, 8, 18, .28);
}

body.theme-dark .reports-spotlight-label,
body.theme-dark .reports-spotlight-meta {
  color: var(--n-500);
}

body.theme-dark .reports-spotlight-value {
  color: #f3fbff;
}

body.theme-dark .agenda-overview,
body.theme-dark .doctors-area,
body.theme-dark .messages-area,
body.theme-dark .obras-area,
body.theme-dark .professionals-area,
body.theme-dark .sala-area,
body.theme-dark .reports-area {
  background:
    radial-gradient(circle at top left, rgba(143, 217, 224, .10), transparent 24%),
    radial-gradient(circle at top right, rgba(24, 70, 112, .18), transparent 28%),
    linear-gradient(180deg, rgba(8, 18, 29, .16), rgba(8, 18, 29, .06)),
    transparent;
}

body.theme-dark .agenda-overview-head,
body.theme-dark .messages-toolbar,
body.theme-dark .doctors-toolbar,
body.theme-dark .obras-toolbar,
body.theme-dark .professionals-toolbar,
body.theme-dark .sala-toolbar,
body.theme-dark .reports-toolbar,
body.theme-dark .messages-detail-header,
body.theme-dark .messages-composer,
body.theme-dark .obras-form-wrap,
body.theme-dark .professionals-list-wrap {
  background:
    linear-gradient(120deg, rgba(143, 217, 224, .08), rgba(143, 217, 224, 0) 34%),
    linear-gradient(180deg, rgba(21, 39, 58, .96), rgba(14, 28, 44, .98));
  border-color: rgba(143, 217, 224, .10);
}

body.theme-dark .reports-toolbar-top {
  background: linear-gradient(to bottom, rgba(21, 39, 58, .98), rgba(14, 28, 44, .96));
  border-bottom-color: rgba(143, 217, 224, .08);
}

body.theme-dark .reports-toolbar-bottom {
  background: rgba(14, 28, 44, .98);
}

body.theme-dark .reports-toolbar-icon {
  background: linear-gradient(135deg, rgba(14,165,233,.18), rgba(13,148,136,.14));
  border-color: rgba(143,217,224,.20);
  color: #67e8f9;
}

body.theme-dark .reports-filters-divider {
  background: rgba(143, 217, 224, .12);
}

body.theme-dark .agenda-overview-head h2,
body.theme-dark .messages-toolbar h3,
body.theme-dark .doctors-toolbar h3,
body.theme-dark .obras-toolbar h3,
body.theme-dark .professionals-toolbar h3,
body.theme-dark .sala-toolbar h3,
body.theme-dark .reports-toolbar h3,
body.theme-dark .messages-detail-name,
body.theme-dark .doctor-card-name,
body.theme-dark .professional-name,
body.theme-dark .os-name {
  color: #f3fbff;
}

body.theme-dark .agenda-overview-head p,
body.theme-dark .messages-toolbar p,
body.theme-dark .doctors-toolbar p,
body.theme-dark .obras-toolbar p,
body.theme-dark .professionals-toolbar p,
body.theme-dark .sala-toolbar p,
body.theme-dark .reports-toolbar p,
body.theme-dark .messages-detail-meta,
body.theme-dark .messages-compose-hint,
body.theme-dark .doctors-filter span,
body.theme-dark .doctor-stat-label,
body.theme-dark .doctor-card-sub,
body.theme-dark .doctor-metric-label,
body.theme-dark .doctor-card-label,
body.theme-dark .professional-meta,
body.theme-dark .settings-tab-sub,
body.theme-dark .prof-card-sub,
body.theme-dark .prof-schedule-palette-sub,
body.theme-dark .prof-schedule-palette-summary,
body.theme-dark .prof-schedule-palette-empty,
body.theme-dark .prof-schedule-hint,
body.theme-dark .prof-schedule-time-field span,
body.theme-dark .prof-schedule-overview-sub,
body.theme-dark .prof-schedule-overview-stat-label,
body.theme-dark .prof-schedule-overview-stat-meta,
body.theme-dark .prof-schedule-board-sub,
body.theme-dark .prof-schedule-board-legend-item,
body.theme-dark .prof-schedule-day-meta,
body.theme-dark .prof-schedule-inspector p,
body.theme-dark .prof-schedule-inspector-section-sub,
body.theme-dark .prof-schedule-inspector-foot,
body.theme-dark .prof-schedule-inspector-empty,
body.theme-dark .prof-schedule-block-meta,
body.theme-dark .prof-schedule-block-flag,
body.theme-dark .obras-toolbar p,
body.theme-dark .obras-stat-label,
body.theme-dark .obras-stat-meta,
body.theme-dark .os-sub,
body.theme-dark .os-state-meta,
body.theme-dark .os-cut-meta,
body.theme-dark .reports-loading,
body.theme-dark .reports-empty-row,
body.theme-dark .sala-empty {
  color: var(--n-500);
}

body.theme-dark .agenda-month-day,
body.theme-dark .agenda-monthly-shell,
body.theme-dark .agenda-monthly-search,
body.theme-dark .agenda-monthly-mode-switch,
body.theme-dark .agenda-monthly-stat,
body.theme-dark .agenda-monthly-day-sheet,
body.theme-dark .ov-card,
body.theme-dark .doctor-card,
body.theme-dark .doctor-card.is-inactive,
body.theme-dark .professional-item,
body.theme-dark .professional-shortcut-card,
body.theme-dark .settings-tab-item,
body.theme-dark .prof-schedule-overview,
body.theme-dark .prof-schedule-overview-stat,
body.theme-dark .prof-schedule-inspector,
body.theme-dark .prof-schedule-board,
body.theme-dark .prof-schedule-day-top,
body.theme-dark .prof-card,
body.theme-dark .prof-empty,
body.theme-dark .config-inline-item,
body.theme-dark .config-row,
body.theme-dark .obras-stat-card,
body.theme-dark .sala-prof-group {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .96)),
    var(--white);
  box-shadow: 0 18px 36px rgba(0, 8, 18, .24);
}

body.theme-dark .agenda-month-day-head,
body.theme-dark .agenda-monthly-day-number,
body.theme-dark .agenda-monthly-mode-btn.is-active,
body.theme-dark .professional-hero,
body.theme-dark .sala-prof-head {
  background:
    linear-gradient(120deg, rgba(143, 217, 224, .08), rgba(143, 217, 224, 0) 34%),
    linear-gradient(180deg, rgba(19, 36, 54, .96), rgba(15, 29, 45, .98));
  border-color: rgba(143, 217, 224, .10);
}

body.theme-dark .agenda-month-day-title,
body.theme-dark .agenda-month-time,
body.theme-dark .agenda-month-patient,
body.theme-dark .agenda-monthly-head h2,
body.theme-dark .agenda-monthly-search input,
body.theme-dark .agenda-monthly-stat-value,
body.theme-dark .agenda-monthly-day-sheet-head h3,
body.theme-dark .agenda-monthly-day-number,
body.theme-dark .agenda-monthly-turno-patient,
body.theme-dark .agenda-monthly-detail-title,
body.theme-dark .prof-schedule-overview-title,
body.theme-dark .prof-schedule-overview-stat-value,
body.theme-dark .prof-schedule-board-title,
body.theme-dark .prof-schedule-inspector h5,
body.theme-dark .prof-schedule-inspector-section-title,
body.theme-dark .ov-name,
body.theme-dark .ov-kpi-value,
body.theme-dark .doctor-stat-card strong,
body.theme-dark .doctor-metric strong,
body.theme-dark .settings-tab-title,
body.theme-dark .prof-card h4,
body.theme-dark .professional-hero-copy h4,
body.theme-dark .professional-shortcut-value,
body.theme-dark .prof-schedule-palette-title,
body.theme-dark .prof-schedule-day-name,
body.theme-dark .prof-schedule-block-tools .prof-schedule-palette-title,
body.theme-dark .prof-schedule-block-time,
body.theme-dark .prof-schedule-block-label,
body.theme-dark .obras-stat-value,
body.theme-dark .os-cut-value,
body.theme-dark .sala-hora,
body.theme-dark .sala-patient,
body.theme-dark .reports-error {
  color: #f3fbff;
}

body.theme-dark .agenda-month-day-count,
body.theme-dark .agenda-month-meta,
body.theme-dark .agenda-month-row.is-blocked .agenda-month-meta,
body.theme-dark .agenda-monthly-head p,
body.theme-dark .agenda-monthly-search input::placeholder,
body.theme-dark .agenda-monthly-stat-label,
body.theme-dark .agenda-monthly-stat-meta,
body.theme-dark .agenda-monthly-day-count,
body.theme-dark .agenda-monthly-day-sheet-head p,
body.theme-dark .agenda-monthly-turno-meta,
body.theme-dark .agenda-monthly-weekday,
body.theme-dark .agenda-monthly-detail-meta,
body.theme-dark .agenda-monthly-detail-note,
body.theme-dark .ov-esp,
body.theme-dark .ov-next-title,
body.theme-dark .ov-time,
body.theme-dark .ov-note,
body.theme-dark .professional-hero-kicker,
body.theme-dark .professional-pill,
body.theme-dark .prof-time-input,
body.theme-dark .prof-schedule-day-range,
body.theme-dark .prof-schedule-rail-label,
body.theme-dark .prof-schedule-clear,
body.theme-dark .sala-os,
body.theme-dark .sala-prest,
body.theme-dark .reports-date-input,
body.theme-dark .reports-table td.num {
  color: var(--n-500);
}

body.theme-dark .agenda-month-row,
body.theme-dark .agenda-monthly-legend-item,
body.theme-dark .agenda-monthly-day,
body.theme-dark .agenda-monthly-turno,
body.theme-dark .agenda-monthly-detail-row,
body.theme-dark .ov-next-row,
body.theme-dark .doctor-metric,
body.theme-dark .doctor-card-calendar,
body.theme-dark .message-conversation-item,
body.theme-dark .messages-empty-card,
body.theme-dark .messages-day-sep,
body.theme-dark .message-bubble.incoming,
body.theme-dark .message-attachment-link,
body.theme-dark .professional-pill,
body.theme-dark .prof-time-input,
body.theme-dark .prof-schedule-treatment-chip,
body.theme-dark .prof-schedule-overbook-card,
body.theme-dark .prof-schedule-rail,
body.theme-dark .prof-schedule-grid,
body.theme-dark .config-inline-editor,
body.theme-dark .config-row-action:hover,
body.theme-dark .config-row-pill,
body.theme-dark .prof-active-switch-card,
body.theme-dark .treatment-whatsapp-toggle,
body.theme-dark .prof-socialworks-panel,
body.theme-dark .prof-works-grid,
body.theme-dark .prof-work-item,
body.theme-dark .prof-socialworks-empty,
body.theme-dark .prof-schedule-block-tools,
body.theme-dark .os-state-pill,
body.theme-dark .reports-date-input,
body.theme-dark .sala-table thead th,
body.theme-dark .sala-table tbody td {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(15, 29, 45, .76);
}

body.theme-dark .agenda-month-row:hover,
body.theme-dark .agenda-monthly-turno:hover,
body.theme-dark .agenda-monthly-detail-row:hover,
body.theme-dark .agenda-month-row.is-blocked:hover,
body.theme-dark .ov-next-row.can-edit:hover,
body.theme-dark .message-conversation-item:hover,
body.theme-dark .message-conversation-item.active,
body.theme-dark .settings-tab-item:hover,
body.theme-dark .professional-item:hover,
body.theme-dark .professional-item.active,
body.theme-dark .prof-schedule-treatment-chip:hover,
body.theme-dark .prof-schedule-treatment-chip.is-active,
body.theme-dark .config-inline-item.is-open,
body.theme-dark .config-row-action:hover,
body.theme-dark .prof-active-switch-card:hover,
body.theme-dark .treatment-whatsapp-toggle:hover,
body.theme-dark .prof-work-item:hover,
body.theme-dark .obras-stat-card:hover {
  border-color: rgba(143, 217, 224, .26);
  background:
    linear-gradient(180deg, rgba(24, 46, 68, .98), rgba(16, 32, 49, .96)),
    var(--white);
  box-shadow: 0 20px 38px rgba(0, 8, 18, .28);
}

body.theme-dark .psb-bar,
body.theme-dark .psb-editor,
body.theme-dark .psb-bar-empty-card {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(21, 39, 58, .96), rgba(14, 28, 44, .98));
  box-shadow: 0 18px 34px rgba(0, 8, 18, .22);
}

body.theme-dark .psb-bar-title,
body.theme-dark .psb-editor-time,
body.theme-dark .psb-bar-empty-card strong {
  color: #f3fbff;
}

body.theme-dark .psb-bar-kicker,
body.theme-dark .psb-bar-sub,
body.theme-dark .psb-editor-label,
body.theme-dark .psb-editor-dur,
body.theme-dark .psb-treatments-note,
body.theme-dark .psb-overbook-btn,
body.theme-dark .psb-bar-empty-card {
  color: var(--n-500);
}

body.theme-dark .psb-overbook-btn {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(15, 29, 45, .76);
}

body.theme-dark .psb-overbook-btn.is-active {
  border-color: rgba(20,184,166,.34);
  background: rgba(20,184,166,.16);
  color: #99f6e4;
}

body.theme-dark .prof-schedule-day-card,
body.theme-dark .prof-schedule-day-card-column,
body.theme-dark .prof-schedule-day-visual-rail {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(21, 39, 58, .96), rgba(14, 28, 44, .98));
  box-shadow: 0 18px 34px rgba(0, 8, 18, .22);
}

body.theme-dark .prof-schedule-day-card.is-selected-day {
  border-color: rgba(96,165,250,.34);
  box-shadow: 0 0 0 1px rgba(96,165,250,.12), 0 22px 36px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-schedule-day-card-column.is-setup {
  background:
    linear-gradient(180deg, rgba(17, 52, 57, .96), rgba(14, 28, 44, .98));
}

body.theme-dark .prof-schedule-block-chip,
body.theme-dark .prof-schedule-block-chip-cta,
body.theme-dark .prof-schedule-day-visual-toggle::after {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(15, 29, 45, .76);
}

body.theme-dark .prof-schedule-block-chip-title,
body.theme-dark .prof-schedule-day-visual-title {
  color: #f3fbff;
}

body.theme-dark .prof-schedule-day-card-help,
body.theme-dark .prof-schedule-day-visual-sub,
body.theme-dark .prof-schedule-block-chip-cta {
  color: var(--n-500);
}

body.theme-dark .prof-schedule-block-chip.is-selected .prof-schedule-block-chip-cta {
  border-color: rgba(20,184,166,.34);
  background: rgba(20,184,166,.16);
  color: #99f6e4;
}

body.theme-dark .agenda-month-row.is-blocked,
body.theme-dark .agenda-monthly-day.is-other-month,
body.theme-dark .agenda-monthly-turno.is-blocked,
body.theme-dark .agenda-monthly-detail-row.is-blocked,
body.theme-dark .ov-next-row.is-blocked,
body.theme-dark .professional-item.is-inactive,
body.theme-dark .professional-pill.is-inactive,
body.theme-dark .os-state-pill.inactive {
  background: rgba(71, 85, 105, .16);
  border-color: rgba(148, 163, 184, .18);
  color: var(--n-600);
}

body.theme-dark .ov-next-row.is-akito {
  border-color: rgba(96, 165, 250, .52);
  background: linear-gradient(180deg, rgba(22, 56, 92, .99), rgba(16, 42, 72, .98));
}

body.theme-dark .ov-next-row.is-studies {
  border-color: rgba(251, 191, 36, .22);
  background: rgba(194, 65, 12, .12);
}

body.theme-dark .ov-meta-chip {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(12, 24, 38, .68);
  color: var(--n-500);
}

body.theme-dark .ov-meta-chip.is-akito {
  border-color: rgba(96, 165, 250, .24);
  background: rgba(30, 58, 138, .20);
  color: #93c5fd;
}

body.theme-dark .ov-card.active,
body.theme-dark .doctor-card:hover {
  border-color: rgba(143, 217, 224, .32);
  box-shadow: 0 0 0 1px rgba(143, 217, 224, .16), 0 18px 36px rgba(0, 8, 18, .28);
}

body.theme-dark .agenda-monthly-empty {
  border-color: rgba(143, 217, 224, .16);
  background: rgba(12, 24, 38, .62);
  color: var(--n-500);
}

body.theme-dark .agenda-monthly-mode-btn,
body.theme-dark .agenda-monthly-day-link,
body.theme-dark .agenda-monthly-detail-action {
  color: #8fd9e0;
}

body.theme-dark .agenda-monthly-legend-item.is-active,
body.theme-dark .agenda-monthly-mode-btn.is-active {
  border-color: rgba(143, 217, 224, .24);
  background:
    linear-gradient(120deg, rgba(143, 217, 224, .08), rgba(143, 217, 224, 0) 34%),
    linear-gradient(180deg, rgba(19, 36, 54, .96), rgba(15, 29, 45, .98));
  color: #f3fbff;
  box-shadow: 0 14px 26px rgba(0, 8, 18, .22);
}

body.theme-dark .agenda-monthly-search svg {
  color: #8fd9e0;
}

body.theme-dark .professional-shortcut-card,
body.theme-dark .prof-section-card,
body.theme-dark .prof-section-chevron,
body.theme-dark .prof-section-note {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(15, 29, 45, .76);
}

body.theme-dark .professional-shortcut-card:hover,
body.theme-dark .professional-shortcut-card:focus-visible,
body.theme-dark .prof-section-card[open] {
  border-color: rgba(143, 217, 224, .24);
  background:
    linear-gradient(180deg, rgba(24, 46, 68, .98), rgba(16, 32, 49, .96)),
    var(--white);
  box-shadow: 0 20px 38px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-section-summary:hover {
  background: rgba(24, 46, 68, .72);
}

body.theme-dark .professional-shortcut-label,
body.theme-dark .professional-shortcut-meta,
body.theme-dark .prof-section-sub,
body.theme-dark .prof-section-meta,
body.theme-dark .prof-field-help,
body.theme-dark .prof-section-note {
  color: var(--n-500);
}

body.theme-dark .professional-shortcut-value,
body.theme-dark .prof-section-title {
  color: #f3fbff;
}

body.theme-dark .prof-section-body {
  border-top-color: rgba(143, 217, 224, .10);
}

body.theme-dark .prof-schedule-block-tools {
  border-top-color: rgba(143, 217, 224, .10);
}

body.theme-dark .ov-kpi,
body.theme-dark .doctor-stat-card {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(12, 24, 38, .62);
}

body.theme-dark .ov-patient,
body.theme-dark .message-conversation-name,
body.theme-dark .message-conversation-preview,
body.theme-dark .professional-pill.is-active,
body.theme-dark .prof-toggle-row,
body.theme-dark .prof-day-label,
body.theme-dark .prof-work-item,
body.theme-dark .prof-socialworks-toggle-title,
body.theme-dark .config-row strong,
body.theme-dark .reports-table td.fw {
  color: var(--n-800);
}

body.theme-dark .ov-edit-card,
body.theme-dark .ov-edit-option,
body.theme-dark .messages-source-switch {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .96));
}

body.theme-dark .ov-edit-label,
body.theme-dark .ov-edit-option-hint,
body.theme-dark .message-conversation-sub,
body.theme-dark .message-conversation-time,
body.theme-dark .messages-disabled-note {
  color: var(--n-500);
}

body.theme-dark .ov-edit-option-label,
body.theme-dark .ov-edit-current,
body.theme-dark .messages-source-btn.active {
  color: #f3fbff;
}

body.theme-dark .ov-edit-close,
body.theme-dark .messages-source-btn {
  background: rgba(12, 24, 38, .68);
  border-color: rgba(143, 217, 224, .12);
  color: var(--n-500);
}

body.theme-dark .ov-edit-close:hover,
body.theme-dark .ov-edit-option:hover {
  border-color: rgba(143, 217, 224, .28);
  background: rgba(22, 43, 65, .92);
  color: #f3fbff;
}

body.theme-dark .ov-edit-option.active {
  border-color: rgba(143, 217, 224, .26);
  background: rgba(20, 48, 70, .96);
  box-shadow: inset 0 0 0 1px rgba(143, 217, 224, .14);
}

body.theme-dark .prof-schedule-quickbar,
body.theme-dark .schedule-exception-shortcut,
body.theme-dark .schedule-exception-preview-card,
body.theme-dark .schedule-exception-draft-summary {
  border-color: rgba(143, 217, 224, .12);
  background:
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .96)),
    var(--white);
  box-shadow: 0 18px 36px rgba(0, 8, 18, .24);
}

body.theme-dark .prof-schedule-quickbar-title,
body.theme-dark .prof-schedule-clipboard-value,
body.theme-dark .prof-schedule-block-chip-time,
body.theme-dark .schedule-exception-shortcut-title {
  color: #f3fbff;
}

body.theme-dark .prof-schedule-quickbar-sub,
body.theme-dark .prof-schedule-quickbar-note,
body.theme-dark .prof-schedule-clipboard-label,
body.theme-dark .prof-schedule-block-chip-meta,
body.theme-dark .schedule-exception-shortcut-meta,
body.theme-dark .schedule-exception-shortcut-kicker {
  color: var(--n-500);
}

body.theme-dark .prof-schedule-bulk-chip,
body.theme-dark .prof-schedule-mini-action,
body.theme-dark .prof-schedule-day-action,
body.theme-dark .prof-schedule-block-chip {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(15, 29, 45, .76);
}

body.theme-dark .prof-schedule-bulk-chip.is-active,
body.theme-dark .prof-schedule-day-action.is-active,
body.theme-dark .prof-schedule-block-chip.is-selected,
body.theme-dark .prof-schedule-segmented-btn.is-active {
  border-color: rgba(143, 217, 224, .24);
  background: rgba(20, 48, 70, .96);
  color: #defcff;
}

body.theme-dark .prof-schedule-segmented {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(12, 24, 38, .72);
}

body.theme-dark .prof-schedule-day-chip-empty {
  border-color: rgba(143, 217, 224, .16);
  background: rgba(12, 24, 38, .56);
  color: var(--n-500);
}

body.theme-dark .message-status-pill,
body.theme-dark .messages-label-pill {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(12, 24, 38, .72);
  color: var(--n-600);
}

body.theme-dark .messages-list-wrap {
  background: rgba(12, 24, 38, .52);
}

body.theme-dark .messages-detail-header,
body.theme-dark .messages-composer {
  border-color: rgba(143, 217, 224, .12);
  background: rgba(12, 24, 38, .74);
}

body.theme-dark .messages-detail-back {
  border-color: rgba(143, 217, 224, .16);
  background: rgba(12, 24, 38, .76);
  color: #defcff;
}

body.theme-dark .messages-detail-back:hover {
  border-color: rgba(143, 217, 224, .30);
  background: rgba(20, 48, 70, .94);
  box-shadow: 0 12px 24px rgba(0, 8, 18, .28);
}

body.theme-dark .messages-thread {
  background:
    linear-gradient(180deg, rgba(10, 20, 31, .72), rgba(10, 20, 31, .72)),
    radial-gradient(circle at top right, rgba(143, 217, 224, .08), transparent 24%),
    var(--n-50);
}

body.theme-dark .message-read-pill,
body.theme-dark .messages-detail-read,
body.theme-dark .message-bubble-status.seen {
  background: rgba(30, 58, 138, .24);
  border-color: rgba(96, 165, 250, .28);
  color: #bfdbfe;
}

body.theme-dark .message-bubble-status.sent {
  background: rgba(30, 41, 59, .7);
  border-color: rgba(148, 163, 184, .18);
}

body.theme-dark .messages-day-sep {
  color: var(--n-500);
}

body.theme-dark .message-bubble.outgoing {
  background: linear-gradient(180deg, rgba(143, 217, 224, .18), rgba(20, 78, 92, .16));
  border-color: rgba(143, 217, 224, .22);
  color: #defcff;
}

body.theme-dark .message-bubble.private {
  background: rgba(194, 65, 12, .16);
  border-color: rgba(251, 191, 36, .18);
  color: #fdba74;
}

body.theme-dark .message-bubble.activity,
body.theme-dark .message-bubble-time {
  color: var(--n-500);
}

@media (min-width: 821px) {
  .messages-area {
    padding: 16px 16px 18px;
    background:
      linear-gradient(180deg, #dfe6e8 0%, #d5dde0 100%);
  }

  .messages-toolbar {
    padding: 12px 16px;
    border: 1px solid rgba(200, 211, 214, .92);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    background:
      linear-gradient(180deg, rgba(247, 249, 250, .98), rgba(238, 242, 244, .96));
    box-shadow: 0 24px 48px rgba(15, 23, 42, .08);
    backdrop-filter: blur(12px);
  }

  .messages-toolbar h3 {
    color: #111b21;
  }

  .messages-toolbar p {
    color: #667781;
  }

  .messages-toolbar-actions {
    gap: 10px;
  }

  .messages-source-switch {
    padding: 5px;
    background: rgba(255, 255, 255, .98);
    border-color: rgba(208, 218, 222, .92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76);
  }

  .messages-source-btn {
    color: #54656f;
  }

  .messages-source-btn.active {
    background: rgba(17, 27, 33, .07);
    color: #111b21;
    box-shadow: none;
  }

  .messages-status-filter span {
    color: #8696a0;
  }

  .messages-status-filter .field-input {
    min-height: 40px;
    background: rgba(255, 255, 255, .98);
    border-color: rgba(208, 218, 222, .92);
  }

  .messages-layout {
    grid-template-columns: 348px minmax(0, 1fr);
    gap: 0;
    padding: 0;
    border: 1px solid rgba(200, 211, 214, .92);
    border-top: none;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 28px 56px rgba(15, 23, 42, .08);
  }

  .messages-list-wrap {
    padding: 10px 0;
    border: none;
    border-radius: 0;
    border-right: 1px solid rgba(220, 227, 232, .96);
    background:
      linear-gradient(180deg, rgba(247, 248, 250, .98), rgba(240, 242, 245, .98));
    box-shadow: none;
  }

  .messages-list {
    gap: 2px;
  }

  .messages-empty-card {
    margin: 14px;
    border-style: solid;
    border-color: rgba(212, 221, 226, .94);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 22px rgba(15, 23, 42, .04);
  }

  .message-conversation-item {
    margin: 0 8px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
    animation: none;
  }

  .message-conversation-item:hover {
    transform: none;
    border-color: rgba(17, 27, 33, .06);
    background: rgba(255, 255, 255, .72);
    box-shadow: none;
  }

  .message-conversation-item.active {
    border-color: var(--message-accent-ring, rgba(18, 140, 126, .16));
    background:
      radial-gradient(circle at top right, var(--message-accent-soft, rgba(18, 140, 126, .12)), transparent 46%),
      linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(243, 248, 247, .96));
    box-shadow: inset 0 0 0 1px var(--message-accent-soft, rgba(18, 140, 126, .08));
  }

  .message-conversation-item.is-unread::before,
  .message-conversation-item.active::before {
    inset: 12px auto 12px 0;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--message-accent, #25d366), transparent 82%);
  }

  .message-conversation-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--message-accent, #25d366), #9ddfe4);
    box-shadow: none;
  }

  .message-conversation-name {
    font-size: 14px;
    color: #111b21;
  }

  .message-conversation-sub {
    margin-top: 2px;
    color: #667781;
  }

  .message-unread-badge {
    min-width: 20px;
    height: 20px;
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, .12);
  }

  .message-conversation-preview {
    margin-top: 6px;
    min-height: 0;
    color: #54656f;
    -webkit-line-clamp: 1;
  }

  .message-conversation-foot {
    margin-top: 8px;
  }

  .message-conversation-foot-tags {
    gap: 5px;
  }

  .message-conversation-time {
    font-size: 11px;
    color: #8696a0;
  }

  .message-status-pill,
  .message-read-pill,
  .messages-label-pill {
    min-height: 22px;
    padding: 3px 8px;
    border-color: rgba(17, 27, 33, .08);
    background: rgba(255, 255, 255, .8);
    color: #54656f;
    box-shadow: none;
  }

  .messages-detail {
    background: #efeae2;
  }

  .messages-detail-header {
    min-height: 74px;
    padding: 14px 18px;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(220, 227, 232, .96);
    background:
      linear-gradient(180deg, rgba(240, 242, 245, .98), rgba(236, 240, 243, .98));
  }

  .messages-detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--message-accent, #25d366), #9ddfe4);
    box-shadow: none;
  }

  .messages-detail-name {
    color: #111b21;
    font-size: 15px;
    letter-spacing: 0;
  }

  .messages-detail-meta {
    color: #667781;
  }

  .messages-detail-read {
    margin-top: 6px;
    background: rgba(18, 140, 126, .1);
    border-color: rgba(18, 140, 126, .12);
    color: #0b6e61;
  }

  .messages-thread {
    padding: 20px 28px;
    gap: 8px;
    border: none;
    background:
      radial-gradient(circle at 20px 20px, rgba(255, 255, 255, .16) 1.8px, transparent 2px) 0 0 / 42px 42px,
      radial-gradient(circle at 10px 28px, rgba(255, 255, 255, .1) 1.4px, transparent 1.8px) 0 0 / 46px 46px,
      linear-gradient(180deg, rgba(239, 234, 226, .98), rgba(232, 229, 221, .98)),
      #efeae2;
  }

  .messages-day-sep {
    padding: 4px 12px;
    border-color: rgba(17, 27, 33, .08);
    background: rgba(255, 255, 255, .84);
    color: #667781;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .05);
  }

  .message-bubble-row {
    padding: 0 6px;
  }

  .message-bubble {
    max-width: min(720px, 65%);
    padding: 8px 10px 9px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 1px rgba(11, 20, 26, .08), 0 8px 16px rgba(11, 20, 26, .04);
  }

  .message-bubble::after {
    content: "";
    position: absolute;
    top: 10px;
    width: 10px;
    height: 12px;
  }

  .message-bubble.incoming {
    background: #ffffff;
    color: #111b21;
  }

  .message-bubble.incoming::after {
    left: -6px;
    background: #ffffff;
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
  }

  .message-bubble.outgoing {
    background: #d9fdd3;
    color: #111b21;
  }

  .message-bubble.outgoing::after,
  .message-bubble.private::after {
    right: -6px;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }

  .message-bubble.outgoing::after {
    background: #d9fdd3;
  }

  .message-bubble.private {
    background: #fff3cd;
    color: #6b4a00;
  }

  .message-bubble.private::after {
    background: #fff3cd;
  }

  .message-bubble.activity::after {
    display: none;
  }

  .message-bubble-top {
    margin-bottom: 4px;
  }

  .message-bubble-author {
    color: #54656f;
  }

  .message-bubble-content {
    font-size: 13px;
    line-height: 1.48;
  }

  .message-bubble-time {
    font-size: 10.5px;
    color: #667781;
  }

  .message-bubble-status {
    margin-top: 6px;
    border: none;
    background: rgba(17, 27, 33, .06);
    color: #667781;
  }

  .message-bubble-status.seen {
    background: rgba(18, 140, 126, .12);
    color: #0b6e61;
  }

  .message-attachment-link {
    border-color: rgba(17, 27, 33, .08);
    background: rgba(255, 255, 255, .78);
    color: #055160;
    box-shadow: none;
  }

  .messages-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px 16px;
    border: none;
    border-top: 1px solid rgba(220, 227, 232, .96);
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(240, 242, 245, .98), rgba(238, 242, 245, .98));
  }

  .messages-compose-input {
    min-height: 52px;
    max-height: 144px;
    padding: 15px 18px;
    border: 1px solid transparent;
    border-radius: 24px;
    resize: none;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: none;
  }

  .messages-compose-input:focus {
    border-color: rgba(18, 140, 126, .18);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .12);
  }

  .messages-compose-actions {
    margin-top: 0;
    align-items: center;
    justify-content: flex-end;
  }

  .messages-compose-hint {
    display: none;
  }

  .messages-compose-actions .messages-send-btn.btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 999px;
    justify-content: center;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 12px 24px rgba(18, 140, 126, .24);
  }

  .messages-compose-actions .messages-send-btn.btn:disabled {
    opacity: .7;
    box-shadow: none;
  }

  .messages-compose-actions .messages-send-btn span {
    display: none;
  }

  .messages-compose-actions .messages-send-btn svg {
    width: 18px;
    height: 18px;
  }

  body.theme-dark .messages-area {
    background:
      linear-gradient(180deg, #0b141a 0%, #0a1318 100%);
  }

  body.theme-dark .messages-toolbar {
    border-color: rgba(255, 255, 255, .06);
    background:
      linear-gradient(180deg, rgba(32, 44, 51, .98), rgba(29, 39, 45, .98));
    box-shadow: 0 28px 56px rgba(0, 0, 0, .34);
  }

  body.theme-dark .messages-toolbar h3 {
    color: #e9edef;
  }

  body.theme-dark .messages-toolbar p {
    color: #8696a0;
  }

  body.theme-dark .messages-source-switch {
    background: rgba(17, 27, 33, .88);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: none;
  }

  body.theme-dark .messages-source-btn {
    color: #8696a0;
  }

  body.theme-dark .messages-source-btn.active {
    background: rgba(255, 255, 255, .08);
    color: #e9edef;
  }

  body.theme-dark .messages-status-filter span {
    color: #8696a0;
  }

  body.theme-dark .messages-status-filter .field-input {
    background: rgba(17, 27, 33, .88);
    border-color: rgba(255, 255, 255, .08);
    color: #e9edef;
  }

  body.theme-dark .messages-layout {
    border-color: rgba(255, 255, 255, .06);
    background: #0b141a;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .36);
  }

  body.theme-dark .messages-list-wrap {
    border-right-color: rgba(255, 255, 255, .06);
    background:
      linear-gradient(180deg, rgba(17, 27, 33, .98), rgba(15, 24, 30, .98));
  }

  body.theme-dark .messages-empty-card {
    border-color: rgba(255, 255, 255, .07);
    background: rgba(17, 27, 33, .88);
    box-shadow: none;
  }

  body.theme-dark .message-conversation-item {
    border-color: transparent;
    background: transparent;
  }

  body.theme-dark .message-conversation-item:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, .04);
  }

  body.theme-dark .message-conversation-item.active {
    border-color: var(--message-accent-ring, rgba(37, 211, 102, .18));
    background: rgba(42, 57, 66, .94);
    box-shadow: none;
  }

  body.theme-dark .message-conversation-name,
  body.theme-dark .message-conversation-preview {
    color: #e9edef;
  }

  body.theme-dark .message-conversation-sub,
  body.theme-dark .message-conversation-time,
  body.theme-dark .messages-compose-hint {
    color: #8696a0;
  }

  body.theme-dark .message-status-pill,
  body.theme-dark .message-read-pill,
  body.theme-dark .messages-label-pill {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .05);
    color: #cfd8dc;
  }

  body.theme-dark .message-status-pill.open {
    background: rgba(56, 189, 248, .14);
    border-color: rgba(56, 189, 248, .18);
    color: #7dd3fc;
  }

  body.theme-dark .message-status-pill.pending {
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .18);
    color: #fcd34d;
  }

  body.theme-dark .message-status-pill.resolved {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .18);
    color: #86efac;
  }

  body.theme-dark .message-status-pill.snoozed {
    background: rgba(168, 85, 247, .14);
    border-color: rgba(168, 85, 247, .18);
    color: #d8b4fe;
  }

  body.theme-dark .message-status-pill.internal {
    background: rgba(20, 184, 166, .14);
    border-color: rgba(20, 184, 166, .18);
    color: #99f6e4;
  }

  body.theme-dark .messages-detail-header,
  body.theme-dark .messages-composer {
    border-color: rgba(255, 255, 255, .06);
    background:
      linear-gradient(180deg, rgba(32, 44, 51, .98), rgba(29, 39, 45, .98));
  }

  body.theme-dark .messages-detail-name {
    color: #e9edef;
  }

  body.theme-dark .messages-detail-meta {
    color: #8696a0;
  }

  body.theme-dark .messages-detail-read {
    background: rgba(37, 211, 102, .12);
    border-color: rgba(37, 211, 102, .12);
    color: #8cf7c0;
  }

  body.theme-dark .messages-thread {
    background:
      radial-gradient(circle at 18px 18px, rgba(255, 255, 255, .04) 1.6px, transparent 1.9px) 0 0 / 42px 42px,
      radial-gradient(circle at 12px 30px, rgba(255, 255, 255, .03) 1.3px, transparent 1.7px) 0 0 / 48px 48px,
      linear-gradient(180deg, rgba(11, 20, 26, .98), rgba(10, 19, 24, .98)),
      #0b141a;
  }

  body.theme-dark .messages-day-sep {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(32, 44, 51, .92);
    color: #8696a0;
    box-shadow: none;
  }

  body.theme-dark .message-bubble.incoming {
    background: #202c33;
    color: #e9edef;
  }

  body.theme-dark .message-bubble.incoming::after {
    background: #202c33;
  }

  body.theme-dark .message-bubble.outgoing {
    background: #005c4b;
    color: #e9edef;
  }

  body.theme-dark .message-bubble.outgoing::after {
    background: #005c4b;
  }

  body.theme-dark .message-bubble.private {
    background: #4a2d00;
    color: #ffe1a6;
  }

  body.theme-dark .message-bubble.private::after {
    background: #4a2d00;
  }

  body.theme-dark .message-bubble-author,
  body.theme-dark .message-bubble-time {
    color: #99a8af;
  }

  body.theme-dark .message-bubble-status {
    background: rgba(255, 255, 255, .06);
    color: #99a8af;
  }

  body.theme-dark .message-bubble-status.seen {
    background: rgba(37, 211, 102, .14);
    color: #8cf7c0;
  }

  body.theme-dark .message-attachment-link {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .06);
    color: #d8f6ff;
  }

  body.theme-dark .messages-compose-input {
    background: #2a3942;
    border-color: transparent;
    color: #e9edef;
    box-shadow: none;
  }

  body.theme-dark .messages-compose-input:focus {
    background: #314047;
    border-color: rgba(37, 211, 102, .22);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, .12);
  }
}

body.theme-dark .doctor-chip {
  background: rgba(59, 130, 246, .14);
  border-color: rgba(96, 165, 250, .18);
  color: #bfdbfe;
}

body.theme-dark .doctor-card-calendar,
body.theme-dark .prof-empty,
body.theme-dark .messages-empty-card {
  color: var(--n-600);
}

body.theme-dark .professional-shortcut-card::before {
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .16), transparent 42%),
    linear-gradient(135deg, rgba(143, 217, 224, .02), rgba(15, 23, 42, .08));
}

body.theme-dark .professional-shortcut-label,
body.theme-dark .professional-shortcut-meta {
  color: #94a3b8;
}

body.theme-dark .professional-shortcut-cta {
  background: rgba(143, 217, 224, .12);
  border-color: rgba(143, 217, 224, .2);
  color: #d8fbff;
}

body.theme-dark .professional-shortcut-arrow {
  background: rgba(148, 163, 184, .14);
  color: #dbeafe;
}

body.theme-dark .settings-tab-item.active,
body.theme-dark .professional-item.active {
  box-shadow: 0 0 0 1px rgba(143, 217, 224, .18), 0 18px 36px rgba(0, 8, 18, .26);
}

body.theme-dark .professional-hero {
  border-color: rgba(143, 217, 224, .12);
}

body.theme-dark .professional-pill.is-active,
body.theme-dark .os-state-pill.enabled {
  background: rgba(22, 163, 74, .16);
  border-color: rgba(74, 222, 128, .22);
  color: #86efac;
}

body.theme-dark .prof-time-input:focus,
body.theme-dark .reports-date-input:focus {
  outline: none;
  border-color: rgba(143, 217, 224, .34);
  box-shadow: 0 0 0 3px rgba(143, 217, 224, .12);
}

body.theme-dark .prof-schedule-overview-stat {
  background: rgba(12, 24, 38, .62);
}

body.theme-dark .prof-schedule-board-legend-item,
body.theme-dark .prof-schedule-inspector-empty {
  border-color: rgba(143, 217, 224, .14);
  background: rgba(12, 24, 38, .58);
}

body.theme-dark .prof-schedule-overview {
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .10), transparent 32%),
    radial-gradient(circle at bottom left, rgba(20, 184, 166, .10), transparent 28%),
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .96));
}

body.theme-dark .prof-schedule-board {
  background:
    radial-gradient(circle at top left, rgba(143, 217, 224, .08), transparent 24%),
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .96));
}

body.theme-dark .prof-schedule-rail {
  background: linear-gradient(180deg, rgba(12, 24, 38, .68), rgba(10, 20, 31, .74));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

body.theme-dark .prof-schedule-grid {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(148, 163, 184, .12) 0,
      rgba(148, 163, 184, .12) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(226, 232, 240, .10) 0,
      rgba(226, 232, 240, .10) 1px,
      transparent 1px,
      transparent 40px
    ),
    linear-gradient(180deg, rgba(19, 36, 54, .96), rgba(15, 29, 45, .98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 32px rgba(0, 8, 18, .22);
}

body.theme-dark .prof-schedule-day-top::after {
  background: linear-gradient(90deg, rgba(143, 217, 224, .58), rgba(34, 211, 238, .38));
  opacity: .72;
}

body.theme-dark .prof-schedule-day-controls-kicker,
body.theme-dark .prof-schedule-empty-hint-title {
  color: var(--n-600);
}

body.theme-dark .prof-schedule-day-controls-note,
body.theme-dark .prof-schedule-empty-hint-text,
body.theme-dark .prof-schedule-block-capacity {
  color: var(--n-500);
}

body.theme-dark .prof-schedule-time-field,
body.theme-dark .prof-schedule-clear,
body.theme-dark .prof-schedule-block-duration {
  border-color: rgba(143, 217, 224, .14);
  background: rgba(12, 24, 38, .58);
  box-shadow: none;
}

body.theme-dark .prof-schedule-time-field .prof-schedule-time-input {
  color: #f3fbff;
}

body.theme-dark .prof-schedule-time-field:focus-within {
  border-color: rgba(143, 217, 224, .28);
  box-shadow: 0 0 0 3px rgba(143, 217, 224, .12);
}

body.theme-dark .prof-schedule-add-btn {
  background: linear-gradient(180deg, #0891b2, #0e7490);
  border-color: rgba(143, 217, 224, .24);
  box-shadow: 0 16px 28px rgba(0, 8, 18, .24);
}

body.theme-dark .prof-schedule-add-btn:hover {
  background: linear-gradient(180deg, #06b6d4, #0e7490);
  box-shadow: 0 20px 34px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-schedule-day-badge {
  background: rgba(71, 85, 105, .26);
  color: #94a3b8;
}

body.theme-dark .prof-schedule-day.is-enabled .prof-schedule-day-badge {
  background: rgba(8, 145, 178, .18);
  color: #8fd9e0;
}

body.theme-dark .prof-schedule-day.is-selected-day .prof-schedule-day-top {
  border-color: rgba(143, 217, 224, .26);
  background:
    radial-gradient(circle at top right, rgba(143, 217, 224, .12), transparent 34%),
    linear-gradient(180deg, rgba(24, 46, 68, .98), rgba(16, 32, 49, .96));
  box-shadow: 0 0 0 1px rgba(143, 217, 224, .12), 0 18px 36px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-schedule-day.is-selected-day .prof-schedule-grid {
  border-color: rgba(143, 217, 224, .28);
  box-shadow: 0 0 0 1px rgba(143, 217, 224, .10), 0 22px 36px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-schedule-day.is-enabled .prof-schedule-grid:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 22px 34px rgba(0, 8, 18, .26);
}

body.theme-dark .prof-schedule-day:not(.is-enabled) .prof-schedule-grid {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(148, 163, 184, .08) 10px,
      rgba(148, 163, 184, .08) 11px
    ),
    linear-gradient(180deg, rgba(12, 24, 38, .68), rgba(10, 20, 31, .74));
}

body.theme-dark .prof-schedule-empty-hint {
  color: rgba(148, 163, 184, .42);
}

body.theme-dark .prof-schedule-grid:hover .prof-schedule-empty-hint {
  color: rgba(143, 217, 224, .62);
}

body.theme-dark .prof-schedule-block {
  background:
    linear-gradient(180deg, rgba(23, 42, 61, .98), rgba(15, 30, 46, .96)),
    var(--prof-schedule-accent-surface, linear-gradient(135deg, rgba(14,165,233,.14), rgba(14,165,233,.08)));
  box-shadow: 0 18px 30px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-schedule-block:hover {
  box-shadow: 0 20px 36px rgba(0, 8, 18, .32);
}

body.theme-dark .prof-schedule-block.is-selected {
  box-shadow: 0 0 0 2px rgba(143, 217, 224, .18), 0 22px 38px rgba(0, 8, 18, .34);
}

body.theme-dark .prof-schedule-block-body:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(143, 217, 224, .20);
}

body.theme-dark .prof-schedule-block-flag {
  background: rgba(255, 255, 255, .08);
}

body.theme-dark .prof-schedule-block-overbook-toggle {
  border-color: rgba(143, 217, 224, .14);
  background: rgba(255, 255, 255, .08);
  color: #cbd5e1;
}

body.theme-dark .prof-schedule-block-overbook-toggle.is-active {
  border-color: rgba(74, 222, 128, .24);
  background: rgba(34, 197, 94, .16);
  color: #dcfce7;
}

body.theme-dark .prof-schedule-block-duration {
  color: #f3fbff;
}

body.theme-dark .prof-schedule-handle::after {
  background: rgba(226, 232, 240, .34);
}

body.theme-dark .prof-schedule-block:hover .prof-schedule-handle::after,
body.theme-dark .prof-schedule-block.is-selected .prof-schedule-handle::after {
  background: rgba(226, 232, 240, .68);
}

body.theme-dark .prof-schedule-block-remove {
  border-color: rgba(143, 217, 224, .14);
  background: rgba(15, 29, 45, .92);
  color: #cfe7ef;
}

body.theme-dark .prof-schedule-block-remove:hover {
  background: rgba(127, 29, 29, .42);
  border-color: rgba(248, 113, 113, .24);
  color: #fecaca;
}

body.theme-dark .prof-schedule-overbook-card {
  box-shadow: 0 16px 30px rgba(0, 8, 18, .24);
}

body.theme-dark .prof-active-switch-card {
  box-shadow: 0 16px 30px rgba(0, 8, 18, .24);
}

body.theme-dark .prof-schedule-overbook-card.is-active {
  border-color: rgba(74, 222, 128, .24);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, .16), transparent 40%),
    linear-gradient(145deg, rgba(18, 43, 43, .96) 0%, rgba(12, 35, 41, .96) 100%);
  box-shadow: 0 18px 34px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-active-switch-card.is-active {
  border-color: rgba(74, 222, 128, .24);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, .16), transparent 40%),
    linear-gradient(145deg, rgba(18, 43, 43, .96) 0%, rgba(12, 35, 41, .96) 100%);
  box-shadow: 0 18px 34px rgba(0, 8, 18, .28);
}

body.theme-dark .prof-schedule-overbook-switch {
  background: rgba(71, 85, 105, .48);
}

body.theme-dark .prof-active-switch-ui {
  background: rgba(71, 85, 105, .48);
}

body.theme-dark .prof-schedule-overbook-thumb {
  background: #d7e9ef;
}

body.theme-dark .prof-active-switch-thumb {
  background: #d7e9ef;
}

body.theme-dark .prof-schedule-overbook-card.is-active .prof-schedule-overbook-thumb {
  background: #eafff7;
}

body.theme-dark .prof-active-switch-card.is-active .prof-active-switch-thumb {
  background: #eafff7;
}

body.theme-dark .prof-schedule-overbook-kicker,
body.theme-dark .prof-schedule-overbook-meta {
  color: var(--n-500);
}

body.theme-dark .prof-active-switch-kicker,
body.theme-dark .prof-active-switch-meta {
  color: var(--n-500);
}

body.theme-dark .prof-socialworks-toggle-sub,
body.theme-dark .prof-socialworks-search,
body.theme-dark .prof-socialworks-empty {
  color: var(--n-500);
}

body.theme-dark .prof-schedule-overbook-title,
body.theme-dark .prof-schedule-overbook-card.is-active .prof-schedule-overbook-title {
  color: #f3fbff;
}

body.theme-dark .prof-active-switch-title,
body.theme-dark .prof-active-switch-card.is-active .prof-active-switch-title {
  color: #f3fbff;
}

body.theme-dark .prof-schedule-overbook-card.is-active .prof-schedule-overbook-meta {
  color: #b9f6de;
}

body.theme-dark .prof-active-switch-card.is-active .prof-active-switch-meta {
  color: #b9f6de;
}

body.theme-dark .prof-socialworks-toggle-switch {
  background: rgba(71, 85, 105, .48);
}

body.theme-dark .prof-socialworks-toggle-thumb {
  background: #d7e9ef;
}

body.theme-dark .prof-socialworks-toggle input:checked + .prof-socialworks-toggle-switch .prof-socialworks-toggle-thumb {
  background: #eafff7;
}

body.theme-dark .prof-work-item:has(input:checked) {
  border-color: rgba(74, 222, 128, .24);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, .16), transparent 40%),
    linear-gradient(145deg, rgba(18, 43, 43, .96) 0%, rgba(12, 35, 41, .96) 100%);
  box-shadow: 0 18px 34px rgba(0, 8, 18, .20);
}

body.theme-dark .prof-schedule-rail,
body.theme-dark .prof-schedule-grid {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(148,163,184,.16) 0,
      rgba(148,163,184,.16) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.05) 0,
      rgba(255,255,255,.05) 1px,
      transparent 1px,
      transparent 40px
    ),
    linear-gradient(180deg, rgba(143,217,224,.06), rgba(12,24,38,.92));
}

body.theme-dark .config-inline-editor {
  border-top-color: rgba(143, 217, 224, .10);
  background: rgba(12, 24, 38, .48);
}

body.theme-dark .config-row-pill {
  color: #defcff;
}

body.theme-dark .treatment-whatsapp-toggle {
  border-color: rgba(74, 222, 128, .18);
  background:
    radial-gradient(circle at top right, rgba(34,197,94,.12), transparent 42%),
    linear-gradient(180deg, rgba(13, 42, 30, .96) 0%, rgba(11, 35, 27, .96) 100%);
}

body.theme-dark .treatment-whatsapp-toggle-title {
  color: #bbf7d0;
}

body.theme-dark .treatment-whatsapp-toggle-sub {
  color: #94a3b8;
}

body.theme-dark .os-inline-pill {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(251, 191, 36, .18);
  color: #fcd34d;
}

body.theme-dark .os-inline-pill--money,
body.theme-dark .os-copay-value {
  background: rgba(15, 118, 110, .14);
  border-color: rgba(45, 212, 191, .18);
  color: #99f6e4;
}

body.theme-dark .os-state-pill.disabled {
  background: rgba(190, 24, 93, .16);
  border-color: rgba(244, 114, 182, .18);
  color: #f9a8d4;
}

body.theme-dark .reports-date-input {
  background: rgba(15, 29, 45, .82);
}
@media (max-width: 920px) {
  .reports-overview-card {
    flex-direction: column;
  }
  .reports-overview-tags {
    justify-content: flex-start;
  }
  .reports-graphic-grid {
    grid-template-columns: 1fr;
  }
  .reports-spotlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reports-ring-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reports-grid,
  .reports-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .reports-grid,
  .reports-grid-3 {
    grid-template-columns: 1fr;
  }
  .reports-ring-grid,
  .reports-spotlight-grid {
    grid-template-columns: 1fr;
  }
  .reports-holo-row {
    grid-template-columns: 1fr;
  }
  .reports-holo-value {
    text-align: left;
  }
  .reports-filter {
    min-width: 100%;
  }
}

/* ════════════════════════════════════════════════════════
   RECEPTION — Futuristic Visual Layer
   Entrance animations, depth & glass hover effects.
   ════════════════════════════════════════════════════════ */

/* ─── Keyframes ──────────────────────────────────────── */

@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes shimmer-sweep {
  from { transform: translateX(-100%) skewX(-12deg); }
  to   { transform: translateX(350%)  skewX(-12deg); }
}

@keyframes stat-ring-pulse {
  0%, 100% { transform: scale(1);    opacity: 0; }
  35%       { transform: scale(2.6); opacity: .22; }
  70%       { transform: scale(3.2); opacity: 0; }
}

@keyframes topbar-accent-pulse {
  0%, 100% { opacity: .32; }
  50%       { opacity: .58; }
}

/* ─── Topbar — subtle bottom accent line ────────────── */

.topbar { position: relative; }

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal-500), transparent);
  opacity: .32;
  pointer-events: none;
  animation: topbar-accent-pulse 4s ease-in-out infinite;
  z-index: 1;
}

/* ─── Statsbar — indicator ripple rings ─────────────── */

.stat-indicator {
  position: relative;
}

.stat-indicator::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  pointer-events: none;
  animation: stat-ring-pulse 3.4s ease-in-out infinite;
}

.stat:nth-child(1) .stat-indicator::after { animation-delay:   0ms; }
.stat:nth-child(2) .stat-indicator::after { animation-delay: 600ms; }
.stat:nth-child(3) .stat-indicator::after { animation-delay: 1200ms; }
.stat:nth-child(4) .stat-indicator::after { animation-delay: 1800ms; }

/* ─── Overview area — richer ambient background ──────── */

.agenda-overview {
  background:
    radial-gradient(ellipse 920px 440px at -6% -18%, rgba(98,188,197,.20), transparent 64%),
    radial-gradient(ellipse 580px 290px at 110% 2%, rgba(0,78,124,.09), transparent 54%),
    linear-gradient(180deg, #f4fbfe 0%, #f7fafc 100%);
}

/* ─── Overview title — gradient text ────────────────── */

.agenda-overview-head h2 {
  background: linear-gradient(132deg, var(--blue-800) 15%, var(--teal-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Cards — staggered entrance animation ───────────── */

.agenda-overview-grid .ov-card {
  animation: card-enter .40s cubic-bezier(.22,1,.36,1) both;
}
.agenda-overview-grid .ov-card:nth-child(1) { animation-delay:   0ms; }
.agenda-overview-grid .ov-card:nth-child(2) { animation-delay:  60ms; }
.agenda-overview-grid .ov-card:nth-child(3) { animation-delay: 120ms; }
.agenda-overview-grid .ov-card:nth-child(4) { animation-delay: 180ms; }
.agenda-overview-grid .ov-card:nth-child(5) { animation-delay: 240ms; }
.agenda-overview-grid .ov-card:nth-child(6) { animation-delay: 300ms; }
.agenda-overview-grid .ov-card:nth-child(7) { animation-delay: 360ms; }
.agenda-overview-grid .ov-card:nth-child(8) { animation-delay: 420ms; }

/* ─── Card — hover lift, glow & shimmer ─────────────── */

.ov-card {
  transition:
    transform 240ms cubic-bezier(.22,1,.36,1),
    box-shadow 240ms cubic-bezier(.22,1,.36,1),
    border-color 200ms ease;
  cursor: pointer;
}

/* Shimmer strip */
.ov-card::after {
  content: '';
  position: absolute;
  top: -80%;
  left: -55%;
  width: 42%;
  height: 260%;
  background: linear-gradient(
    112deg,
    transparent 0%,
    rgba(255,255,255,.16) 38%,
    rgba(255,255,255,.28) 50%,
    rgba(255,255,255,.16) 62%,
    transparent 100%
  );
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none;
  z-index: 5;
}
.ov-card:hover::after {
  animation: shimmer-sweep .58s ease-in-out forwards;
}
/* Reset shimmer when hover ends cleanly */
.ov-card:not(:hover)::after {
  transition: opacity .15s ease;
  opacity: 0;
}

.ov-card:hover {
  transform: translateY(-5px) scale(1.010);
  box-shadow:
    0 22px 46px rgba(0,30,54,.13),
    0 0 0 1.5px rgba(98,188,197,.32);
  border-color: rgba(98,188,197,.46);
}

/* Color bar grows on hover */
.ov-card::before {
  transition: height 220ms cubic-bezier(.22,1,.36,1), opacity 200ms ease;
}
.ov-card:hover::before {
  height: 4px;
  opacity: .95;
}

/* ─── Avatar — scale + ring glow on hover ────────────── */

.ov-avatar {
  transition:
    transform 240ms cubic-bezier(.22,1,.36,1),
    box-shadow 240ms ease;
}
.ov-card:hover .ov-avatar {
  transform: scale(1.11);
  box-shadow:
    0 0 0 3px rgba(255,255,255,.55),
    0 0 0 5px var(--doc-color),
    0 6px 20px rgba(0,30,54,.22);
}

/* ─── KPI boxes — light glass on hover ───────────────── */

.ov-kpi {
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}
.ov-card:hover .ov-kpi {
  background: rgba(255,255,255,.96);
  border-color: rgba(98,188,197,.32);
  box-shadow: 0 2px 10px rgba(98,188,197,.10);
}
.ov-kpi-value {
  transition: color 180ms ease;
}
.ov-card:hover .ov-kpi-value {
  color: var(--teal-700);
}

/* ─── Appointment rows — slide + glow on hover ───────── */

.ov-next-row.can-edit:hover {
  border-color: rgba(98,188,197,.54);
  background: rgba(236,251,253,.97);
  transform: translateX(3px) translateY(-1px);
  box-shadow: 0 3px 10px rgba(98,188,197,.12);
}

/* ─── Open button — lift + glow on hover ─────────────── */

.ov-open-btn:hover {
  box-shadow: 0 8px 22px rgba(20,67,109,.22);
  transform: translateY(-1px);
}

/* ─── Dark mode overrides ─────────────────────────────── */

body.theme-dark .topbar::after {
  background: linear-gradient(90deg, transparent, rgba(143,217,224,.52), transparent);
  opacity: .52;
}

body.theme-dark .agenda-overview {
  background:
    radial-gradient(ellipse 920px 440px at -6% -18%, rgba(98,188,197,.11), transparent 64%),
    radial-gradient(ellipse 580px 290px at 110% 2%, rgba(20,67,109,.22), transparent 54%),
    transparent;
}

body.theme-dark .agenda-overview-head h2 {
  background: linear-gradient(132deg, #c4e8f8 15%, var(--teal-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-dark .ov-card:hover {
  transform: translateY(-5px) scale(1.010);
  box-shadow:
    0 22px 46px rgba(0,8,18,.44),
    0 0 0 1.5px rgba(143,217,224,.36);
  border-color: rgba(143,217,224,.40);
}

body.theme-dark .ov-card::after {
  background: linear-gradient(
    112deg,
    transparent 0%,
    rgba(143,217,224,.06) 38%,
    rgba(143,217,224,.11) 50%,
    rgba(143,217,224,.06) 62%,
    transparent 100%
  );
}

body.theme-dark .ov-card:hover .ov-avatar {
  box-shadow:
    0 0 0 3px rgba(10,22,38,.80),
    0 0 0 5px var(--doc-color),
    0 6px 20px rgba(0,8,18,.52);
}

body.theme-dark .ov-card:hover .ov-kpi {
  background: rgba(14,28,44,.88);
  border-color: rgba(143,217,224,.26);
  box-shadow: 0 2px 10px rgba(143,217,224,.08);
}

body.theme-dark .ov-card:hover .ov-kpi-value {
  color: var(--teal-400);
}

body.theme-dark .ov-next-row.can-edit:hover {
  border-color: rgba(143,217,224,.36);
  background: rgba(18,44,64,.88);
  box-shadow: 0 3px 10px rgba(0,8,18,.28);
}

body.theme-dark .ov-open-btn:hover {
  box-shadow: 0 8px 22px rgba(15,23,42,.30);
}

/* ════════════════════════════════════════════════════════
   MINI CALENDAR — Futuristic Visual Layer
   ════════════════════════════════════════════════════════ */

@keyframes mc-day-select {
  0%   { box-shadow: 0 0 0 0 rgba(98,188,197,.52); }
  60%  { box-shadow: 0 0 0 7px rgba(98,188,197,0); }
  100% { box-shadow: 0 12px 24px rgba(58,160,170,.28); }
}

@keyframes mc-label-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Container: más profundidad y glass */
.rp-block #mc-container {
  background:
    radial-gradient(circle at 20% 10%, rgba(98,188,197,.16), transparent 44%),
    linear-gradient(160deg, rgba(247,252,255,.98) 0%, rgba(240,249,255,.96) 100%);
  border: 1px solid rgba(98,188,197,.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 14px 32px rgba(24,63,96,.09),
    0 0 0 1px rgba(98,188,197,.08);
}

/* Etiqueta del mes con animación al cambiar */
.mc-month-label {
  font-size: 13.5px;
  letter-spacing: -.3px;
  background: linear-gradient(130deg, var(--blue-800) 10%, var(--teal-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: mc-label-in .22s ease-out both;
}

/* Botones nav con forma más definida */
.mc-nav-btn {
  border-radius: 8px;
  transition:
    transform 160ms cubic-bezier(.22,1,.36,1),
    background var(--t-fast),
    box-shadow var(--t-fast),
    border-color var(--t-fast);
}
.mc-nav-btn:hover {
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 8px 18px rgba(27,76,111,.14);
}
.mc-nav-btn:active {
  transform: scale(.94);
}

/* Cabecera de días: letra más pequeña y espaciada */
.mc-day-header {
  font-size: 9px;
  letter-spacing: .7px;
  color: var(--teal-700);
  opacity: .7;
}

/* Día base: radio menor = más modern */
.mc-day {
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  transition:
    transform 160ms cubic-bezier(.22,1,.36,1),
    background var(--t-fast),
    box-shadow var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast);
}

/* Hover: glow suave */
.mc-day:hover {
  background: linear-gradient(160deg, rgba(98,188,197,.20), rgba(98,188,197,.12));
  border-color: rgba(98,188,197,.32);
  box-shadow:
    0 4px 14px rgba(56,113,151,.14),
    inset 0 1px 0 rgba(255,255,255,.8);
  transform: translateY(-2px) scale(1.05);
}

/* Hoy: anillo de color azul nítido */
.mc-day.mc-today {
  background: linear-gradient(160deg, rgba(232,234,255,.96), rgba(240,242,255,.92));
  border-color: rgba(47,62,201,.20);
  font-weight: 800;
  color: var(--blue-700);
}

/* Seleccionado: azul Akito */
.mc-day.mc-selected {
  background: linear-gradient(160deg, var(--blue-700), var(--blue-800));
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(47,62,201,.28), 0 10px 22px rgba(47,62,201,.28);
  animation: mc-day-select .38s cubic-bezier(.22,1,.36,1) both;
}
.mc-day.mc-selected:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(47,62,201,.36), 0 12px 26px rgba(47,62,201,.32);
}

/* Hoy + seleccionado */
.mc-day.mc-today.mc-selected {
  background: linear-gradient(160deg, var(--blue-700), var(--blue-900));
  box-shadow: 0 0 0 2px rgba(47,62,201,.30), 0 10px 22px rgba(47,62,201,.34);
}

/* Días de otros meses más sutiles */
.mc-day.mc-other {
  opacity: .45;
  background: transparent;
}

/* Indicador de turnos */
.mc-day.mc-has-turns::after {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  bottom: 2.5px;
  background: var(--blue-700);
  box-shadow: 0 0 4px rgba(47,62,201,.40);
  opacity: .78;
}
.mc-day.mc-has-turns:hover::after {
  opacity: 1;
  box-shadow: 0 0 6px rgba(47,62,201,.55);
  transform: translateX(-50%) scale(1.2);
}
.mc-day.mc-selected.mc-has-turns::after {
  background: rgba(255,255,255,.95);
  box-shadow: 0 0 4px rgba(255,255,255,.50);
}

/* ─── Dark mode ───────────────────────────────────────── */

body.theme-dark .rp-block #mc-container {
  background:
    radial-gradient(circle at 20% 10%, rgba(98,188,197,.13), transparent 44%),
    linear-gradient(160deg, rgba(13,24,39,.97) 0%, rgba(9,19,32,.96) 100%);
  border-color: rgba(143,217,224,.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 14px 32px rgba(2,8,18,.38),
    0 0 0 1px rgba(143,217,224,.06);
}

body.theme-dark .mc-month-label {
  background: linear-gradient(130deg, #c4e8f8 10%, var(--teal-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-dark .mc-day-header {
  color: var(--teal-400);
}

body.theme-dark .mc-day {
  background: rgba(14,28,44,.70);
  color: #cfe2f3;
  border-color: rgba(143,217,224,.06);
}

body.theme-dark .mc-day:hover {
  background: linear-gradient(160deg, rgba(143,217,224,.14), rgba(143,217,224,.08));
  border-color: rgba(143,217,224,.28);
  box-shadow: 0 4px 14px rgba(2,8,18,.38), inset 0 1px 0 rgba(255,255,255,.04);
  color: #f3fbff;
}

body.theme-dark .mc-day.mc-today {
  background: linear-gradient(160deg, rgba(31,63,104,.94), rgba(20,45,79,.90));
  border-color: rgba(143,217,224,.22);
  color: #f2f8ff;
}

body.theme-dark .mc-day.mc-selected {
  background: linear-gradient(160deg, #52b9c3, #3e9fa9);
  color: #08131d;
  box-shadow: 0 0 0 2px rgba(143,217,224,.32), 0 10px 22px rgba(0,8,18,.44);
}

body.theme-dark .mc-day.mc-today.mc-selected {
  background: linear-gradient(160deg, #5a91d1, #3f74b4);
  color: #f4f9ff;
}

body.theme-dark .mc-day.mc-other {
  background: rgba(10,21,34,.86);
  color: #6f88a3;
  opacity: .55;
}

body.theme-dark .mc-day.mc-has-turns::after {
  background: var(--teal-400);
  box-shadow: 0 0 5px rgba(143,217,224,.44);
}

/* Reception right panel refresh */
.rp-block--actions {
  background:
    radial-gradient(circle at top left, rgba(98,188,197,.10), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,250,253,.98));
}

.rp-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.rp-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.35px;
  color: var(--blue-900);
}

.rp-copy {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--n-500);
}

.rp-pulse-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(98,188,197,.18);
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 22px rgba(24,63,96,.08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .45px;
  text-transform: uppercase;
  color: var(--teal-800);
  white-space: nowrap;
}

.qa-grid {
  gap: 10px;
}

.qa-btn {
  position: relative;
  min-height: 108px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(139,163,191,.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,249,252,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    0 16px 28px rgba(24,63,96,.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  overflow: hidden;
  transition:
    transform 180ms cubic-bezier(.22,1,.36,1),
    box-shadow var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    background var(--t-fast);
}

.qa-btn::before {
  content: '';
  position: absolute;
  inset: auto -28% -50% auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98,188,197,.18), transparent 70%);
  opacity: .8;
  pointer-events: none;
}

.qa-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(255,255,255,.08), transparent 42%, rgba(90,120,158,.10));
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}

.qa-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(90,120,158,.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 22px 34px rgba(24,63,96,.12);
}

.qa-btn:hover::after {
  opacity: 1;
}

.qa-btn--hero,
.qa-btn--wide {
  grid-column: 1 / -1;
}

.qa-btn--hero,
.qa-btn--wide {
  flex-direction: row;
  align-items: center;
}

.qa-btn--hero {
  min-height: 132px;
}

.qa-btn--wide {
  min-height: 94px;
}

.qa-icon-wrap {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(139,163,191,.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    0 12px 18px rgba(24,63,96,.10);
  flex: 0 0 auto;
}

.qa-btn--hero .qa-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.qa-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.qa-btn--hero .qa-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.qa-copy-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.qa-btn--hero .qa-copy-wrap,
.qa-btn--wide .qa-copy-wrap {
  flex: 1;
}

.qa-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--n-400);
}

.qa-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--n-900);
}

.qa-btn--hero .qa-title {
  font-size: 16px;
  letter-spacing: -.2px;
}

.qa-meta {
  font-size: 11px;
  line-height: 1.45;
  color: var(--n-500);
}

.qa-arrow {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(139,163,191,.18);
  box-shadow: 0 8px 14px rgba(24,63,96,.10);
  flex: 0 0 auto;
}

.qa-arrow svg {
  width: 13px;
  height: 13px;
}

.qa-btn.qa-primary {
  border-color: rgba(14,34,54,.12);
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.14), transparent 38%),
    linear-gradient(145deg, #183552 0%, #0d2236 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 18px 30px rgba(13,34,54,.24);
}

.qa-btn.qa-teal {
  border-color: rgba(39,76,118,.24);
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 42%),
    linear-gradient(145deg, #2d5a8d 0%, #18385c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 18px 30px rgba(24,56,92,.22);
}

.qa-btn.qa-primary .qa-title,
.qa-btn.qa-primary .qa-kicker,
.qa-btn.qa-primary .qa-meta,
.qa-btn.qa-teal .qa-title,
.qa-btn.qa-teal .qa-kicker,
.qa-btn.qa-teal .qa-meta {
  color: #fff;
}

.qa-btn.qa-primary .qa-kicker,
.qa-btn.qa-teal .qa-kicker {
  color: rgba(255,255,255,.72);
}

.qa-btn.qa-primary .qa-meta,
.qa-btn.qa-teal .qa-meta {
  color: rgba(255,255,255,.82);
}

.qa-btn.qa-primary .qa-icon-wrap,
.qa-btn.qa-primary .qa-arrow,
.qa-btn.qa-teal .qa-icon-wrap,
.qa-btn.qa-teal .qa-arrow {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}

.qa-btn.qa-primary:hover,
.qa-btn.qa-teal:hover {
  border-color: rgba(255,255,255,.18);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 20px 32px rgba(13,34,54,.24);
}

.qa-btn.qa-primary:hover {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 38%),
    linear-gradient(145deg, #1d3e61 0%, #10293f 100%);
}

.qa-btn.qa-teal:hover {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 42%),
    linear-gradient(145deg, #35679d 0%, #1d446c 100%);
}

.mc-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  margin-bottom: 14px;
}

.mc-insight {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(139,163,191,.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(247,251,255,.76));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.mc-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--teal-700);
}

.mc-summary {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-900);
  line-height: 1.2;
}

.mc-meta {
  font-size: 11px;
  line-height: 1.4;
  color: var(--n-500);
}

.mc-meter {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(139,163,191,.16);
  overflow: hidden;
  margin-top: 2px;
}

.mc-meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-500), var(--blue-700));
  transition: width var(--t-slow);
}

.mc-month-total {
  min-width: 0;
  padding: 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(139,163,191,.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(243,248,252,.86));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 10px 18px rgba(24,63,96,.08);
  display: grid;
  gap: 2px;
  align-content: center;
  text-align: left;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.mc-month-total:hover {
  transform: translateY(-2px);
  border-color: rgba(98,188,197,.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.84),
    0 16px 24px rgba(24,63,96,.12);
}

.mc-month-total strong {
  font-size: 21px;
  line-height: 1;
  color: var(--blue-800);
}

.mc-month-total span {
  font-size: 9.5px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--n-500);
}

.mc-grid {
  gap: 7px;
}

.mc-day {
  padding: 8px 8px 14px;
  align-items: flex-start;
  justify-content: flex-start;
}

.mc-day-number {
  position: relative;
  z-index: 1;
}

.mc-day-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(139,163,191,.16);
  box-shadow: 0 8px 14px rgba(24,63,96,.08);
  font-size: 9px;
  font-weight: 800;
  color: var(--blue-800);
  line-height: 1;
}

.mc-day.mc-has-turns::after {
  left: 8px;
  bottom: 6px;
  transform: none;
  width: 18px;
  height: 4px;
}

.mc-day.mc-density-1:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(236,248,251,.92), rgba(247,251,255,.86));
  border-color: rgba(98,188,197,.18);
}

.mc-day.mc-density-2:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(223,243,248,.94), rgba(240,249,255,.88));
  border-color: rgba(98,188,197,.22);
}

.mc-day.mc-density-3:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(206,238,244,.96), rgba(230,245,252,.92));
  border-color: rgba(98,188,197,.28);
}

.mc-day.mc-density-4:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(184,230,238,.98), rgba(220,241,250,.94));
  border-color: rgba(98,188,197,.34);
}

.mc-day:hover .mc-day-count {
  transform: translateY(-1px);
}

.mc-day.mc-selected .mc-day-count {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.22);
  color: #fff;
  box-shadow: none;
}

.mc-day.mc-today.mc-selected .mc-day-count {
  background: rgba(255,255,255,.16);
}

body.theme-dark .rp-block--actions {
  background:
    radial-gradient(circle at top left, rgba(143,217,224,.10), transparent 44%),
    linear-gradient(180deg, rgba(18,37,55,.98), rgba(12,27,41,.98));
}

body.theme-dark .rp-title {
  color: #eef8ff;
}

body.theme-dark .rp-copy {
  color: var(--n-500);
}

body.theme-dark .rp-pulse-chip {
  border-color: rgba(143,217,224,.16);
  background: rgba(15,29,45,.74);
  box-shadow: 0 12px 24px rgba(0,8,18,.22);
  color: #bff7fb;
}

body.theme-dark .qa-btn {
  border-color: rgba(143,217,224,.12);
  background:
    linear-gradient(180deg, rgba(18,37,55,.96), rgba(14,28,44,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 16px 28px rgba(0,8,18,.28);
}

body.theme-dark .qa-btn:hover {
  border-color: rgba(143,217,224,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 22px 34px rgba(0,8,18,.34);
}

body.theme-dark .qa-title {
  color: #eef8ff;
}

body.theme-dark .qa-kicker,
body.theme-dark .qa-meta {
  color: var(--n-500);
}

body.theme-dark .qa-icon-wrap,
body.theme-dark .qa-arrow {
  background: rgba(9,20,32,.58);
  border-color: rgba(143,217,224,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

body.theme-dark .qa-btn.qa-primary {
  background:
    radial-gradient(circle at top right, rgba(103,136,176,.08), transparent 38%),
    linear-gradient(145deg, #173552 0%, #0d2236 100%);
  border-color: rgba(103,136,176,.16);
}

body.theme-dark .qa-btn.qa-teal {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.10), transparent 38%),
    linear-gradient(145deg, #264d7b 0%, #162f4c 100%);
  border-color: rgba(103,136,176,.18);
}

body.theme-dark .mc-insight,
body.theme-dark .mc-month-total {
  border-color: rgba(143,217,224,.12);
  background:
    linear-gradient(180deg, rgba(18,37,55,.84), rgba(12,27,41,.90));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 24px rgba(0,8,18,.24);
}

body.theme-dark .mc-summary,
body.theme-dark .mc-month-total strong {
  color: #eef8ff;
}

body.theme-dark .mc-kicker {
  color: var(--teal-400);
}

body.theme-dark .mc-meta,
body.theme-dark .mc-month-total span {
  color: var(--n-500);
}

body.theme-dark .mc-meter {
  background: rgba(143,217,224,.10);
}

body.theme-dark .mc-day-count {
  background: rgba(9,20,32,.70);
  border-color: rgba(143,217,224,.12);
  box-shadow: 0 8px 16px rgba(0,8,18,.24);
  color: #d8faff;
}

body.theme-dark .mc-day.mc-density-1:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(16,35,50,.82), rgba(13,28,42,.80));
}

body.theme-dark .mc-day.mc-density-2:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(18,42,59,.88), rgba(14,33,48,.84));
  border-color: rgba(143,217,224,.16);
}

body.theme-dark .mc-day.mc-density-3:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(21,50,68,.92), rgba(15,38,55,.88));
  border-color: rgba(143,217,224,.22);
}

body.theme-dark .mc-day.mc-density-4:not(.mc-selected):not(.mc-today) {
  background: linear-gradient(180deg, rgba(27,60,78,.96), rgba(18,44,64,.92));
  border-color: rgba(143,217,224,.28);
}

/* Compact right-panel tuning */
@keyframes qa-compact-sheen {
  from { transform: translateX(-145%) skewX(-16deg); }
  to   { transform: translateX(260%) skewX(-16deg); }
}

@keyframes mc-orbit-pulse {
  0%, 100% { opacity: .42; transform: scale(.94); }
  50% { opacity: .92; transform: scale(1.08); }
}

@keyframes mc-container-breathe {
  0%, 100% { box-shadow: 0 18px 36px rgba(24,63,96,.10), 0 0 0 1px rgba(98,188,197,.10), inset 0 1px 0 rgba(255,255,255,.82); }
  50% { box-shadow: 0 20px 40px rgba(24,63,96,.13), 0 0 0 1px rgba(98,188,197,.16), inset 0 1px 0 rgba(255,255,255,.88); }
}

.rp-block--actions {
  background: transparent;
}

.rp-block--actions .rp-label {
  margin-bottom: 12px;
}

.rp-block--actions .qa-grid {
  gap: 6px;
}

.rp-block--actions .qa-grid.qa-grid--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rp-block--actions .qa-btn {
  min-height: 0;
  padding: 11px 8px;
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.rp-block--actions .qa-grid--duo .qa-btn {
  min-height: 88px;
  padding: 12px 10px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  border-radius: 16px;
  border-color: rgba(120,145,173,.18);
  background: linear-gradient(180deg, rgba(250,252,255,.98), rgba(243,247,251,.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 6px 14px rgba(24,63,96,.08);
}

.rp-block--actions .qa-grid--duo .qa-btn::before {
  display: none;
}

.rp-block--actions .qa-grid--duo .qa-btn::after {
  width: 46px;
  height: 46px;
  background: radial-gradient(circle, rgba(45,90,141,.10), transparent 74%);
  opacity: .5;
}

.rp-block--actions .qa-grid--duo .qa-btn.qa-teal {
  border-color: rgba(74,117,160,.18);
  background: linear-gradient(180deg, rgba(248,251,255,.98), rgba(238,245,251,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 6px 14px rgba(37,76,116,.08);
}

.rp-block--actions .qa-grid--duo .qa-btn.qa-primary {
  border-color: rgba(95,122,153,.18);
  background: linear-gradient(180deg, rgba(247,250,253,.98), rgba(236,242,248,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    0 6px 14px rgba(24,63,96,.08);
}

.rp-block--actions .qa-btn::before {
  content: '';
  position: absolute;
  top: -115%;
  left: -42%;
  width: 46%;
  height: 250%;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255,255,255,.14) 38%,
    rgba(255,255,255,.28) 50%,
    rgba(255,255,255,.14) 62%,
    transparent 100%
  );
  transform: translateX(-145%) skewX(-16deg);
  opacity: 0;
  pointer-events: none;
}

.rp-block--actions .qa-btn::after {
  content: '';
  position: absolute;
  inset: auto auto -20px -10px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,90,141,.18), transparent 72%);
  opacity: .82;
  pointer-events: none;
}

.rp-block--actions .qa-btn:hover::before {
  opacity: 1;
  animation: qa-compact-sheen .72s ease-out forwards;
}

.rp-block--actions .qa-btn svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  transition: transform 160ms cubic-bezier(.22,1,.36,1), filter 160ms ease;
}

.rp-block--actions .qa-btn:hover svg {
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 3px 8px rgba(24,63,96,.18));
}

.rp-block--actions .qa-grid--duo .qa-btn.qa-primary:hover,
.rp-block--actions .qa-grid--duo .qa-btn.qa-teal:hover {
  transform: translateY(-1px);
  border-color: rgba(95,122,153,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.84),
    0 10px 18px rgba(24,63,96,.10);
}

.rp-block--actions .qa-grid--duo .qa-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  border-color: rgba(120,145,173,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

.rp-block--actions .qa-grid--duo .qa-icon-wrap svg {
  width: 15px;
  height: 15px;
  color: #35597f;
}

.rp-block--actions .qa-grid--duo .qa-copy-wrap {
  gap: 0;
}

.rp-block--actions .qa-grid--duo .qa-title {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: -.1px;
  text-align: center;
  color: #294562;
}

.qa-btn-label {
  position: relative;
  z-index: 1;
  display: block;
}

@media (max-width: 640px) {
  .rp-block--actions .qa-grid.qa-grid--duo {
    grid-template-columns: 1fr;
  }

  .rp-block--actions .qa-grid--duo .qa-btn {
    min-height: 82px;
  }
}

.mc-topline {
  display: none;
}

.rp-block #mc-container {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(98,188,197,.18);
  background:
    radial-gradient(circle at 16% 10%, rgba(98,188,197,.18), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(0,78,124,.08), transparent 28%),
    linear-gradient(180deg, rgba(244,251,255,.98), rgba(236,247,253,.96) 48%, rgba(247,251,255,.98) 100%);
  box-shadow:
    0 18px 36px rgba(24,63,96,.10),
    0 0 0 1px rgba(98,188,197,.10),
    inset 0 1px 0 rgba(255,255,255,.82);
  animation: mc-container-breathe 5.4s ease-in-out infinite;
}

.rp-block #mc-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 24px, rgba(98,188,197,.06) 24px, rgba(98,188,197,.06) 25px, transparent 25px),
    linear-gradient(0deg, transparent 24px, rgba(98,188,197,.05) 24px, rgba(98,188,197,.05) 25px, transparent 25px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.65), transparent 84%);
  pointer-events: none;
  opacity: .48;
  z-index: 0;
}

.rp-block #mc-container::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow:
    inset 0 0 0 1px rgba(98,188,197,.08),
    0 0 0 1px rgba(98,188,197,.04);
  pointer-events: none;
  z-index: 0;
}

.rp-block #mc-container > * {
  position: relative;
  z-index: 1;
}

.rp-block #mc-container .mc-nav {
  margin-bottom: 14px;
}

.rp-block #mc-container .mc-month-label {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -.28px;
  text-shadow: 0 0 14px rgba(98,188,197,.14);
}

.rp-block #mc-container .mc-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,248,253,.78));
  border: 1px solid rgba(98,188,197,.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    0 10px 18px rgba(24,63,96,.08);
}

.rp-block #mc-container .mc-nav-btn:hover {
  background:
    linear-gradient(180deg, rgba(238,251,255,.98), rgba(225,244,250,.92));
  border-color: rgba(98,188,197,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 14px 22px rgba(24,63,96,.14),
    0 0 0 1px rgba(98,188,197,.10);
}

.rp-block #mc-container .mc-day-header {
  color: #5caeb8;
  font-size: 8.8px;
  letter-spacing: .9px;
  opacity: .86;
  text-shadow: 0 0 10px rgba(98,188,197,.14);
}

.rp-block #mc-container .mc-day {
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(98,188,197,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(241,248,253,.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.90),
    0 6px 12px rgba(24,63,96,.04);
  backdrop-filter: blur(8px) saturate(118%);
  -webkit-backdrop-filter: blur(8px) saturate(118%);
}

.rp-block #mc-container .mc-day-count {
  display: none;
}

.rp-block #mc-container .mc-day-number {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -.2px;
  transition: transform 160ms cubic-bezier(.22,1,.36,1), text-shadow 160ms ease;
}

.rp-block #mc-container .mc-day:hover {
  border-color: rgba(98,188,197,.24);
  background:
    linear-gradient(180deg, rgba(235,249,252,.98), rgba(220,242,248,.84));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.94),
    0 12px 18px rgba(24,63,96,.10),
    0 0 0 1px rgba(98,188,197,.08);
}

.rp-block #mc-container .mc-day:hover .mc-day-number {
  transform: translateY(-1px);
  text-shadow: 0 0 10px rgba(98,188,197,.28);
}

.rp-block #mc-container .mc-day.mc-today {
  border-color: rgba(76,132,199,.22);
  background:
    linear-gradient(180deg, rgba(228,240,255,.98), rgba(216,236,255,.86));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 10px 18px rgba(54,104,168,.10),
    0 0 0 1px rgba(76,132,199,.08);
}

.rp-block #mc-container .mc-day.mc-selected {
  color: #fff;
  border-color: rgba(4,89,120,.10);
  background:
    linear-gradient(180deg, #23adc1 0%, #0f8fa8 54%, #0b7698 100%);
  box-shadow:
    0 14px 24px rgba(11,118,152,.26),
    0 0 0 1px rgba(14,146,172,.16),
    0 0 18px rgba(35,173,193,.22);
}

.rp-block #mc-container .mc-day.mc-selected .mc-day-number {
  text-shadow: 0 0 12px rgba(255,255,255,.20);
}

.rp-block #mc-container .mc-day.mc-today.mc-selected {
  background:
    linear-gradient(180deg, #0d568e 0%, #0b4778 52%, #083962 100%);
  box-shadow:
    0 14px 24px rgba(8,57,98,.26),
    0 0 0 1px rgba(69,134,202,.18),
    0 0 18px rgba(69,134,202,.20);
}

.rp-block #mc-container .mc-day.mc-other {
  background: rgba(247,250,252,.28);
  border-color: transparent;
  opacity: .54;
}

.rp-block #mc-container .mc-day.mc-has-turns::after {
  left: 50%;
  bottom: 3px;
  width: 10px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(98,188,197,.88), rgba(0,78,124,.82));
  box-shadow:
    0 0 8px rgba(98,188,197,.24),
    0 0 14px rgba(98,188,197,.18);
  animation: mc-orbit-pulse 2.4s ease-in-out infinite;
}

.rp-block #mc-container .mc-day.mc-selected.mc-has-turns::after {
  background: linear-gradient(90deg, rgba(255,255,255,.92), rgba(210,245,250,.92));
  box-shadow:
    0 0 10px rgba(255,255,255,.20),
    0 0 16px rgba(255,255,255,.14);
}

.rp-block #mc-container .mc-day.mc-density-1:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(242,249,253,.96), rgba(233,246,250,.80));
}

.rp-block #mc-container .mc-day.mc-density-2:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(232,247,251,.98), rgba(219,241,247,.84));
  border-color: rgba(98,188,197,.12);
}

.rp-block #mc-container .mc-day.mc-density-3:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(219,243,248,.98), rgba(204,235,244,.88));
  border-color: rgba(98,188,197,.18);
}

.rp-block #mc-container .mc-day.mc-density-4:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(207,238,245,.98), rgba(188,229,239,.92));
  border-color: rgba(98,188,197,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.94),
    0 8px 16px rgba(24,63,96,.08),
    0 0 12px rgba(98,188,197,.10);
}

body.theme-dark .rp-block--actions .qa-btn::before {
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(103,136,176,.06) 38%,
    rgba(103,136,176,.14) 50%,
    rgba(103,136,176,.06) 62%,
    transparent 100%
  );
}

body.theme-dark .rp-block--actions .qa-btn::after {
  background: radial-gradient(circle, rgba(103,136,176,.16), transparent 72%);
}

body.theme-dark .rp-block #mc-container {
  border-color: rgba(143,217,224,.16);
  background:
    radial-gradient(circle at 16% 10%, rgba(143,217,224,.12), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(34,82,128,.18), transparent 28%),
    linear-gradient(180deg, rgba(10,20,32,.98), rgba(11,24,38,.96) 48%, rgba(8,18,29,.98) 100%);
  box-shadow:
    0 20px 40px rgba(0,8,18,.36),
    0 0 0 1px rgba(143,217,224,.08),
    inset 0 1px 0 rgba(255,255,255,.04);
}

body.theme-dark .rp-block #mc-container::before {
  background:
    linear-gradient(90deg, transparent 24px, rgba(143,217,224,.05) 24px, rgba(143,217,224,.05) 25px, transparent 25px),
    linear-gradient(0deg, transparent 24px, rgba(143,217,224,.04) 24px, rgba(143,217,224,.04) 25px, transparent 25px);
  opacity: .40;
}

body.theme-dark .rp-block #mc-container::after {
  border-color: rgba(255,255,255,.05);
  box-shadow:
    inset 0 0 0 1px rgba(143,217,224,.08),
    0 0 0 1px rgba(143,217,224,.03);
}

body.theme-dark .rp-block #mc-container .mc-month-label {
  text-shadow: 0 0 16px rgba(143,217,224,.16);
}

body.theme-dark .rp-block #mc-container .mc-nav-btn {
  background:
    linear-gradient(180deg, rgba(15,31,49,.96), rgba(11,23,37,.92));
  border-color: rgba(143,217,224,.14);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 10px 18px rgba(0,8,18,.22);
}

body.theme-dark .rp-block #mc-container .mc-nav-btn:hover {
  background:
    linear-gradient(180deg, rgba(19,39,58,.98), rgba(13,27,42,.94));
  border-color: rgba(143,217,224,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 14px 22px rgba(0,8,18,.28),
    0 0 0 1px rgba(143,217,224,.08);
}

body.theme-dark .rp-block #mc-container .mc-day-header {
  color: #83dfe6;
  text-shadow: 0 0 12px rgba(143,217,224,.18);
}

body.theme-dark .rp-block #mc-container .mc-day {
  border-color: rgba(143,217,224,.08);
  background:
    linear-gradient(180deg, rgba(15,29,45,.88), rgba(12,24,38,.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 14px rgba(0,8,18,.16);
}

body.theme-dark .rp-block #mc-container .mc-day:hover {
  border-color: rgba(143,217,224,.22);
  background:
    linear-gradient(180deg, rgba(18,42,60,.96), rgba(14,31,47,.82));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 14px 20px rgba(0,8,18,.26),
    0 0 0 1px rgba(143,217,224,.06);
}

body.theme-dark .rp-block #mc-container .mc-day:hover .mc-day-number {
  text-shadow: 0 0 12px rgba(143,217,224,.24);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-today {
  border-color: rgba(83,145,209,.22);
  background:
    linear-gradient(180deg, rgba(22,52,84,.96), rgba(16,38,63,.86));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 18px rgba(6,22,40,.24),
    0 0 0 1px rgba(83,145,209,.08);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-selected {
  color: #eafcff;
  border-color: rgba(143,217,224,.18);
  background:
    linear-gradient(180deg, #2eb6c8 0%, #1b90a9 54%, #146e88 100%);
  box-shadow:
    0 14px 24px rgba(2,8,18,.36),
    0 0 0 1px rgba(143,217,224,.12),
    0 0 18px rgba(46,182,200,.24);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-today.mc-selected {
  background:
    linear-gradient(180deg, #1f6fae 0%, #185989 54%, #113f65 100%);
  box-shadow:
    0 14px 24px rgba(2,8,18,.38),
    0 0 0 1px rgba(83,145,209,.16),
    0 0 18px rgba(83,145,209,.22);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-other {
  background: rgba(7,16,26,.42);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-has-turns::after {
  background: linear-gradient(90deg, rgba(143,217,224,.92), rgba(83,145,209,.88));
  box-shadow:
    0 0 8px rgba(143,217,224,.24),
    0 0 16px rgba(143,217,224,.18);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-selected.mc-has-turns::after {
  background: linear-gradient(90deg, rgba(255,255,255,.94), rgba(214,246,251,.92));
}

body.theme-dark .rp-block #mc-container .mc-day.mc-density-1:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(13,28,42,.86), rgba(11,23,36,.74));
}

body.theme-dark .rp-block #mc-container .mc-day.mc-density-2:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(15,34,50,.90), rgba(12,26,40,.80));
  border-color: rgba(143,217,224,.10);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-density-3:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(18,42,60,.94), rgba(14,31,47,.84));
  border-color: rgba(143,217,224,.14);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-density-4:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(22,50,68,.98), rgba(16,38,58,.88));
  border-color: rgba(143,217,224,.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 10px 18px rgba(0,8,18,.22),
    0 0 14px rgba(143,217,224,.08);
}

body.theme-dark .rp-block #mc-container .mc-day-count {
  display: none;
}

/* Mini calendar — clean futuristic refinement */
@keyframes mc-clean-dot {
  0%, 100% { opacity: .72; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.22); }
}

@keyframes mc-clean-selected-glow {
  0%, 100% {
    box-shadow:
      0 10px 20px rgba(22,50,83,.18),
      0 0 0 3px rgba(90,120,158,.14);
  }
  50% {
    box-shadow:
      0 12px 24px rgba(22,50,83,.22),
      0 0 0 5px rgba(90,120,158,.08);
  }
}

.rp-block #mc-container {
  animation: none;
  border-radius: 20px;
  border: 1px solid rgba(205,216,228,.92);
  background:
    radial-gradient(circle at 18% 0%, rgba(45,90,141,.08), transparent 28%),
    linear-gradient(180deg, rgba(251,252,254,.98), rgba(244,246,250,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.92),
    0 12px 28px rgba(25,47,72,.08);
}

.rp-block #mc-container::before,
.rp-block #mc-container::after {
  content: none;
  display: none;
}

.rp-block #mc-container .mc-nav {
  margin-bottom: 12px;
}

.rp-block #mc-container .mc-month-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.2px;
  text-shadow: none;
}

.rp-block #mc-container .mc-nav-btn {
  border-radius: 10px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(214,223,232,.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.94),
    0 6px 14px rgba(25,47,72,.06);
}

.rp-block #mc-container .mc-nav-btn:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,246,250,.92));
  border-color: rgba(91,120,158,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.96),
    0 8px 16px rgba(25,47,72,.10);
  transform: translateY(-1px);
}

.rp-block #mc-container .mc-day-header {
  font-size: 9px;
  letter-spacing: .65px;
  color: #7a8ea5;
  text-shadow: none;
  opacity: .92;
}

.rp-block #mc-container .mc-grid {
  gap: 6px;
}

.rp-block #mc-container .mc-day {
  border-radius: 10px;
  border: 1px solid rgba(229,234,240,.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(247,248,250,.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.94),
    0 4px 10px rgba(25,47,72,.04);
  backdrop-filter: blur(6px) saturate(112%);
  -webkit-backdrop-filter: blur(6px) saturate(112%);
}

.rp-block #mc-container .mc-day-number {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -.1px;
  text-shadow: none;
}

.rp-block #mc-container .mc-day:hover {
  border-color: rgba(120,145,178,.32);
  background:
    linear-gradient(180deg, rgba(246,248,252,.98), rgba(239,243,248,.92));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.96),
    0 10px 16px rgba(25,47,72,.08);
  transform: translateY(-1px);
}

.rp-block #mc-container .mc-day:hover .mc-day-number {
  transform: none;
  text-shadow: none;
}

.rp-block #mc-container .mc-day.mc-today {
  border-color: rgba(123,140,168,.30);
  background:
    linear-gradient(180deg, rgba(241,244,250,.98), rgba(234,239,246,.92));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 8px 14px rgba(52,76,108,.08);
}

.rp-block #mc-container .mc-day.mc-selected {
  color: #fff;
  border-color: transparent;
  background:
    linear-gradient(180deg, #244e81 0%, #163253 100%);
  box-shadow:
    0 10px 20px rgba(22,50,83,.18),
    0 0 0 3px rgba(90,120,158,.14);
  animation: mc-clean-selected-glow 2.6s ease-in-out infinite;
}

.rp-block #mc-container .mc-day.mc-selected .mc-day-number {
  text-shadow: none;
}

.rp-block #mc-container .mc-day.mc-today.mc-selected {
  background:
    linear-gradient(180deg, #1f4574 0%, #132d4b 100%);
}

.rp-block #mc-container .mc-day.mc-other {
  background: rgba(255,255,255,.42);
  border-color: transparent;
  box-shadow: none;
  opacity: .45;
}

.rp-block #mc-container .mc-day.mc-has-turns::after {
  width: 4px;
  height: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: #5b7697;
  box-shadow: 0 0 0 4px rgba(91,118,151,.10);
  animation: mc-clean-dot 2.2s ease-in-out infinite;
}

.rp-block #mc-container .mc-day.mc-selected.mc-has-turns::after {
  background: rgba(255,255,255,.98);
  box-shadow: 0 0 0 4px rgba(255,255,255,.12);
}

.rp-block #mc-container .mc-day.mc-density-1:not(.mc-selected):not(.mc-today),
.rp-block #mc-container .mc-day.mc-density-2:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(250,251,253,.98), rgba(244,246,249,.86));
}

.rp-block #mc-container .mc-day.mc-density-3:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(245,248,251,.98), rgba(238,242,247,.90));
  border-color: rgba(216,225,236,.92);
}

.rp-block #mc-container .mc-day.mc-density-4:not(.mc-selected):not(.mc-today) {
  background:
    linear-gradient(180deg, rgba(241,244,249,.98), rgba(232,237,244,.92));
  border-color: rgba(198,209,223,.94);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.96),
    0 6px 12px rgba(25,47,72,.06);
}

body.theme-dark .rp-block #mc-container {
  border-color: rgba(103,136,176,.16);
  background:
    radial-gradient(circle at 18% 0%, rgba(103,136,176,.10), transparent 28%),
    linear-gradient(180deg, rgba(14,27,40,.98), rgba(10,22,34,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 16px 32px rgba(0, 8, 18, .28);
}

body.theme-dark .rp-block #mc-container .mc-nav-btn {
  background: rgba(17,34,50,.92);
  border-color: rgba(103,136,176,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 6px 14px rgba(0, 8, 18, .18);
}

body.theme-dark .rp-block #mc-container .mc-nav-btn:hover {
  background: rgba(20,40,58,.98);
  border-color: rgba(103,136,176,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 8px 16px rgba(0, 8, 18, .24);
}

body.theme-dark .rp-block #mc-container .mc-day-header {
  color: #9ab0cb;
}

body.theme-dark .rp-block #mc-container .mc-day {
  border-color: rgba(103,136,176,.08);
  background:
    linear-gradient(180deg, rgba(17,32,47,.90), rgba(13,25,38,.82));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 4px 10px rgba(0, 8, 18, .12);
}

body.theme-dark .rp-block #mc-container .mc-day:hover {
  border-color: rgba(103,136,176,.20);
  background:
    linear-gradient(180deg, rgba(20,40,58,.96), rgba(15,31,46,.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 16px rgba(0, 8, 18, .20);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-today {
  border-color: rgba(103,136,176,.22);
  background:
    linear-gradient(180deg, rgba(26,49,76,.96), rgba(18,35,54,.88));
}

body.theme-dark .rp-block #mc-container .mc-day.mc-selected {
  color: #eefbff;
  background:
    linear-gradient(180deg, #2d5a8d 0%, #18385c 100%);
  box-shadow:
    0 12px 22px rgba(0,8,18,.28),
    0 0 0 3px rgba(103,136,176,.10);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-today.mc-selected {
  background:
    linear-gradient(180deg, #284f7d 0%, #15324f 100%);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-other {
  background: rgba(255,255,255,.03);
}

body.theme-dark .rp-block #mc-container .mc-day.mc-has-turns::after {
  background: #9ab0cb;
  box-shadow: 0 0 0 4px rgba(154,176,203,.08);
}

/* Agenda mensual — compact month overview on desktop */
@media (min-width: 1200px) {
  .agenda-monthly-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .agenda-monthly-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 22px;
  }

  .agenda-monthly-head {
    margin-bottom: 10px;
    gap: 12px;
  }

  .agenda-monthly-kicker {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .agenda-monthly-head h2 {
    font-size: 22px;
  }

  .agenda-monthly-head p {
    margin-top: 6px;
    font-size: 12px;
  }

  .agenda-monthly-head .btn {
    min-height: 36px;
    padding: 0 12px;
  }

  .agenda-monthly-toolbar {
    margin-bottom: 10px;
    gap: 10px;
  }

  .agenda-monthly-search {
    min-height: 40px;
    border-radius: 14px;
    padding: 0 12px;
  }

  .agenda-monthly-search input {
    font-size: 12.5px;
  }

  .agenda-monthly-mode-switch {
    padding: 3px;
  }

  .agenda-monthly-mode-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .agenda-monthly-summary {
    gap: 8px;
    margin-bottom: 10px;
  }

  .agenda-monthly-stat {
    min-height: 70px;
    padding: 10px 12px;
    border-radius: 16px;
    gap: 2px;
  }

  .agenda-monthly-stat-label {
    font-size: 10px;
  }

  .agenda-monthly-stat-value {
    font-size: 20px;
  }

  .agenda-monthly-stat-meta {
    font-size: 11px;
    line-height: 1.3;
  }

  .agenda-monthly-legend {
    gap: 8px;
    margin-bottom: 10px;
  }

  .agenda-monthly-legend-item {
    padding: 6px 10px;
    font-size: 11px;
  }

  .agenda-monthly-grid {
    flex: 1;
    min-height: 0;
    gap: 8px;
    grid-template-rows: 20px repeat(6, minmax(0, 1fr));
    align-content: stretch;
  }

  .agenda-monthly-weekday {
    padding: 0 2px 4px;
    font-size: 10px;
  }

  .agenda-monthly-day {
    min-height: 0;
    height: 100%;
    padding: 8px;
    border-radius: 16px;
    gap: 6px;
    overflow: hidden;
  }

  .agenda-monthly-day-head {
    gap: 6px;
  }

  .agenda-monthly-day-head-main {
    gap: 4px;
  }

  .agenda-monthly-day-number {
    width: 28px;
    height: 28px;
    font-size: 12.5px;
  }

  .agenda-monthly-day-count {
    font-size: 10px;
    line-height: 1.25;
  }

  .agenda-monthly-day-link {
    padding: 0;
    font-size: 10px;
    letter-spacing: .06em;
  }

  .agenda-monthly-day-body {
    flex: 1;
    min-height: 0;
    gap: 4px;
    overflow: hidden;
  }

  .agenda-monthly-turno {
    gap: 6px;
    padding: 6px 7px;
    border-radius: 10px;
  }

  .agenda-monthly-turno-time {
    min-width: 56px;
    font-size: 10px;
  }

  .agenda-monthly-turno-copy {
    gap: 1px;
  }

  .agenda-monthly-turno-patient {
    font-size: 11px;
    line-height: 1.25;
  }

  .agenda-monthly-turno-prof {
    display: none;
  }

  .agenda-monthly-turno-meta {
    font-size: 10px;
    line-height: 1.25;
  }

  .agenda-monthly-more {
    margin-top: 0;
    padding: 6px 8px;
    font-size: 10px;
    border-radius: 10px;
  }

  .agenda-monthly-day-sheet {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────
   WEEKLY CALENDAR VIEW  (wcal-*)
   Vista tipo Google Calendar para configurar horarios.
   ───────────────────────────────────────────────────── */

/* Shell principal — ocupa todo el espacio del editor */
.wcal-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 0;
}

/* ── Topbar ─────────────────────────────────────────── */
.wcal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 14px;
  border-bottom: 1px solid var(--n-150, rgba(15,23,42,.08));
  flex-shrink: 0;
  background: var(--white, #fff);
}

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

.wcal-prof-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.wcal-prof-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-900, #0f172a);
  line-height: 1.2;
}

.wcal-prof-meta {
  font-size: 11px;
  color: var(--n-500, #64748b);
}

.wcal-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#wcal-save-btn.is-dirty {
  animation: wcal-pulse 2s infinite;
}

@keyframes wcal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .75; }
}

/* ── Layout calendario + panel lateral ─────────────── */
.wcal-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  gap: 0;
  height: 0; /* Forces the flex child to shrink properly */
}

/* ── Área del calendario ────────────────────────────── */
.wcal-calendar-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--n-150, rgba(15,23,42,.08));
}

/* Headers de los días */
.wcal-day-headers {
  display: grid;
  grid-template-columns: 44px repeat(7, 1fr);
  flex-shrink: 0;
  border-bottom: 1px solid var(--n-150, rgba(15,23,42,.08));
  background: var(--white, #fff);
}

.wcal-time-spacer {
  width: 44px;
  border-right: 1px solid var(--n-100, rgba(15,23,42,.05));
}

.wcal-day-header {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--n-500, #64748b);
  letter-spacing: .04em;
  text-transform: uppercase;
  border-right: 1px solid var(--n-100, rgba(15,23,42,.05));
}

.wcal-day-header:last-child { border-right: none; }

.wcal-day-header.is-today {
  color: var(--teal-600, #0d9488);
  background: rgba(13,148,136,.04);
}

/* Scroll del grid */
.wcal-grid-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  min-height: 0;
}

/* Grid interno */
#wcal-grid { min-height: 580px; }

.wcal-grid-inner {
  display: grid;
  grid-template-columns: 44px 1fr;
  min-height: 580px;
  position: relative;
}

/* Columna de horas */
.wcal-time-col {
  position: relative;
  border-right: 1px solid var(--n-100, rgba(15,23,42,.05));
  background: var(--white, #fff);
  flex-shrink: 0;
}

.wcal-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  transform: translateY(-50%);
}

.wcal-hour-label {
  display: block;
  padding-right: 6px;
  text-align: right;
  font-size: 9px;
  font-weight: 700;
  color: var(--n-400, #94a3b8);
  white-space: nowrap;
  transform: translateY(-50%);
  line-height: 1;
}

/* Días wrap — 7 columnas */
.wcal-days-wrap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 100%;
  position: relative;
}

/* Líneas horizontales de hora (via background) */
.wcal-days-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    180deg,
    transparent,
    transparent calc(100% / var(--wcal-hours, 14) - 1px),
    rgba(15,23,42,.04) calc(100% / var(--wcal-hours, 14) - 1px),
    rgba(15,23,42,.04) calc(100% / var(--wcal-hours, 14))
  );
  pointer-events: none;
  z-index: 0;
}

/* Columna de cada día */
.wcal-col {
  position: relative;
  border-right: 1px solid var(--n-100, rgba(15,23,42,.05));
  cursor: crosshair;
  user-select: none;
  min-height: 580px;
  min-width: 80px;
}

.wcal-col:last-child { border-right: none; }

.wcal-col.is-today { background: rgba(13,148,136,.025); }

.wcal-col-inner {
  position: absolute;
  inset: 0;
}

/* Bloque de horario */
.wcal-block {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  background: var(--wcal-block-color);
  opacity: .82;
  border: 1.5px solid var(--wcal-block-color);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
  transition: box-shadow .12s, border-color .12s, transform .08s, opacity .12s;
  min-height: 18px;
}

.wcal-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.72);
  pointer-events: none;
  z-index: 0;
}

.wcal-block > * { position: relative; z-index: 1; }

.wcal-block:hover {
  opacity: .92;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  z-index: 2;
}

.wcal-block.is-selected {
  opacity: 1;
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 4px var(--wcal-block-color), 0 4px 14px rgba(0,0,0,.2);
  z-index: 3;
  transform: translateX(-1px);
}

.wcal-block.is-overbook {
  --wcal-block-color: #a855f7;
}

.wcal-block-inner {
  padding: 3px 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.wcal-block-time {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcal-block-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.wcal-block-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: #a855f7;
  color: #fff;
  margin-top: 2px;
  letter-spacing: .04em;
}

/* Botón eliminar en el bloque */
.wcal-block-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(15,23,42,.12);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--n-500);
  z-index: 4;
  flex-shrink: 0;
  padding: 0;
}

.wcal-block:hover .wcal-block-del { display: flex; }

.wcal-block-del:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* Handle de resize en el fondo del bloque */
.wcal-block-resize {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  cursor: s-resize;
  display: flex;
  justify-content: center;
  align-items: center;
}

.wcal-block-resize::before {
  content: '';
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: rgba(15,23,42,.25);
}

/* Preview de drag al crear un bloque */
.wcal-drag-preview {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  background: rgba(14,165,233,.15);
  border: 1.5px dashed rgba(14,165,233,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(14,165,233,.8);
  pointer-events: none;
  z-index: 10;
  min-height: 10px;
}

/* ── Panel lateral de edición ───────────────────────── */
.wcal-panel-wrap {
  display: flex;
  flex-direction: column;
  background: var(--n-50, #f8fafc);
  border-left: 1px solid var(--n-150, rgba(15,23,42,.08));
  overflow-y: auto;
  min-height: 0;
}

#wcal-panel {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wcal-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  min-height: 160px;
  text-align: center;
  color: var(--n-400, #94a3b8);
  padding: 24px 16px;
}

.wcal-panel-empty svg { opacity: .35; }

.wcal-panel-empty p {
  font-size: 12px;
  line-height: 1.55;
  max-width: 200px;
}

.wcal-panel-header {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--n-150, rgba(15,23,42,.08));
  margin: -12px -12px 12px;
  background: var(--white, #fff);
}

.wcal-panel-dayname {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--n-400);
}

.wcal-panel-blocktime {
  font-size: 16px;
  font-weight: 800;
  color: var(--blue-900, #0f172a);
  letter-spacing: -.01em;
  margin-top: 2px;
}

.wcal-panel-dur {
  font-size: 11px;
  color: var(--n-500);
  margin-top: 2px;
}

.wcal-panel-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--n-100, rgba(15,23,42,.05));
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wcal-panel-section:last-child { border-bottom: none; }

.wcal-panel-section--actions {
  padding-top: 12px;
  align-items: flex-start;
}

.wcal-panel-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--n-400);
}

.wcal-panel-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wcal-panel-note {
  font-size: 10.5px;
  color: var(--n-400);
  line-height: 1.45;
}

.wcal-panel-time-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.wcal-panel-time-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 80px;
}

.wcal-panel-time-field span {
  font-size: 9px;
  font-weight: 700;
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.wcal-panel-time-field .field-input {
  padding: 5px 8px;
  font-size: 12px;
  min-height: 32px;
}

/* Chips de tratamientos en el panel */
.wcal-treat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.wcal-treatment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--n-200, #e2e8f0);
  background: var(--white, #fff);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue-800, #1e40af);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap;
}

.wcal-treatment-chip:hover {
  border-color: rgba(14,165,233,.35);
  color: var(--blue-700);
}

.wcal-treatment-chip.is-active {
  border-color: rgba(13,148,136,.4);
  background: rgba(13,148,136,.08);
  color: #0f766e;
}

.wcal-treat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wcal-panel-clear-treat {
  font-size: 10px;
  font-weight: 700;
  color: var(--n-400);
  border: 1px solid var(--n-200);
  background: var(--white);
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}

.wcal-panel-clear-treat:hover {
  color: var(--n-600);
  border-color: var(--n-300);
}

/* Toggle sobreturnos en el panel */
.wcal-overbook-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--n-200, #e2e8f0);
  background: var(--white, #fff);
  cursor: pointer;
  text-align: left;
  transition: border-color .14s, background .14s;
}

.wcal-overbook-toggle:hover {
  border-color: rgba(14,165,233,.3);
}

.wcal-overbook-toggle.is-active {
  border-color: rgba(168,85,247,.4);
  background: rgba(168,85,247,.05);
}

.wcal-overbook-switch {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: var(--n-250, #cbd5e1);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: background .14s;
}

.wcal-overbook-toggle.is-active .wcal-overbook-switch {
  background: #a855f7;
}

.wcal-overbook-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .14s;
}

.wcal-overbook-toggle.is-active .wcal-overbook-thumb {
  transform: translateX(13px);
}

.wcal-overbook-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.wcal-overbook-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-900, #0f172a);
  line-height: 1.2;
}

.wcal-overbook-toggle.is-active .wcal-overbook-title {
  color: #7c3aed;
}

.wcal-overbook-sub {
  font-size: 10px;
  color: var(--n-500);
  line-height: 1.3;
}

/* ── Dark mode ──────────────────────────────────────── */
body.theme-dark .wcal-topbar,
body.theme-dark .wcal-day-headers,
body.theme-dark .wcal-panel-header { background: var(--card-bg-dark, #1e293b); }

body.theme-dark .wcal-panel-wrap,
body.theme-dark .wcal-col { background: var(--bg-dark, #0f172a); }

body.theme-dark .wcal-col.is-today { background: rgba(13,148,136,.06); }

body.theme-dark .wcal-treatment-chip,
body.theme-dark .wcal-overbook-toggle { background: var(--card-bg-dark, #1e293b); }

body.theme-dark .wcal-block::before {
  background: rgba(15,23,42,.55);
}

body.theme-dark .wcal-block-time,
body.theme-dark .wcal-block-label {
  color: #f1f5f9;
}

/* ── professionals-editor height fix for wcal ───────── */
.professionals-editor.is-wcal {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.professionals-editor.is-wcal .wcal-shell {
  flex: 1;
  min-height: 0;
}

/* ==========================================================
   WEEKLY SCHEDULE WORKBENCH - overrides for settings tab
   ========================================================== */

.wcal-shell {
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.94));
  gap: 12px;
  padding: 14px 16px 16px;
}

.wcal-topbar {
  padding: 16px 18px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
}

.wcal-prof-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wcal-prof-meta {
  max-width: 760px;
  line-height: 1.45;
}

.wcal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.wcal-overview-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.wcal-overview-card,
.wcal-card,
.wcal-calendar-area {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
  backdrop-filter: blur(8px);
}

.wcal-overview-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wcal-overview-label,
.wcal-card-kicker,
.wcal-card-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #64748b;
}

.wcal-overview-value {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.wcal-overview-meta,
.wcal-card-note,
.wcal-empty-note,
.wcal-legend-note,
.wcal-day-header-meta {
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
}

.wcal-toolbar-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.1fr .95fr;
  gap: 12px;
}

.wcal-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.wcal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wcal-card-head h4 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}

.wcal-card-head p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}

.wcal-chip,
.wcal-legend-chip,
.wcal-mini-action,
.wcal-day-chip,
.wcal-segmented-btn,
.wcal-link-btn {
  border: 1px solid rgba(148,163,184,.24);
  background: rgba(248,250,252,.9);
  color: #334155;
}

.wcal-chip,
.wcal-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.wcal-chip.is-overbook {
  border-color: rgba(168,85,247,.38);
  background: rgba(168,85,247,.1);
  color: #7c3aed;
}

.wcal-bulk-days,
.wcal-bulk-presets,
.wcal-chip-list,
.wcal-day-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wcal-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wcal-day-chip,
.wcal-mini-action,
.wcal-segmented-btn,
.wcal-link-btn {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
}

.wcal-day-chip:hover,
.wcal-mini-action:hover,
.wcal-segmented-btn:hover,
.wcal-link-btn:hover,
.wcal-treatment-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.34);
}

.wcal-day-chip.is-active,
.wcal-segmented-btn.is-active {
  background: rgba(14,165,233,.1);
  border-color: rgba(14,165,233,.38);
  color: #0369a1;
}

.wcal-selected-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.wcal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wcal-field span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.wcal-empty-state {
  min-height: 132px;
  border: 1px dashed rgba(148,163,184,.34);
  border-radius: 18px;
  background: rgba(248,250,252,.72);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.wcal-empty-state strong {
  font-size: 14px;
  color: #0f172a;
}

.wcal-treat-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wcal-treat-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wcal-legend-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wcal-legend-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.wcal-legend-st {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(168,85,247,.14);
  color: #7c3aed;
  font-size: 10px;
  font-weight: 800;
}

.wcal-legend-bullet {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 4px;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  flex-shrink: 0;
}

.wcal-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: auto;
}

.wcal-calendar-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.wcal-day-headers {
  grid-template-columns: 64px minmax(980px, 1fr);
  padding: 0;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

.wcal-day-headers-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}

.wcal-time-spacer {
  width: 64px;
}

.wcal-day-header {
  padding: 12px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  justify-content: center;
}

.wcal-day-header-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wcal-day-header-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #475569;
}

.wcal-day-header-range {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.wcal-day-header-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(168,85,247,.12);
  color: #7c3aed;
}

.wcal-grid-inner {
  grid-template-columns: 64px minmax(980px, 1fr);
  min-height: 520px;
}

.wcal-time-col {
  background: rgba(255,255,255,.82);
}

.wcal-days-wrap {
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}

.wcal-block {
  left: 6px;
  right: 6px;
  border-radius: 16px;
  border: 1px solid var(--wcal-block-border);
  background: var(--wcal-block-surface);
  box-shadow: 0 16px 28px var(--wcal-block-shadow);
  opacity: 1;
  overflow: hidden;
}

.wcal-block::before {
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--wcal-block-stripe);
  opacity: 1;
}

.wcal-block::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.12));
  pointer-events: none;
}

.wcal-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px var(--wcal-block-shadow);
}

.wcal-block.is-selected {
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 4px var(--wcal-block-accent), 0 18px 32px var(--wcal-block-shadow);
}

.wcal-block.is-overbook {
  box-shadow: 0 0 0 1px rgba(168,85,247,.24), 0 18px 34px rgba(168,85,247,.18);
}

.wcal-block-inner {
  padding: 8px 10px 10px 14px;
}

.wcal-block-time {
  font-size: 10px;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcal-block-label {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
}

.wcal-block-meta {
  margin-top: 4px;
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcal-block-badge {
  margin-top: 6px;
}

@media (max-width: 1440px) {
  .wcal-toolbar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .wcal-overview-strip,
  .wcal-toolbar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .wcal-day-headers,
  .wcal-grid-inner {
    grid-template-columns: 56px minmax(760px, 1fr);
  }

  .wcal-day-headers-row,
  .wcal-days-wrap {
    grid-template-columns: repeat(7, minmax(108px, 1fr));
  }

  .wcal-selected-fields {
    grid-template-columns: 1fr;
  }
}

body.theme-dark .wcal-shell {
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.08), transparent 28%),
    linear-gradient(180deg, rgba(15,23,42,.96), rgba(2,6,23,.98));
}

body.theme-dark .wcal-topbar,
body.theme-dark .wcal-overview-card,
body.theme-dark .wcal-card,
body.theme-dark .wcal-calendar-area,
body.theme-dark .wcal-time-col {
  background: rgba(15,23,42,.82);
  border-color: rgba(148,163,184,.18);
  box-shadow: 0 14px 34px rgba(2,6,23,.42);
}

body.theme-dark .wcal-prof-name,
body.theme-dark .wcal-overview-value,
body.theme-dark .wcal-card-head h4,
body.theme-dark .wcal-day-header-range {
  color: #f8fafc;
}

body.theme-dark .wcal-prof-meta,
body.theme-dark .wcal-overview-meta,
body.theme-dark .wcal-card-head p,
body.theme-dark .wcal-card-note,
body.theme-dark .wcal-empty-note,
body.theme-dark .wcal-legend-note,
body.theme-dark .wcal-day-header-meta,
body.theme-dark .wcal-field span {
  color: #94a3b8;
}

body.theme-dark .wcal-day-header-name {
  color: #cbd5e1;
}

body.theme-dark .wcal-chip,
body.theme-dark .wcal-legend-chip,
body.theme-dark .wcal-mini-action,
body.theme-dark .wcal-day-chip,
body.theme-dark .wcal-segmented-btn,
body.theme-dark .wcal-link-btn,
body.theme-dark .wcal-treatment-chip {
  background: rgba(30,41,59,.88);
  border-color: rgba(148,163,184,.24);
  color: #e2e8f0;
}

body.theme-dark .wcal-day-chip.is-active,
body.theme-dark .wcal-segmented-btn.is-active,
body.theme-dark .wcal-treatment-chip.is-active {
  background: rgba(14,165,233,.18);
  border-color: rgba(56,189,248,.42);
  color: #bae6fd;
}

body.theme-dark .wcal-empty-state {
  background: rgba(15,23,42,.74);
  border-color: rgba(148,163,184,.24);
}

body.theme-dark .wcal-empty-state strong,
body.theme-dark .wcal-block-time,
body.theme-dark .wcal-block-label {
  color: #f8fafc;
}

body.theme-dark .wcal-block-meta {
  color: #cbd5e1;
}

/* ═══════════════════════════════════════════════════════════════
   PSV2 — nuevo diseño de horarios por tabs de días (admin/recepción)
   Base = light (tokens del :root). Dark overrides al final.
   ═══════════════════════════════════════════════════════════════ */

/* ── Shell ────────────────────────────────────────────────────── */
.psv2-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Fila de estadísticas ─────────────────────────────────────── */
.psv2-stats-row {
  display: flex;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--n-200);
  flex-wrap: wrap;
  background: var(--n-50);
}
.psv2-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}
.psv2-stat-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--n-400);
}
.psv2-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-900);
  line-height: 1.1;
}
.psv2-stat-meta {
  font-size: 11px;
  color: var(--n-500);
}

/* ── Tabs de días ─────────────────────────────────────────────── */
.psv2-day-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 20px 0;
  border-bottom: 1px solid var(--n-200);
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
}
.psv2-day-tabs::-webkit-scrollbar { display: none; }

.psv2-day-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px 10px;
  border: none;
  background: transparent;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--n-500);
  transition: color .15s, background .15s;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}
.psv2-day-tab:hover {
  color: var(--n-800);
  background: rgba(0,0,0,.03);
}
.psv2-day-tab.is-active {
  color: var(--blue-700);
}
.psv2-day-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--blue-700);
  border-radius: 2px 2px 0 0;
}
.psv2-day-tab-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}
.psv2-day-tab-badge {
  font-size: 10px;
  color: var(--n-400);
}
.psv2-day-tab.has-blocks .psv2-day-tab-badge {
  color: var(--n-600);
}
.psv2-day-tab.is-active .psv2-day-tab-badge {
  color: var(--blue-700);
}
.psv2-day-tab-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--n-200);
  transition: background .15s;
}
.psv2-day-tab.has-blocks .psv2-day-tab-dot { background: var(--blue-700); }
.psv2-day-tab.is-active .psv2-day-tab-dot  { background: var(--blue-700); }

/* ── Panels ───────────────────────────────────────────────────── */
.psv2-panels {
  position: relative;
}
.psv2-day-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--n-100);
}
.psv2-day-panel.is-active { display: flex; }

/* Encabezado del día */
.psv2-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.psv2-day-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--n-900);
  margin: 0;
}
.psv2-day-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.psv2-day-quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--n-200);
  border-radius: 8px;
  background: #fff;
  color: var(--n-600);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.psv2-day-quick-btn:hover {
  color: var(--blue-700);
  border-color: var(--blue-700);
  background: var(--blue-50);
}
.psv2-day-quick-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Sección bloques */
.psv2-blocks-section { display: flex; flex-direction: column; gap: 10px; }
.psv2-blocks-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--n-500);
}
.psv2-blocks-list { display: flex; flex-direction: column; gap: 8px; }

/* Card de bloque */
.psv2-block-card {
  border: 1px solid var(--n-200);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.psv2-block-card:hover {
  border-color: var(--n-300);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.psv2-block-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.psv2-block-time {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.psv2-time-input {
  background: var(--n-100);
  border: 1px solid var(--n-200);
  border-radius: 8px;
  color: var(--n-900);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 6px 10px;
  width: 108px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.psv2-time-input:focus {
  outline: none;
  border-color: var(--blue-700);
  background: var(--blue-50);
}
.psv2-time-sep {
  color: var(--n-400);
  font-size: 14px;
  flex-shrink: 0;
}
.psv2-block-duration {
  font-size: 11px;
  font-weight: 600;
  color: var(--n-600);
  background: var(--n-150);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.psv2-block-del {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--n-400);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.psv2-block-del:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}
.psv2-block-del svg { width: 14px; height: 14px; }

/* Cuerpo de bloque */
.psv2-block-body {
  border-top: 1px solid var(--n-150);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--n-50);
}
.psv2-block-overbook {
  display: flex;
  align-items: center;
  gap: 10px;
}
.psv2-block-overbook-text { flex: 1; }
.psv2-block-overbook-label { font-size: 13px; font-weight: 600; color: var(--n-800); }
.psv2-block-overbook-sub   { font-size: 11px; color: var(--n-500); margin-top: 2px; }

/* Toggle */
.psv2-toggle { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.psv2-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.psv2-toggle-track {
  width: 38px; height: 22px;
  background: var(--n-300);
  border-radius: 11px;
  position: relative;
  transition: background .2s;
}
.psv2-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.psv2-toggle input:checked + .psv2-toggle-track {
  background: var(--blue-700);
}
.psv2-toggle input:checked + .psv2-toggle-track::after {
  transform: translateX(16px);
}

/* Tratamientos dentro del bloque */
.psv2-block-treatments { display: flex; flex-direction: column; gap: 6px; }
.psv2-block-treatments-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--n-600);
  display: flex;
  align-items: center;
  gap: 6px;
}
.psv2-block-treatments-label span { font-weight: 400; color: var(--n-400); }
.psv2-treatment-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.psv2-treatment-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid var(--n-200);
  background: #fff;
  color: var(--n-700);
  cursor: pointer;
  transition: color .14s, background .14s, border-color .14s;
  user-select: none;
  white-space: nowrap;
}
.psv2-treatment-chip:hover {
  border-color: var(--blue-700);
  color: var(--blue-700);
  background: var(--blue-50);
}
.psv2-treatment-chip.is-selected {
  background: var(--blue-100);
  border-color: var(--blue-700);
  color: var(--blue-800);
  font-weight: 600;
}

/* Estado vacío del día */
.psv2-day-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  color: var(--n-400);
  text-align: center;
  font-size: 13px;
  border: 1px dashed var(--n-200);
  border-radius: 12px;
  background: #fff;
}
.psv2-day-empty svg { width: 34px; height: 34px; opacity: .4; }

/* Fila agregar franja */
.psv2-add-block-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed var(--n-300);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.psv2-add-block-row:focus-within {
  border-color: var(--blue-700);
  background: var(--blue-50);
}
.psv2-add-time-input {
  background: var(--n-100);
  border: 1px solid var(--n-200);
  border-radius: 8px;
  color: var(--n-900);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 10px;
  width: 108px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.psv2-add-time-input:focus {
  outline: none;
  border-color: var(--blue-700);
  background: var(--blue-50);
}
.psv2-add-block-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: 1px solid var(--blue-700);
  border-radius: 8px;
  background: var(--blue-700);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.psv2-add-block-btn:hover {
  background: var(--blue-800);
  border-color: var(--blue-800);
}
.psv2-add-block-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Dark theme overrides ─────────────────────────────────────── */
body.theme-dark .psv2-stats-row {
  background: rgba(14, 22, 38, 0.7);
  border-color: rgba(255,255,255,.07);
}
body.theme-dark .psv2-stat-label { color: #6b89a5; }
body.theme-dark .psv2-stat-value { color: #e2f0ff; }
body.theme-dark .psv2-stat-meta  { color: #5a7a96; }

body.theme-dark .psv2-day-tabs {
  background: rgba(14,22,38,.8);
  border-color: rgba(255,255,255,.07);
}
body.theme-dark .psv2-day-tab { color: #5a7a96; }
body.theme-dark .psv2-day-tab:hover { color: #c8dff5; background: rgba(255,255,255,.04); }
body.theme-dark .psv2-day-tab.is-active { color: #7eb8f7; }
body.theme-dark .psv2-day-tab.is-active::after { background: #3b82f6; }
body.theme-dark .psv2-day-tab-dot { background: rgba(255,255,255,.12); }
body.theme-dark .psv2-day-tab.has-blocks .psv2-day-tab-dot { background: #3b82f6; }
body.theme-dark .psv2-day-tab-badge { color: #5a7a96; }
body.theme-dark .psv2-day-tab.has-blocks .psv2-day-tab-badge { color: #8ba9c8; }
body.theme-dark .psv2-day-tab.is-active .psv2-day-tab-badge { color: #7eb8f7; }

body.theme-dark .psv2-day-panel { background: rgba(10,18,32,.5); }
body.theme-dark .psv2-day-title  { color: #daeeff; }
body.theme-dark .psv2-blocks-title { color: #5a7a96; }

body.theme-dark .psv2-day-quick-btn {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: #8ba9c8;
}
body.theme-dark .psv2-day-quick-btn:hover {
  color: #93c5fd;
  border-color: rgba(96,165,250,.4);
  background: rgba(59,130,246,.08);
}

body.theme-dark .psv2-block-card { background: rgba(16,26,44,.7); border-color: rgba(255,255,255,.08); }
body.theme-dark .psv2-block-card:hover { border-color: rgba(255,255,255,.15); box-shadow: none; }
body.theme-dark .psv2-block-body { background: rgba(10,18,32,.4); border-color: rgba(255,255,255,.06); }

body.theme-dark .psv2-time-input,
body.theme-dark .psv2-add-time-input {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  color: #daeeff;
}
body.theme-dark .psv2-time-input:focus,
body.theme-dark .psv2-add-time-input:focus {
  border-color: #3b82f6;
  background: rgba(59,130,246,.12);
}
body.theme-dark .psv2-time-sep { color: #4a6a80; }
body.theme-dark .psv2-block-duration { background: rgba(255,255,255,.06); color: #6b89a5; }
body.theme-dark .psv2-block-del { color: #4a6a80; }
body.theme-dark .psv2-block-del:hover { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.25); }

body.theme-dark .psv2-block-overbook-label { color: #c8dff5; }
body.theme-dark .psv2-block-overbook-sub   { color: #5a7a96; }
body.theme-dark .psv2-toggle-track { background: rgba(255,255,255,.15); }
body.theme-dark .psv2-toggle input:checked + .psv2-toggle-track { background: #3b82f6; }

body.theme-dark .psv2-block-treatments-label { color: #6b89a5; }
body.theme-dark .psv2-treatment-chip {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
  color: #8ba9c8;
}
body.theme-dark .psv2-treatment-chip:hover { border-color: rgba(147,197,253,.4); color: #bfdbfe; }
body.theme-dark .psv2-treatment-chip.is-selected {
  background: rgba(59,130,246,.2);
  border-color: rgba(96,165,250,.5);
  color: #93c5fd;
  font-weight: 500;
}

body.theme-dark .psv2-day-empty {
  border-color: rgba(255,255,255,.07);
  background: rgba(255,255,255,.02);
  color: #4a6a80;
}

body.theme-dark .psv2-add-block-row {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.02);
}
body.theme-dark .psv2-add-block-row:focus-within {
  border-color: rgba(96,165,250,.4);
  background: rgba(59,130,246,.05);
}
body.theme-dark .psv2-add-block-btn {
  border-color: rgba(96,165,250,.4);
  background: rgba(59,130,246,.15);
  color: #93c5fd;
}
body.theme-dark .psv2-add-block-btn:hover {
  background: rgba(59,130,246,.25);
  border-color: rgba(96,165,250,.6);
}

/* Responsive foundation refresh */
@media (max-width: 1180px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body {
    min-height: 100dvh;
  }

  .app {
    min-height: 100dvh;
    height: auto;
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px 0;
    overflow: visible;
  }

  .sidebar::after {
    display: none;
  }

  .sidebar-panel,
  .sidebar:hover .sidebar-panel,
  .sidebar:focus-within .sidebar-panel {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-height: 0;
    padding: 8px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 22px;
    box-shadow: var(--sidebar-shadow);
  }

  .sidebar-logo,
  .sidebar:hover .sidebar-logo,
  .sidebar:focus-within .sidebar-logo,
  .nav-btn,
  .sidebar:hover .nav-btn,
  .sidebar:focus-within .nav-btn,
  .settings-wrap,
  .sidebar:hover .settings-wrap,
  .sidebar:focus-within .settings-wrap,
  .sidebar-user-row,
  .sidebar:hover .sidebar-user-row,
  .sidebar:focus-within .sidebar-user-row {
    width: auto;
    min-width: max-content;
    margin: 0;
    padding: 0 14px;
    justify-content: flex-start;
    gap: 10px;
  }

  .sidebar-logo::before,
  .sidebar:hover .sidebar-logo::before,
  .sidebar:focus-within .sidebar-logo::before {
    left: 10px;
    transform: none;
  }

  .sidebar-logo .sidebar-logo-icon,
  .sidebar:hover .sidebar-logo .sidebar-logo-icon,
  .sidebar:focus-within .sidebar-logo .sidebar-logo-icon,
  .sidebar:hover .nav-icon,
  .sidebar:focus-within .nav-icon {
    margin-left: 0;
  }

  .nav-btn::after {
    display: none;
  }

  .nav-label,
  .sidebar:hover .nav-label,
  .sidebar:focus-within .nav-label {
    max-width: none;
    min-width: 0;
    opacity: 1;
    transform: none;
    overflow: visible;
    clip-path: none;
    pointer-events: auto;
  }

  .sidebar-spacer {
    display: none;
  }

  .settings-wrap {
    margin-left: auto;
  }

  .settings-menu,
  .sidebar:hover .settings-menu,
  .sidebar:focus-within .settings-menu {
    position: fixed;
    top: 76px;
    right: 16px;
    left: auto;
    bottom: auto;
  }

  .center {
    min-width: 0;
    min-height: 0;
  }

  .topbar {
    height: auto;
    min-height: 0;
    padding: 14px 16px;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
  }

  .topbar-left,
  .topbar-clock-search,
  .topbar-actions {
    width: 100%;
  }

  .topbar-left,
  .topbar-clock-search,
  .topbar-actions,
  .date-nav {
    flex-wrap: wrap;
  }

  .page-title {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  .date-display {
    flex: 1 1 220px;
    min-width: 0;
  }

  .topbar-clock-search {
    justify-content: space-between;
    gap: 10px;
  }

  .search-wrap {
    flex: 1 1 320px;
    min-width: min(100%, 280px);
  }

  .topbar-actions {
    gap: 10px;
  }

  .topbar-actions .btn {
    flex: 1 1 180px;
    justify-content: center;
  }

  .statsbar {
    height: auto;
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .stat {
    flex: 1 1 140px;
  }

  .statsbar-prof {
    width: 100%;
    justify-content: space-between;
  }

  .statsbar-select {
    width: min(100%, 280px);
  }

  .main-body {
    flex-direction: column;
    overflow: visible;
    min-height: 0;
  }

  .grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  .right-panel {
    display: flex;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--n-150);
    overflow: visible;
  }

  .qa-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .reports-grid,
  .reports-grid-3,
  .reports-graphic-grid,
  .reports-spotlight-grid {
    grid-template-columns: 1fr;
  }

  .reports-table-wrap,
  .patients-table-wrap,
  .obras-table-wrap {
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
  }

  .modal-overlay {
    align-items: flex-start;
    padding: 10px;
    overflow-y: auto;
  }

  .modal,
  .modal-lg,
  .modal-clinical-history,
  .modal-patient-info-panel,
  .modal-os,
  .modal-schedule {
    width: min(100%, 1120px);
    max-width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .modal-foot {
    flex-wrap: wrap;
    gap: 10px;
  }

  .modal-foot .btn {
    flex: 1 1 180px;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .patients-table-scale-shell {
    width: 100% !important;
    max-width: 100%;
  }

  .patients-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    border-spacing: 0;
  }

  .patients-table,
  .patients-table tbody,
  .patients-table tr,
  .patients-table td {
    display: block;
  }

  .patients-table thead {
    display: none;
  }

  .patients-table tbody {
    display: grid;
    gap: 12px;
  }

  .patients-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(218,228,236,.88);
    background:
      linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94)),
      var(--white);
    box-shadow: 0 14px 26px rgba(0,30,54,.08);
  }

  .patients-table tbody tr:hover,
  .patients-table tbody tr:focus-within {
    border-color: rgba(98,188,197,.30);
    box-shadow: 0 18px 30px rgba(0,30,54,.10);
  }

  .patients-table tbody td {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .patients-table tbody td::before {
    content: attr(data-label);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--n-400);
  }

  .patients-table tbody td:first-child,
  .patients-table tbody td:last-child {
    grid-column: 1 / -1;
  }

  .patients-table tbody td[data-label="Email"] {
    grid-column: 1 / -1;
  }

  .patients-table tbody td:first-child::before,
  .patients-table tbody td:last-child::before {
    display: none;
  }

  .patients-table tbody td:last-child {
    margin-top: 2px;
    text-align: left;
  }

  .patient-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .patient-main {
    align-items: flex-start;
    gap: 10px;
  }

  .patient-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
  }

  .patient-main-copy {
    width: 100%;
    gap: 8px;
  }

  .patient-name-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
  }

  .patients-table .p-name {
    font-size: 15px;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .patients-table .p-muted {
    min-height: 22px;
    padding: 0 8px;
    font-size: 10px;
  }

  .patient-inline-meta {
    flex-wrap: wrap;
    gap: 5px;
  }

  .patient-chip {
    min-height: 22px;
    padding: 3px 8px;
    font-size: 10px;
  }

  .patient-value-chip {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .patient-value-chip.is-social,
  .patient-value-chip.is-female,
  .patient-value-chip.is-male,
  .patient-value-chip.is-neutral {
    background: transparent;
    border-color: transparent;
  }

  .patient-birth {
    gap: 4px;
  }

  .patient-birth strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .patient-birth small {
    font-size: 10px;
  }

  .patient-row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .patient-edit-btn {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    font-size: 10.5px;
    box-shadow: none;
  }

  .patient-edit-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }

  .patient-edit-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.theme-dark .patients-table tbody tr {
    border-color: rgba(143, 217, 224, .14);
    background:
      linear-gradient(180deg, rgba(24, 43, 62, .96), rgba(16, 32, 48, .96)),
      rgba(15, 29, 45, .92);
    box-shadow: 0 16px 30px rgba(0, 8, 18, .24);
  }

  body.theme-dark .patients-table tbody tr:hover,
  body.theme-dark .patients-table tbody tr:focus-within {
    border-color: rgba(143, 217, 224, .28);
  }

  body.theme-dark .patients-table tbody td {
    background: transparent;
  }

  body.theme-dark .patients-table tbody td::before {
    color: var(--n-500);
  }
}

@media (max-width: 1180px) and (min-width: 821px) {
  .sidebar-panel,
  .sidebar:hover .sidebar-panel,
  .sidebar:focus-within .sidebar-panel {
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: visible;
    gap: 6px;
  }

  .sidebar-logo,
  .sidebar:hover .sidebar-logo,
  .sidebar:focus-within .sidebar-logo,
  .nav-btn,
  .sidebar:hover .nav-btn,
  .sidebar:focus-within .nav-btn,
  .settings-wrap,
  .sidebar:hover .settings-wrap,
  .sidebar:focus-within .settings-wrap,
  .sidebar-user-row,
  .sidebar:hover .sidebar-user-row,
  .sidebar:focus-within .sidebar-user-row {
    width: 48px;
    min-width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .sidebar-logo::before,
  .sidebar:hover .sidebar-logo::before,
  .sidebar:focus-within .sidebar-logo::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .nav-icon,
  .sidebar:hover .nav-icon,
  .sidebar:focus-within .nav-icon {
    margin-left: 0;
  }

  .nav-label,
  .sidebar:hover .nav-label,
  .sidebar:focus-within .nav-label {
    max-width: 0;
    opacity: 0;
    transform: translateX(-8px);
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    pointer-events: none;
  }

  .sidebar-spacer {
    display: none;
  }

  .settings-wrap {
    margin-left: 0;
  }

  .nav-btn::after {
    display: block;
    left: 50%;
    top: calc(100% + 8px);
    transform: translate(-50%, -4px);
  }

  .nav-btn:hover::after,
  .sidebar:hover .nav-btn:hover::after,
  .sidebar:focus-within .nav-btn:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    flex: 0 0 auto;
    padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 260;
  }

  .sidebar-panel,
  .sidebar:hover .sidebar-panel,
  .sidebar:focus-within .sidebar-panel {
    width: 100%;
    min-height: 0;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 18px;
    box-shadow: 0 -10px 30px rgba(3, 11, 22, .16);
    scrollbar-width: none;
  }

  .sidebar-panel::-webkit-scrollbar {
    display: none;
  }

  .sidebar-logo,
  .sidebar:hover .sidebar-logo,
  .sidebar:focus-within .sidebar-logo,
  .sidebar-user-row,
  .sidebar:hover .sidebar-user-row,
  .sidebar:focus-within .sidebar-user-row {
    display: none;
  }

  .nav-btn,
  .sidebar:hover .nav-btn,
  .sidebar:focus-within .nav-btn,
  .settings-wrap,
  .sidebar:hover .settings-wrap,
  .sidebar:focus-within .settings-wrap {
    width: 48px;
    min-width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    justify-content: center;
    gap: 0;
    flex: 0 0 auto;
  }

  .nav-btn,
  .sidebar:hover .nav-btn,
  .sidebar:focus-within .nav-btn {
    width: 48px;
    min-width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    justify-content: center;
    gap: 0;
    border-radius: 16px;
    flex: 0 0 auto;
  }

  .topbar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .topbar-brand-icon img {
    width: 22px;
    height: 22px;
  }

  .topbar-brand-text {
    font-size: 13px;
  }

  .nav-label,
  .sidebar:hover .nav-label,
  .sidebar:focus-within .nav-label {
    max-width: 0;
    opacity: 0;
    transform: translateX(-8px);
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    pointer-events: none;
  }

  .sidebar-spacer {
    display: none;
  }

  .settings-wrap {
    margin-left: 0;
  }

  .settings-menu,
  .sidebar:hover .settings-menu,
  .sidebar:focus-within .settings-menu {
    top: auto;
    right: 12px;
    left: auto;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 10px);
  }

  .center {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 10px 12px;
    gap: 8px 10px;
  }

  .topbar-left,
  .topbar-clock-search {
    width: auto;
  }

  .topbar-left {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
  }

  .topbar-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-self: center;
  }

  .page-title {
    display: none;
  }

  .date-nav {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px auto;
    align-items: center;
    gap: 4px;
  }

  .date-nav-btn {
    width: 24px;
    height: 24px;
  }

  .date-nav-btn svg {
    width: 11px;
    height: 11px;
  }

  .date-display {
    min-width: 0;
    width: 100%;
    padding: 5px 10px;
  }

  .today-btn {
    padding: 4px 10px;
  }

  .topbar-clock-search {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  .search-wrap {
    width: min(100%, 190px);
  }

  .search-wrap input,
  .search-wrap input:focus {
    width: 100%;
  }

  .statsbar-select {
    width: 100%;
  }

  .topbar-clock {
    padding: 4px 9px;
  }

  .topbar-clock-time {
    font-size: 14px;
  }

  .topbar-clock-secs {
    font-size: 9px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .statsbar {
    padding: 10px 12px;
  }

  .statsbar-prof {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .agenda-table {
    min-width: 840px;
  }

  .patients-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px 0;
  }

  .agenda-monthly-summary,
  .agenda-monthly-grid,
  .professional-overview-grid {
    grid-template-columns: 1fr;
  }
  .obras-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .obras-table tbody {
    gap: 10px;
  }
  .obras-table tbody tr {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
  }
  .obras-table tbody td::before {
    margin-bottom: 5px;
    font-size: 8px;
    letter-spacing: .45px;
  }
  .os-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
    font-size: 12px;
  }
  .os-name {
    font-size: 12px;
  }
  .os-sub,
  .os-state-meta,
  .os-cut-meta,
  .os-notes {
    font-size: 10px;
    line-height: 1.35;
  }
  .os-cut-value,
  .os-copay-value {
    font-size: 12px;
  }
  .obras-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 0 10px 8px;
  }
  .obras-stat-card {
    min-height: 68px;
    padding: 9px 12px 8px;
    border-radius: 16px;
  }
  .obras-stat-card::before {
    width: 82px;
    height: 82px;
    inset: auto -18px -24px auto;
    opacity: .6;
  }
  .obras-stat-label {
    font-size: 8px;
    letter-spacing: .45px;
  }
  .obras-stat-value {
    margin-top: 5px;
    font-size: 16px;
  }
  .obras-stat-meta {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.2;
  }
  .topbar,
  .statsbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    gap: 6px 8px;
  }

  .topbar-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 11px;
  }

  .topbar-brand-icon img {
    width: 20px;
    height: 20px;
  }

  .topbar-brand-text {
    font-size: 12px;
  }

  .topbar-left {
    gap: 6px 8px;
  }

  .date-nav {
    grid-template-columns: 22px minmax(0, 1fr) 22px auto;
  }

  .date-nav-btn {
    width: 22px;
    height: 22px;
  }

  .agenda-table {
    min-width: 760px;
  }

  .modal,
  .modal-lg,
  .modal-clinical-history,
  .modal-patient-info-panel,
  .modal-os,
  .modal-schedule {
    border-radius: 18px;
  }

  .modal-inner {
    padding: 18px 16px;
  }

  .modal-foot .btn {
    flex-basis: 100%;
  }

  .patients-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 10px 10px 0;
  }

  .patients-search-icon {
    top: 36px;
  }

  .date-display {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .today-btn,
  .btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .search-wrap {
    width: min(100%, 150px);
  }

  .search-wrap input,
  .search-wrap input:focus {
    width: 100%;
  }

  .topbar-clock {
    padding: 4px 8px;
  }

  .topbar-clock-time {
    font-size: 13px;
  }

  .topbar-clock-secs {
    font-size: 8px;
  }

  .patients-stat-card {
    min-height: 0;
    padding: 6px 7px;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0,30,54,.05);
  }

  .patients-stat-card::before {
    width: 28px;
    height: 28px;
    inset: auto -6px -10px auto;
    opacity: .22;
  }

  .patients-stat-label {
    display: block;
    font-size: 7.5px;
    line-height: 1.12;
    letter-spacing: .04em;
  }

  .patients-stat-value {
    margin-top: 4px;
    font-size: 13px;
    letter-spacing: -.3px;
  }

  .pi-row,
  .pi-row-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 1440px) and (min-width: 1181px) {
  :root {
    --panel-w: 248px;
    --sidebar-w-expanded: 208px;
  }

  .topbar {
    padding: 0 14px;
    gap: 8px;
  }

  .topbar-left {
    gap: 8px;
  }

  .page-title {
    font-size: 13px;
    padding-right: 8px;
  }

  .date-display {
    min-width: 132px;
    padding: 5px 10px;
    font-size: 12px;
  }

  .today-btn,
  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .week-pill {
    padding: 4px 7px;
  }

  .week-pill .pill-num {
    font-size: 12px;
  }

  .search-wrap input {
    width: 168px;
  }

  .search-wrap input:focus {
    width: 212px;
  }

  .search-kbd {
    display: none;
  }

  .topbar-clock {
    padding: 5px 9px;
  }

  .topbar-clock-time {
    font-size: 14px;
  }

  .statsbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .stat-name,
  .statsbar-prof-label {
    font-size: 10px;
  }

  .right-panel {
    width: var(--panel-w);
  }

  .rp-block {
    padding: 14px;
  }

  .qa-grid {
    grid-template-columns: 1fr;
  }
}

.mobile-bottom-nav {
  display: none;
}

.mobile-bottom-nav-shell {
  pointer-events: auto;
}

.mobile-bottom-nav-btn {
  min-width: 0;
  border-radius: 14px;
  color: rgba(255,255,255,.64);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.mobile-bottom-nav-btn:active {
  transform: scale(.96);
}

.mobile-bottom-nav-btn.active {
  color: #f8fbff;
}

.mobile-bottom-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mobile-bottom-nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

@media (max-width: 820px) {
  .sidebar {
    display: none;
  }

  .mobile-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 320;
    pointer-events: none;
  }

  .mobile-bottom-nav-shell {
    max-width: 460px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(38, 55, 78, .98), rgba(16, 27, 43, .98)),
      rgba(18, 28, 44, .96);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 -12px 30px rgba(3, 11, 22, .22);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
  }

  .mobile-bottom-nav-btn {
    flex: 1 1 0;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav-btn.active {
    background: linear-gradient(180deg, rgba(136, 156, 178, .24), rgba(92, 109, 130, .22));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  }

  .mobile-bottom-nav-btn.hidden {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   AGENDA TABLE — Vista tarjeta en móvil
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 821px) and (max-width: 1180px) {
  .messages-area {
    height: calc(100dvh - 154px);
    min-height: 0;
    overflow: hidden;
  }

  .messages-toolbar {
    flex: 0 0 auto;
    padding: 10px 14px;
    gap: 10px;
  }

  .messages-toolbar p {
    display: none;
  }

  .messages-layout {
    flex: 1;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    overflow: hidden;
  }

  .messages-list-wrap,
  .messages-detail {
    min-height: 0;
    overflow: hidden;
  }

  .messages-list-wrap {
    padding: 10px;
    border-radius: 20px;
    overflow-y: auto;
  }

  .message-conversation-item {
    padding: 10px;
    border-radius: 16px;
  }

  .message-conversation-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .message-conversation-preview {
    margin-top: 8px;
    min-height: 0;
    -webkit-line-clamp: 1;
  }

  .message-conversation-foot {
    margin-top: 8px;
  }

  .messages-detail-header {
    min-height: 64px;
    padding: 12px 14px;
    border-radius: 20px 20px 0 0;
  }

  .messages-detail-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .messages-detail-name {
    font-size: 14px;
  }

  .messages-thread {
    min-height: 0;
    padding: 12px 14px;
  }

  .message-bubble {
    max-width: min(620px, 84%);
    padding: 10px 12px;
    border-radius: 18px;
  }

  .messages-composer {
    padding: 10px 12px;
    border-radius: 0 0 20px 20px;
  }

  .messages-compose-input {
    min-height: 44px;
    max-height: 92px;
    padding: 11px 14px;
    border-radius: 18px;
  }

  .messages-send-btn.btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

@media (max-width: 700px) {
  /* Quitar overflow horizontal del contenedor */
  .agenda-wrap,
  .agenda-scroll,
  .agenda-table-wrap,
  .grid-wrap {
    overflow-x: visible;
  }

  /* La tabla pasa a bloque */
  .agenda-table,
  .agenda-table thead,
  .agenda-table tbody,
  .agenda-table tr,
  .agenda-table td,
  .agenda-table th {
    display: block;
  }

  /* Ocultar encabezado */
  .agenda-table thead {
    display: none;
  }

  /* Sin ancho mínimo que fuerce scroll */
  .agenda-table {
    min-width: 0;
    width: 100%;
  }

  /* Cada fila = tarjeta flex horizontal */
  .agenda-table tbody tr {
    display: flex;
    align-items: center;
    border: 1px solid var(--n-150);
    border-radius: 12px;
    margin: 4px 0;
    padding: 0;
    min-height: 0;
    background: var(--white);
    overflow: hidden;
    cursor: pointer;
  }

  /* Turnos libres: más apagados */
  .agenda-table tbody tr.s-libre { opacity: .72; }

  /* Estado como borde izquierdo de color */
  .agenda-table tbody tr.s-reservado   { border-left: 3px solid var(--s-reservado-bar);  }
  .agenda-table tbody tr.s-confirmado  { border-left: 3px solid var(--s-confirmado-bar); }
  .agenda-table tbody tr.s-entreturno  { border-left: 3px solid var(--s-entreturno-bar); }
  .agenda-table tbody tr.s-atendido    { border-left: 3px solid var(--s-atendido-bar);   }
  .agenda-table tbody tr.s-ausente     { border-left: 3px solid #e11d48; }
  .agenda-table tbody tr.s-bloqueado   { border-left: 3px solid var(--s-bloqueado-bar);  }
  .agenda-table tbody tr.row-flow-attended     { border-left: 3px solid #22c55e !important; }
  .agenda-table tbody tr.row-flow-in-attention { border-left: 3px solid #16a34a !important; }
  .agenda-table tbody tr.row-flow-waiting      { border-left: 3px solid #f59e0b !important; }
  .agenda-table tbody tr.row-flow-studies      { border-left: 3px solid #f59e0b !important; }
  .agenda-table tbody tr.row-flow-ready        { border-left: 3px solid #0891b2 !important; }
  .agenda-table tbody tr.row-flow-absent       { border-left: 3px solid #e11d48 !important; }

  /* ── Hora: columna fija a la izquierda ── */
  .agenda-table tbody tr td.cell-hora {
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--n-150);
    padding: 0;
    align-self: stretch;
  }

  .hora-inner {
    height: auto;
    min-height: 0;
    padding: 8px 4px;
  }

  .hora-text      { font-size: 11px; }
  .hora-end-text  { font-size: 10px; }

  /* ── Barra de estado: oculta (reemplazada por borde izquierdo) ── */
  .agenda-table tbody tr td.cell-bar { display: none; }

  /* ── Paciente: área central, todo el espacio libre ── */
  .agenda-table tbody tr td.col-pac,
  .agenda-table tbody tr td.cell-libre {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    height: auto;
    align-self: center;
  }

  .agenda-table tbody tr td.cell-libre { font-size: 11.5px; }

  /* ── Columnas secundarias: ocultas en móvil ── */
  .agenda-table tbody tr td.col-tel,
  .agenda-table tbody tr td.col-os,
  .agenda-table tbody tr td.col-prest,
  .agenda-table tbody tr td.col-obs,
  .agenda-table tbody tr td.col-op,
  .agenda-table tbody tr td.col-conf {
    display: none;
  }

  /* ── Acciones: columna derecha compacta ── */
  .agenda-table tbody tr td.col-act {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 6px 8px;
    align-self: stretch;
    border-left: 1px solid var(--n-100);
  }

  .row-act-stack {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  /* Botones siempre visibles en táctil (no hay hover) */
  .row-act-btn {
    opacity: 1;
    width: 32px;
    height: 32px;
    background: var(--teal-50);
    color: var(--teal-600);
  }

  .row-act-btn svg { width: 14px; height: 14px; }

  .row-overbook-btn {
    font-size: 9px;
    min-height: 22px;
    padding: 0 5px;
  }

  /* Separador de hora llena */
  .agenda-table tbody tr.sep-hour { margin-top: 8px; }

  /* Línea "ahora" */
  .agenda-table tbody tr.row-now { border-top: 2px solid var(--teal-500); }
  .agenda-table tbody tr.row-now td.cell-hora::before {
    position: static;
    transform: none;
    display: block;
    margin-bottom: 2px;
  }
}
