/* ─────────────────────────────────────────────────────────────
   Portal de Informes — Profint Medicina Laboral
   Design tokens + global styles
   ───────────────────────────────────────────────────────────── */

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

:root {
  /* Profint brand — manual de marca (cyan/teal). Los nombres --profint-green*
     se conservan por compatibilidad; los valores son ahora navy-teal/cyan. */
  --profint-green: #146C94;       /* navy-teal · primary, botones, activo */
  --profint-green-600: #0f5575;   /* hover primary */
  --profint-green-700: #0b4a64;   /* texto sobre soft, focus */
  --profint-green-50: #eaf5fa;    /* fondo suave (item activo, badges, chips) */
  --profint-green-100: #d3e9f3;   /* hover background */
  --profint-green-200: #afd3e2;   /* borders sutiles */
  --brand-bright: #19A7CE;        /* cyan vibrante · acentos, links, rail */

  /* Aliases --brand* del nuevo design system (mismos valores que arriba) */
  --brand: var(--profint-green);
  --brand-600: var(--profint-green-600);
  --brand-700: var(--profint-green-700);
  --brand-50: var(--profint-green-50);
  --brand-100: var(--profint-green-100);
  --brand-200: var(--profint-green-200);

  /* Surfaces */
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #f9fbfc;
  --surface-3: #eef3f6;
  --hover: #f1f5f7;

  /* Text */
  --ink: #102a36;
  --ink-2: #1f4254;
  --muted: #5f7682;
  --muted-2: #8aa0ab;
  --faint: #b0c2cc;

  /* Lines */
  --border: #e4ebf0;
  --border-strong: #d0dbe2;
  --border-soft: #eef2f5;

  /* Aptitud — A/B/C/D/E/R */
  --apt-A: #16a34a;
  --apt-A-bg: #e7f7ee;
  --apt-B: #84cc16;
  --apt-B-bg: #f1fae0;
  --apt-C: #eab308;
  --apt-C-bg: #fdf5db;
  --apt-D: #f97316;
  --apt-D-bg: #ffeedb;
  --apt-E: #dc2626;
  --apt-E-bg: #fde7e7;
  --apt-R: #64748b;
  --apt-R-bg: #eef1f4;

  /* Estado del examen */
  --st-concurrencia: #d97706;
  --st-concurrencia-bg: #fff4dc;
  --st-aptitud: #b45309;
  --st-aptitud-bg: #fdf0d4;
  --st-revision: #2563eb;
  --st-revision-bg: #e0ebff;
  --st-informada: #059669;
  --st-informada-bg: #d9f4e8;
  --st-devuelto: #dc2626;
  --st-devuelto-bg: #fde7e7;
  /* Pills del flujo (alineados al tablero): prácticas=azul, informable=teal, revisar=violeta */
  --st-practicas: #2563eb;
  --st-practicas-bg: #e3edff;
  --st-informable: #0d9488;
  --st-informable-bg: #d7f2ee;
  --st-revisar: #7c3aed;
  --st-revisar-bg: #efe8fe;
  --st-reabierto: #6b7280;
  --st-reabierto-bg: #eef0f2;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Density-driven spacing (overridden by tweaks) */
  --row-h: 56px;
  --pad: 16px;
  --pad-lg: 24px;
  --gap: 12px;

  /* Type */
  --font-sans: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;

  /* Shadow */
  --sh-1: 0 1px 0 rgba(15, 31, 23, 0.04), 0 1px 2px rgba(15, 31, 23, 0.04);
  --sh-2: 0 1px 3px rgba(15, 31, 23, 0.05), 0 6px 18px -8px rgba(15, 31, 23, 0.10);
  --sh-3: 0 8px 28px -12px rgba(15, 31, 23, 0.18);
  --sh-drawer: -24px 0 60px -20px rgba(15, 31, 23, 0.18);
}

/* Density modes */
[data-density="compact"] {
  --row-h: 44px;
  --pad: 12px;
  --pad-lg: 16px;
  --gap: 8px;
  --fs-base: 13px;
  --fs-sm: 11.5px;
}
[data-density="comfortable"] {
  --row-h: 64px;
  --pad: 20px;
  --pad-lg: 28px;
  --gap: 14px;
}

/* Dark mode */
/* The host application's Vite bundle also declares :root color tokens and is
   loaded after this stylesheet. Qualify the theme on html so Portal Médico's
   palette wins that cascade across every screen (not just the shell chrome). */
html[data-theme="dark"] {
  --bg: #0e1a20;
  --surface: #15252e;
  --surface-2: #1a2d37;
  --surface-3: #213742;
  --hover: #1e2f3a;
  --ink: #e9f1f4;
  --ink-2: #c2d4dc;
  --muted: #8aa1ac;
  --muted-2: #6a818c;
  --faint: #4a5f6a;
  --border: #253b45;
  --border-strong: #324b56;
  --border-soft: #1c2e37;

  --profint-green-700: #74c8e6;
  --profint-green-50: rgba(25, 167, 206, .15);
  --profint-green-100: rgba(25, 167, 206, .24);
  --profint-green-200: #2a4b56;

  --apt-A-bg: #102b1a;
  --apt-B-bg: #21330d;
  --apt-C-bg: #2c2308;
  --apt-D-bg: #2c1c0a;
  --apt-E-bg: #2c1010;
  --apt-R-bg: #1a2027;

  --st-concurrencia-bg: #2a200a;
  --st-aptitud-bg: #2a1d09;
  --st-revision-bg: #14213a;
  --st-informada-bg: #102a1e;
  --st-devuelto-bg: #2a1010;
  --st-practicas-bg: #15233f;
  --st-informable-bg: #0c2622;
  --st-revisar-bg: #1f1633;
  --st-reabierto-bg: #1c2025;
}

/* Theme toggle — muestra luna en claro, sol en oscuro */
.theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }

/* Dark mode — overrides de componentes para legibilidad/contraste */
[data-theme="dark"] .btn-primary { background: var(--brand-bright); color: #06222e; }
[data-theme="dark"] .btn-primary:hover { background: #36b6da; }
[data-theme="dark"] .btn-primary svg { color: inherit; }

/* High contrast */
html[data-theme="hc"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f5f5f5;
  --hover: #eaeaea;
  --ink: #000000;
  --ink-2: #000000;
  --muted: #2c2c2c;
  --muted-2: #4a4a4a;
  --border: #000000;
  --border-strong: #000000;
  --border-soft: #4a4a4a;
  --profint-green: #0b4a64;
  --profint-green-50: #d3e9f3;
}

/* Base */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

button { font-family: inherit; cursor: default; }
input, textarea, select { font-family: inherit; color: inherit; }

/* App layout */
.app {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  background: var(--bg);
  transition: grid-template-columns 0.16s ease;
}
[data-density="compact"] .app { grid-template-columns: 234px 1fr; }
html.sb-collapsed .app { grid-template-columns: 76px 1fr; }

/* ───────── Sidebar — rail teal oscuro ───────── */
.sb {
  --sb-fg: #e7f0f5;
  --sb-muted: #94b3c3;
  --sb-hover: rgba(255, 255, 255, 0.07);
  --sb-active-bg: rgba(25, 167, 206, 0.18);
  --sb-active-fg: #ffffff;
  --sb-border: rgba(255, 255, 255, 0.10);
  --sb-rail: var(--brand-bright);
  background: linear-gradient(190deg, #0f3a50 0%, #0c2f41 58%, #0a2734 100%);
  color: var(--sb-fg);
  border-right: 1px solid rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 14px 13px;
  border-bottom: 1px solid var(--sb-border);
}
.sb-logo {
  width: 34px; height: 34px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.sb-brand .sb-text { flex: 1; min-width: 0; }
.sb-name {
  font-weight: 700; font-size: 14px; letter-spacing: -0.01em; line-height: 1.1; color: #fff;
}
.sb-sub { font-size: 11px; color: var(--sb-muted); margin-top: 1px; }
.sb-collapse {
  width: 30px; height: 30px; flex: none; margin-left: auto;
  display: grid; place-items: center; cursor: pointer;
  border: 0; background: transparent; border-radius: 7px;
  color: var(--sb-muted); font-size: 19px;
}
.sb-collapse:hover { background: var(--sb-hover); color: #fff; }
.sb-section {
  padding: 16px 14px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--sb-muted); opacity: 0.82;
  white-space: nowrap;
}
.sb-nav {
  display: flex; flex-direction: column;
  padding: 6px 10px; gap: 2px;
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
}
/* Item anclado al fondo del nav (ej. Ayuda y manual) */
.sb-item--bottom { margin-top: auto; }
.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--sb-fg); font-size: 13.5px; font-weight: 500;
  background: transparent; border: 0; text-align: left; width: 100%;
  position: relative; white-space: nowrap;
}
.sb-item:hover { background: var(--sb-hover); }
.sb-item.active { background: var(--sb-active-bg); color: var(--sb-active-fg); font-weight: 600; }
.sb-item.active::before {
  content: ""; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--sb-rail);
}
.sb-item .ic {
  font-size: 18px; width: 22px; height: 20px; flex: none; color: var(--sb-muted); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; top: 1px; /* nudge óptico: el glyph se alinea a mayúsculas, queda alto */
}
.sb-item:hover .ic { color: var(--sb-fg); }
.sb-item.active .ic { color: var(--sb-rail); }
.sb-item .lbl { overflow: hidden; text-overflow: ellipsis; }
.sb-item .count {
  margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600;
  background: rgba(255, 255, 255, 0.12); color: var(--sb-fg);
  padding: 1px 7px; border-radius: 999px; min-width: 18px; text-align: center;
}
.sb-item.active .count { background: var(--sb-rail); color: #06222e; }
.sb-menu-group {
  display: grid;
  gap: 2px;
}
.sb-item--parent .sb-caret {
  margin-left: auto;
  font-size: 13px;
  color: var(--sb-muted);
  transition: transform 0.16s ease, color 0.16s ease;
}
.sb-menu-group.open .sb-caret {
  color: var(--sb-rail);
  transform: rotate(180deg);
}
.sb-submenu {
  display: none;
  margin: 1px 0 4px 33px;
  padding-left: 10px;
  border-left: 1px solid rgba(203, 224, 235, 0.22);
}
.sb-menu-group.open .sb-submenu { display: grid; gap: 2px; }
.sb-subitem {
  display: flex; align-items: center; gap: 8px;
  min-height: 30px; padding: 6px 9px;
  border-radius: 8px; color: var(--sb-muted);
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap; position: relative;
}
.sb-subitem:hover { background: var(--sb-hover); color: var(--sb-fg); }
.sb-subitem.active {
  background: rgba(77, 223, 205, 0.12);
  color: var(--sb-active-fg);
  font-weight: 650;
}
.sb-subitem.active::before {
  content: ""; position: absolute; left: -11px; top: 50%;
  width: 3px; height: 14px; border-radius: 3px;
  background: var(--sb-rail); transform: translateY(-50%);
}
.sb-subitem i {
  font-size: 15px; width: 17px; flex: none;
}
.sb-foot {
  margin-top: auto; padding: 12px 14px;
  border-top: 1px solid var(--sb-border);
  display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-bright), #0f5575);
  color: #fff; font-weight: 700; font-size: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.sb-me-name { font-size: 13px; font-weight: 600; color: #fff; }
.sb-me-role { font-size: 11px; color: var(--sb-muted); }
.sb-foot .iconbtn { color: var(--sb-muted); }
.sb-foot .iconbtn:hover { background: var(--sb-hover); color: #fff; }

/* ── Estado colapsado (rail de iconos) ── */
html.sb-collapsed .sb-brand { justify-content: center; padding: 15px 0 13px; }
html.sb-collapsed .sb-brand .sb-text,
html.sb-collapsed .sb-logo,
html.sb-collapsed .sb-item .lbl,
html.sb-collapsed .sb-caret,
html.sb-collapsed .sb-submenu,
html.sb-collapsed .sb-foot .sb-text { display: none; }
html.sb-collapsed .sb-collapse { margin: 0; }
html.sb-collapsed .sb-section { font-size: 0; padding: 14px 0 5px; text-align: center; }
html.sb-collapsed .sb-section::after { content: "•••"; font-size: 11px; letter-spacing: 1px; color: var(--sb-muted); }
html.sb-collapsed .sb-nav { padding: 6px 8px; }
html.sb-collapsed .sb-item { justify-content: center; padding: 10px 0; gap: 0; }
html.sb-collapsed .sb-item .ic { font-size: 21px; }
html.sb-collapsed .sb-item.active::before { left: 0; }
html.sb-collapsed .sb-item .count { position: absolute; top: 3px; right: 8px; padding: 0 4px; min-width: 0; font-size: 9.5px; }
html.sb-collapsed .sb-foot { justify-content: center; padding: 12px 0; }
html.sb-collapsed .sb-avatar { display: none; }
html.sb-collapsed .sb-foot .iconbtn { display: grid; }

/* Main / topbar */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.medicos-shell .topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* La hoja global del portal se carga después y también define .topbar. */
html[data-theme="dark"] .medicos-shell .topbar {
  --surface: #15252e;
  --surface-2: #1a2d37;
  --surface-3: #213742;
  --hover: #1e2f3a;
  --ink: #e9f1f4;
  --ink-2: #c2d4dc;
  --muted: #8aa1ac;
  --muted-2: #6a818c;
  --border: #253b45;
  --border-strong: #324b56;
  background: var(--surface);
}
.topbar-l { display: flex; align-items: center; gap: 12px; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb-sep { color: var(--faint); margin: 0 6px; }
.crumb-now { color: var(--ink); font-weight: 500; }
.topbar-r { display: flex; align-items: center; gap: 8px; }
.iconbtn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: grid; place-items: center;
  position: relative;
}
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px;
  background: var(--apt-E);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.page {
  padding: 24px 32px 80px;
  width: 100%;
}
[data-density="compact"] .page { padding: 16px 24px 60px; }

/* Page header — clase .page-hdr (NO .ph: ese selector colisiona con la clase
   base de los iconos Phosphor `<i class="ph ph-...">` y les filtraba
   display:flex/margin-bottom, rompiendo la alineación de los iconos). */
.page-hdr {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-hdr h1 {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-hdr .sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn-primary {
  background: var(--profint-green);
  color: white;
  border-color: var(--profint-green);
}
.btn-primary:hover { background: var(--profint-green-600); }
/* CTA de la fila (Informar): cyan vibrante para no confundirse con el teal del menú/Filtrar. */
.btn-informar { background: var(--brand-bright); border-color: var(--brand-bright); color: #fff; }
.btn-informar:hover { background: #1593b6; border-color: #1593b6; color: #fff; }
[data-theme="dark"] .btn-informar { color: #06222e; }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--hover); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--hover); }
.btn-danger {
  background: var(--apt-E);
  color: white;
}
.btn-danger:hover { filter: brightness(0.95); }
.btn-warn {
  background: var(--apt-D);
  color: white;
}
.btn-warn:hover { filter: brightness(0.95); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--profint-green);
  box-shadow: 0 0 0 3px var(--profint-green-50);
}
.textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

/* Select — custom chevron */
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f7682' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238aa1ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Native date input polish */
.input[type="date"] { cursor: pointer; font-variant-numeric: tabular-nums; }
.input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.12s;
}
.input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 0.9; }
[data-theme="dark"] .input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .daterange .dr-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Input with leading icon */
.input-wrap { position: relative; }
.input-wrap .input-ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
  display: flex;
}
.input-wrap .input { padding-left: 36px; }
.canonical-query { display: block; width: 100%; }
.search-wrap .canonical-query input,
.canonical-query input { width: 100%; }
.search-wrap .canonical-query input { padding-left: 34px; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}

/* Stat tiles (dashboard) */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
}
.tile-ic {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.tile-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.tile-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 16px;
}
.tile-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
}
.tile-num {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}
.tile-num-label {
  font-size: 12.5px;
  color: var(--muted);
}
.tile-corner {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 11px;
  color: var(--muted-2);
}

/* Today's queue strip */
.queue {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.queue-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.queue-list {
  display: flex;
  flex-direction: column;
}
.queue-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}
.queue-row:first-child { border-top: 0; }
.queue-time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.queue-name { font-weight: 500; }
.queue-meta { font-size: 12px; color: var(--muted); }

/* Filter bar */
.filterbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "search date"
    "result actions";
  gap: 14px 24px;
  align-items: end;
  margin-bottom: 16px;
}
.filterbar .fb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filterbar .fb-field > .field-label { margin: 0; white-space: nowrap; }
.filterbar .fb-search { grid-area: search; }
.filterbar .fb-search .input-wrap, .filterbar .fb-search .input { width: 100%; }
.filterbar .fb-date { grid-area: date; }
.filterbar .fb-result { grid-area: result; }
.filterbar .fb-result .select { min-width: 200px; max-width: 260px; }
.filterbar .fb-actions { grid-area: actions; display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
  .filterbar { grid-template-columns: 1fr; grid-template-areas: "search" "date" "result" "actions"; }
  .filterbar .fb-actions { justify-content: flex-start; }
}
.daterow {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}

/* Segmented control (quick presets) */
.seg {
  display: inline-flex;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.seg .qbtn {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  height: 100%;
  padding: 0 14px;
}
.seg .qbtn:last-child { border-right: 0; }
.seg .qbtn.active {
  background: var(--profint-green-50);
  color: var(--profint-green-700);
  border-color: var(--profint-green-200);
}

/* Quick-filter chips (also used standalone) */
.qbtn {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.qbtn:hover { color: var(--ink); background: var(--hover); border-color: var(--muted-2); }
.qbtn.active {
  background: var(--profint-green-50);
  color: var(--profint-green-700);
  border-color: var(--profint-green-200);
}
/* Dark mode: el activo necesita texto CLARO (green-700 = #74c8e6 en dark) — antes usaba
   green-200 (#2a4b56, slate oscuro) sobre fondo oscuro y quedaba ilegible. */
[data-theme="dark"] .qbtn.active {
  color: var(--profint-green-700);
  background: var(--profint-green-100);
  border-color: var(--brand-bright);
}
.qbtn.active:hover { color: var(--profint-green-700); }

/* Conclusión del alumno — layout compacto en 2 columnas */
.esc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; }
.esc-grid > .esc-col + .esc-col { border-left: 1px solid var(--border-soft); padding-left: 28px; }
@media (max-width: 620px) { .esc-grid > .esc-col + .esc-col { border-left: 0; padding-left: 0; } }
.esc-col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.esc-col > .field-label { margin-bottom: 0; }
.esc-col .seg-wrap { gap: 6px; }
.esc-date { margin: 0; }
.esc-ef-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.esc-ef-row .field { margin: 0; }

/* Grouped date-range control */
.daterange {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color 0.14s, box-shadow 0.14s;
}
.daterange:hover { border-color: var(--muted-2); }
.daterange:focus-within {
  border-color: var(--profint-green);
  box-shadow: 0 0 0 3px var(--profint-green-50);
}
.daterange > svg { color: var(--muted); flex: none; margin-right: 4px; }
.daterange .dr-input {
  border: 0;
  background: transparent;
  height: 100%;
  width: 116px;
  padding: 0 2px;
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.daterange .dr-input:focus { outline: none; }
.daterange .dr-sep { color: var(--muted-2); flex: none; display: flex; }

/* ── Enhanced range picker (JS) ── */
.daterange[data-rangepicker] { position: relative; }
.daterange.dr-enhanced .dr-input { display: none; }
.dr-field {
  border: 0;
  background: transparent;
  height: 100%;
  min-width: 92px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}
.dr-field:hover { background: var(--hover); }
.dr-field .dr-ph { color: var(--muted-2); }
.dr-field .dr-val { color: var(--ink); font-weight: 500; }
.daterange.dr-open { border-color: var(--profint-green); box-shadow: 0 0 0 3px var(--profint-green-50); }

/* Popover */
.dp-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 500;
  display: none;            /* visible sólo cuando el contenedor está "abierto" */
  width: max-content;
  max-width: min(430px, calc(100vw - 24px));
  box-sizing: border-box;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  padding: 12px;
  gap: 12px;
  isolation: isolate;
  animation: dp-in 0.12s ease-out;
}
/* El popup se muestra sólo mientras el control está abierto (sino no cerraba). */
.daterange.dr-open .dp-pop,
.datepick.dp-open .dp-pop { display: flex; }
.dp-pop.dp-above { top: auto; bottom: calc(100% + 8px); }
.dp-pop.dp-align-end { right: 0; left: auto; }
@keyframes dp-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Presets */
.dp-presets {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 10px;
  border-right: 1px solid var(--border-soft);
  min-width: 124px;
}
.dp-preset {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dp-preset:hover { background: var(--profint-green-50); color: var(--profint-green-700); }
.dp-preset-clear { margin-top: auto; color: var(--muted); }
.dp-preset-clear:hover { background: var(--hover); color: var(--ink); }

/* Calendar */
.dp-cal { width: 276px; max-width: 100%; min-width: 0; }
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 8px;
}
.dp-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.dp-nav {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dp-nav:hover { background: var(--hover); color: var(--ink); }
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-dow { margin-bottom: 4px; }
.dp-dowc {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 2px 0;
}
.dp-day {
  display: grid;
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  position: relative;
  transition: background 0.1s, color 0.1s;
}
.dp-day:hover { background: var(--profint-green-50); }
.dp-day:focus-visible,
.dp-nav:focus-visible,
.dp-preset:focus-visible,
.dp-foot-btn:focus-visible {
  outline: 2px solid var(--profint-green);
  outline-offset: 2px;
}
.dp-day.dp-out { color: var(--faint); }
.dp-day.dp-today { font-weight: 700; color: var(--profint-green); }
.dp-day.dp-in {
  background: var(--profint-green-50);
  border-radius: 0;
  color: var(--profint-green-700);
}
.dp-day.dp-start, .dp-day.dp-end {
  background: var(--profint-green);
  color: #fff;
  font-weight: 600;
}
.dp-day.dp-start:hover, .dp-day.dp-end:hover { background: var(--profint-green-600); }
.dp-day.dp-start { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.dp-day.dp-end { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.dp-day.dp-start.dp-end { border-radius: var(--r-sm); }

@media (max-width: 560px) {
  .dp-pop {
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .dp-presets {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
    padding-right: 0;
    padding-bottom: 10px;
    min-width: 0;
  }
  .dp-cal { width: 100%; }
  .dp-day { height: 38px; }
  .dp-preset-clear { margin-top: 0; }
}

/* ───────────────────────── Single-date picker ───────────────────────── */
.datepick { position: relative; display: block; }
.datepick .dp-native-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  border: 0;
}
.datepick-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.datepick-field:hover { border-color: var(--muted-2); }
.datepick.dp-open .datepick-field {
  border-color: var(--profint-green);
  box-shadow: 0 0 0 3px var(--profint-green-50);
}
.datepick-field > svg { color: var(--muted); flex: none; }
.datepick-field .dp-val { font-variant-numeric: tabular-nums; }
.datepick-field .dp-ph { color: var(--muted-2); }
.datepick-field .dp-clear {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: var(--r-pill, 999px);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.datepick-field .dp-clear:hover { background: var(--hover); color: var(--ink); }
.dp-pop.dp-pop-single { left: 0; right: auto; flex-direction: column; }
/* Footer del datepicker single (Hoy / Limpiar) */
.dp-foot {
  display: flex; gap: 8px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--border-soft);
}
.dp-foot-btn {
  flex: 1; height: 32px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--profint-green-700);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dp-foot-btn:hover { background: var(--profint-green-50); border-color: var(--profint-green-200); }
.dp-foot-btn--clear { color: var(--muted); }
.dp-foot-btn--clear:hover { background: var(--hover); color: var(--ink); border-color: var(--muted-2); }

/* ───────────────────────── Collapsible panel (cpanel) ───────────────────────── */
.cpanel { margin: 0 0 16px; border: 0; }
.cpanel > .cpanel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--profint-green-50);
  border: 1px solid var(--profint-green-200);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--profint-green-700);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.12s;
}
.cpanel > .cpanel-head::-webkit-details-marker { display: none; }
.cpanel > .cpanel-head:hover { background: var(--profint-green-100); }
.cpanel > .cpanel-head::before {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  margin-left: 2px;
}
.cpanel[open] > .cpanel-head::before { transform: rotate(45deg); }
.cpanel[open] > .cpanel-head {
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom-color: transparent;
}
.cpanel .cpanel-head .cpanel-hint {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.cpanel > .cpanel-card {
  border: 1px solid var(--profint-green-200);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--surface);
}

/* Tab chips (estado) */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.tab:hover { background: var(--hover); }
.tab .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2);
}
.tab[data-st="concurrencia"] .dot { background: var(--st-concurrencia); }
.tab[data-st="aptitud"] .dot { background: var(--st-aptitud); }
.tab[data-st="practicas"] .dot { background: var(--st-practicas); }
.tab[data-st="informable"] .dot { background: var(--st-informable); }
.tab[data-st="revision"] .dot { background: var(--st-revision); }
.tab[data-st="revisar"] .dot { background: var(--st-revisar); }
.tab[data-st="informada"] .dot { background: var(--st-informada); }
.tab .num {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.tab.active {
  background: var(--profint-green);
  color: white;
  border-color: var(--profint-green);
}
.tab.active .num { background: rgba(255,255,255,0.18); color: white; }

/* Exam list — list layout */
.exlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exrow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  transition: border-color 0.1s, box-shadow 0.1s;
  position: relative;
}
.exrow > :nth-child(2) { min-width: 0; }
.exrow:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-1);
}
[data-density="compact"] .exrow { padding: 10px 14px; }
.exrow.expanded {
  border-color: var(--profint-green-200);
  box-shadow: 0 0 0 1px var(--profint-green-200);
}

