:root {
  --bg: #f4f7f9;
  --sidebar: #1a2536;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #fff;
  --card: #fff;
  --primary: #3276b1;
  --primary-hover: #2a6496;
  --border: #e0e6ed;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #dc2626;
  --pill-dark: #334155;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}
body.app-body {
  overflow: hidden;
}

.hidden { display: none !important; }

/* ?? Login ?? */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eef5;
  padding: 1.5rem;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-vendor {
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--muted);
}
.login-vendor-label { display: block; font-size: 0.8rem; margin-bottom: 0.25rem; }
.login-vendor-name { color: #1e3a5f; font-size: 1.05rem; letter-spacing: 0.02em; }
.login-card {
  background: var(--card);
  border-radius: 10px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}
.login-brand {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
}
.login-clinic {
  margin: 0 0 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-org-advanced {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.login-org-advanced summary {
  cursor: pointer;
  font-weight: 600;
  color: #475569;
}
.login-org-advanced input {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
}
.login-org-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}
.login-field { margin-bottom: 1rem; }
.login-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}
.login-req { color: var(--danger); margin-right: 0.15rem; }
.login-field input,
.login-field select,
.login-field textarea,
.top-select,
.search-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.login-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.4 1.4 6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.7rem;
  cursor: pointer;
}
.login-field textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.4;
}
.login-field input:focus,
.login-field select:focus,
.login-field textarea:focus,
.top-select:focus,
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.login-password-wrap { position: relative; }
.login-password-wrap input { padding-right: 2.5rem; }
.login-eye {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.7;
}
.login-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.login-submit:hover { background: var(--primary-hover); }
.login-submit:disabled { opacity: 0.6; cursor: wait; }
.login-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