/* Patient avatar */
.pavatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--profint-green-50), var(--profint-green-100));
  color: var(--profint-green-700);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
[data-theme="dark"] .pavatar { color: var(--profint-green-200); }
[data-density="compact"] .pavatar { width: 32px; height: 32px; font-size: 11.5px; }

.exname {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-density="compact"] .exname { font-size: 13.5px; }
.exmeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.exmeta > * { flex-shrink: 0; }
.exmeta > span:last-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.exmeta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.dni { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.extime {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.35;
}
.extime b { color: var(--ink); font-weight: 600; }

.attach-mini {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* Aptitud chip */
.apt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: white;
  flex-shrink: 0;
}
.apt-lg { width: 56px; height: 56px; font-size: 24px; border-radius: 12px; }
.apt-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px 0 4px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}
.apt-pill .let {
  width: 18px; height: 18px;
  border-radius: 50%;
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 10.5px;
}
.apt-A, .apt-pill.apt-A { background: var(--apt-A-bg); color: var(--apt-A); }
.apt-A.solid, .apt-A.apt-lg { background: var(--apt-A); color: white; }
.apt-pill.apt-A .let { background: var(--apt-A); }
.apt-B, .apt-pill.apt-B { background: var(--apt-B-bg); color: #6b8a0e; }
.apt-B.solid, .apt-B.apt-lg { background: var(--apt-B); color: white; }
.apt-pill.apt-B .let { background: var(--apt-B); }
.apt-C, .apt-pill.apt-C { background: var(--apt-C-bg); color: #8b6b08; }
.apt-C.solid, .apt-C.apt-lg { background: var(--apt-C); color: white; }
.apt-pill.apt-C .let { background: var(--apt-C); }
.apt-D, .apt-pill.apt-D { background: var(--apt-D-bg); color: #b3520e; }
.apt-D.solid, .apt-D.apt-lg { background: var(--apt-D); color: white; }
.apt-pill.apt-D .let { background: var(--apt-D); }
.apt-E, .apt-pill.apt-E { background: var(--apt-E-bg); color: var(--apt-E); }
.apt-E.solid, .apt-E.apt-lg { background: var(--apt-E); color: white; }
.apt-pill.apt-E .let { background: var(--apt-E); }
.apt-R, .apt-pill.apt-R { background: var(--apt-R-bg); color: var(--apt-R); }
.apt-R.solid, .apt-R.apt-lg { background: var(--apt-R); color: white; }
.apt-pill.apt-R .let { background: var(--apt-R); }

/* Estado chip */
.est {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.est .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.est-concurrencia { background: var(--st-concurrencia-bg); color: var(--st-concurrencia); }
.est-concurrencia .dot { background: var(--st-concurrencia); }
.est-aptitud { background: var(--st-aptitud-bg); color: var(--st-aptitud); }
.est-aptitud .dot { background: var(--st-aptitud); }
.est-revision { background: var(--st-revision-bg); color: var(--st-revision); }
.est-revision .dot { background: var(--st-revision); }
.est-informada { background: var(--st-informada-bg); color: var(--st-informada); }
.est-informada .dot { background: var(--st-informada); }
.est-devuelto { background: var(--st-devuelto-bg); color: var(--st-devuelto); }
.est-devuelto .dot { background: var(--st-devuelto); }
.est-reabierto { background: var(--st-reabierto-bg); color: var(--st-reabierto); }
.est-reabierto .dot { background: var(--st-reabierto); }

/* Motivo de la consulta (Accidente vs Medicina Laboral) */
.est-accidente { background: var(--st-concurrencia-bg); color: var(--st-concurrencia); }
.est-accidente .dot { background: var(--st-concurrencia); }
.est-medlab { background: var(--st-aptitud-bg); color: var(--st-aptitud); }
.est-medlab .dot { background: var(--st-aptitud); }

/* Tag de tipo de prestación (código + descripción) en la meta de la fila */
.tag-prest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-2);
}
.tag-prest .cod {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* Badges (urgente, menor, observado, devuelto) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-urg { background: #fee4e4; color: var(--apt-E); }
.badge-menor { background: #fff4dc; color: var(--st-concurrencia); }
.badge-obs { background: var(--st-aptitud-bg); color: var(--st-aptitud); }

/* Drawer (wizard) */
.drawer-back {
  position: fixed; inset: 0;
  background: rgba(11, 31, 23, 0.36);
  backdrop-filter: blur(2px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-back.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(880px, 96vw);
  height: 100vh;
  background: var(--bg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-drawer);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  border-left: 1px solid var(--border);
}
.drawer.open { transform: translateX(0); }
.drawer-modal {
  width: min(880px, 92vw);
  height: min(92vh, 980px);
  top: 50%; right: 50%;
  transform: translate(50%, -40%);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.drawer-modal.open { transform: translate(50%, -50%); }
.drawer-full {
  width: 100vw;
  border-left: 0;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 120px;
}
[data-density="compact"] .drawer-body { padding: 16px 22px 100px; }
.drawer-foot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  gap: 12px;
}
.drawer-modal .drawer-foot { position: static; }

/* Wizard stepper */
.stepper {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 18px;
}
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.step .num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
}
.step.done .num {
  background: var(--profint-green);
  color: white;
}
.step.active .num {
  background: var(--profint-green);
  color: white;
  box-shadow: 0 0 0 3px var(--profint-green-50);
}
.step.active { color: var(--ink); font-weight: 500; }
.step-line {
  flex: 1; height: 1px; background: var(--border-strong); max-width: 40px;
}

/* Patient header (in wizard) */
.phdr {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 18px;
}
.phdr .pavatar { width: 48px; height: 48px; font-size: 15px; border-radius: 12px; }
.phdr-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.phdr-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.phdr-meta b { color: var(--ink-2); font-weight: 500; }

/* Aptitud big buttons (paso 2) */
.aptgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 700px) {
  .aptgrid { grid-template-columns: repeat(3, 1fr); }
}
.aptbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.12s;
  position: relative;
}
.aptbtn:hover { border-color: var(--border-strong); background: var(--hover); }
.aptbtn .let {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: white;
  letter-spacing: -0.01em;
}
.aptbtn .lname {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.aptbtn .ldesc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  min-height: 28px;
}
.aptbtn.selected {
  border-color: currentColor;
  box-shadow: 0 0 0 2px currentColor;
  background: var(--surface);
}
.aptbtn.selected.apt-A { color: var(--apt-A); }
.aptbtn.selected.apt-B { color: var(--apt-B); }
.aptbtn.selected.apt-C { color: var(--apt-C); }
.aptbtn.selected.apt-D { color: var(--apt-D); }
.aptbtn.selected.apt-E { color: var(--apt-E); }
.aptbtn.selected.apt-R { color: var(--apt-R); }
.aptbtn .let.lA { background: var(--apt-A); }
.aptbtn .let.lB { background: var(--apt-B); }
.aptbtn .let.lC { background: var(--apt-C); }
.aptbtn .let.lD { background: var(--apt-D); }
.aptbtn .let.lE { background: var(--apt-E); }
.aptbtn .let.lR { background: var(--apt-R); }

.aptdesc {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--profint-green);
  font-size: 13px;
  color: var(--ink-2);
}

/* Práctica groups (accordion) */
.pgroup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.pgroup-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: default;
}
.pgroup-head:hover { background: var(--surface-2); }
.pgroup.open .pgroup-head { border-bottom: 1px solid var(--border-soft); }
.chev {
  width: 16px; height: 16px;
  transition: transform 0.15s;
  color: var(--muted);
}
.pgroup.open .chev { transform: rotate(90deg); }
.pgroup-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.pgroup-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.pgroup-summary {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 360px;
  text-align: right;
}
.pgroup-body {
  padding: 4px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.practice {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
}
.practice:first-child { border-top: 0; }
.practice-name {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.practice-name .attach {
  display: inline-flex; gap: 6px;
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}
.practice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.quick {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.qf {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.qf:hover { background: var(--profint-green-50); color: var(--profint-green-700); border-color: var(--profint-green-200); }
.qf.active { background: var(--profint-green); color: white; border-color: var(--profint-green); }

.attach-strip {
  display: flex; gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.attach-thumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--ink-2);
}
.attach-thumb .ic { width: 14px; height: 14px; color: var(--muted); }
.attach-thumb.img {
  padding: 0;
  width: 56px; height: 40px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}

/* Section heading inside drawer */
.section-h {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 10px;
}
.section-h:first-child { margin-top: 0; }

/* Table for Ver Informes */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  scrollbar-width: thin;
}
.tbl {
  min-width: 1100px;
}
.tbl-row {
  display: grid;
  grid-template-columns: 100px minmax(160px, 1.3fr) minmax(160px, 1.2fr) 110px 70px minmax(170px, 1fr) minmax(150px, 1fr) 156px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
}
.tbl-row > * { min-width: 0; overflow: hidden; }
.tbl-row > * { text-overflow: ellipsis; }
.tbl-row .actions { overflow: visible; }
.tbl-row.head {
  border-top: 0;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 16px;
}
.tbl-row:hover:not(.head) { background: var(--surface-2); }
.tbl .actions { display: flex; gap: 4px; }

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kcol {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}
.kcol-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 6px;
  font-size: 12.5px;
  font-weight: 600;
}
.kcol-head .dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; display: inline-block; }
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.kcard-name { font-weight: 600; font-size: 13px; }
.kcard-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* Modal (mail) */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(11, 31, 23, 0.42);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-back.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: min(620px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s;
}
.modal-back.open .modal { transform: scale(1); }
.modal-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--border-soft); }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* Recipient chip */
.recip {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--surface-2);
}
.recip input { accent-color: var(--profint-green); }
.recip-email { font-family: var(--font-mono); font-size: 12.5px; }
.recip-role { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-ic {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--faint);
}
.empty-title { color: var(--ink); font-weight: 600; font-size: 15px; margin-bottom: 4px; }

/* Timeline (drawer side) */
.timeline {
  font-size: 12px;
}
.tl-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 8px 0;
  position: relative;
}
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: -4px;
  width: 1px;
  background: var(--border-strong);
}
.tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--profint-green);
  margin-top: 4px;
}
.tl-time { font-family: var(--font-mono); color: var(--muted); font-size: 11px; }
.tl-text { color: var(--ink-2); margin-top: 1px; line-height: 1.4; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  display: flex; align-items: center; gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--sh-3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok { background: var(--profint-green); }

/* Subtle utility */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border-soft); margin: 12px 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* For es-AR locale chrome */
.localechip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Quick filter pills for Ver Informes */
.quickpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.quickpill.active { background: var(--profint-green-50); color: var(--profint-green-700); border-color: var(--profint-green-200); }

/* Responsive */
@media (max-width: 1100px) {
  .exrow {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    column-gap: 12px;
  }
  .exrow > :nth-child(4) { display: none; }   /* hide horas col, info already in meta */
}
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .sb-brand .sb-text, .sb-item .lbl, .sb-section, .sb-foot .sb-text { display: none; }
  .sb-item { justify-content: center; padding: 9px 0; }
  .sb-item .count { position: absolute; top: 2px; right: 6px; padding: 0 4px; font-size: 9.5px; min-width: 0; }
  .page { padding: 16px; }
  .page-hdr h1 { font-size: 22px; }
}

/* ─────────────────────────────────────────────────────────────
   Extensiones Razor — formularios server-rendered + alerts
   ───────────────────────────────────────────────────────────── */

/* Reset link default look inside the app.
   1) Sin subrayado en NINGÚN <a> (incluye <a class="btn ...">, pills, chips, nav) — antes
      el reset sólo cubría :not(.btn) y los <a class="btn"> salían subrayados.
   2) El color heredado + hover verde aplica SÓLO a links "de texto": se excluyen los
      componentes que definen su propio color (.btn / .tab / .sb-item / .sv-chip / .vi-*),
      así sus estados activos no quedan pisados por el reset (bug "Informados": texto
      negro sobre fondo azul porque el reset (0,2,1) le ganaba a .tab.active (0,2,0)). */
.medicos-shell a { text-decoration: none; }
.medicos-shell a:not(.btn):not(.tab):not(.sb-item):not(.sv-chip):not(.vi-doc):not(.vi-doclist-item) { color: inherit; }
.medicos-shell a:not(.btn):not(.tab):not(.sb-item):not(.sv-chip):not(.vi-doc):not(.vi-doclist-item):hover { color: var(--profint-green); }

/* ── Iconos Phosphor (no tocar `display` para no romper el toggle sol/luna) ── */
.medicos-shell .ph { line-height: 1; vertical-align: -0.125em; }
.iconbtn .ph, .theme-toggle .ph { font-size: 18px; }
.sb-collapse .ph { font-size: 19px; }
/* Tamaños utilitarios para iconos standalone (empty states, headers, feature icons). */
.medicos-shell .ph-lg { font-size: 22px; }
.medicos-shell .ph-xl { font-size: 32px; }
.medicos-shell .ph-2xl { font-size: 44px; }

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.alert-success {
  background: var(--profint-green-50);
  border-color: var(--profint-green-200);
  color: var(--profint-green-700);
}
.alert-error {
  background: var(--apt-E-bg);
  border-color: #fecaca;
  color: var(--apt-E);
}
.alert-warn {
  background: var(--apt-D-bg);
  border-color: #fed7aa;
  color: var(--apt-D);
}
.alert-info {
  background: var(--st-revision-bg);
  border-color: #bfdbfe;
  color: var(--st-revision);
}

/* Login / forgot / restablecer */
.auth-shell {
  min-height: 100vh;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  box-shadow: var(--sh-2);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-brand .sb-logo { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
.auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.auth-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 22px;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn-primary { width: 100%; height: 42px; font-size: 14px; }
.auth-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.auth-foot a { color: var(--profint-green); font-weight: 500; }

/* Wizard como página completa (no drawer) */
.wizard-page {
  max-width: 880px;
  margin: 0 auto;
}
.wizard-page-foot {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin: 24px -32px -80px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.pager a, .pager .pager-info {
  font-size: 12.5px;
  color: var(--muted);
}
.pager a {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.pager a:hover {
  background: var(--profint-green-50);
  color: var(--profint-green-700);
  border-color: var(--profint-green-200);
}

/* Practica dinámica (form rows del wizard) */
.practica-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
}
.practica-item .remove {
  position: absolute;
  top: 8px; right: 10px;
  background: transparent;
  border: 0;
  color: var(--apt-E);
  font-size: 18px;
  cursor: pointer;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 6px;
}
.practica-item .remove:hover { background: var(--apt-E-bg); }

/* Form grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* Examen card expanded (lista) — opens a panel below */
.exrow-expanded-panel {
  background: var(--surface-2);
  border: 1px solid var(--profint-green-200);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  margin-top: -1px;
  margin-bottom: 8px;
  padding: 16px 18px;
}

/* Helper: gap utilities */
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }

/* Modal helper for envío mail */
.modal-shell {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 23, 0.42);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Topbar density-aware */
.topbar-greet {
  font-size: 13px;
  color: var(--muted);
}
.topbar-greet b { color: var(--ink); font-weight: 500; }

/* ============================================================================ */
/* Kanban dashboard del Portal de Informes                                      */
/* ============================================================================ */

/* Accent palette por columna — el dashboard rotular el flujo con un tono       */
/* incremental verde → azul → primary → violeta → success.                       */
.kanban-col--warning  { --col-accent: #e8a23a; --col-accent-soft: #fef3e2; }
.kanban-col--info     { --col-accent: #3b82f6; --col-accent-soft: #e7f0fd; }
.kanban-col--primary  { --col-accent: var(--profint-green); --col-accent-soft: var(--profint-green-50); }
.kanban-col--accent   { --col-accent: #8b5cf6; --col-accent-soft: #f1ebfe; }
.kanban-col--success  { --col-accent: #16a34a; --col-accent-soft: #e2f5e8; }

[data-theme="dark"] .kanban-col--warning  { --col-accent-soft: #2a230f; }
[data-theme="dark"] .kanban-col--info     { --col-accent-soft: #16203a; }
[data-theme="dark"] .kanban-col--primary  { --col-accent-soft: var(--profint-green-50); }
[data-theme="dark"] .kanban-col--accent   { --col-accent-soft: #251f3a; }
[data-theme="dark"] .kanban-col--success  { --col-accent-soft: #142a1b; }

/* Header arriba del board */
.kanban-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}
.kanban-header__title h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--ink);
}
.kanban-header__sub {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kanban-header__total {
  padding: 2px 9px;
  background: var(--profint-green-50);
  color: var(--profint-green-700);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.kanban-header__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Mini-stats row — totales clicables que scrollean a su columna */
.kanban-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kanban-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}
.kanban-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--col-accent);
}
.kanban-stat:hover {
  transform: translateY(-1px);
  border-color: var(--col-accent);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.06);
}
.kanban-stat__icon {
  width: 38px; height: 38px;
  background: var(--col-accent-soft);
  color: var(--col-accent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kanban-stat__icon i { font-size: 20px; }
.kanban-stat__body { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.kanban-stat__num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kanban-stat__lbl {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-top: 2px;
}

/* Board — grid horizontal de 5 columnas, scroll x en pantallas chicas */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Columna */
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--col-accent);
  border-radius: 12px;
  padding: 14px 12px 10px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.kanban-col.is-drop-target {
  background: var(--col-accent-soft);
  border-color: var(--col-accent);
  box-shadow: inset 0 0 0 2px var(--col-accent);
}
.kanban-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.kanban-col__title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-col__title i { color: var(--col-accent); font-size: 18px; }
.kanban-col__title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.kanban-col__count {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  background: var(--col-accent-soft);
  color: var(--col-accent);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.kanban-col__desc {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.4;
}
.kanban-col__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 60px;
}

/* Card */
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px -3px rgba(0, 0, 0, 0.08);
  border-color: var(--col-accent);
}
.kanban-card.is-dragging {
  cursor: grabbing;
  opacity: 0.55;
}
.kanban-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.kanban-card__pac {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card__dni {
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.kanban-card__cli {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card__cli i { font-size: 13px; color: var(--col-accent); }
.kanban-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted-2);
  border-top: 1px dashed var(--border-soft);
  padding-top: 6px;
}
.kanban-card__fecha { font-variant-numeric: tabular-nums; }
.kanban-card__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--col-accent-soft);
  color: var(--col-accent);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 11px;
  transition: filter 0.12s ease;
}
.kanban-card__action:hover { filter: brightness(0.95); }
.kanban-card__action i { font-size: 12px; }

/* Estado vacío de la columna */
.kanban-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 8px;
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}
.kanban-empty i { font-size: 28px; opacity: 0.6; }

.kanban-more {
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  padding: 6px 4px 2px;
  font-style: italic;
}

/* Responsive — en pantallas chicas el grid se vuelve scroll horizontal */
@media (max-width: 1180px) {
  .kanban-stats { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
  .kanban-board { grid-auto-columns: minmax(260px, 1fr); grid-template-columns: none; grid-auto-flow: column; }
}
@media (max-width: 720px) {
  .kanban-header { flex-direction: column; align-items: flex-start; }
  .kanban-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Confirm modal (concurrencia) ── */
.cmodal-overlay {
  position: fixed; inset: 0;
  background: rgba(11, 31, 23, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 200;
  opacity: 0; transition: opacity 0.12s;
}
.cmodal-overlay.open { opacity: 1; }
.cmodal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  width: 100%; max-width: 420px;
  padding: 22px 24px;
  transform: translateY(6px); transition: transform 0.12s;
}
.cmodal-overlay.open .cmodal { transform: none; }
.cmodal-ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--profint-green-50); color: var(--profint-green);
  display: grid; place-items: center; margin-bottom: 14px;
}
.cmodal-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.cmodal-body { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.cmodal-body b { color: var(--ink-2); font-weight: 600; }
.cmodal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ── Confirmación de emisión del informe laboral ── */
.cmodal--confirm { max-width: 540px; }
.cmodal--confirm .cmodal-body { max-height: 60vh; overflow-y: auto; }
.lab-confirm__res {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--profint-green-50);
  border: 1px solid var(--profint-green-200);
  border-radius: var(--r-md);
}
.lab-confirm__res-lbl {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--profint-green-700);
}
.lab-confirm__res strong { font-size: 15px; color: var(--ink); font-weight: 600; }
.lab-confirm__list {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 6px 16px;
  margin: 0;
}
.lab-confirm__list dt {
  font-size: 12.5px; color: var(--muted); font-weight: 500;
}
.lab-confirm__list dd {
  margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.lab-confirm__chip {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px; border-radius: var(--r-pill, 999px);
  font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.lab-confirm__note {
  margin: 16px 0 0; padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.lab-confirm__note strong { color: var(--ink-2); font-weight: 600; }

/* Filas con divisores sutiles (más legible que el dl plano). */
.lab-confirm__list { row-gap: 0; }
.lab-confirm__list dt,
.lab-confirm__list dd {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  align-self: center;
}
.lab-confirm__list dd { text-align: right; }
.lab-confirm__sec { margin-top: 16px; }
.lab-confirm__sec-h {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--profint-green-700);
  padding-bottom: 4px; margin-bottom: 2px;
}
.lab-confirm__sec .lab-confirm__list dt:last-of-type,
.lab-confirm__sec .lab-confirm__list dd:last-of-type { border-bottom: 0; }

/* ── Conclusión laboral: layout agrupado (decisión apto/alta + fecha | justifica aparte) ── */
.lab-cl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px 24px;
  align-items: start;
}
.lab-cl__main { min-width: 0; }
.lab-cl__main .seg-field { margin-bottom: 14px; }
.lab-cl__main .seg-field:last-of-type { margin-bottom: 0; }
.lab-cl__dates { margin-top: 0; }
.lab-cl__edufis { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-soft); }
.lab-cl__side {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}
.seg-wrap--stack { flex-direction: column; align-items: stretch; gap: 6px; }
.seg-wrap--stack .qbtn { justify-content: flex-start; text-align: left; }
@media (max-width: 760px) {
  .lab-cl { grid-template-columns: 1fr; }
  .lab-cl__side { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); padding-top: 14px; }
  .seg-wrap--stack { flex-direction: row; flex-wrap: wrap; }
}

/* ── Barra de Resultado + Emitir: sticky para verla siempre al completar ── */
.lab-emit-bar {
  position: sticky; bottom: 12px; z-index: 20;
  padding: 14px 16px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  box-shadow: var(--sh-2);
  border: 1px solid var(--profint-green-200);
}
.lab-emit-bar__info { min-width: 0; }
.lab-emit-bar__res {
  font-size: 16px; font-weight: 700; color: var(--profint-green-700);
  line-height: 1.25;
}

/* ── Fila registrada ── */
.exrow.done { background: var(--surface-2); }
.conc-done { display: flex; align-items: center; gap: 10px; }
.conc-check {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--apt-A-bg); color: var(--apt-A);
  display: grid; place-items: center; flex: none;
}
.conc-done-txt { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.conc-done-txt b { color: var(--apt-A); font-weight: 600; }

/* ── Toast ── */
.toast-host {
  position: fixed; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 8px; z-index: 300;
}
.toast {
  background: var(--ink); color: #fff;
  padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 13px; box-shadow: var(--sh-2); max-width: 360px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.15s, transform 0.15s;
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: var(--profint-green); }
.toast.err { background: var(--apt-E); }

/* ── Menú 3 puntos (fila cerrada) ── */
.conc-menu { position: relative; margin-left: 6px; }
.conc-menu-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted);
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.conc-menu-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--muted-2); }
.conc-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 188px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  padding: 5px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px;
}
.conc-menu-pop[hidden] { display: none; }
.conc-menu-pop button {
  display: flex; align-items: center; gap: 9px;
  text-align: left; border: 0; background: transparent;
  border-radius: var(--r-sm); padding: 8px 10px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.conc-menu-pop button:hover { background: var(--hover); }
.conc-menu-pop button svg { color: var(--muted); flex: none; }

/* Acciones visibles en filas ya informadas: Ver mail + Reenviar */
.conc-actions { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.conc-act-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.conc-act-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--muted-2); }
.conc-act-btn i { font-size: 14px; color: var(--muted); }
.conc-act-btn:hover i { color: var(--brand); }
@media (max-width: 760px) { .conc-act-btn span { display: none; } .conc-act-btn { padding: 0 8px; } }