/* ?? App shell ?? */
.app-body {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  height: 100%;
  max-height: 100vh;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-brand {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo { font-size: 0.75rem; opacity: 0.7; letter-spacing: 0.04em; }
.sidebar-product { font-size: 1.15rem; font-weight: 700; color: #fff; margin-top: 0.15rem; }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: relative;
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
  color: inherit;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.is-active { background: rgba(37, 99, 235, 0.35); color: var(--sidebar-active); font-weight: 600; }
.nav-item.is-soon { opacity: 0.55; }
.nav-section-label {
  margin: 0.85rem 0.65rem 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}
.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
}
.sidebar-user { color: #fff; font-weight: 500; margin-bottom: 0.35rem; }
.btn-link {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #e8eef5;
  padding: 0.7rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.topbar-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 0.55rem 0 0.65rem;
  min-height: 2.45rem;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.topbar-field:hover {
  background: #e8eef5;
}
.topbar-field:focus-within {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.topbar-field.is-open {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.top-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 150px;
  max-width: 260px;
  width: auto;
  padding: 0.55rem 1.35rem 0.55rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  outline: none;
}
.top-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.top-soft-trigger {
  appearance: none;
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 150px;
  max-width: 260px;
  width: auto;
  padding: 0.55rem 0.35rem 0.55rem 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.topbar-field-prof .top-soft-trigger,
.topbar-field-prof .top-select { max-width: 320px; min-width: 200px; }
.topbar-field .top-select:focus { box-shadow: none; }
.topbar-field.is-disabled {
  opacity: 0.72;
  pointer-events: none;
}
.top-soft-panel {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(320px, 50vh);
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
}
.top-soft-panel.hidden { display: none; }
.top-soft-option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.top-soft-option:hover,
.top-soft-option.is-active {
  background: #eff6ff;
}
.top-soft-option-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.top-soft-option.is-active .top-soft-option-title,
.top-soft-option:hover .top-soft-option-title {
  color: #2563eb;
}
.top-soft-option-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.2;
}
.top-soft-empty {
  padding: 0.75rem;
  color: #94a3b8;
  font-size: 0.85rem;
}
.topbar-field-ico {
  display: inline-flex;
  color: #64748b;
  flex-shrink: 0;
}
.topbar-field-ico.is-prof { color: #7c3aed; }
.topbar-chevron {
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  margin: -0.2rem 0.15rem 0 0;
  pointer-events: none;
  flex-shrink: 0;
}
.date-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.15rem;
  position: relative;
}
.date-nav-group {
  display: inline-flex;
  align-items: stretch;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid transparent;
}
.date-nav-group:focus-within {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.date-nav-btn {
  border: none;
  background: transparent;
  width: 2.2rem;
  color: #334155;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.date-nav-btn:hover { background: #e2e8f0; color: #0f172a; }
.date-label {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 9.8rem;
  text-align: center;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  color: #0f172a;
  letter-spacing: 0.01em;
}
.date-label:hover { background: #e8eef5; color: var(--primary); }
.date-label[aria-expanded="true"] { background: #fff; color: var(--primary); }
.btn-hoy {
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  min-height: 2.45rem;
}
.btn-hoy:hover { background: #e2e8f0; color: #0f172a; }
.top-datepicker {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 80;
  width: 280px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 0.85rem 0.9rem 0.75rem;
}
.top-dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.top-dp-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  text-transform: capitalize;
}
.top-dp-nav {
  display: inline-flex;
  gap: 0.2rem;
}
.top-dp-nav button {
  border: none;
  background: #f1f5f9;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  cursor: pointer;
  color: #334155;
  font-size: 0.95rem;
}
.top-dp-nav button:hover { background: #e2e8f0; }
.top-dp-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.25rem;
}
.top-dp-dows span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 0.2rem 0;
}
.top-dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}
.top-dp-day {
  border: none;
  background: transparent;
  border-radius: 9px;
  aspect-ratio: 1;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}
.top-dp-day.is-out { color: #cbd5e1; }
.top-dp-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1.5px #93c5fd;
  color: var(--primary);
}
.top-dp-day.is-selected {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  box-shadow: none;
}
.top-dp-day:hover:not(.is-selected) { background: #eff6ff; }
.top-dp-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px solid #f1f5f9;
}
.top-dp-foot button {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.15rem;
}
.top-dp-foot button:hover { text-decoration: underline; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.topbar .search-wrap {
  position: relative;
}
.topbar .search-ico {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}
.topbar .search-input {
  min-width: 240px;
  max-width: 340px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 999px;
  padding: 0.55rem 0.95rem 0.55rem 2.1rem;
  font-size: 0.9rem;
}
.topbar .search-input:focus {
  outline: none;
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.btn-icon {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  width: 2.35rem;
  height: 2.35rem;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: #eef2f7; }

.content {
  padding: 1rem 1.15rem 1.5rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--border);
}
.kpi-turnos { border-left-color: #3276b1; }
.kpi-sala { border-left-color: #0d9488; }
.kpi-atencion { border-left-color: #38bdf8; }
.kpi-atendidos { border-left-color: #16a34a; }
.kpi-libres { border-left-color: #84cc16; }
.kpi-ausentes { border-left-color: #f59e0b; }
.kpi-title { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-value { font-size: 1.5rem; font-weight: 700; margin-top: 0.15rem; }
.kpi-sub { font-size: 0.75rem; color: var(--muted); }

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  align-items: center;
}
.btn-primary, .btn-secondary, .btn-ghost, .btn-row {
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-with-count {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.btn-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e8eef5;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); margin-left: auto; }
.btn-row {
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
}
.btn-row.is-primary { background: var(--primary); color: #fff; border-color: var(--primary); }

.inicio-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0.85rem;
  align-items: start;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.panel-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
}
.table-wrap { overflow-x: auto; }
.turnos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.turnos-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.turnos-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.turnos-table tr:hover td { background: #f8fafc; }
.pac-name { font-weight: 600; }
.pac-dni { color: var(--muted); font-size: 0.8rem; }
.pac-age {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
}
.estado-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}
.estado-pill.is-atrasado,
.estado-pill.is-bloqueado { background: #475569; color: #fff; }
.estado-pill.is-libre {
  background: #fff;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.estado-pill.is-asignado { background: #dbeafe; color: #1d4ed8; }
.estado-pill.is-en_sala { background: #ccfbf1; color: #0f766e; }
.estado-pill.is-en_atencion { background: #e0f2fe; color: #0369a1; }
.estado-pill.is-atendido { background: #dcfce7; color: #166534; }
.estado-pill.is-ausente { background: #ffedd5; color: #c2410c; }
.estado-sub {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.estado-sub.is-warn { color: #c2410c; font-weight: 600; }
.estado-sub.is-ok { color: #15803d; font-weight: 600; }
.estado-sub.is-cargos { color: #9a3412; font-weight: 700; }
.group-row td {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.5rem !important;
  border-bottom: 1px solid var(--border);
}
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.btn-row.is-cobrar { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.btn-row.is-recibir { color: #0369a1; border-color: #7dd3fc; background: #f0f9ff; }
.row-menu { position: relative; display: inline-flex; }
.btn-menu { min-width: 2rem; font-weight: 700; letter-spacing: 0.05em; }
.row-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.row-menu-panel.is-fixed-open {
  position: fixed;
  z-index: 4000;
  right: auto;
}
.row-menu-panel.hidden { display: none; }
.row-menu-panel button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}
.row-menu-panel button:hover { background: #f1f5f9; }
.row-menu-panel button.is-danger { color: #dc2626; }
.row-menu-panel button.is-danger:hover { background: #fef2f2; }

/* Profesionales list */
.profs-header { align-items: center; }
.profs-toolbar { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
/* Buscadores de listados (profesionales, pacientes, agendas, etc.) */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}
.search-field .search-icon {
  position: absolute;
  left: 0.65rem;
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}
.search-field input {
  width: min(280px, 55vw);
  padding: 0.45rem 0.7rem 0.45rem 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-field input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.search-field.ag-search input {
  width: min(340px, 62vw);
}
.prof-name { font-weight: 700; color: #0f172a; }
.prof-login { font-size: 0.78rem; color: #94a3b8; margin-top: 0.1rem; }
.pac-name { font-weight: 700; color: #0f172a; letter-spacing: 0.01em; }
.pac-doc { font-size: 0.78rem; margin-top: 0.1rem; }
.pacs-table .th-acciones,
.pacs-table .td-acciones { text-align: right; width: 5rem; }
.pacs-table tbody tr[data-id] { cursor: pointer; }
.pacs-table tbody tr[data-id]:hover td { background: #f8fafc; }
.pill-esp {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 600;
}
.pill-rol {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.users-table .user-login { font-weight: 600; letter-spacing: 0.01em; }
.users-table .th-acciones,
.users-table .td-acciones { text-align: right; width: 5rem; }
.users-table .btn-menu {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.th-sort {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
}
.sort-ico { opacity: 0.45; font-size: 0.75rem; }
.sort-ico.is-active { opacity: 1; color: #0369a1; }
.profs-table .th-acciones,
.profs-table .td-acciones { text-align: right; width: 5rem; }
.profs-table .btn-menu {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.panel-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.panel-title-row .panel-title { margin: 0; }
.panel-count {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.panel-sort { font-size: 0.8rem; }

.side-panels { display: flex; flex-direction: column; gap: 0.85rem; }
.libres-list, .proximos-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
.libres-list li, .proximos-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.proximos-meta { color: var(--muted); font-size: 0.75rem; }
.proximos-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 0.25rem;
  overflow: hidden;
}
.proximos-bar > span {
  display: block;
  height: 100%;
  background: #34d399;
}

.soon-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
}
.soon-box h2 { margin-top: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  width: 100%;
  max-width: 400px;
}
.modal-card h3 { margin: 0 0 1rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 200;
  max-width: 320px;
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .inicio-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sidebar { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ?? Sidebar accordion ?? */
.nav-group-label {
  margin: 0.85rem 0.65rem 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}
.nav-accordion { margin: 0.1rem 0; }
.nav-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.nav-accordion-toggle:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-acc-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.nav-acc-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-acc-count {
  flex: 0 0 auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}
.nav-accordion-toggle .chevron {
  transition: transform 0.15s ease;
  opacity: 0.7;
  display: inline-block;
}
.nav-accordion-toggle.is-open .chevron { transform: rotate(90deg); }
.nav-accordion-panel {
  display: none;
  padding-left: 0.35rem;
  margin-bottom: 0.15rem;
}
.nav-accordion-panel.is-open {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-sub { font-size: 0.85rem; padding-left: 1.15rem; }
.nav-item.hidden { display: none !important; }
.sidebar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

/* ?? Admin sections ?? */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
}
.section-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.admin-table-wrap { margin-top: 0.25rem; }
.admin-table tbody tr.clickable-row { cursor: pointer; }
.admin-table tbody tr.clickable-row:hover td { background: #eff6ff; }
.row-actions-cell { white-space: nowrap; }
.btn-row.is-danger { color: var(--danger); border-color: #fecaca; }
.muted { color: var(--muted); font-size: 0.875rem; }

.badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}
.badge.is-ok { background: #dcfce7; color: #166534; }
.badge.is-muted { background: #f1f5f9; color: #64748b; }

.segment-bar {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.segment {
  border: none;
  background: #fff;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}
.segment.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.segment + .segment { border-left: 1px solid var(--border); }

.kpi-row-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 540px; }

.modal-card-wide { max-width: 520px; }
.field-check label { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.field-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.field-toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}
.field-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.field-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
}
.field-toggle-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  display: block;
  flex-shrink: 0;
  transition: background 0.18s ease;
}
.field-toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease;
}
.field-toggle-switch input:checked + .field-toggle-ui {
  background: var(--primary, #3276b1);
}
.field-toggle-switch input:checked + .field-toggle-ui::after {
  transform: translateX(20px);
}
.field-toggle-switch input:focus-visible + .field-toggle-ui {
  box-shadow: 0 0 0 3px rgba(50, 118, 177, 0.28);
}
.field-toggle-switch input:disabled + .field-toggle-ui {
  opacity: 0.5;
  cursor: not-allowed;
}
.field-toggle.is-readonly .field-toggle-switch {
  cursor: not-allowed;
}
.login-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}
.btn-upload { cursor: pointer; position: relative; }
.btn-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ?? Drawer ?? */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 110;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 92vw);
  height: 100vh;
  background: #fff;
  z-index: 120;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
}
.drawer.drawer-wide { width: min(480px, 96vw); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.drawer-header-start {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.drawer-header h3 { margin: 0; font-size: 1.05rem; }
.drawer-body { padding: 1rem; overflow-y: auto; flex: 1; }
.drawer-body .login-field select,
.drawer #form-gestionar-cx select,
.drawer #form-derivar select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.6rem 2.1rem 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.4 1.4 6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.7rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}
.drawer-body .login-field select:focus,
.drawer #form-gestionar-cx select:focus,
.drawer #form-derivar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(50, 118, 177, 0.15);
}
.drawer-body .login-field input,
.drawer-body .login-field textarea {
  border-color: #e2e8f0;
  border-radius: 8px;
}
.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.drawer-close { font-size: 1.25rem; line-height: 1; }
.drawer-header-start {
  justify-content: flex-start;
  gap: 0.65rem;
}
.drawer-header-start h3 {
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.detalle-list {
  margin: 0 0 1rem;
  padding: 0;
}
.detalle-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.detalle-row dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.detalle-row dd {
  margin: 0;
  font-weight: 600;
}
.detalle-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.detalle-actions .btn-primary,
.detalle-actions .btn-secondary {
  width: 100%;
  justify-content: center;
}
.modal-card-md { max-width: 440px; }
.modal-repro-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.modal-repro-head h3 { margin: 0; }
.repro-hint { margin: 0 0 1rem; font-size: 0.85rem; line-height: 1.4; }
.repro-modo {
  display: flex;
  width: 100%;
  margin-bottom: 0.85rem;
}
.repro-modo .segment { flex: 1; text-align: center; }

.modal-card-cobrar { max-width: 560px; width: 100%; }
.modal-cobrar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.modal-cobrar-head h3 { margin: 0 0 0.15rem; }
.modal-cobrar-head .muted { margin: 0; font-size: 0.875rem; }
.cobrar-section { margin-bottom: 1rem; }
.cobrar-section h4 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.cobrar-help { margin: 0 0 0.65rem; font-size: 0.8rem; }
.cobrar-rows { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.55rem; }
.cobrar-row {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 0.4rem;
  align-items: center;
}
.cobrar-row:has(.cobrar-medio) {
  grid-template-columns: 130px 100px 1fr auto;
}
.cobrar-row input,
.cobrar-row select {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
}
.cobrar-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.55rem;
}
.cobrar-add-row select { flex: 1; }
.cobrar-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.95rem;
}
.cobrar-vuelto { color: var(--primary); font-weight: 600; }
.btn-dashed {
  width: 100%;
  border: 1px dashed #94a3b8;
  background: #fff;
  color: var(--primary);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-dashed:hover { background: #f8fafc; }
.cobrar-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.btn-icon.is-danger { color: #dc2626; }
#cobrar-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ?? Tabs / ficha ?? */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
}
.tab {
  border: none;
  background: transparent;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-panel { min-height: 120px; }

.ficha-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.ficha-header h2 { margin: 0 0 0.25rem; }
.ficha-meta { color: var(--muted); font-size: 0.875rem; }
.ficha-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-back-ficha { padding-left: 0; }

/* ?? Preferencias ?? */
.pref-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pref-page-header h2 { margin: 0 0 0.25rem; font-size: 1.35rem; }
.pref-page-sub { margin: 0; color: var(--muted); font-size: 0.875rem; max-width: 42rem; }
.pref-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.pref-block h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.pref-card-desc {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
.pref-field { margin-bottom: 0.85rem; }
.pref-field > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}
.pref-field input[type="text"],
.pref-field input[type="url"],
.pref-field input[type="number"],
.pref-field input[type="time"],
.pref-field select,
.pref-field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
}
.pref-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.multi-dd {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.multi-dd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.multi-dd.is-open .multi-dd-trigger {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.multi-dd-label.is-placeholder { color: #94a3b8; }
.multi-dd-caret { color: #94a3b8; font-size: 0.75rem; }
.multi-dd-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
}
.multi-dd-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.multi-dd-option:hover { background: #f8fafc; }
.multi-dd-option input { margin: 0; }
.multi-dd-empty { padding: 0.65rem 0.55rem; font-size: 0.85rem; }
.pref-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.pref-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pref-color-row input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.pref-color-hex { max-width: 110px; }
.pref-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.pref-logo-preview {
  min-height: 48px;
  min-width: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
}
.pref-logo-preview img { max-height: 48px; max-width: 160px; object-fit: contain; }
.pref-upload-btn { cursor: pointer; margin: 0; }
.pref-toggles { display: flex; flex-direction: column; gap: 0.65rem; }
.pref-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
}
.pref-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pref-switch-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.pref-switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
.pref-switch input:checked + .pref-switch-ui {
  background: var(--primary, #3276b1);
}
.pref-switch input:checked + .pref-switch-ui::after {
  transform: translateX(18px);
}
.pref-switch-label { font-weight: 600; color: #1e293b; }
.pref-segments { display: flex; width: 100%; max-width: 520px; }
.pref-segments .segment { flex: 1; text-align: center; font-size: 0.8rem; }
.pref-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}
.pref-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.pref-radios { display: flex; flex-direction: column; gap: 0.45rem; }
.pref-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.pref-inline { display: flex; gap: 0.5rem; }
.pref-inline input { flex: 1; }
.pref-card-raw textarea {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}
.pref-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.pref-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}
.pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}
.pref-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}
.pref-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.toggle-row { margin-bottom: 0.5rem; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.toggle input { width: 1rem; height: 1rem; accent-color: var(--primary); }
.pref-section textarea {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cierre-panel { max-width: 640px; padding: 1.25rem 1.35rem 1.35rem; }
.cierre-title {
  margin: 0 0 0.55rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}
.cierre-desc {
  margin: 0 0 1.1rem;
  line-height: 1.45;
  font-size: 0.9rem;
}
.cierre-fecha-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.cierre-fecha-label {
  font-weight: 800;
  font-size: 0.9rem;
  color: #0f172a;
}
.cierre-fecha-wrap { display: inline-block; }
.cierre-fecha-wrap .caja-fecha-btn {
  text-transform: lowercase;
  min-width: 16rem;
  justify-content: space-between;
}
.cierre-impacto { margin-bottom: 1rem; }
.cierre-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.antecedentes-area { width: 100%; font-family: inherit; }

/* ?? Adjuntos ?? */
.adjuntos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}
.adjunto-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.adjunto-card:hover { border-color: var(--primary); background: #f8fafc; }
.adjunto-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.adjunto-meta { font-size: 0.72rem; color: var(--muted); }

.hc-editor textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; }

.report-filters label { font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.report-filters input[type="date"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ?? Reportes ?? */
.rep-page { display: flex; flex-direction: column; gap: 0.85rem; }
.rep-header h2 { margin: 0; }
.rep-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
}
.rep-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
}
.rep-filter-label {
  font-weight: 700;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.rep-range-wrap,
.rep-prof-wrap {
  position: relative;
}
.rep-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 15.5rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  font-family: inherit;
}
.rep-range-btn:hover,
.rep-range-btn.is-open {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.rep-range-clear {
  margin-left: auto;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}
.rep-range-clear:hover { background: #cbd5e1; color: #0f172a; }
.rep-range-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 70;
  display: flex;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  min-width: 560px;
}
.rep-range-presets {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0.7rem;
  border-right: 1px solid #e2e8f0;
  min-width: 8.5rem;
  background: #fafbfc;
}
.rep-range-presets button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
}
.rep-range-presets button:hover { background: #eef2ff; color: #1d4ed8; }
.rep-range-cals { padding: 0.75rem 0.9rem 0.9rem; }
.rep-range-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.rep-range-nav-left,
.rep-range-nav-right {
  display: inline-flex;
  gap: 0.2rem;
}
.rep-range-nav button {
  border: none;
  background: #f1f5f9;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  font-size: 0.9rem;
}
.rep-range-nav button:hover { background: #e2e8f0; color: #0f172a; }
.rep-range-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.rep-dp-month-title {
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 0.45rem;
}
.rep-dp-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.1rem;
  margin-bottom: 0.2rem;
}
.rep-dp-dows span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 0.2rem 0;
}
.rep-dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.1rem 0;
}
.rep-dp-day {
  border: none;
  background: transparent;
  height: 2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
}
.rep-dp-day.is-out { color: #cbd5e1; }
.rep-dp-day.is-in {
  background: #dbeafe;
  border-radius: 0;
}
.rep-dp-day.is-start,
.rep-dp-day.is-end {
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  z-index: 2;
}
.rep-dp-day.is-start.is-in,
.rep-dp-day.is-end.is-in {
  background: #2563eb;
}
.rep-dp-day:hover:not(.is-start):not(.is-end) {
  background: #eff6ff;
  border-radius: 8px;
}
.rep-prof-wrap .caja-user-field { min-width: 14rem; }
.rep-prof-panel { min-width: 14rem; }
@media (max-width: 720px) {
  .rep-range-panel {
    min-width: 0;
    width: min(94vw, 360px);
    flex-direction: column;
  }
  .rep-range-presets {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  .rep-range-months { grid-template-columns: 1fr; }
}
.rep-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  border-bottom: 1px solid #e2e8f0;
  margin-top: 0.25rem;
}
.rep-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #64748b;
  cursor: pointer;
}
.rep-tab:hover { color: #0f172a; }
.rep-tab.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.rep-content { display: flex; flex-direction: column; gap: 1rem; }
.cat-hint {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
}
.cat-select-wrap { display: block; margin-bottom: 0.55rem; }
.cat-reporte-select {
  width: 100%;
  max-width: 42rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: #0f172a;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}
.cat-desc {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.4;
  max-width: 52rem;
}
.cat-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.cat-filtro {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 9.5rem;
}
.cat-filtro-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}
.cat-req { color: #dc2626; font-weight: 800; }
.cat-filtro input[type="date"],
.cat-filtro select {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: #0f172a;
}
.cat-filtro select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.8rem;
  min-width: 10.5rem;
}
.cat-filtro-run {
  min-width: auto;
  padding-bottom: 1px;
}
.cat-filtro-run .btn-primary {
  min-height: 2.35rem;
  padding: 0.45rem 1.15rem;
  border-radius: 8px;
  font-weight: 700;
}
.cat-result-empty { padding-top: 0.85rem; padding-bottom: 0.85rem; }
.cat-result-table .rep-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .cat-filtro { min-width: calc(50% - 0.5rem); flex: 1 1 9rem; }
  .cat-filtro-run { width: 100%; }
  .cat-filtro-run .btn-primary { width: 100%; }
}
.rep-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
}
.rep-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 0.85rem;
}
.rep-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.rep-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rep-kpi-label {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.rep-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.rep-kpi-val.is-ok { color: #16a34a; }
.rep-kpi-val.is-aus { color: #ca8a04; }
.rep-kpi-val.is-cancel { color: #dc2626; }
.rep-kpi-val.is-st { color: #7c3aed; }
.rep-table-wrap { margin-top: 0; }
.rep-table {
  width: 100%;
  border-collapse: collapse;
}
.rep-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  white-space: nowrap;
}
.rep-table thead th:first-child {
  background: #f1f5f9;
}
.rep-table tbody td {
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  vertical-align: middle;
}
.rep-table tbody td:first-child {
  background: #f8fafc;
}
.rep-table th.is-sortable {
  cursor: pointer;
  user-select: none;
}
.rep-table-prest thead th:first-child,
.rep-table-prest tbody td:first-child {
  background: #fff;
}
.rep-table-prest thead th.is-importe,
.rep-table-prest tbody td.rep-importe-cell {
  background: #f8fafc;
}
.rep-table-prest .rep-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-table-prest thead th.rep-num {
  text-align: right;
}
.rep-practica-name {
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.rep-table-motivo thead th:first-child,
.rep-table-motivo tbody td:first-child {
  background: #fff;
}
.rep-table-motivo thead th.is-total,
.rep-table-motivo tbody td.rep-total-cell {
  background: #f1f5f9;
}
.rep-table-motivo .rep-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-table-motivo thead th.rep-num {
  text-align: right;
}
.rep-motivo-name {
  font-weight: 700;
  color: #0f172a;
}
.rep-table-ina thead th:first-child,
.rep-table-ina tbody td:first-child {
  background: #fff;
}
.rep-table-ina thead th.is-total,
.rep-table-ina thead th.is-aus-col,
.rep-table-ina tbody td.rep-aus-cell {
  background: #f1f5f9;
}
.rep-table-ina .rep-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-table-ina thead th.rep-num {
  text-align: right;
}
.rep-pill-aus-sq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: #fef3c7;
  color: #b45309;
  font-weight: 800;
  font-size: 0.85rem;
}
.rep-sort {
  display: inline-block;
  margin-left: 0.2rem;
  color: #cbd5e1;
  font-size: 0.7rem;
}
.rep-sort.is-active { color: #64748b; }
.rep-fecha-cell { min-width: 5.5rem; }
.rep-fecha-top { font-weight: 800; color: #0f172a; }
.rep-fecha-year { font-size: 0.75rem; color: #94a3b8; margin-top: 0.1rem; }
.rep-num-ok { color: #16a34a; font-weight: 700; }
.rep-muted { color: #94a3b8; }
.rep-pill-aus {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  font-size: 0.82rem;
}
.rep-pill-st {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  font-size: 0.82rem;
}
@media (max-width: 960px) {
  .rep-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-kpi-val { font-size: 1.2rem; }
}

/* ?? Top search dropdown ?? */
.search-wrap { position: relative; }
.search-input {
  min-width: 260px;
  max-width: 360px;
  border-radius: 999px;
}
.topbar .search-input {
  padding-left: 2.1rem;
}
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.search-item:hover { background: #f1f5f9; }
.search-item-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.search-item-meta { font-size: 0.75rem; color: var(--muted); }
.pac-typeahead { position: relative; }
.pac-typeahead-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.15rem);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 120;
  max-height: 220px;
  overflow-y: auto;
}
.pac-typeahead-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #166534;
  background: #dcfce7;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
}
.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.modal-title-row h3 { margin: 0; }
.modal-close { border: none; background: transparent; font-size: 1.25rem; cursor: pointer; color: var(--muted); }
.modal-desc { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.modal-card-wide { max-width: 560px; }
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.modal-grid-nom {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  gap: 0.65rem;
}
.modal-grid-3 {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr 0.7fr;
  gap: 0.65rem;
}
.modal-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.req-star { color: #dc2626; font-weight: 700; }
.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.field-section-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.btn-link-accent {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
}
.btn-link-accent:hover { text-decoration: underline; }
.modal-card-asignar {
  max-width: 440px;
  width: min(440px, 94vw);
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.1rem;
}
.modal-card-asignar .modal-title-row {
  margin-bottom: 1rem;
}
.modal-card-asignar .modal-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}
.modal-card-asignar .login-field {
  margin-bottom: 0.95rem;
}
.modal-card-asignar .login-field > .field-section-label {
  display: block;
  margin-bottom: 0.4rem;
}
.modal-card-asignar .login-field input,
.modal-card-asignar .login-field select,
.modal-card-asignar .login-field textarea {
  border-radius: 8px;
  border-color: #e2e8f0;
}
.modal-card-asignar .pac-typeahead-hint:not(.hidden) {
  margin-top: 0.45rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.85rem;
  font-weight: 600;
}
.asignar-tip {
  margin: -0.15rem 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.4;
}
.modal-card-asignar .btn-primary:disabled {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}
.req { color: var(--danger); margin-right: 0.15rem; }
.sex-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.sex-btn {
  flex: 1;
  border: none;
  background: #fff;
  padding: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.sex-btn.is-active {
  background: var(--primary);
  color: #fff;
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .modal-grid-2, .modal-grid-3, .modal-grid-4, .modal-grid-nom { grid-template-columns: 1fr; }
}
.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

/* ?? Admin polish ?? */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.section-header h2 { margin: 0; font-size: 1.25rem; }
.section-hint { margin: 0 0 0.85rem; }
.section-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.admin-table thead th {
  background: #f1f5f9;
  padding: 0.55rem 0.65rem;
}
.admin-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
}
.badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}
.badge.is-ok { background: #dcfce7; color: #166534; }
.badge.is-muted { background: #f1f5f9; color: #64748b; }
.badge-st { background: #ede9fe; color: #5b21b6; font-size: 0.7rem; padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: 700; }
.btn-danger-outline {
  border: 1px solid #fca5a5;
  background: #fff;
  color: var(--danger);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-link-danger {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn-icon-danger {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-row.is-danger { color: var(--danger); border-color: #fecaca; }

.modal-card { max-width: 480px; }
.modal-card select,
.modal-card input,
.modal-card textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

/* ?? HC visual editor ?? */
.hc-toolbar {
  margin-bottom: 0.85rem;
  gap: 0.65rem;
}
.hc-toolbar .hc-pl-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}
.hc-toolbar .hc-pl-picker select,
#hc-pl-list {
  min-width: 260px;
  max-width: min(420px, 70vw);
  padding: 0.45rem 2.1rem 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.4 1.4 6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.7rem;
  cursor: pointer;
}
.hc-toolbar .hc-pl-picker select:focus,
#hc-pl-list:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.hc-section { margin-bottom: 0.85rem; }
.hc-section-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.hc-sec-titulo {
  flex: 1;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.hc-fields-table input,
.hc-fields-table select {
  width: 100%;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.85rem;
}
.hc-fields-table .td-center { text-align: center; }
.hc-editor-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* ?? Ficha paciente: Historia cl?nica ?? */
.hc-ficha-bar { margin-bottom: 0.85rem; }
.hc-prof-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  max-width: 420px;
}
.hc-prof-label select {
  font-weight: 500;
  color: #0f172a;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.hc-pl-hint { margin: 0.4rem 0 0; font-size: 0.8rem; }
.hc-subtabs { margin-bottom: 1rem; }
.hc-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem 1.25rem;
}
.hc-form-card.is-readonly { background: #f8fafc; }
.hc-form-section { margin-bottom: 1.25rem; }
.hc-form-sec-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.hc-form-field { margin-bottom: 0.85rem; }
.hc-form-field textarea {
  min-height: 88px;
  resize: vertical;
}
.btn-block {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}
.hc-historial-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.hc-historial-list { display: flex; flex-direction: column; gap: 0; }
.hc-hist-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}
.hc-hist-item:last-child { border-bottom: 0; }
.hc-hist-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.hc-hist-head:hover { background: #f8fafc; }
.hc-hist-chevron {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.hc-hist-item.is-open .hc-hist-chevron { transform: rotate(90deg); color: #64748b; }
.hc-hist-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem;
  min-width: 0;
}
.hc-hist-fecha {
  font-weight: 700;
  color: #0f172a;
}
.hc-hist-sep { color: #94a3b8; }
.hc-hist-prof {
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.hc-hist-body {
  padding: 0 1rem 1rem 2.1rem;
  border-top: 1px solid #f1f5f9;
}
.tab-count {
  font-weight: 500;
  color: #64748b;
}
.tab.is-active .tab-count { color: inherit; }
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: 0.15s;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(16px); }

.nav-item.is-active {
  background: rgba(50, 118, 177, 0.35);
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Quir?fano / Cirug?as */
.gest-cx-plantilla-campos {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.25rem 0 0.75rem;
}
.gest-cx-plantilla-campos .hc-form-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}
.gest-cx-plantilla-campos .hc-form-section:not(.has-title) {
  background: transparent;
  border: none;
  padding: 0;
}
.gest-cx-plantilla-campos .hc-form-sec-title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
}
.gest-cx-plantilla-campos .hc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}
.gest-cx-plantilla-campos .hc-form-field.is-full {
  grid-column: 1 / -1;
}
.gest-cx-plantilla-campos .hc-form-field {
  margin: 0;
}
@media (max-width: 600px) {
  .gest-cx-plantilla-campos .hc-form-grid {
    grid-template-columns: 1fr;
  }
  .gest-cx-plantilla-campos .hc-form-field.is-full {
    grid-column: auto;
  }
}
#gest-cx-plantilla-hint,
.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
}
.qx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.qx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.qx-filters select {
  min-width: 140px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.85rem;
  color: #64748b;
}
.qx-table-wrap { overflow-x: auto; }
.qx-table { min-width: 1100px; }
.qx-expand-th { width: 2.25rem; }
.qx-expand-cell {
  width: 2.25rem;
  vertical-align: middle;
  text-align: center;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}
.qx-expand-btn {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1.5px solid #94a3b8;
  background: #fff;
  color: #475569;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.qx-expand-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.qx-row.is-open > td {
  border-bottom-color: transparent;
}
.qx-detail-row > td {
  padding: 0 0.85rem 0.85rem 2.6rem !important;
  background: #f8fafc;
  border-top: none;
  vertical-align: top;
}
.qx-detail-row:not(.is-open) { display: none; }
.qx-resumen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #cbd5e1;
  background: #fff;
  border-radius: 0 8px 8px 0;
}
.qx-resumen-item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.35rem; }
.qx-resumen-k { font-weight: 700; color: #475569; }
.qx-resumen-val { color: #0f172a; font-weight: 500; }
.qx-resumen-sep { color: #94a3b8; margin: 0 0.1rem; }
.qx-resumen-obs { flex: 1 1 100%; }
.qx-retinas.is-ok { color: #15803d; font-weight: 700; }
.qx-pac-name { font-weight: 700; color: #0f172a; letter-spacing: 0.01em; }
.qx-pac-meta { font-size: 0.78rem; color: #94a3b8; margin-top: 0.1rem; }
.qx-cx { font-weight: 600; font-size: 0.85rem; }
.qx-sin-prog {
  appearance: none;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
}
.qx-sin-prog:hover { color: var(--primary); }
.qx-plus { font-weight: 700; color: #64748b; }
.qx-prog-mark { color: #22c55e; font-size: 0.7rem; }
.qx-asistio {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
}
.qx-pill-pair {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  background: #f8fafc;
}
.qx-pill {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}
.qx-pill.is-on { background: #e2e8f0; color: #334155; }
.qx-pill.is-on.is-ok { background: #dcfce7; color: #15803d; }
.qx-flag-cell { text-align: center; }
.qx-flag-time {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0369a1;
}
.qx-prog-date { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; color: #334155; }
.qx-estado {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}
.qx-estado.is-pendiente { background: #ffedd5; color: #c2410c; }
.qx-estado.is-programada { background: #e0f2fe; color: #0369a1; }
.qx-estado.is-realizada { background: #dcfce7; color: #15803d; }
.qx-switch { margin: 0; }
.qx-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  white-space: nowrap;
}

/* ?? Perfil profesional / TV ?? */
body.role-profesional .admin-inicio-wrap { display: none !important; }
body.role-profesional #prof-dash-root { display: block !important; }
#prof-dash-root.hidden { display: none !important; }
body.role-quirofano .admin-inicio-wrap { display: none !important; }
body.role-quirofano .sidebar-nav > .nav-item:not([data-section="inicio"]),
body.role-quirofano .sidebar-nav > .nav-group-label,
body.role-quirofano .sidebar-nav > .nav-accordion { display: none !important; }
body.role-quirofano .sidebar-nav > .nav-accordion:has([data-section="cirugias"]) {
  display: block !important;
}
.prof-dash { margin-bottom: 1rem; }
.prof-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.prof-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border-left: 4px solid #94a3b8;
}
.prof-kpi.is-sala { border-left-color: #14b8a6; }
.prof-kpi.is-atendidos { border-left-color: #22c55e; }
.prof-kpi.is-ausentes { border-left-color: #f59e0b; }
.prof-kpi-title { font-size: 0.82rem; color: #64748b; font-weight: 600; }
.prof-kpi-value { font-size: 1.75rem; font-weight: 700; color: #0f172a; line-height: 1.1; }
.prof-kpi-sub { font-size: 0.78rem; color: #94a3b8; }
.prof-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}
.prof-next-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.25rem 1.25rem;
  margin-bottom: 1rem;
}
.prof-next-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.prof-next-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.prof-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; display: inline-block;
}
.prof-tv-badge {
  font-size: 0.72rem;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}
.prof-next-name { font-size: 1.45rem; font-weight: 800; margin-bottom: 0.35rem; }
.prof-next-meta { opacity: 0.9; font-size: 0.9rem; margin-bottom: 0.9rem; }
.prof-next-empty { font-size: 1.1rem; opacity: 0.85; padding: 0.5rem 0 0.25rem; }
.prof-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.btn-secondary.is-cargos,
.btn-sm.is-cargos {
  border-color: #fdba74;
  color: #9a3412;
  background: #fff7ed;
}
.pill-cargos {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ffedd5;
  color: #9a3412;
  vertical-align: middle;
}
.cargos-extra-lista {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.75rem 0;
  max-height: 220px;
  overflow: auto;
}
.cargos-extra-empty { margin: 0.5rem 0; }
.cargos-extra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}
.cargos-extra-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.cargos-extra-add {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 0.7fr auto;
  gap: 0.45rem;
  align-items: center;
}
@media (max-width: 720px) {
  .cargos-extra-add { grid-template-columns: 1fr; }
}
.cargos-extra-help { margin: 0.55rem 0 0; font-size: 0.82rem; }
.caja-cargos-hint {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9a3412;
}
.caja-table tr.has-cargos td { background: #fffbeb; }
.prof-more { position: relative; }
.prof-more-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  min-width: 11rem;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
  z-index: 5;
}
.prof-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}
.prof-more-menu button:hover { background: #f1f5f9; }
.prof-next-card .btn-primary {
  background: #fff;
  color: #1e3a5f;
  border-color: #fff;
}
.prof-next-card .btn-secondary,
.prof-next-card .btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.prof-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.prof-list { list-style: none; margin: 0; padding: 0; }
.prof-list li {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}
.prof-hora { font-weight: 700; color: #334155; }
.prof-os { color: #64748b; font-size: 0.8rem; }
.prof-sala-list { list-style: none; margin: 0; padding: 0; }
.prof-sala-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.prof-sala-list li.is-siguiente { background: #eff6ff; border-radius: 8px; }
.prof-sala-name { font-weight: 700; font-size: 0.88rem; }
.prof-sala-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.78rem; color: #64748b; margin-top: 0.2rem; }
.pill-sig {
  background: #dbeafe; color: #1d4ed8;
  border-radius: 999px; padding: 0.05rem 0.45rem; font-weight: 700;
}
.prof-sala-order { display: flex; flex-direction: column; gap: 0.15rem; }
.edad-pill {
  display: inline-flex;
  background: #e2e8f0;
  color: #475569;
  border-radius: 6px;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.25rem;
}
.st-tag { color: #7c3aed; font-size: 0.7rem; font-weight: 700; }
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 0.65rem;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; font-weight: 700;
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 320px; max-height: 360px; overflow: auto;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  z-index: 40;
}
.notif-item { padding: 0.65rem 0.75rem; border-bottom: 1px solid #f1f5f9; }
.notif-item.is-unread { background: #f0fdf4; }
.notif-title { font-weight: 700; font-size: 0.85rem; }
.notif-msg { font-size: 0.78rem; color: #64748b; }
.modal-card-wide { max-width: 720px; width: min(720px, 94vw); }
.modal-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.tv-root { min-height: calc(100vh - 120px); }
.tv-screen {
  background: #0b1220; color: #fff; border-radius: 16px;
  padding: 1.5rem; min-height: 70vh;
}
.tv-header { display: flex; justify-content: space-between; margin-bottom: 1.5rem; opacity: 0.85; }
.tv-llamado {
  text-align: center; padding: 2rem 1rem; border-radius: 16px;
  background: #111827; margin-bottom: 1.5rem;
}
.tv-llamado.has-call { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); }
.tv-llamado-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; opacity: 0.9; }
.tv-llamado-name { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-top: 0.5rem; }
.tv-llamado-meta { margin-top: 0.35rem; opacity: 0.9; }
.tv-lista h2 { font-size: 1rem; margin: 0 0 0.75rem; opacity: 0.8; }
.tv-lista ul { list-style: none; margin: 0; padding: 0; }
.tv-lista li {
  display: flex; justify-content: space-between;
  padding: 0.7rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 1.05rem;
}
.tv-lista li.is-active { background: rgba(37, 99, 235, 0.35); border-radius: 8px; }
.tv-hint { padding: 2rem; color: #64748b; }
@media (max-width: 1100px) {
  .prof-layout { grid-template-columns: 1fr; }
  .prof-lists { grid-template-columns: 1fr; }
}

/* ?? Kiosko admisi?n ?? */
.kiosk-body {
  margin: 0;
  min-height: 100vh;
  background: #0b1c3d;
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kiosk-screen {
  width: min(520px, 94vw);
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}
.kiosk-mark { color: #f97316; font-size: 1.4rem; margin-bottom: 0.75rem; }
.kiosk-screen h1 { font-size: 2rem; margin: 0 0 0.5rem; font-weight: 800; }
.kiosk-sub { opacity: 0.9; margin: 0 0 1.25rem; }
.kiosk-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 1.5rem;
  padding: 0.9rem 1rem;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.kiosk-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}
.kiosk-pad button {
  background: rgba(255,255,255,0.1);
  border: 0;
  color: #fff;
  border-radius: 12px;
  font-size: 1.45rem;
  font-weight: 700;
  padding: 1.05rem 0;
  cursor: pointer;
}
.kiosk-pad button:active { background: rgba(255,255,255,0.2); }
.kiosk-ok { background: rgba(255,255,255,0.16) !important; font-size: 1rem !important; }
.kiosk-error { color: #fecaca; margin-top: 0.85rem; }
.kiosk-name-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  text-align: left;
}
.kiosk-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.kiosk-field span {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}
.kiosk-input-text {
  letter-spacing: normal;
  text-align: left;
  font-size: 1.2rem;
  text-transform: uppercase;
}
.kiosk-name-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}
.kiosk-btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 12px;
  padding: 0.9rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.kiosk-btn-secondary:active { background: rgba(255,255,255,0.1); }
.kiosk-success-ico {
  width: 64px; height: 64px; border-radius: 50%;
  background: #22c55e; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem;
}
.kiosk-doc-out { opacity: 0.9; margin-bottom: 0.75rem; }
.kiosk-code-label {
  letter-spacing: 0.12em; font-size: 0.8rem; opacity: 0.75; margin-top: 0.5rem;
}
.kiosk-code {
  color: #f97316; font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 800; margin: 0.2rem 0 0.85rem;
}
.kiosk-msg { max-width: 28rem; margin: 0 auto 1.5rem; opacity: 0.95; line-height: 1.4; }
.kiosk-btn-new {
  background: #f97316; color: #fff; border: 0; border-radius: 12px;
  padding: 0.9rem 1.6rem; font-size: 1.05rem; font-weight: 700; cursor: pointer;
}
.kiosk-logout {
  position: fixed; bottom: 1rem; right: 1rem;
  background: transparent; border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7); border-radius: 8px; padding: 0.35rem 0.7rem; cursor: pointer;
}

/* ?? Admisi?n bandeja ?? */
.adm-sin-turno {
  font-weight: 700;
  color: #b45309;
}
.adm-pill-warn {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.adm-kpis {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  margin: 0.75rem 0 1rem; font-size: 0.92rem; color: #64748b;
}
.adm-kpis .is-ok { color: #16a34a; }
.adm-codigo {
  background: none; border: 0; color: var(--primary, #2563eb);
  font-weight: 700; cursor: pointer; padding: 0;
}
.adm-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.btn-link-danger {
  background: none; border: 0; color: #dc2626; cursor: pointer; font-weight: 600; padding: 0.35rem 0.2rem;
}
.adm-espera-pill {
  display: inline-flex; margin-top: 0.2rem;
  background: #e2e8f0; color: #475569; border-radius: 999px;
  padding: 0.1rem 0.45rem; font-size: 0.72rem; font-weight: 700;
}
.adm-llamado-meta { color: #16a34a; font-size: 0.78rem; font-weight: 600; margin-top: 0.15rem; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.2rem;
  border-radius: 6px;
  background: #4b5c73;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: auto;
  padding: 0 0.35rem;
  flex-shrink: 0;
  line-height: 1;
}
.nav-badge.is-deriv,
#derivaciones-badge {
  background: #7f1d1d;
}
.nav-badge.is-admision,
#admision-badge {
  background: #4b5c73;
}
.tv-admision { background: linear-gradient(135deg, #ea580c, #f59e0b) !important; }

/* ??? Pantalla TV full page (sala de espera) ??? */
.tv-full-body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f7;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #0b1c3d;
  overflow: hidden;
}
.tv-full {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
}
.tv-full-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 2rem 0.95rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.tv-full-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.tv-full-logo {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.55rem;
  background: #0b1c3d;
  color: #f97316;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.tv-full-clinica {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 800;
  color: #0b1c3d;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-full-sala {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #7aa0c8;
  text-transform: uppercase;
}
.tv-full-clock {
  text-align: right;
  flex-shrink: 0;
}
.tv-full-hora {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #0b1c3d;
  line-height: 1;
}
.tv-full-fecha {
  margin-top: 0.25rem;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  font-weight: 600;
  color: #1e3a5f;
}
.tv-full-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  padding: 1.35rem 2rem 1.25rem;
  min-height: 0;
  background: #eef2f7;
}
.tv-full-call {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #0d2748 0%, #0a1c36 55%, #0b2444 100%);
  border-radius: 1.1rem;
  color: #fff;
  overflow: hidden;
  min-height: 0;
  box-shadow: 0 10px 30px rgba(11, 28, 61, 0.18);
}
.tv-full-call-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1.15rem 1.4rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tv-full-call-ico {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #f97316;
  color: transparent;
  font-size: 0;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}
.tv-full-call-name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.75rem 1.5rem;
  font-size: clamp(1.55rem, 3.6vw, 2.65rem);
  font-weight: 800;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.2;
}
.tv-full-call.has-call .tv-full-call-name {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.6rem);
  animation: tvPulseName 1.6s ease-in-out infinite;
}
@keyframes tvPulseName {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.92; transform: scale(1.015); }
}
.tv-full-destino {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.4rem;
  background: #c4814a;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 700;
  color: #fff;
}
.tv-full-arrow {
  font-size: 1.25rem;
  line-height: 1;
}
.tv-full-destino-val {
  min-width: 8rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  padding-bottom: 0.1rem;
  margin-left: 0.15rem;
}
.tv-full-call.has-call .tv-full-destino-val {
  border-bottom-color: transparent;
}
.tv-full-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  overflow: hidden;
}
.tv-full-side-block {
  background: transparent;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tv-full-side-block h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0b1c3d;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.04em;
}
.tv-full-bullet {
  width: 0.7rem;
  height: 0.7rem;
  background: #2563eb;
  border-radius: 2px;
  flex-shrink: 0;
}
.tv-full-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}
.tv-full-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid #dde5ef;
}
.tv-full-list li.is-active {
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}
.tv-li-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #0b1c3d;
}
.tv-li-meta {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 600;
}
.tv-empty {
  color: #94a3b8 !important;
  font-weight: 600;
  border-bottom: 0 !important;
  padding-top: 0.35rem !important;
}
.tv-full-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 2rem;
  background: #0b1c3d;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  flex-shrink: 0;
}
.tv-full-logout {
  position: fixed;
  bottom: 3.2rem;
  right: 1rem;
  z-index: 5;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.tv-full-logout:hover { opacity: 1; }
.tv-sound-unlock {
  position: fixed;
  left: 50%;
  bottom: 3.4rem;
  transform: translateX(-50%);
  z-index: 6;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  max-width: calc(100vw - 2rem);
}
.tv-sound-unlock.hidden { display: none !important; }
.tv-full-call.tv-call-flash {
  animation: tvCallFlash 0.9s ease-out;
}
@keyframes tvCallFlash {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.55); }
  40% { box-shadow: 0 0 0 14px rgba(249, 115, 22, 0.18); }
  100% { box-shadow: 0 10px 30px rgba(11, 28, 61, 0.18); }
}
@media (max-width: 960px) {
  .tv-full-main {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .tv-full-call { min-height: 42vh; }
}

/* ??? Agendas calendario / lista ??? */
.ag-header { align-items: center; gap: 1rem; }
.ag-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.ag-search { margin: 0; min-width: 220px; }
.ag-viewbar { margin: 0.25rem 0 1rem; }
.ag-view-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}
.ag-view-btn {
  border: 0;
  background: transparent;
  color: #334155;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.ag-view-btn.is-active {
  background: #1d4ed8;
  color: #fff;
}
.ag-weekbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.ag-week-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.ag-week-label {
  font-weight: 700;
  color: #0f172a;
  min-width: 12rem;
  text-align: center;
}
.ag-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.ag-cal-col {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.ag-cal-col.is-today {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}
.ag-cal-dayhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.65rem 0.7rem 0.45rem;
  border-bottom: 1px solid #f1f5f9;
}
.ag-cal-dow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
}
.ag-cal-dom {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
.ag-day-add {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  border: 0;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.ag-day-add:hover { background: #cbd5e1; }
.ag-cal-cards {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
.ag-cal-empty {
  color: #cbd5e1;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
}
.ag-card {
  border-radius: 10px;
  padding: 0.55rem 0.6rem 0.5rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.ag-card.is-blue { background: #dbeafe; }
.ag-card.is-violet { background: #ede9fe; }
.ag-card.is-amber { background: #fef3c7; }
.ag-card.is-mint { background: #d1fae5; }
.ag-card.is-rose { background: #ffe4e6; }
.ag-card.is-sky { background: #e0f2fe; }
.ag-card:hover { filter: brightness(0.98); }
.ag-card-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.2rem;
}
.ag-card-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.ag-card-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.ag-card-stats {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.35rem;
  font-weight: 600;
}
.ag-list-tools {
  display: flex;
  align-items: center;
  margin: 0.25rem 0 0.85rem;
}
.ag-range-wrap { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; }
.ag-range-label { font-weight: 700; color: #334155; font-size: 0.9rem; }
.ag-range-input {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #93c5fd;
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}
.ag-range-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 0.75rem 0.85rem 1rem;
  min-width: min(560px, 92vw);
}
.ag-range-nav {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.ag-range-nav button {
  border: 0;
  background: #f1f5f9;
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-weight: 700;
  color: #334155;
}
.ag-range-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.ag-range-month-title {
  text-align: center;
  font-weight: 800;
  margin-bottom: 0.45rem;
  color: #0f172a;
}
.ag-range-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
}
.ag-range-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}
.ag-range-day {
  border: 0;
  background: transparent;
  border-radius: 8px;
  height: 2rem;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}
.ag-range-day.is-out { visibility: hidden; }
.ag-range-day.is-in { background: #dbeafe; border-radius: 0; }
.ag-range-day.is-edge {
  background: #3b82f6;
  color: #fff;
  border-radius: 8px;
}
.ag-range-day.is-today:not(.is-edge) { box-shadow: inset 0 0 0 1px #3b82f6; }
.ag-list-wrap { background: #fff; border-radius: 12px; border: 1px solid #e8eef5; }
.ag-list-table td { vertical-align: middle; }
.ag-list-dia .ag-dia-top { font-weight: 700; color: #0f172a; }
.ag-list-dia .ag-dia-year { font-size: 0.78rem; color: #94a3b8; }
.ag-list-prof { font-weight: 800; color: #0f172a; letter-spacing: 0.01em; }
.ag-list-meta { font-size: 0.78rem; color: #94a3b8; margin-top: 0.1rem; }
.ag-list-hora { white-space: nowrap; font-weight: 600; }
.ag-slot-pill {
  display: inline-flex;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.ag-list-occ .ag-occ-pct {
  color: #16a34a;
  font-weight: 700;
  font-size: 0.82rem;
}
.ag-modal-card {
  max-width: 640px;
  width: min(640px, 94vw);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.15rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}
.ag-modal-card .modal-title-row {
  margin-bottom: 1rem;
}
.ag-modal-card .modal-title-row h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
}
.ag-modal-card .modal-close {
  font-size: 1.35rem;
  line-height: 1;
  color: #94a3b8;
}
.ag-form .login-field {
  margin-bottom: 0.85rem;
}
.ag-form .login-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}
.ag-form .login-field input,
.ag-form .login-field select {
  width: 100%;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.95rem;
  min-height: 2.55rem;
}
.ag-form .login-field input:focus,
.ag-form .login-field select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.ag-form .login-field.is-readonly input,
.ag-form .login-field.is-readonly select,
.ag-form .login-field input:disabled,
.ag-form .login-field select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  box-shadow: none;
}
.ag-form .modal-grid-2,
.ag-form .modal-grid-4 {
  margin-bottom: 0.15rem;
}
.ag-form-fecha-wrap {
  max-width: 220px;
  margin-bottom: 0.15rem;
}
.ag-form-hint {
  margin: 0.15rem 0 0;
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.45;
}
.ag-form-hint strong {
  color: #475569;
  font-weight: 700;
}
.ag-modal-card .modal-actions {
  margin-top: 1.15rem;
  gap: 0.65rem;
}
.ag-modal-card .modal-actions .btn-ghost {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.55rem 1rem;
}
.ag-modal-card .modal-actions .btn-primary {
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
}
@media (max-width: 1100px) {
  .ag-range-months { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .modal-grid-4 { grid-template-columns: 1fr 1fr; }
  .ag-form-fecha-wrap { max-width: none; }
}

/* ?? Derivaciones ?? */
.modal-card-derivar { max-width: 480px; width: min(480px, 94vw); border-radius: 14px; }
.modal-card-derivar .modal-desc { margin: 0 0 1rem; }
.modal-card-derivar .prio-toggle.segment-bar {
  display: flex;
  width: 100%;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.modal-card-derivar .prio-btn.segment {
  flex: 1;
  border: none;
  border-radius: 0;
  background: #fff;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  box-shadow: none;
}
.modal-card-derivar .prio-btn.segment + .prio-btn.segment {
  border-left: 1px solid var(--border);
}
.modal-card-derivar .prio-btn.segment.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}
.prio-toggle {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.prio-btn {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: #64748b;
  box-shadow: none;
}
.prio-btn + .prio-btn { border-left: 1px solid #e2e8f0; }
.prio-btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}
#modal-confirm { z-index: 5000; }
.modal-card-confirm { max-width: 420px; padding: 1.25rem 1.35rem; border-radius: 14px; }
.modal-card-confirm .modal-actions {
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.modal-card-confirm .modal-actions .btn-ghost,
.modal-card-confirm .modal-actions .btn-secondary {
  margin-left: 0;
}
.modal-card-confirm .btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
}
.confirm-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 0.55rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  font-size: 1rem;
}
.confirm-ico { color: #ea580c; font-size: 1.25rem; line-height: 1.2; flex-shrink: 0; }
.confirm-hint {
  margin: 0 0 1.1rem 1.9rem;
  font-size: 0.88rem;
  line-height: 1.4;
}
.btn-danger {
  border: none;
  background: #dc2626;
  color: #fff;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }
.deriv-page { display: flex; flex-direction: column; gap: 1rem; }
.deriv-intro h2 { margin: 0 0 0.35rem; }
.deriv-intro p { margin: 0; }
.card-panel {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 14px;
  padding: 1rem 1.15rem;
}
.deriv-block h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.deriv-table .deriv-pac { font-weight: 800; }
.deriv-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.deriv-badge.is-hacia { background: #dbeafe; color: #1d4ed8; }
.deriv-badge.is-urgente { background: #fee2e2; color: #b91c1c; }
.deriv-badge.is-normal { background: #f1f5f9; color: #475569; }
.deriv-badge.is-pendiente { background: #ffedd5; color: #c2410c; }
.deriv-badge.is-agendada { background: #dcfce7; color: #15803d; }
.deriv-badge.is-cancelada { background: #fee2e2; color: #b91c1c; }
.deriv-hacia-card {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.deriv-hacia-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.deriv-hacia-name { font-weight: 800; font-size: 1.05rem; margin: 0.2rem 0 0.45rem; }
.deriv-hacia-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.875rem; }
.deriv-fecha-field { position: relative; }
.deriv-fecha-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}
.deriv-fecha-btn:hover { border-color: #93c5fd; }
.deriv-fecha-field .top-datepicker,
.deriv-fecha-field .deriv-dp {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
}
.deriv-slots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0 0.65rem;
}
.deriv-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.deriv-slot {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.65rem;
  text-align: left;
  cursor: pointer;
}
.deriv-slot:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(50, 118, 177, 0.12); }
.deriv-slot-hora { display: block; font-weight: 800; color: #0f172a; }
.deriv-slot-meta { display: block; font-size: 0.75rem; color: #94a3b8; margin-top: 0.15rem; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
@media (max-width: 720px) {
  .deriv-slots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.deriv-slots-grid.is-empty {
  display: block;
  border: 1px dashed #dbe3ee;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  background: #f8fafc;
}
.deriv-empty-slots {
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
}
.deriv-empty-ico { font-size: 1.75rem; margin-bottom: 0.35rem; }
.deriv-empty-title { margin: 0 0 0.35rem; font-weight: 800; color: #0f172a; }
.deriv-empty-slots .muted { margin: 0 0 0.9rem; font-size: 0.875rem; }
.sobreturno-pac-locked {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
}
.st-pac-name { font-weight: 800; color: #0f172a; }
.st-pac-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.st-pac-tag {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ?? Caja ?? */
.caja-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.caja-header h2 { margin: 0; }
.caja-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.caja-fecha-wrap,
.caja-user-wrap {
  position: relative;
}
.caja-fecha-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  text-transform: lowercase;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.caja-fecha-btn:hover,
.caja-fecha-btn[aria-expanded="true"] {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.caja-fecha-ico {
  font-size: 0.9rem;
  opacity: 0.7;
}
.caja-datepicker {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 60;
}
.caja-dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.caja-dp-head .top-dp-title {
  flex: 1;
  text-align: center;
}
.caja-dp-foot {
  justify-content: center;
}
.caja-dp-foot button {
  color: #2563eb;
  font-weight: 700;
}
.caja-user-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 14rem;
}
.caja-user-field input {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  font-family: inherit;
}
.caja-user-field input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.caja-user-field input::placeholder { color: #94a3b8; font-weight: 600; }
.caja-user-ico {
  position: absolute;
  right: 0.7rem;
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.95rem;
}
.caja-user-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
}
.caja-user-option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}
.caja-user-option:hover,
.caja-user-option.is-active {
  background: #f1f5f9;
}
.caja-user-empty {
  padding: 0.75rem;
  color: #94a3b8;
  font-size: 0.85rem;
}
.caja-export {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
}
.caja-export-ico { font-size: 1rem; line-height: 1; }
.caja-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1rem;
}
.caja-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  margin-bottom: 0.65rem;
}
.caja-resumen-title {
  font-weight: 700;
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.caja-resumen-total-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}
.caja-resumen-total {
  font-size: 1.75rem;
  font-weight: 800;
  color: #16a34a;
  margin: 0.1rem 0 0.85rem;
  letter-spacing: -0.02em;
}
.caja-resumen-medios {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.caja-resumen-medio-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}
.caja-resumen-medio-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0.15rem;
}
.caja-table .caja-empty {
  text-align: center;
  padding: 1.25rem 0.75rem !important;
}
.caja-table tbody tr:last-child td {
  border-bottom: none;
}
.caja-medios-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.caja-medio-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.caja-medio-pill.is-anulado {
  background: #fee2e2;
  color: #b91c1c;
  text-decoration: line-through;
}
.caja-badge {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}
.caja-badge.is-cobrado {
  background: #dcfce7;
  color: #166534;
}
.caja-badge.is-anulado {
  background: #fee2e2;
  color: #b91c1c;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.blk-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 920px;
}
.blk-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.25rem;
}
.blk-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}
.blk-hint {
  margin: 0.45rem 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #64748b;
  max-width: 46rem;
}
.blk-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.blk-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 1.2fr);
  gap: 0.9rem 1rem;
}
.blk-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.blk-field-full { width: 100%; }
.blk-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}
.blk-req { color: #dc2626; margin-right: 0.15rem; }
.blk-field select,
.blk-field input[type="text"] {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: #0f172a;
}
.blk-field select:focus,
.blk-field input[type="text"]:focus,
.blk-rango input[type="time"]:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.blk-fecha-wrap { width: 100%; }
.blk-fecha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}
.blk-fecha-btn.is-compact {
  width: auto;
  min-width: 9.5rem;
}
.blk-fecha-btn[aria-expanded="true"],
.blk-fecha-btn:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.blk-datepicker { left: 0; right: auto; }
.blk-rango {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.45rem;
  padding: 0.2rem 0.55rem 0.2rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}
.blk-rango input[type="time"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: #0f172a;
  padding: 0.35rem 0.15rem;
}
.blk-rango input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  width: 0;
}
.blk-rango-sep {
  color: #94a3b8;
  font-weight: 600;
  flex: 0 0 auto;
}
.blk-rango-ico {
  opacity: 0.65;
  font-size: 0.95rem;
  flex: 0 0 auto;
}
.blk-actions { margin-top: 0.15rem; }
.blk-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.88rem;
  font-weight: 600;
}
.blk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.blk-table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}
.blk-prof-cell {
  font-weight: 700;
  letter-spacing: 0.01em;
}
.blk-quitar {
  border: 0;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
}
.blk-quitar:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .blk-row { grid-template-columns: 1fr; }
  .blk-card-head { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .caja-resumen-medios { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .caja-resumen-medios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caja-toolbar { width: 100%; }
}

/* ?? Permisos de reportes ?? */
.perm-page { max-width: 1100px; }
.perm-help { margin: 0.25rem 0 0; max-width: 42rem; }
.perm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.perm-search {
  min-width: 12rem;
  flex: 1 1 14rem;
  max-width: 22rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}
.perm-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding-bottom: 2rem;
}
.perm-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
}
.perm-card.is-admin { background: #fffbeb; border-color: #fde68a; }
.perm-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.perm-user-name {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}
.perm-user-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}
.perm-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.perm-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  margin-right: 0.25rem;
}
.perm-all-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 700;
}
.perm-admin-note { margin: 0; font-size: 0.85rem; }
.perm-group + .perm-group { margin-top: 0.75rem; }
.perm-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}
.perm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}
.perm-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.4rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  line-height: 1.25;
}
.perm-check:has(input:checked) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}
.perm-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.perm-check span { word-break: break-word; }

/* ??? Auditor?a ??? */
.aud-page { display: flex; flex-direction: column; gap: 0.85rem; }
.aud-tabs { margin-bottom: 0.15rem; }
.aud-head { margin-bottom: 0; }
.aud-help {
  margin: 0.35rem 0 0;
  max-width: 52rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #94a3b8;
}
.aud-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 0.75rem;
}
.aud-range { min-width: min(100%, 16rem); }
.aud-range .rep-range-btn {
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.55rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border-color: #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
}
.aud-cal-ico {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  opacity: 0.55;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M8 2v3M16 2v3M3.5 9h17M5 5h14a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2z'/%3E%3C/svg%3E");
}
.aud-cat-wrap { position: relative; min-width: 13rem; }
.aud-cat-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid #93c5fd;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.aud-cat-btn.is-open,
.aud-cat-btn:hover { border-color: #60a5fa; }
.aud-cat-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 100%;
  max-height: 18rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.aud-cat-option {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.aud-cat-option:hover { background: #f1f5f9; }
.aud-cat-option.is-active { background: #eff6ff; color: #1d4ed8; }
.aud-table-wrap {
  overflow: auto;
  border-top: 1px solid #eef2f7;
}
.aud-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.aud-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.01em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #eef2f7;
  white-space: nowrap;
}
.aud-table td {
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  vertical-align: middle;
}
.aud-table tbody tr:nth-child(even) { background: #fafbfc; }
.aud-td-fecha { white-space: nowrap; }
.aud-fecha-top { font-weight: 700; line-height: 1.25; }
.aud-fecha-sub { color: #64748b; font-size: 0.85rem; margin-top: 0.1rem; }
.aud-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #334155;
  word-break: break-word;
}
.aud-detalle { max-width: 28rem; }
.aud-ip {
  font-variant-numeric: tabular-nums;
  color: #475569;
  white-space: nowrap;
  text-align: right;
}
.aud-table th:last-child { text-align: right; }
.aud-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.aud-pill-default { background: #f1f5f9; color: #334155; }
.aud-pill-hc { background: #ede9fe; color: #5b21b6; }
.aud-pill-cobros { background: #dcfce7; color: #166534; }
.aud-pill-pacientes { background: #e0f2fe; color: #0369a1; }
.aud-pill-adjuntos { background: #ccfbf1; color: #0f766e; }
.aud-pill-bloqueos { background: #ffedd5; color: #c2410c; }
.aud-pill-turnos { background: #e2e8f0; color: #334155; }
.aud-pill-sesiones { background: #dbeafe; color: #1d4ed8; }
.aud-pill-config { background: #ffedd5; color: #9a3412; }
.aud-pill-abierta { background: #dcfce7; color: #15803d; text-transform: lowercase; }
.aud-empty { padding: 2rem 0.5rem; }
.aud-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0 0.25rem;
}
.aud-page-btn {
  appearance: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.aud-page-btn:hover:not(:disabled) { background: #f8fafc; }
.aud-page-btn:disabled { opacity: 0.4; cursor: default; }
.aud-page-num {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  background: #fff;
}
@media (max-width: 720px) {
  .aud-detalle { max-width: 14rem; }
  .aud-cat-wrap { min-width: min(100%, 13rem); flex: 1; }
  .aud-range { flex: 1; }
}