/* ── Time picker (control moderno de hora) ── */
.timepicker { position: relative; display: inline-block; }
/* El <input type="time"> nativo queda accesible pero invisible (validación + submit). */
.timepicker__native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.timepicker__trigger {
  display: inline-flex; align-items: center; gap: 8px;
  width: 118px; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.timepicker__trigger:hover { border-color: var(--muted-2); }
.timepicker.is-open .timepicker__trigger {
  border-color: var(--profint-green);
  box-shadow: 0 0 0 3px var(--profint-green-50);
}
.timepicker__ic { display: flex; color: var(--profint-green); flex: none; }
.timepicker__val { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.timepicker__caret { display: flex; color: var(--muted-2); margin-left: auto; transition: transform 0.16s; }
.timepicker.is-open .timepicker__caret { transform: rotate(180deg); }

.timepicker__pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  z-index: 70;
  width: 168px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  overflow: hidden;
  animation: tp-in 0.12s ease;
}
.timepicker.flip-up .timepicker__pop { top: auto; bottom: calc(100% + 6px); }
.timepicker__pop[hidden] { display: none; }
@keyframes tp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.timepicker__cols { display: flex; height: 180px; }
.timepicker__list {
  flex: 1; list-style: none; margin: 0; padding: 70px 0;
  overflow-y: auto; scroll-snap-type: y mandatory;
  scrollbar-width: thin;
}
.timepicker__list + .timepicker__list { border-left: 1px solid var(--border); }
.timepicker__list::-webkit-scrollbar { width: 6px; }
.timepicker__list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.timepicker__opt {
  scroll-snap-align: center;
  height: 32px; line-height: 32px;
  text-align: center;
  font-size: 13.5px; font-variant-numeric: tabular-nums;
  color: var(--muted); cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.timepicker__opt:hover { background: var(--hover); color: var(--ink); }
.timepicker__opt.is-active {
  color: var(--profint-green); font-weight: 700;
  background: var(--profint-green-50);
}

.timepicker__foot {
  border-top: 1px solid var(--border);
  padding: 6px; display: flex;
}
.timepicker__now {
  flex: 1; height: 30px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--profint-green);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
.timepicker__now:hover { background: var(--profint-green-50); }

/* ── Modal de mail (preview) ── */
.cmodal--lg { max-width: 720px; padding: 0; overflow: hidden; }
.cmodal-mail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.cmodal-mail-meta { font-size: 12.5px; color: var(--muted); line-height: 1.5; min-width: 0; }
.cmodal-mail-meta .mm-subject { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.cmodal-mail-close {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--r-sm);
  color: var(--muted); cursor: pointer;
}
.cmodal-mail-close:hover { background: var(--hover); color: var(--ink); }
.cmodal-mail-frame {
  width: 100%; height: 72vh; border: 0; display: block; background: var(--surface-2);
}

/* ════ Popup "Ver informe" del examen (Informe + Mail) ════ */
.vi-modal {
  max-width: 780px; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; max-height: 88vh;
}
.vi-loading { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 13.5px; }

.vi-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--border); flex: none;
}
.vi-pac { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vi-avatar {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: var(--profint-green-50); color: var(--profint-green);
}
.vi-pac-info { min-width: 0; }
.vi-pac-name { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.vi-pac-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 5px; }
.vi-close {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--r-sm); color: var(--muted); cursor: pointer;
}
.vi-close:hover { background: var(--hover); color: var(--ink); }

.vi-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); flex: none; }
.vi-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 4px; margin-bottom: -1px;
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.vi-tab + .vi-tab { margin-left: 14px; }
.vi-tab:hover { color: var(--ink-2); }
.vi-tab.on { color: var(--profint-green); border-bottom-color: var(--profint-green); }

.vi-body { padding: 20px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.vi-panel[hidden] { display: none; }

.vi-apt-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; margin-bottom: 16px; }
.vi-apt {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 14px 20px; border-radius: var(--r-md); min-width: 190px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1.5px solid var(--border-strong);
}
.vi-apt-letra { font-family: var(--font-mono); font-weight: 700; font-size: 30px; line-height: 1; }
.vi-apt-label { font-size: 13.5px; font-weight: 600; }
.vi-apt.g-A { color: var(--apt-A); background: var(--apt-A-bg); border-color: var(--apt-A); }
.vi-apt.g-B { color: var(--apt-B); background: var(--apt-B-bg); border-color: var(--apt-B); }
.vi-apt.g-C { color: var(--apt-C); background: var(--apt-C-bg); border-color: var(--apt-C); }
.vi-apt.g-D { color: var(--apt-D); background: var(--apt-D-bg); border-color: var(--apt-D); }
.vi-apt.g-E { color: var(--apt-E); background: var(--apt-E-bg); border-color: var(--apt-E); }
.vi-apt.g-R { color: var(--apt-R); background: var(--apt-R-bg); border-color: var(--apt-R); }

.vi-facts { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; align-content: center; margin: 0; }
.vi-facts > div { min-width: 0; }
.vi-facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.vi-facts dd { font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 1px 0 0; }

.vi-obs { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; }
.vi-obs-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.vi-obs p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.vi-sec-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.vi-empty { font-size: 13px; color: var(--muted); margin: 0; }

.vi-grupos { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.vi-grow { display: flex; gap: 14px; padding: 10px 14px; align-items: baseline; }
.vi-grow + .vi-grow { border-top: 1px solid var(--border-soft); }
.vi-grow-name { flex: 0 0 38%; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.vi-grow-res { flex: 1; font-size: 13px; color: var(--ink); }

.vi-docs { display: flex; flex-wrap: wrap; gap: 8px; }
.vi-doc {
  display: inline-flex; align-items: center; gap: 8px; text-align: left;
  padding: 9px 13px; border-radius: var(--r-md); text-decoration: none; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: inherit;
  font-family: inherit;
}
.vi-doc:hover { background: var(--surface-2); border-color: var(--profint-green-200); }
.vi-doc--pdf { border-color: var(--profint-green-200); background: var(--profint-green-50); }
.vi-doc--pdf:hover { background: var(--profint-green-100); }
.vi-doc-ic { width: 28px; height: 28px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--profint-green-50); color: var(--profint-green); }
.vi-doc-body { display: flex; flex-direction: column; min-width: 0; }
.vi-doc-name { font-size: 12px; font-weight: 600; color: var(--ink-2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi-doc-sub { font-size: 10.5px; color: var(--muted); }

/* Badge de cantidad en el tab Documentos */
.vi-tab-count {
  font-size: 10.5px; font-weight: 700; line-height: 1;
  padding: 2px 6px; border-radius: 999px; margin-left: 1px;
  background: var(--profint-green-50); color: var(--profint-green);
}
.vi-tab.on .vi-tab-count { background: var(--profint-green); color: #fff; }

/* ── Solapa Documentos: master-detail ── */
.vi-docpane { display: flex; height: 64vh; min-height: 360px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.vi-docpane[hidden] { display: none; }
.vi-doclist { flex: 0 0 248px; overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface-2); }
.vi-doclist-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; background: transparent; cursor: pointer; font-family: inherit;
  border-bottom: 1px solid var(--border-soft); border-left: 2px solid transparent;
}
.vi-doclist-item:hover { background: var(--hover); }
.vi-doclist-item.on { background: var(--surface); border-left-color: var(--profint-green); }
.vi-doclist-ic { width: 26px; height: 26px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--profint-green-50); color: var(--profint-green); }
.vi-doclist-body { display: flex; flex-direction: column; min-width: 0; }
.vi-doclist-name { font-size: 12px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi-doclist-item.on .vi-doclist-name { color: var(--profint-green); }
.vi-doclist-sub { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.vi-docview { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.vi-docview-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.vi-docview-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.vi-doctools { display: flex; align-items: center; gap: 8px; flex: none; }
.vi-doczoom { display: flex; align-items: center; gap: 1px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; }
.vi-zbtn { width: 26px; height: 26px; flex: none; border: 0; background: transparent; border-radius: 5px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; }
.vi-zbtn:hover { background: var(--surface); color: var(--profint-green); }
.vi-zlevel { min-width: 50px; height: 26px; border: 0; background: transparent; cursor: pointer; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink-2); border-radius: 5px; padding: 0 4px; }
.vi-zlevel:hover { background: var(--surface); color: var(--profint-green); }
.vi-docview-open { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); }
.vi-docview-open:hover { background: var(--hover); color: var(--profint-green); }
.vi-docstage { flex: 1; min-height: 0; overflow: auto; background: var(--surface-2); }
.vi-docframe { width: 100%; height: 100%; border: 0; display: block; background: var(--surface-2); }
.vi-docimg { display: block; width: 100%; height: auto; }
/* Contenedor dimensionado por JS (desborda el stage) + capa de arrastre "manito". */
.vi-zdoc { position: relative; display: block; }
.vi-panlayer { position: absolute; inset: 0; cursor: default; background: transparent; }
.vi-panlayer.can-pan { cursor: grab; }
.vi-panlayer.grabbing { cursor: grabbing; }

.vi-mail-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; margin: 0 0 14px; }
.vi-mail-meta > div { min-width: 0; }
.vi-mail-meta dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.vi-mail-meta dd { font-size: 13px; color: var(--ink-2); margin: 1px 0 0; word-break: break-word; }
.vi-mail-estado { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--apt-A-bg); color: var(--apt-A); }
.vi-mail-frame-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.vi-mail-frame { width: 100%; height: 52vh; border: 1px solid var(--border); border-radius: var(--r-md); display: block; background: #fff; }

/* Nota legacy colapsable (texto original importado) */
.legacy-note {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-bottom: 12px;
}
.legacy-note > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  user-select: none;
}
.legacy-note > summary::-webkit-details-marker { display: none; }
.legacy-note > summary:hover { color: var(--ink-2); }
.legacy-note > summary svg { color: var(--muted-2); flex: none; }
.legacy-note[open] > summary { border-bottom: 1px solid var(--border); }
.legacy-note-body {
  padding: 14px 16px;
  font-size: 12.5px; line-height: 1.55;
  color: var(--muted); white-space: pre-wrap;
  font-family: var(--font-mono); font-size: 11.5px;
}

/* ════════════ Dashboard del médico (Inicio) ════════════ */
.dash-head { margin-bottom: 6px; }
.dash-greet { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.dash-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.dash-section-title {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); margin: 26px 0 12px;
}

/* Hero cards (trabajo pendiente) */
.dash-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .dash-hero { grid-template-columns: 1fr; } }
.hero-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px;
  text-decoration: none; color: inherit; position: relative; overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.hero-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent-c);
}
.hero-card:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.hero-top { display: flex; align-items: center; justify-content: space-between; min-height: 38px; margin-bottom: 12px; }
.hero-ic {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent-c);
}
.hero-ic .ph { font-size: 22px; line-height: 1; position: relative; top: 1px; }
.hero-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent-c);
}
.hero-num {
  font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.hero-label { font-size: 14.5px; font-weight: 600; color: var(--ink-2); margin-top: 9px; }
.hero-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.hero-link {
  margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--accent-c);
  display: flex; align-items: center; gap: 5px;
}
.hero-card:hover .hero-link { gap: 8px; transition: gap 0.12s; }

/* Strip de chips secundarios */
.dash-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.chip-stat {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; color: var(--muted);
}
.chip-stat b { color: var(--ink); font-weight: 600; }

/* Tiles del mes */
.dash-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1000px) { .dash-tiles { grid-template-columns: repeat(2, 1fr); } }
.mtile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px;
}
.mtile-num { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.mtile-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Paneles de estadística */
.dash-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; margin-top: 8px; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px;
}
.panel-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  margin-bottom: 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.panel-title small { font-weight: 500; color: var(--muted-2); font-size: 11.5px; }

/* Bar list (empresas) */
.barlist { display: flex; flex-direction: column; gap: 12px; }
.barrow-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; margin-bottom: 5px; gap: 10px; }
.barrow-top .bn { color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.barrow-top .bv { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bartrack { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.barfill { height: 100%; background: var(--profint-green); border-radius: 999px; transition: width 0.3s; }

/* Tendencia (mini bar chart) */
.trend { display: flex; align-items: flex-end; gap: 5px; height: 140px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; justify-content: flex-end; height: 100%; }
.trend-v { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; height: 13px; }
.trend-bar { width: 100%; max-width: 22px; background: var(--profint-green-100); border-radius: 4px 4px 0 0; min-height: 2px; }
.trend-bar.today { background: var(--profint-green); }
.trend-d { font-size: 9.5px; color: var(--muted-2); }

/* Distribución de aptitud */
.apt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.apt-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 7px 12px; font-size: 12.5px; color: var(--muted);
}
.apt-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.apt-chip b { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.apt-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 12px; }
.apt-period[hidden] { display: none; }

/* Segmented control compacto dentro del título del panel (tabs de período) */
.panel-title .seg { height: 30px; }
.panel-title .seg .qbtn { padding: 0 11px; font-size: 11.5px; }

/* ════════════ Panel laboral (Informar informe laboral) ════════════ */
.section-sub {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted-2); margin: 18px 0 10px;
}

/* Pills de adjuntos */
.attach-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; color: var(--ink-2);
  text-decoration: none; background: var(--surface); cursor: pointer;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.attach-pill:hover { background: var(--hover); border-color: var(--muted-2); }
.attach-pill svg { color: var(--profint-green); flex: none; }

/* Fila de práctica (descripción + resultado editable) */
.prow {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--border-soft);
}
.prow:first-of-type { border-top: 0; }
.prow-name { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.prow-name .muted { font-weight: 400; }

/* Segmented que envuelve (pills) */
.seg-field { margin-bottom: 16px; }
.seg-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-wrap .qbtn { height: 34px; }

/* Grilla de toggles SI/NO */
.yn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
@media (max-width: 760px) { .yn-grid { grid-template-columns: repeat(2, 1fr); } }
.yn-btns { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.yn-b {
  height: 32px; padding: 0 16px; border: 0; border-right: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.yn-b:last-child { border-right: 0; }
.yn-b:hover { background: var(--hover); }
.yn-b.on { background: var(--profint-green); color: #fff; }
.yn-b.no { background: var(--apt-E); color: #fff; }

/* Grilla de dropdowns / fechas */
.dd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .dd-grid { grid-template-columns: repeat(2, 1fr); } }
.field { min-width: 0; }

/* ─────────────────────────────────────────────────────────────────────────
   Agrupadores de prácticas — tablero drag & drop
   ───────────────────────────────────────────────────────────────────────── */
.agr-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 4px 0 16px;
}
.agr-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.agr-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.agr-search input {
  width: 100%; height: 38px; padding: 0 34px 0 36px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 13.5px;
}
.agr-search input:focus { outline: none; border-color: var(--profint-green); box-shadow: 0 0 0 3px var(--profint-green-50); }
.agr-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--hover); color: var(--muted); font-size: 16px; line-height: 1;
}
.agr-search-clear:hover { background: var(--border-strong); color: var(--ink); }
.agr-hint { font-size: 12px; color: var(--muted); }

/* Filtro por categorías (grupos) */
.agr-catfilter { position: relative; flex: 0 0 auto; }
.agr-catfilter-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.agr-catfilter-btn:hover { border-color: var(--muted-2); }
.agr-catfilter-btn.is-active { border-color: var(--profint-green); color: var(--profint-green-700); background: var(--profint-green-50); }
.agr-catfilter-btn .caret { color: var(--muted); margin-left: 2px; }
.agr-catfilter-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  width: 290px; max-height: 380px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px;
}
.agr-catfilter-menu[hidden] { display: none; }
.agr-catfilter-search input {
  width: 100%; height: 32px; padding: 0 10px; margin-bottom: 6px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 12.5px;
}
.agr-catfilter-search input:focus { outline: none; border-color: var(--profint-green); }
.agr-catfilter-actions { display: flex; gap: 6px; margin-bottom: 6px; }
.agr-catfilter-actions button {
  flex: 1; height: 28px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.agr-catfilter-actions button:hover { background: var(--hover); }
.agr-catfilter-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.agr-cat-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: var(--r-sm); cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.agr-cat-item:hover { background: var(--surface-2); }
.agr-cat-item input { accent-color: var(--profint-green); width: 15px; height: 15px; flex: 0 0 auto; }
.agr-cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agr-cat-count {
  flex: 0 0 auto; min-width: 22px; height: 18px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--profint-green-50); color: var(--profint-green-700);
  border-radius: var(--r-pill); font-size: 11px; font-weight: 700;
}
.agr-cat-empty { padding: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

.agr-board {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; padding: 4px 4px 80px; min-height: 320px;
}
.agr-col {
  flex: 0 0 280px; max-width: 280px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); display: flex; flex-direction: column;
  max-height: calc(100vh - 220px);
}
.agr-col.just-created { animation: agrPulse 1.2s ease; }
@keyframes agrPulse { 0% { box-shadow: 0 0 0 0 var(--profint-green-200); } 100% { box-shadow: 0 0 0 12px transparent; } }
.agr-col-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 13px;
  border-bottom: 1px solid var(--border-soft); position: sticky; top: 0;
  background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 1;
}
.agr-col-name {
  font-size: 13px; font-weight: 700; color: var(--ink); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agr-col-count {
  flex: 0 0 auto; min-width: 24px; height: 20px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--profint-green-50); color: var(--profint-green-700);
  border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700;
}
/* Botón editar (renombrar grupo) */
.agr-col-edit {
  flex: 0 0 auto; width: 24px; height: 24px; border: 0; background: transparent;
  color: var(--muted); border-radius: var(--r-sm); cursor: pointer;
  display: grid; place-items: center; opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.agr-col-head:hover .agr-col-edit,
.agr-col-edit:focus-visible { opacity: 1; }
.agr-col-edit:hover { background: var(--hover); color: var(--profint-green-700); }
/* Header en modo edición */
.agr-col-head.editing { gap: 6px; }
.agr-col-edit-input {
  flex: 1; min-width: 0; height: 28px; padding: 0 9px;
  border: 1px solid var(--profint-green); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.agr-col-edit-input:focus { outline: none; box-shadow: 0 0 0 3px var(--profint-green-50); }
.agr-col-edit-btn {
  flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: var(--r-sm);
  cursor: pointer; display: grid; place-items: center;
}
.agr-col-edit-btn.save { background: var(--profint-green); color: #fff; }
.agr-col-edit-btn.save:hover { background: var(--profint-green-600); }
.agr-col-edit-btn.cancel { background: var(--hover); color: var(--muted); }
.agr-col-edit-btn.cancel:hover { color: var(--ink); }
.agr-col-body {
  flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px;
  min-height: 60px; transition: background 0.12s;
}
.agr-col-body.dragover { background: var(--profint-green-50); outline: 2px dashed var(--profint-green-200); outline-offset: -6px; }
.agr-col.is-empty .agr-col-body::after {
  content: "Soltá prácticas acá"; display: block; text-align: center;
  color: var(--muted-2); font-size: 12px; padding: 18px 8px; border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
}

.agr-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 9px 11px; cursor: grab;
  user-select: none; transition: border-color 0.12s, box-shadow 0.12s, transform 0.05s;
}
.agr-card-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: #fff;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.12s, transform 0.12s, background 0.12s, border-color 0.12s;
}
.agr-card-check svg { width: 11px; height: 11px; opacity: 0; transition: opacity 0.12s; }
.agr-card:hover .agr-card-check { opacity: 1; }
.agr-card.selected .agr-card-check {
  opacity: 1; transform: scale(1);
  background: var(--profint-green); border-color: var(--profint-green);
}
.agr-card.selected .agr-card-check svg { opacity: 1; }
.agr-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.agr-card:active { cursor: grabbing; }
.agr-card.dragging { opacity: 0.45; }
.agr-card.selected { border-color: var(--profint-green); box-shadow: 0 0 0 2px var(--profint-green-50); background: var(--profint-green-50); }
.agr-card-detalle { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.3; padding-right: 20px; }
.agr-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.agr-card-meta .mono { font-family: var(--font-mono); }
.agr-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

.agr-selbar {
  position: sticky; top: 64px; z-index: 18;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 9px 12px;
  background: var(--ink); color: #fff;
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  animation: agrSelIn 0.16s ease;
}
.agr-selbar[hidden] { display: none; }
@keyframes agrSelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.agr-sel-count { font-size: 13px; white-space: nowrap; padding-left: 4px; }
.agr-sel-count b { font-weight: 800; }

/* Combobox de grupo destino */
.agr-combo { position: relative; flex: 1 1 260px; max-width: 400px; }
.agr-combo-input {
  width: 100%; height: 36px; padding: 0 34px 0 12px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.14); color: #fff; font-size: 13px;
}
.agr-combo-input::placeholder { color: rgba(255,255,255,0.6); }
.agr-combo-input:focus { outline: none; background: #fff; color: var(--ink); }
.agr-combo-caret {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer;
  color: rgba(255,255,255,0.75); display: grid; place-items: center;
}
.agr-combo-input:focus ~ .agr-combo-caret { color: var(--muted); }
.agr-combo-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  max-height: 280px; overflow-y: auto; padding: 5px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.agr-combo-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); text-align: left;
}
.agr-combo-item:hover, .agr-combo-item.active { background: var(--profint-green-50); color: var(--profint-green-700); }
.agr-combo-item svg { flex: 0 0 auto; }
.agr-combo-create { font-weight: 700; color: var(--profint-green-700); }
.agr-combo-empty { padding: 10px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 560px) {
  .agr-selbar { flex-wrap: wrap; }
  .agr-combo { flex-basis: 100%; max-width: none; order: 3; }
}

/* ─────────────────────────────────────────────────────────────
   Ayuda (manual embebido)
   ───────────────────────────────────────────────────────────── */
.ayuda-wrap { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.ayuda-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 30px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.ayuda-bar > a { margin-left: auto; }
.ayuda-bar .at { font-weight: 700; font-size: 14px; }
.ayuda-bar .as { font-size: 12.5px; color: var(--muted); }
.ayuda-frame { flex: 1; width: 100%; border: none; display: block; background: var(--bg); }

/* ─────────────────────────────────────────────────────────────
   Dashboard — chip "por vencer" + panel TAT (tiempo de informe)
   ───────────────────────────────────────────────────────────── */
.chip-stat.chip-warn { background: var(--warning-50, #fdf3e3); border-color: #f0d9a8; }
a.chip-stat { transition: border-color .12s, box-shadow .12s; }
a.chip-stat:hover { border-color: var(--warning); box-shadow: var(--sh-1); }

.tat-panel { }
.tat-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.tat-big { display: flex; align-items: baseline; gap: 9px; flex: 1; min-width: 220px; }
.tat-num { font-size: 46px; font-weight: 700; letter-spacing: -.03em; font-family: var(--font-mono); line-height: 1; color: var(--ink); }
.tat-unit { font-size: 16px; color: var(--muted); font-weight: 600; }
.tat-flag {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 6px;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill);
}
.tat-flag.ok { background: var(--apt-A-bg); color: var(--apt-A); }
.tat-flag.warn { background: var(--warning-50, #fdf3e3); color: var(--st-aptitud); }
.tat-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 16px; min-width: 120px; }
.tat-card-n { font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: var(--ink); }
.tat-card-l { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tat-desc { font-size: 12.5px; color: var(--muted); margin: 14px 0 12px; }
.tat-sla-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.tat-sla-top .mono { font-weight: 700; }
@media (max-width: 720px) { .tat-mini { grid-template-columns: 1fr 1fr; } }

/* ─────────────────────────────────────────────────────────────
   Panel Informar — asistente de aptitud + plantillas + estudios previos
   ───────────────────────────────────────────────────────────── */
.asistente {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--profint-green-50); border: 1px solid var(--profint-green-200);
  border-radius: var(--r-md); padding: 13px 14px; margin-bottom: 16px;
}
.asistente > svg { flex-shrink: 0; color: var(--brand-bright); margin-top: 1px; }
.asistente .as-t { font-size: 13px; font-weight: 700; color: var(--profint-green-700); }
.asistente .as-d { font-size: 12px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
.asistente .btn { flex-shrink: 0; }

.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tpl-chip {
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 5px 10px; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.tpl-chip:hover { border-color: var(--profint-green); background: var(--profint-green-50); color: var(--profint-green-700); }

.prev-chip-apt {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  font-weight: 700; font-size: 13px; font-family: var(--font-mono);
}

/* ─────────────────────────────────────────────────────────────
   Búsqueda global (topbar)
   ───────────────────────────────────────────────────────────── */
.gsearch { position: relative; }
.gsearch-input {
  display: flex; align-items: center; gap: 9px;
  width: 280px; height: 38px; padding: 0 10px 0 13px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); color: var(--muted);
  transition: border-color .14s, box-shadow .14s, width .2s var(--ease);
}
.gsearch-input svg { color: var(--muted-2); flex-shrink: 0; }
.gsearch-input input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: 13px; color: var(--ink); font-family: var(--font-sans); }
.gsearch-input.on { border-color: var(--profint-green); box-shadow: 0 0 0 3px var(--profint-green-50); }
.gsearch-kbd {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
}
.gsearch-pop {
  position: absolute; top: calc(100% + 7px); right: 0; width: 380px; max-width: 86vw; z-index: 60;
  padding: 6px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--sh-3);
  max-height: 420px; overflow-y: auto;
}
.gsearch-opt {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: var(--r-sm); text-align: left; text-decoration: none; color: inherit;
  transition: background .1s var(--ease);
}
.gsearch-opt:hover { background: var(--profint-green-50); }
.gsearch-opt > svg { flex-shrink: 0; color: var(--brand-bright); }
.gsearch-opt .go-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gsearch-opt .go-main b { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-opt .go-meta { font-size: 11.5px; color: var(--muted); }
.gsearch-opt .go-kind {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted-2); background: var(--surface-3); padding: 2px 8px; border-radius: var(--r-pill);
}
.gsearch-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 920px) { .gsearch-input { width: 200px; } .gsearch-kbd { display: none; } }

.medicos-shell > .main > main > .presence-toolbar { margin: 16px 24px 0; }
.medicos-shell > .main > main > .presence-workspace { padding: 24px; }
@media (max-width: 720px) {
  .medicos-shell .topbar { height: auto; min-height: 56px; flex-wrap: wrap; gap: 10px; padding: 12px; }
  .medicos-shell .topbar-l { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; gap: 6px; }
  .medicos-shell .topbar-r { width: 100%; min-width: 0; gap: 4px; }
  .medicos-shell .topbar-r > .iconbtn { flex-shrink: 0; }
  .medicos-shell .topbar-greet { display: none; }
  .medicos-shell .gsearch { flex: 1; min-width: 0; }
  .medicos-shell .gsearch-input { width: 100%; min-width: 0; }
  .medicos-shell .gsearch-pop { left: 0; right: auto; max-width: calc(100vw - 88px); }
  .medicos-shell > .main > main > .presence-toolbar { margin: 12px 12px 0; }
  .medicos-shell > .main > main > .presence-workspace { padding: 12px; }
}

/* ─────────────────────────────────────────────────────────────
   Vistas guardadas (combos de filtros) — Exámenes
   ───────────────────────────────────────────────────────────── */
/* Estado (tabs) y Vistas en DOS COLUMNAS lado a lado (cada grupo su columna). */
.exfilters-head { display: grid; grid-template-columns: max-content max-content; gap: 12px 28px; align-items: start; margin-bottom: 14px; }
.exfilters-head .tabs { margin-bottom: 0; }
.exfilters-head .saved-views { margin-bottom: 0; }
@media (max-width: 820px) { .exfilters-head { grid-template-columns: 1fr; } }
.saved-views { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.saved-views .sv-label { font-size: 12px; font-weight: 600; color: var(--muted-2); display: inline-flex; align-items: center; gap: 6px; margin-right: 2px; }
.sv-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px;
  border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  transition: border-color .12s, background .12s, color .12s;
}
.sv-chip svg { color: var(--brand-bright); }
.sv-chip:hover { border-color: var(--profint-green); background: var(--profint-green-50); color: var(--profint-green-700); }
.sv-chip:hover svg { color: var(--profint-green); }

/* ─────────────────────────────────────────────────────────────
   Refinamiento fino — foco por teclado (accesibilidad) consistente
   ───────────────────────────────────────────────────────────── */
.btn:focus-visible,
.tab:focus-visible,
.qbtn:focus-visible,
.sb-item:focus-visible,
.iconbtn:focus-visible,
.sv-chip:focus-visible,
.chip-stat:focus-visible,
.pager button:focus-visible,
.pager a:focus-visible,
.gsearch-opt:focus-visible,
.tpl-chip:focus-visible {
  outline: 2px solid var(--profint-green);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
[data-theme="dark"] .btn:focus-visible,
[data-theme="dark"] .tab:focus-visible,
[data-theme="dark"] .qbtn:focus-visible,
[data-theme="dark"] .sb-item:focus-visible,
[data-theme="dark"] .iconbtn:focus-visible {
  outline-color: var(--brand-bright);
}


/* Valores rápidos por grupo (panel Informar) */
.grp-sug-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.grp-sug-label { font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
.grp-sug-chip { font-size: 11.5px; }

/* Modal de confirmación de emisión — resumen */
.emit-sum { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.es-pac { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.es-pac-n { font-weight: 600; font-size: 14px; color: var(--ink); }
.es-pac-m { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-row { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.es-row:last-child { border-bottom: 0; }
.es-g { flex: 0 0 38%; color: var(--muted); font-weight: 500; }
.es-v { flex: 1; color: var(--ink-2); min-width: 0; }
.es-v.es-empty { color: var(--muted-2); font-style: italic; }

/* Modal de emisión — aptitud destacada + combo de revisor */
.es-scroll { max-height: 30vh; overflow-y: auto; }
.es-apt { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.es-apt-badge { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 20px; flex: 0 0 auto; border: 1.5px solid currentColor; background: var(--surface); }
.es-apt-txt { min-width: 0; }
.es-apt-txt b { font-size: 15px; color: var(--ink); display: block; }
.es-apt-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.es-apt.g-A { color: var(--apt-A); } .es-apt.g-A .es-apt-badge { background: var(--apt-A-bg); }
.es-apt.g-B { color: var(--apt-B); } .es-apt.g-B .es-apt-badge { background: var(--apt-B-bg); }
.es-apt.g-C { color: var(--apt-C); } .es-apt.g-C .es-apt-badge { background: var(--apt-C-bg); }
.es-apt.g-D { color: var(--apt-D); } .es-apt.g-D .es-apt-badge { background: var(--apt-D-bg); }
.es-apt.g-E { color: var(--apt-E); } .es-apt.g-E .es-apt-badge { background: var(--apt-E-bg); }
.es-apt.g-R { color: var(--apt-R); } .es-apt.g-R .es-apt-badge { background: var(--apt-R-bg); }

.rev-combo { position: relative; }
.rev-combo-btn { width: 100%; height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); font-size: 13.5px; color: var(--ink); cursor: pointer; transition: border-color .14s, box-shadow .14s; }
.rev-combo-btn:hover { border-color: var(--muted-2); }
.rev-combo-btn.open { border-color: var(--profint-green); box-shadow: 0 0 0 3px var(--profint-green-50); }
.rev-combo-val { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-combo-val.placeholder { color: var(--muted-2); }
.rev-combo-btn .chev { color: var(--muted-2); flex: 0 0 auto; transition: transform .2s; }
.rev-combo-btn.open .chev { transform: rotate(180deg); }
.rev-combo-pop { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 50; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 6px; max-height: 300px; display: flex; flex-direction: column; }
.rev-combo-pop[hidden] { display: none; }
.rev-combo-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 34px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); margin-bottom: 6px; flex: 0 0 auto; }
.rev-combo-search svg { color: var(--muted-2); flex: 0 0 auto; }
.rev-combo-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--ink); }
.rev-combo-list { overflow-y: auto; }
.rev-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: var(--r-sm); text-align: left; cursor: pointer; background: none; border: 0; color: var(--ink-2); font-size: 13px; transition: background .1s; }
.rev-opt:hover { background: var(--profint-green-50); }
.rev-opt.on { background: var(--profint-green-50); }
.rev-opt-av { width: 30px; height: 30px; border-radius: 50%; background: var(--profint-green-50); color: var(--profint-green-700); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: 0 0 auto; }
.rev-opt-main { display: flex; flex-direction: column; min-width: 0; }
.rev-opt-main b { font-size: 13px; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-opt-mail { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Clientes logueados (presencia) ── */
.cl-count { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.cl-count b { color: var(--ink); font-weight: 700; }
.cl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--apt-A, #16a34a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--apt-A, #16a34a) 22%, transparent); }
.cl-user { font-weight: 600; color: var(--ink); }
.cl-sub { font-size: 12px; color: var(--muted); }

/* ── Chat panel (Portal de Informes, slide-over) ── */
.chatpanel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1200;
  width: 360px; max-width: calc(100vw - 32px); height: 500px; max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--sh-2); display: none; flex-direction: column; overflow: hidden;
}
.chatpanel.open { display: flex; }
.chatpanel__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--profint-green); color: #fff; }
.chatpanel__title { flex: 1; font-weight: 600; font-size: 14.5px; }
.chatpanel__close { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 18px; opacity: .9; }
.chatpanel__close:hover { opacity: 1; }
.chatpanel__msgs { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); display: flex; flex-direction: column; }
.chatpanel__hint { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 12px; }
.chatpanel__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.chatpanel__form input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; background: var(--surface); color: var(--ink); }
.chatmsg { max-width: 82%; margin-bottom: 8px; }
.chatmsg--mine { margin-left: auto; }
.chatmsg__b { padding: 8px 11px; border-radius: 12px; font-size: 13px; line-height: 1.45; background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.chatmsg--mine .chatmsg__b { background: var(--profint-green); color: #fff; border-color: var(--profint-green); }
.chatmsg__t { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.chatmsg--mine .chatmsg__t { text-align: right; }

/* ── Valores rápidos (chips de autocomplete) ── */
.sug-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sug-chip {
  border: 1px solid var(--profint-green-200); background: var(--profint-green-50);
  color: var(--profint-green-700); border-radius: var(--r-pill, 999px);
  padding: 3px 10px; font-size: 12px; cursor: pointer; line-height: 1.5;
  transition: background 0.12s, border-color 0.12s;
}
.sug-chip:hover { background: var(--profint-green-100); border-color: var(--profint-green); }
.sug-chip:active { transform: translateY(0.5px); }

/* ── Rich select (dropdown moderno) ── */
.richselect { position: relative; }
.rs-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}
.richselect__btn {
  width: 100%; height: 38px; min-height: 38px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 13.5px;
  cursor: pointer; text-align: left; line-height: 1.2; white-space: nowrap; overflow: hidden;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.richselect__btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.richselect__btn:hover { border-color: var(--muted-2); }
.richselect.is-open .richselect__btn { border-color: var(--profint-green); box-shadow: 0 0 0 3px var(--profint-green-50); }
.richselect__btn .ph { color: var(--muted-2); transition: transform 0.16s; flex: none; }
.richselect.is-open .richselect__btn .ph { transform: rotate(180deg); }
.richselect__ph { color: var(--muted-2); }
.richselect__pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--sh-2); padding: 5px;
  max-height: 300px; overflow: hidden;
  animation: dp-in 0.12s ease;
}
.richselect__pop[hidden] { display: none; }
.richselect__list { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; }
.richselect__search {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 4px; padding: 5px 8px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface); color: var(--muted-2);
}
.richselect__search input {
  width: 100%; height: 32px; min-height: 32px; padding: 0;
  border: 0; background: transparent; box-shadow: none;
  color: var(--ink); font: inherit; font-size: 12.5px;
}
.richselect__search input:focus { outline: none; box-shadow: none; }
.richselect__opt {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: transparent; border-radius: var(--r-sm);
  min-height: 34px; font-size: 13.5px; color: var(--ink); cursor: pointer; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.richselect__opt:hover, .richselect__opt:focus-visible { background: var(--hover); outline: none; }
.richselect__opt.is-active { background: var(--profint-green-50); color: var(--profint-green-700); font-weight: 600; }
.richselect__opt:disabled { color: var(--muted-2); cursor: not-allowed; opacity: .55; }
.richselect__opt[hidden] { display: none; }
.richselect__btn[aria-invalid="true"] { border-color: var(--apt-E); }

/* ===========================================================================
   Pantalla de Revisión de examen (medicos-revision.js + ExamenInforme/Revisar)
   =========================================================================== */
.rev-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-1); padding: 14px 16px; margin-bottom: 12px;
}
.rev-head__pac { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rev-head__name { font-weight: 700; font-size: 15px; color: var(--ink); }
.rev-head__meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-top: 3px;
}
.rev-head__meta .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); display: inline-block;
}
.rev-apt {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff; background: var(--muted);
}
.rev-apt.g-A { background: var(--apt-A); } .rev-apt.g-B { background: var(--apt-B); }
.rev-apt.g-C { background: var(--apt-C); } .rev-apt.g-D { background: var(--apt-D); }
.rev-apt.g-E { background: var(--apt-E); } .rev-apt.g-R { background: var(--apt-R); }

.rev-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--profint-green-50); border: 1px solid var(--profint-green-200);
  border-radius: var(--r-md);
}
.rev-bar__status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--profint-green-700); }
.rev-bar__status i { font-size: 18px; }

.rev-cards { display: flex; flex-direction: column; gap: 10px; }
.rev-card {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong, var(--border));
  border-radius: var(--r-md); box-shadow: var(--sh-1); padding: 12px 14px;
  transition: border-color .12s ease, background .12s ease;
}
.rev-card__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rev-card__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.rev-card__side { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: center; width: 86px; }
.rev-check {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--border-strong, #cbd5e1); background: var(--surface); color: var(--muted-2);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  transition: all .12s ease;
}
.rev-check:hover { border-color: var(--apt-A); color: var(--apt-A); }
.rev-check__lbl { font-size: 10.5px; font-weight: 600; color: var(--muted-2); text-align: center; }

/* Confirmado → verde */
.rev-card--ok { border-color: var(--apt-A); border-left-color: var(--apt-A); background: var(--apt-A-bg); }
.rev-card--ok .rev-check { background: var(--apt-A); border-color: var(--apt-A); color: #fff; }
.rev-card--ok .rev-check__lbl { color: var(--apt-A); }

/* Modificado → rojo/atención */
.rev-card--edit { border-color: var(--apt-E); border-left-color: var(--apt-E); background: var(--apt-E-bg); }
.rev-card--edit .rev-check { border-color: var(--apt-E); color: var(--apt-E); }
.rev-card--edit .rev-check:hover { background: var(--apt-E); color: #fff; }
.rev-card--edit .rev-check__lbl { color: var(--apt-E); }

.rev-foot {
  display: flex; align-items: center; gap: 14px; margin-top: 16px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-1);
  position: sticky; bottom: 12px;
}
.rev-foot__msg { flex: 1 1 auto; font-size: 12.5px; color: var(--muted); }
.rev-foot .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Adjuntos dentro del card de grupo — links sutiles, baja jerarquía. */
.rev-adj { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.rev-adj__link {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: 11.5px; color: var(--muted); text-decoration: none; line-height: 1.4;
}
.rev-adj__link i { font-size: 12px; opacity: .7; flex: none; }
.rev-adj__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.rev-adj__link:hover { color: var(--brand-bright); text-decoration: underline; }
.rev-adj__link:hover i { opacity: 1; }

/* ── Modal "Ver prácticas" (detalle de prácticas pendientes/concluidas) ── */
.prp-modal { max-width: 900px; width: 100%; padding: 0; overflow: hidden; }
.prp-loading { padding: 40px 24px; text-align: center; color: var(--muted); }
.pr-modal__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.pr-modal__title { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.pr-modal__sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pr-modal__sub strong { color: var(--ink-2); }
.pr-pendencias { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.pr-pendencias__item { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.pr-pendencias__item i { font-size: 14px; }
.pr-pendencias__item.is-unperformed { color: #8a5b15; }
.pr-pendencias__item.is-repeat { color: #a14c32; }
.pr-pendencias__item.is-report { color: #176a8d; }
.pr-dot { color: var(--muted-2); }
.pr-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pr-badge--pend { background: #fdecd2; color: #9a6212; }
.pr-badge--done { background: var(--profint-green-50); color: var(--profint-green-700); }
.pr-close {
    flex: 0 0 auto; width: 30px; height: 30px; border: none; background: transparent;
    color: var(--muted); cursor: pointer; border-radius: 6px; font-size: 18px;
}
.pr-close:hover { background: var(--surface-2); color: var(--ink); }
.pr-modal__body { padding: 8px 20px 20px; max-height: 60vh; overflow-y: auto; }
.pr-empty { padding: 28px 0; text-align: center; color: var(--muted); }
.pr-grupo { margin-top: 14px; }
.pr-grupo__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pr-grupo__name { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pr-grupo__count { font-size: 12px; color: var(--muted-2); font-family: var(--font-mono); }
.pr-list { list-style: none; margin: 0; padding: 0; }
.pr-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 0;
    border-bottom: 1px solid var(--border-soft); font-size: 13.5px; color: var(--ink-2);
}
.pr-item:last-child { border-bottom: none; }
.pr-item > i { font-size: 18px; flex: 0 0 auto; }
.pr-item.is-unperformed > i { color: #bd811c; }
.pr-item.is-repeat > i { color: #c26345; }
.pr-item.is-report > i { color: #2182a9; }
.pr-item.is-done > i { color: var(--profint-green); }
.pr-item__desc { flex: 1 1 auto; }
.pr-item.is-done .pr-item__desc { color: var(--muted); }
.pr-item__res { font-size: 12px; color: var(--muted); font-style: italic; }
.pr-item__st { flex: 0 0 auto; font-size: 11px; font-weight: 600; }
.pr-item.is-unperformed .pr-item__st { color: #8a5b15; }
.pr-item.is-repeat .pr-item__st { color: #a14c32; }
.pr-item.is-report .pr-item__st { color: #176a8d; }
.pr-item.is-done .pr-item__st { color: var(--profint-green-700); }

/* ── Mis prácticas preocupacionales ───────────────────────────────────── */
.pp-page { max-width: 1480px; }
.pp-hero {
  display: flex; align-items: stretch; justify-content: space-between; gap: 24px;
  padding: 26px 28px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: 18px;
  background:
    radial-gradient(circle at 88% 12%, rgba(20,108,148,.14), transparent 34%),
    linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--sh-1);
}
.pp-hero__copy { max-width: 720px; }
.pp-eyebrow {
  display: inline-flex; color: var(--profint-green-700); font-size: 11px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 7px;
}
.pp-hero h1 { margin: 0 0 7px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; color: var(--ink); }
.pp-hero p { margin: 0; max-width: 660px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.pp-hero__summary { display: flex; gap: 10px; align-items: stretch; }
.pp-kpi {
  min-width: 118px; padding: 14px 16px; border-radius: 14px;
  background: var(--profint-green); color: #fff; display: flex; flex-direction: column; justify-content: center;
}
.pp-kpi__value { font-size: 30px; line-height: 1; font-weight: 750; }
.pp-kpi__label { font-size: 11px; margin-top: 6px; opacity: .84; text-transform: uppercase; letter-spacing: .05em; }
.pp-kpi--soft {
  min-width: 190px; max-width: 230px; flex-direction: row; gap: 9px; align-items: center;
  color: var(--profint-green-700); background: var(--profint-green-50); border: 1px solid var(--profint-green-200);
  font-size: 12px; line-height: 1.4;
}
.pp-kpi--soft i { font-size: 22px; flex: none; }
.pp-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: 13px; background: var(--surface); box-shadow: var(--sh-1);
}
.pp-search { flex: 1; max-width: 720px; display: flex; align-items: center; gap: 9px; }
.pp-search > i { font-size: 18px; color: var(--muted); }
.pp-search .canonical-query { flex: 1; min-width: 160px; }
.pp-search .canonical-query input {
  flex: 1; min-width: 160px; border: 0; outline: 0; color: var(--ink); background: transparent;
  font-size: 13px; padding: 7px 0;
}
.pp-search > a { display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.pp-range { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pp-state {
  min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 28px; border: 1px dashed var(--border-strong, var(--border)); border-radius: 16px;
  background: var(--surface); color: var(--muted);
}
.pp-state h2 { margin: 0 0 5px; color: var(--ink); font-size: 17px; }
.pp-state p { margin: 0; font-size: 13px; }
.pp-state__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #fff1f2; color: #be123c; font-size: 25px; }
.pp-state__icon--success { background: var(--profint-green-50); color: var(--profint-green-700); }
.pp-state--error .btn { margin-left: auto; }
.pp-queue { display: flex; flex-direction: column; gap: 9px; }
.pp-task {
  display: grid; grid-template-columns: 38px minmax(220px, 1.2fr) minmax(240px, 1fr) auto auto;
  align-items: center; gap: 16px; padding: 15px 16px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); box-shadow: var(--sh-1);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.pp-task:hover { transform: translateY(-1px); border-color: var(--profint-green-200); box-shadow: var(--sh-2); }
.pp-task__order { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--muted); font: 600 12px var(--font-mono); }
.pp-task__patient { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pp-task__patient h2 { margin: 0 0 4px; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--profint-green-50); color: var(--profint-green-700); font-size: 19px; flex: none; }
.pp-task__practice { min-width: 0; }
.pp-task__practice strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-task__meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; min-width: 0; }
.pp-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.pp-code { padding: 2px 6px; border-radius: 5px; background: var(--surface-2); font: 600 10.5px var(--font-mono); color: var(--ink-2); }
.pp-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.pp-badge--required { background: #fff7ed; color: #9a4f0a; border-color: #fed7aa; }
.pp-task__badges { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.pp-badge--station { gap: 4px; background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.pp-task__action { white-space: nowrap; }
.pp-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.pp-pagination .disabled { pointer-events: none; opacity: .45; }
body.pp-modal-open { overflow: hidden; }
.pp-modal-backdrop {
  position: fixed; inset: 0; z-index: 500; padding: 24px; display: grid; place-items: center;
  background: rgba(5, 20, 30, .62); backdrop-filter: blur(4px); opacity: 0;
  transition: opacity .16s ease;
}
.pp-modal-backdrop[hidden] { display: none; }
.pp-modal-backdrop.is-open { opacity: 1; }
.pp-modal {
  width: min(900px, 96vw); max-height: min(860px, 92vh); overflow: hidden;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  box-shadow: 0 24px 70px rgba(0,0,0,.32); transform: translateY(8px) scale(.985);
  transition: transform .16s ease;
}
.pp-modal-backdrop.is-open .pp-modal { transform: translateY(0) scale(1); }
.pp-modal__loading { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.pp-spinner { width: 30px; height: 30px; border: 3px solid var(--profint-green-100); border-top-color: var(--profint-green); border-radius: 50%; animation: pp-spin .8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
.pp-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 24px 17px; border-bottom: 1px solid var(--border); }
.pp-modal__head h2 { margin: 0 0 6px; color: var(--ink); font-size: 21px; }
.pp-modal__patient { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.pp-modal__patient strong { color: var(--ink-2); }
.pp-modal__close { width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 18px; }
.pp-modal__close:hover { color: var(--ink); background: var(--border-soft); }
.pp-modal__body { max-height: calc(92vh - 88px); overflow: auto; padding: 20px 24px 0; }
.pp-capture-summary { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.pp-station {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  margin-bottom: 18px; padding: 12px 14px; border: 1px solid #a5f3fc; border-radius: 8px; background: #ecfeff;
}
.pp-station__identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pp-station__identity small, .pp-station__identity strong { display: block; }
.pp-station__identity small { margin-bottom: 2px; color: #0e7490; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.pp-station__identity strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pp-station__icon { width: 32px; height: 32px; display: grid; flex: none; place-items: center; border-radius: 7px; background: #cffafe; color: #0e7490; font-size: 17px; }
.pp-station__state { padding: 5px 8px; border-radius: 999px; background: #fff; color: #0e7490; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pp-station__state--inprogress { background: #dcfce7; color: #166534; }
.pp-station__state--deferred { background: #fef3c7; color: #92400e; }
.pp-station__pause { position: relative; font-size: 11px; }
.pp-station__pause summary { color: #0e7490; cursor: pointer; font-weight: 700; }
.pp-station__pause form { position: absolute; z-index: 2; top: 28px; right: 0; width: min(390px, 80vw); padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--sh-3); }
.pp-station__pause label { display: block; margin-bottom: 6px; color: var(--ink-2); font-weight: 650; }
.pp-station__pause form > div { display: flex; gap: 7px; }
.pp-station__pause input { min-width: 0; flex: 1; padding: 8px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.pp-station__pause p, .pp-station-gate form p { margin: 7px 0 0; color: #be123c; font-size: 11px; }
.pp-station-gate { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; }
.pp-station-gate strong { color: var(--ink); font-size: 14px; }
.pp-station-gate p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.pp-station-gate form { flex: none; }
.pp-config-block { display: flex; gap: 13px; padding: 16px; margin-bottom: 22px; border: 1px solid #fed7aa; border-radius: 12px; background: #fff7ed; color: #9a4f0a; }
.pp-config-block > i { font-size: 22px; flex: none; }
.pp-config-block strong { display: block; margin-bottom: 4px; color: #7c2d12; }
.pp-config-block p { margin: 0 0 5px; font-size: 13px; }
.pp-config-block small { color: #9a3412; }
.pp-form-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.pp-form-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.pp-form-section__head h3 { margin: 0 0 4px; color: var(--ink); font-size: 15px; }
.pp-form-section__head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.pp-safe-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; background: var(--profint-green-50); color: var(--profint-green-700); font-size: 10.5px; font-weight: 650; }
.pp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pp-field--wide { grid-column: 1 / -1; }
.pp-field > label { color: var(--ink-2); font-size: 12px; font-weight: 650; }
.pp-field > label span { color: #be123c; }
.pp-field__help { color: var(--muted); font-size: 11px; line-height: 1.4; }
.pp-field input, .pp-field textarea, .pp-field select {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px;
  color: var(--ink); background: var(--surface); font: inherit; font-size: 13px; outline: none;
}
.pp-field textarea { resize: vertical; line-height: 1.5; }
.pp-field input:focus, .pp-field textarea:focus, .pp-field select:focus { border-color: var(--profint-green); box-shadow: 0 0 0 3px var(--profint-green-50); }
.pp-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pp-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.pp-segmented button { border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.pp-segmented button[aria-pressed="true"] { background: var(--profint-green); color: #fff; box-shadow: var(--sh-1); }
.pp-form-error { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: #fff1f2; color: #be123c; font-size: 12px; }
.pp-modal__actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px -24px 0; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.pp-modal__actions > span { color: var(--muted); font-size: 11px; }
.pp-modal__actions > div { display: flex; gap: 8px; }
.pp-toast { position: fixed; right: 24px; bottom: 24px; z-index: 600; max-width: 420px; padding: 12px 16px; border-radius: 11px; background: var(--profint-green); color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.25); font-size: 12.5px; }
.pp-toast.is-error { background: #b91c1c; }
@media (max-width: 980px) {
  .pp-hero { flex-direction: column; }
  .pp-hero__summary { width: 100%; }
  .pp-kpi { flex: 1; }
  .pp-task { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .pp-task__practice { grid-column: 2 / 3; }
  .pp-task__badges { display: none; }
  .pp-task__action { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 640px) {
  .pp-page { padding-inline: 10px; }
  .pp-hero { padding: 20px; }
  .pp-hero__summary { flex-direction: column; }
  .pp-toolbar { align-items: stretch; flex-direction: column; }
  .pp-range { padding-left: 27px; }
  .pp-task { grid-template-columns: 30px minmax(0, 1fr); }
  .pp-task__practice, .pp-task__action { grid-column: 2; grid-row: auto; }
  .pp-task__action { width: 100%; justify-content: center; }
  .pp-form-grid { grid-template-columns: 1fr; }
  .pp-field--wide { grid-column: auto; }
  .pp-station { grid-template-columns: minmax(0, 1fr) auto; }
  .pp-station__pause { grid-column: 1 / -1; }
  .pp-station__pause form { position: static; width: 100%; margin-top: 8px; }
  .pp-station__pause form > div, .pp-station-gate { align-items: stretch; flex-direction: column; }
  .pp-station-gate form, .pp-station-gate .btn { width: 100%; }
  .pp-station-gate .btn { justify-content: center; }
  .pp-modal-backdrop { padding: 0; align-items: end; }
  .pp-modal { width: 100%; max-height: 96vh; border-radius: 18px 18px 0 0; }
  .pp-modal__actions { align-items: stretch; flex-direction: column; }
  .pp-modal__actions > div, .pp-modal__actions .btn { width: 100%; }
  .pp-modal__actions .btn { justify-content: center; }
}

/* ─── Inicio médico: atención presencial de hoy ─────────────────────────── */
.doctor-day { display: flex; flex-direction: column; gap: 12px; max-width: none; }
.doctor-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 96% 12%, rgba(25,167,206,.16), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,.96), var(--profint-green-50));
  box-shadow: var(--sh-1);
}
.doctor-commandbar__identity {
  min-width: 220px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 12px;
  row-gap: 2px;
}
.doctor-commandbar__identity .day-eyebrow {
  grid-row: 1 / span 2;
  align-self: center;
}
.doctor-commandbar__identity strong {
  min-width: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doctor-commandbar__identity span:last-child {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.doctor-commandbar__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.day-date-form--inline {
  min-height: 42px;
  padding: 3px;
  border-radius: 999px;
}
.day-date-form--inline input[type="date"] {
  width: 142px;
  min-height: 34px;
  text-align: center;
}
.office-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 42, 54, .06);
  cursor: pointer;
}
.office-chip:hover {
  border-color: rgba(25, 116, 150, .34);
  background: #fff;
}
.office-chip > span:not(.office-dot) {
  display: grid;
  gap: 1px;
  text-align: left;
}
.office-chip strong {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.office-chip small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}
.office-chip.pending {
  border-color: rgba(180, 83, 9, .32);
  background: rgba(255, 251, 235, .88);
}
.office-chip .ph-caret-down {
  color: var(--muted);
  font-size: 14px;
}
.doctor-commandbar__tv {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.78);
}
.day-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 24px; border: 1px solid var(--border); border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 90% 20%, rgba(25,167,206,.18), transparent 28%),
    linear-gradient(135deg, var(--surface), var(--profint-green-50));
  box-shadow: var(--sh-2);
}
.day-hero--compact {
  display: block;
  padding: 0;
  overflow: hidden;
}
.day-hero-summary {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
}
.day-hero-summary::-webkit-details-marker { display: none; }
.day-hero-summary::after {
  content: "Ocultar";
  flex: 0 0 auto;
  min-width: 64px;
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}
.day-hero--compact:not([open]) .day-hero-summary::after { content: "Mostrar"; }
.day-hero--compact:not([open]) .day-hero-summary { min-height: 58px; }
.day-hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px 16px;
  border-top: 1px solid rgba(194, 222, 232, .55);
}
.day-hero-body > div:first-child { min-width: 260px; }
.day-identity {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.day-identity h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1;
}
.day-summary-meta {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-2);
}
.day-summary-meta span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
}
.day-hero > div:first-child { min-width: 0; }
.day-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: min(560px, 48%);
}
.day-hero-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.day-date-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.72);
}
.day-date-form input[type="date"] {
  min-height: 38px;
  border: 0;
  border-inline: 1px solid var(--border-soft);
  background: transparent;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 800;
}
.day-date-form .iconbtn { width: 34px; height: 34px; }
.office-status--hero {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.7);
  box-shadow: var(--sh-1);
}
.day-eyebrow, .panel-kicker {
  color: var(--brand); font-size: var(--fs-xs); font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}
.day-hero h1 { margin: 6px 0 6px; font-size: clamp(26px, 3vw, 38px); line-height: 1.05; color: var(--ink); }
.day-hero p { margin: 0; color: var(--muted); font-size: 15px; }
.day-hero-body p { font-size: 13px; }
.doctor-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.doctor-panel {
  border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface);
  box-shadow: var(--sh-2); padding: 20px;
}
.doctor-panel h2 { margin: 6px 0 8px; color: var(--ink); font-size: 21px; }
.office-active {
  display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 14px;
  border-radius: var(--r-lg); background: var(--profint-green-50); border: 1px solid var(--profint-green-200);
}
.office-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--brand-bright); box-shadow: 0 0 0 6px rgba(25,167,206,.14); }
.office-active strong, .office-choice strong { display: block; color: var(--ink); }
.office-active span, .office-choice span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.office-list { display: grid; gap: 10px; margin-top: 16px; }
.office-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2);
}
.office-choice.selected { border-color: var(--brand-bright); background: var(--profint-green-50); }
.queue-panel { padding: 0; overflow: hidden; }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.queue-head h2 { margin: 4px 0 3px; font-size: 19px; }
.queue-head p { margin: 0; color: var(--muted); font-size: 13px; }
.queue-stats { display: grid; grid-template-columns: repeat(4, minmax(86px, 1fr)); gap: 8px; min-width: min(460px, 45%); }
.queue-stats button {
  appearance: none; text-align: left; cursor: pointer; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  color: var(--muted); font: inherit; font-size: 12px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.queue-stats button:hover { border-color: var(--brand-bright); background: var(--profint-green-50); transform: translateY(-1px); }
.queue-stats button.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(0, 154, 205, .18); color: var(--brand-700); }
.queue-stats button:focus-visible { outline: 3px solid rgba(0, 154, 205, .24); outline-offset: 2px; }
.queue-stats b { display: block; color: var(--ink); font-size: 18px; line-height: 1; margin-bottom: 3px; }
.queue-stats button.active b { color: var(--brand-800); }
.queue-tools-wrap {
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.queue-tools-wrap > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  list-style: none;
}
.queue-tools-wrap > summary::-webkit-details-marker { display: none; }
.queue-tools-wrap > summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.queue-tools-wrap > summary strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.queue-tools {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) minmax(240px, .85fr);
  gap: 10px;
  padding: 2px 18px 14px;
  border-bottom: 0;
  background: var(--surface-2);
  overflow: visible;
}
.queue-filter-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  overflow: visible;
}
.queue-filter-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.queue-filter-card header span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.queue-filter-card header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand-700);
  font-size: var(--fs-xs);
  font-weight: 900;
}
.queue-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px;
  margin: -2px;
  overflow: visible;
}
.queue-chip-grid--scroll {
  max-height: 78px;
  overflow: auto;
  padding-right: 2px;
}
.queue-choice {
  min-height: 32px;
  max-width: calc(100% - 2px);
  display: inline-grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 5px 8px 5px 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.queue-choice:hover {
  border-color: var(--brand-bright);
  background: var(--profint-green-50);
  transform: translateY(-1px);
}
.queue-choice i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: transparent;
  border: 1px solid var(--border);
  font-size: 12px;
}
.queue-choice span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-choice b {
  min-width: 24px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}
.queue-choice.active {
  border-color: var(--brand);
  background: var(--profint-green-50);
  color: var(--brand-700);
  box-shadow: 0 0 0 2px rgba(25, 167, 206, .12);
}
.queue-choice.active i {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.queue-choice.active b {
  background: var(--surface);
  color: var(--brand-700);
}
.queue-sort-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.queue-sort-segment button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.queue-sort-segment button:hover {
  border-color: var(--brand-bright);
  background: var(--profint-green-50);
  transform: translateY(-1px);
}
.queue-sort-segment button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -14px rgba(16, 42, 54, .7);
}
.queue-choice:focus-visible,
.queue-sort-segment button:focus-visible {
  outline: 2px solid rgba(0, 154, 205, .32);
  outline-offset: 2px;
}
.doctor-empty { display: grid; place-items: center; gap: 7px; text-align: center; padding: 52px 20px; color: var(--muted); }
.doctor-empty--filter { border-top: 1px solid var(--border-soft); background: var(--surface); }
.doctor-empty i { font-size: 34px; color: var(--brand); }
.doctor-empty strong { color: var(--ink); }
.doctor-queue { display: grid; }
.patient-row {
  display: grid; grid-template-columns: 94px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--border-soft); background: var(--surface);
}
.patient-row[hidden] { display: none !important; }
.patient-row:hover { background: var(--surface-2); }
.patient-row.active { box-shadow: inset 4px 0 0 var(--brand-bright); background: linear-gradient(90deg, var(--profint-green-50), var(--surface)); }
.patient-row.done { opacity: .72; }
.patient-row.cancel { opacity: .55; }
.patient-time strong { display: block; color: var(--ink); font-size: 18px; }
.patient-time span {
  display: inline-flex; margin-top: 5px; padding: 4px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700;
}
.patient-row.active .patient-time span { background: var(--profint-green-100); color: var(--brand-700); }
.patient-row.done .patient-time span { background: var(--st-informada-bg); color: var(--st-informada); }
.patient-name { color: var(--ink); font-size: 16px; font-weight: 800; }
.patient-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.patient-meta span { color: var(--muted); font-size: 12px; padding-right: 8px; border-right: 1px solid var(--border); }
.patient-meta span:last-child { border-right: 0; }
.patient-meta .patient-chip {
  border-right: 0;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--profint-green-50);
  color: var(--brand-700);
  font-weight: 800;
}
.patient-clinical-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.patient-clinical-badges span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.patient-clinical-badges span.loaded {
  border-color: var(--profint-green-200);
  background: var(--profint-green-50);
  color: var(--brand-700);
}
.patient-actions { display: flex; align-items: center; gap: 8px; }
.patient-actions form { margin: 0; }
.doctor-secondary { margin-top: 2px; }
.dash-hero--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-hero--compact .hero-card { min-height: auto; }
.alert-warning { border:1px solid #f7c979; background:#fff7e6; color:#7a4a00; }
.alert-success { border:1px solid #b7e4c7; background:#edfdf3; color:#116532; }

@media (max-width: 1100px) {
  .doctor-commandbar { align-items: stretch; flex-direction: column; }
  .doctor-commandbar__identity,
  .doctor-commandbar__controls { width: 100%; }
  .doctor-commandbar__controls { justify-content: flex-start; }
  .doctor-grid { grid-template-columns: 1fr; }
  .queue-head { flex-direction: column; }
  .queue-stats { width: 100%; min-width: 0; }
}
@media (max-width: 760px) {
  .doctor-commandbar { padding: 12px; }
  .doctor-commandbar__identity {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .doctor-commandbar__identity .day-eyebrow { grid-row: auto; }
  .doctor-commandbar__identity strong { font-size: 21px; }
  .day-date-form--inline,
  .office-chip { width: 100%; }
  .day-date-form--inline { justify-content: space-between; }
  .day-date-form--inline input[type="date"] { flex: 1; width: auto; }
  .doctor-commandbar__tv { width: 100%; }
  .day-hero { flex-direction: column; align-items: flex-start; }
  .queue-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-tools { grid-template-columns: 1fr; }
  .patient-row { grid-template-columns: 1fr; gap: 10px; }
  .patient-actions { justify-content: flex-start; flex-wrap: wrap; }
  .dash-hero--compact { grid-template-columns: 1fr; }
  .office-sector-grid { grid-template-columns: 1fr; padding: 0; }
}

/* Jornada médica: consultorio en pop-up y circuito clínico completo */
.doctor-workflow-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px auto;
  max-width: 1440px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.office-status { display:flex; align-items:center; gap:12px; }
.office-status strong { display:block; color:var(--ink); }
.office-status span { display:block; color:var(--muted); font-size: var(--fs-sm); }
.office-status.pending .office-dot { background:#f59e0b; }
.queue-panel--full { width: 100%; max-width: none; margin: 0; }
.patient-actions--medical { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.patient-actions--medical form { display:inline-flex; }
.patient-actions--medical .btn { white-space: nowrap; }
.consultorio-dialog {
  width: min(940px, calc(100vw - 32px));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-3);
}
.consultorio-dialog::backdrop { background: rgba(10, 27, 38, .48); backdrop-filter: blur(4px); }
.dialog-close-form { position:absolute; top:14px; right:14px; }
.dialog-x { width:34px; height:34px; border:0; border-radius:50%; background:var(--surface-3); color:var(--muted); font-size:22px; }
.office-list--dialog { margin-top: 18px; max-height: 58vh; overflow:auto; padding-right: 4px; }
.office-map {
  display: grid;
  gap: 14px;
}
.office-sector {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.office-sector header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.office-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 0;
}
.office-pod { margin: 0; }
.office-pod button {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.office-pod button:hover:not(:disabled) {
  border-color: var(--brand-bright);
  background: var(--profint-green-50);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -20px rgba(10, 42, 54, .55);
}
.office-pod.free button {
  border-color: rgba(34, 197, 94, .22);
  background: color-mix(in srgb, #22c55e 7%, var(--surface));
}
.office-pod.busy button {
  border-color: rgba(239, 68, 68, .22);
  background: color-mix(in srgb, #ef4444 6%, var(--surface));
}
.office-pod.unassigned button {
  border-color: var(--border);
  background: var(--surface-3);
  color: var(--muted);
}
.office-pod.selected button {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(25,167,206,.12);
}
.office-pod button:disabled { cursor: default; }
.office-pod i {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 16px;
}
.office-pod.free i { color: #16803d; }
.office-pod.busy i { color: #b4232f; }
.office-pod.unassigned i { color: var(--muted); }
.office-pod strong,
.office-pod span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.office-pod strong { font-size: 13px; line-height: 1.2; }
.office-pod span { color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1.2; }

.doctor-attention { width: 100%; max-width: none; margin: 0; }
.attention-hero {
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:center;
  margin: 26px 0 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: radial-gradient(circle at 88% 28%, rgba(25,167,206,.20), transparent 34%), var(--surface);
  box-shadow: var(--sh-2);
}
.attention-hero--clinical { margin-top: 14px; }
.attention-hero h1 { margin: 4px 0 10px; font-size: clamp(28px, 4vw, 42px); line-height:1.05; }
.attention-hero__actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.attention-meta { display:flex; flex-wrap:wrap; gap:8px; }
.attention-meta span { padding:6px 10px; border-radius:999px; background:var(--surface-2); color:var(--muted); border:1px solid var(--border); font-size: var(--fs-sm); }
.back-link { display:inline-flex; align-items:center; gap:6px; color:var(--brand); text-decoration:none; font-weight:700; font-size:var(--fs-sm); }
.attention-workspace { display:grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .7fr); gap:18px; align-items:start; margin-bottom:18px; }
.attention-side { display:grid; gap:18px; position: sticky; top: 88px; }
.attention-grid { display:grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap:18px; align-items:start; margin-bottom:18px; }
.attention-grid--secondary { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.evolution-panel--primary { min-height: 560px; }
.evolution-panel textarea { min-height: 360px; resize: vertical; }
.clinical-form, .study-form { display:grid; gap:14px; }
.clinical-form label, .study-form label { display:grid; gap:7px; font-weight:700; color:var(--ink-2); font-size:var(--fs-sm); }
.clinical-form input, .clinical-form select, .clinical-form textarea,
.study-form input, .study-form select, .study-form textarea {
  width:100%; border:1px solid var(--border-strong); border-radius:12px; padding:12px 14px; background:var(--surface); font:inherit;
}
.clinical-form textarea:focus, .clinical-form input:focus, .clinical-form select:focus,
.study-form input:focus, .study-form select:focus, .study-form textarea:focus { outline: 3px solid rgba(0, 154, 205, .16); border-color: var(--brand-bright); }
.clinical-form--evolution { margin-top: 14px; }
.clinical-form-row { display:grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap:14px; align-items:end; }
.clinical-context-pill {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.clinical-context-pill span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.clinical-context-pill strong {
  color: var(--ink);
  font-size: 14px;
}
.clinical-save-hint { display:flex; align-items:center; gap:9px; min-height:46px; color:var(--muted); font-size:var(--fs-sm); }
.clinical-save-hint i { color:var(--brand); font-size:20px; }
.clinical-shortcuts { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; align-content:flex-start; max-width:520px; }
.clinical-shortcuts button {
  border:1px solid var(--border); border-radius:999px; background:var(--surface-2); color:var(--ink-2);
  padding:7px 10px; font:inherit; font-size:12px; font-weight:700; cursor:pointer;
}
.clinical-shortcuts button:hover { border-color:var(--brand-bright); background:var(--profint-green-50); color:var(--brand-700); }
.form-actions--sticky { position: sticky; bottom: 0; z-index: 2; margin: 0 -2px -2px; padding: 12px 2px 2px; background: linear-gradient(180deg, rgba(255,255,255,0), var(--surface) 36%); }
.study-form { grid-template-columns: minmax(260px, 1fr) 110px 110px; align-items:end; }
.study-form--compact { grid-template-columns: minmax(260px, 1fr) 110px 110px auto; }
.study-form .wide-field { grid-column: span 3; }
.study-form--compact .wide-field { grid-column: 1 / -1; }
.study-form .btn { justify-self:start; }
.three-cols { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:10px; }
.history-stats { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; margin:14px 0; }
.history-stats span { border:1px solid var(--border); border-radius:14px; padding:12px; background:var(--surface-2); color:var(--muted); }
.history-stats b { display:block; color:var(--ink); font-size:22px; }
.history-stats--compact span { padding:10px 12px; }
.timeline-list, .clinical-list { display:grid; gap:10px; margin-top:14px; }
.timeline-list--compact { max-height: 430px; overflow:auto; padding-right: 4px; }
.timeline-item { display:grid; grid-template-columns: 14px 1fr; gap:10px; padding:12px 0; border-top:1px solid var(--border-soft); }
.timeline-dot { width:10px; height:10px; margin-top:7px; border-radius:50%; background:var(--brand-bright); box-shadow:0 0 0 4px var(--brand-50); }
.timeline-item strong, .clinical-list-row strong { display:block; color:var(--ink); }
.timeline-item span, .clinical-list-row span { color:var(--muted); font-size:var(--fs-sm); }
.timeline-item p, .clinical-list-row p { margin:5px 0 0; color:var(--ink-2); }
.clinical-list h3 { margin: 18px 0 2px; font-size: var(--fs-lg); }
.clinical-list--dense { max-height: 520px; overflow:auto; padding-right: 4px; }
.clinical-list-row { padding:13px 14px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.diagnosis-edit-form { gap: 12px; }
.diagnosis-edit-form__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.diagnosis-edit-form__head .btn { white-space: nowrap; }
.diagnosis-dates { display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:4px; }
.attention-workspace--tabs { grid-template-columns: minmax(0, 1fr) minmax(330px, 420px); }
.clinical-workbench { min-height: 660px; padding: 0; overflow: hidden; }
.clinical-workbench__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:22px 24px 16px;
  border-bottom:1px solid var(--border-soft);
}
.clinical-workbench__head h2 { margin:3px 0 4px; }
.clinical-workbench__head p { margin:0; color:var(--muted); }
.clinical-workbench__status { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.clinical-workbench__status span {
  padding:7px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--ink-2);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.clinical-tabs {
  position:sticky;
  top:0;
  z-index:3;
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
  padding:10px;
  border-bottom:1px solid var(--border-soft);
  background:color-mix(in srgb, var(--surface-2) 92%, transparent);
  backdrop-filter: blur(10px);
}
.clinical-tabs button {
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid transparent;
  border-radius:13px;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-weight:850;
  cursor:pointer;
}
.clinical-tabs button:hover { background:var(--surface); color:var(--ink-2); border-color:var(--border); }
.clinical-tabs button.active {
  background:var(--surface);
  color:var(--brand-700);
  border-color:var(--brand-bright);
  box-shadow:0 8px 20px rgba(15, 141, 172, .10);
}
.clinical-tabs i { font-size:18px; }
.clinical-tabs b {
  min-width:22px;
  height:22px;
  display:grid;
  place-items:center;
  padding:0 6px;
  border-radius:999px;
  background:var(--surface-3);
  color:var(--muted);
  font-size:11px;
}
.clinical-tabs button.active b { background:var(--brand-50); color:var(--brand-700); }
.clinical-tab-panels { padding:22px 24px 24px; }
.clinical-tab-panel[hidden] { display:none !important; }
.clinical-tab-panel.active { display:block; }
.panel-head-inline { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.clinical-count { align-self:flex-start; padding:6px 10px; border-radius:999px; border:1px solid var(--border); background:var(--surface-2); color:var(--muted); font-size:12px; font-weight:800; white-space:nowrap; }
.attachment-list { display:grid; gap:9px; margin-top:14px; }
.attachment-list--grid { grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); }
.attachment-row { width:100%; display:flex; align-items:flex-start; gap:10px; padding:11px 12px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); color:inherit; text-align:left; text-decoration:none; font:inherit; cursor:pointer; }
.attachment-row:hover { border-color:var(--brand-bright); background:var(--profint-green-50); }
.attachment-row i { color:var(--brand); font-size:20px; margin-top:1px; }
.attachment-row strong, .attachment-row small { display:block; }
.attachment-row small { color:var(--muted); margin-top:2px; }
.clinical-attachment-uploader--wide { grid-template-columns:minmax(260px, 1fr) auto; align-items:end; }
.clinical-attachment-uploader--wide .clinical-attachment-preview,
.clinical-attachment-uploader--wide .clinical-attachment-qr { grid-column:1 / -1; }
.clinical-attachment-uploader {
  display:grid;
  gap:10px;
  margin:14px 0 12px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:linear-gradient(180deg, var(--surface-2), var(--surface));
}
.clinical-attachment-uploader label { display:grid; gap:6px; color:var(--ink-2); font-size:var(--fs-sm); font-weight:700; }
.clinical-attachment-uploader input[type="text"] {
  width:100%;
  border:1px solid var(--border-strong);
  border-radius:11px;
  padding:10px 12px;
  background:var(--surface);
  font:inherit;
}
.clinical-attachment-actions { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.clinical-attachment-action {
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  color:var(--ink-2);
  text-decoration:none;
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.clinical-attachment-action:hover { border-color:var(--brand-bright); color:var(--brand-700); background:var(--profint-green-50); }
.clinical-attachment-action i { font-size:20px; color:var(--brand); }
.clinical-attachment-preview {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
}
.clinical-attachment-preview span { min-width:0; color:var(--ink-2); font-size:var(--fs-sm); }
.clinical-attachment-preview strong { word-break:break-word; }
.clinical-attachment-qr {
  display:grid;
  grid-template-columns:132px 1fr;
  gap:12px;
  align-items:center;
  padding:10px;
  border:1px dashed var(--brand-bright);
  border-radius:14px;
  background:var(--brand-50);
}
.clinical-attachment-qr[hidden], .clinical-attachment-preview[hidden] { display:none !important; }
.clinical-attachment-qr canvas { border-radius:10px; background:#fff; padding:6px; }
.clinical-attachment-qr strong, .clinical-attachment-qr span, .clinical-attachment-qr a { display:block; }
.clinical-attachment-qr span { color:var(--muted); font-size:var(--fs-sm); margin:3px 0 7px; }
.clinical-attachment-qr a { color:var(--brand); font-weight:800; font-size:var(--fs-sm); text-decoration:none; }
.doctor-empty.compact { padding: 18px; min-height: unset; }
.rx-doc-preview[hidden] { display:none !important; }
body.rx-doc-preview-open { overflow:hidden; }
.rx-doc-preview {
  position:fixed;
  inset:0;
  z-index:2200;
  display:grid;
  place-items:center;
  padding:20px;
}
.rx-doc-preview__backdrop {
  position:absolute;
  inset:0;
  background:rgba(9, 27, 38, .58);
  backdrop-filter:blur(5px);
}
.rx-doc-preview__dialog {
  position:relative;
  z-index:1;
  width:min(1240px, calc(100vw - 40px));
  height:calc(100vh - 40px);
  max-height:920px;
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
  box-shadow:0 28px 80px rgba(10, 27, 38, .30);
}
.rx-doc-preview__header {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:72px;
  padding:12px 18px;
  border-bottom:1px solid var(--border-soft);
  background:linear-gradient(90deg, var(--surface), var(--brand-50));
}
.rx-doc-preview__header h2 {
  margin:2px 0 0;
  max-width:min(760px, 58vw);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:18px;
  line-height:1.25;
}
.rx-doc-preview__actions { display:flex; align-items:center; gap:8px; }
.rx-doc-preview__tools {
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.76);
}
.rx-doc-preview__tools button,
.rx-doc-preview__tools a {
  width:32px;
  height:30px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--ink-2);
  text-decoration:none;
  cursor:pointer;
}
.rx-doc-preview__tools button:hover,
.rx-doc-preview__tools a:hover {
  background:var(--brand-50);
  color:var(--brand-700);
}
.rx-doc-preview__tools span {
  min-width:48px;
  padding:0 6px;
  color:var(--ink-2);
  font-size:12px;
  font-weight:800;
  text-align:center;
}
.rx-doc-preview__close {
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  color:var(--ink-2);
  cursor:pointer;
}
.rx-doc-preview__close:hover { border-color:var(--brand-bright); color:var(--brand-700); }
.rx-doc-preview__body {
  position:relative;
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  background:#252525;
}
.rx-doc-preview__frame {
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  border:0;
  background:#252525;
}
.rx-doc-preview__image {
  display:block;
  max-width:calc(100% - 48px);
  max-height:calc(100% - 48px);
  margin:24px auto;
  transform-origin:top center;
  transition:transform .12s ease;
  box-shadow:0 10px 34px rgba(0,0,0,.32);
  background:#fff;
}
.rx-doc-preview__image[hidden],
.rx-doc-preview__frame[hidden],
.rx-doc-preview__error[hidden] { display:none !important; }
.rx-doc-preview__error {
  position:absolute;
  left:50%;
  top:50%;
  width:min(520px, calc(100% - 40px));
  display:grid;
  gap:10px;
  justify-items:start;
  transform:translate(-50%, -50%);
  padding:22px;
  border:1px solid rgba(245, 158, 11, .38);
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  box-shadow:0 18px 50px rgba(0,0,0,.34);
}
.rx-doc-preview__error > i {
  color:#d97706;
  font-size:28px;
}
.rx-doc-preview__error strong {
  font-size:18px;
}
.rx-doc-preview__error span {
  color:var(--muted);
  line-height:1.45;
}
.rx-doc-preview__error code {
  width:100%;
  padding:10px 12px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--ink);
  font-size:13px;
}
.rx-doc-preview__error-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.rx-doc-preview__error button,
.rx-doc-preview__error a {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  color:var(--brand-700);
  font-weight:800;
  text-decoration:none;
  cursor:pointer;
}
.rx-doc-preview__error button:hover,
.rx-doc-preview__error a:hover {
  border-color:var(--brand-bright);
  background:var(--brand-50);
}
@media (max-width: 1100px) {
  .attention-workspace, .attention-grid, .attention-grid--secondary { grid-template-columns: 1fr; }
  .attention-side { position: static; }
  .study-form { grid-template-columns: 1fr 1fr; }
  .study-form .wide-field { grid-column: 1 / -1; }
  .attention-hero { align-items:flex-start; flex-direction:column; }
  .clinical-form-row { grid-template-columns: 1fr; }
  .clinical-shortcuts { justify-content:flex-start; max-width:none; }
  .clinical-attachment-uploader--wide { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .clinical-tabs { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .clinical-workbench__head, .panel-head-inline, .rx-doc-preview__header { flex-direction:column; align-items:stretch; }
  .rx-doc-preview__actions { flex-wrap:wrap; }
  .rx-doc-preview__tools { justify-content:space-between; }
  .three-cols, .study-form, .study-form--compact { grid-template-columns: 1fr; }
  .clinical-attachment-actions, .clinical-attachment-qr { grid-template-columns: 1fr; }
  .attention-hero { padding:20px; border-radius:18px; }
  .evolution-panel textarea { min-height: 300px; }
  .rx-doc-preview { padding:0; }
  .rx-doc-preview__dialog { width:100vw; height:100vh; max-height:none; border-radius:0; }
  .rx-doc-preview__header h2 { max-width:100%; }
}
.hc-patient-hero {
    align-items: stretch;
}

.hc-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 10px;
    min-width: min(520px, 100%);
}

.hc-summary-grid > div {
    border: 1px solid var(--medicos-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .76);
    padding: 14px 16px;
}

.hc-summary-grid strong {
    display: block;
    color: var(--medicos-ink);
    font-size: 1.45rem;
    line-height: 1;
}

.hc-summary-grid span {
    color: var(--medicos-muted);
    font-size: .82rem;
}

.hc-clinical-shell {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
}

.hc-filters-panel,
.hc-documents-panel {
    position: sticky;
    top: 82px;
}

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

.hc-filter-cards {
    display: grid;
    gap: 10px;
}

.hc-filter-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--medicos-border);
    border-radius: 8px;
    background: #fff;
    color: var(--medicos-ink);
    cursor: pointer;
    padding: 12px;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.hc-filter-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hc-filter-card i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef7fb;
    color: var(--medicos-primary);
}

.hc-filter-card.active,
.hc-filter-card:has(input:checked) {
    border-color: var(--medicos-primary);
    background: #eaf8fd;
    color: #0b5f80;
}

.hc-date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hc-date-grid label {
    display: grid;
    gap: 6px;
    color: var(--medicos-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hc-date-grid input {
    border: 1px solid var(--medicos-border);
    border-radius: 8px;
    color: var(--medicos-ink);
    padding: 10px;
}

.hc-count-pill {
    border: 1px solid var(--medicos-border);
    border-radius: 999px;
    background: #f7fbfd;
    color: var(--medicos-ink);
    font-weight: 800;
    padding: 8px 12px;
}

.hc-timeline {
    display: grid;
    gap: 12px;
}

.hc-timeline-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
}

.hc-timeline-icon {
    width: 44px;
    height: 44px;
    border: 1px solid #bfe4ef;
    border-radius: 8px;
    background: #eef9fc;
    color: var(--medicos-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.hc-timeline-body {
    border: 1px solid var(--medicos-border);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.hc-timeline-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--medicos-muted);
    font-size: .86rem;
}

.hc-timeline-body p {
    margin: 8px 0 6px;
    color: var(--medicos-ink);
}

.hc-timeline-item--rich .hc-timeline-body {
    padding: 16px;
}

.hc-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hc-event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--medicos-border);
    border-radius: 999px;
    background: #f8fbfd;
    color: var(--medicos-muted);
    font-size: .8rem;
    padding: 5px 9px;
}

.hc-clinical-note,
.hc-clinical-block {
    border-top: 1px solid var(--medicos-border);
    margin-top: 14px;
    padding-top: 14px;
}

.hc-clinical-note h3,
.hc-clinical-block h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--medicos-ink);
    font-size: .98rem;
    margin: 0 0 8px;
}

.hc-clinical-note p,
.hc-clinical-block article p {
    white-space: pre-wrap;
}

.hc-clinical-block {
    display: grid;
    gap: 10px;
}

.hc-clinical-block article {
    border: 1px solid #edf2f7;
    border-radius: 8px;
    background: #fbfdff;
    padding: 10px;
}

.hc-clinical-block article.has-clinical-text {
    border-color: #bfe4ef;
    background: #f2fbfe;
}

.hc-clinical-block article strong,
.hc-clinical-block article span,
.hc-clinical-block article small {
    display: block;
}

.hc-clinical-block article span,
.hc-clinical-block article small,
.hc-muted-note {
    color: var(--medicos-muted);
    font-size: .84rem;
}

.hc-timeline-body small {
    color: var(--medicos-muted);
}

.hc-inline-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--medicos-primary);
    font-weight: 800;
    text-decoration: none;
}

.hc-doc-list {
    display: grid;
    gap: 10px;
}

.hc-doc-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--medicos-border);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.hc-doc-item > i {
    color: var(--medicos-primary);
    font-size: 1.25rem;
}

.hc-doc-item strong,
.hc-doc-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hc-doc-item strong {
    color: var(--medicos-ink);
    font-size: .9rem;
}

.hc-doc-item span {
    color: var(--medicos-muted);
    font-size: .8rem;
}

@media (max-width: 1180px) {
    .hc-clinical-shell {
        grid-template-columns: 1fr;
    }

    .hc-filters-panel,
    .hc-documents-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .hc-summary-grid,
    .hc-date-grid {
        grid-template-columns: 1fr 1fr;
    }
}
