/* ═══════════════════════════════════════════════════
   CONSULTORIO AUDITIVO — Design System
   ═══════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────── */
:root {
  /* Colors */
  --clr-primary:       #0a5c8a;
  --clr-primary-dk:    #07456a;
  --clr-primary-lt:    #e6f2fa;
  --clr-accent:        #0891b2;
  --clr-bg:            #eef3f8;
  --clr-surface:       #ffffff;
  --clr-border:        #d0dde8;
  --clr-border-focus:  #0a5c8a;
  --clr-text:          #0f1f2e;
  --clr-text-muted:    #5a7a91;
  --clr-success:       #047857;
  --clr-success-lt:    #d1fae5;
  --clr-danger:        #b91c1c;
  --clr-danger-lt:     #fee2e2;
  --clr-warn:          #92400e;
  --clr-warn-lt:       #fef3c7;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px;  --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;

  /* Shadows */
  --sh-sm: 0 1px 3px rgba(10,92,138,.08);
  --sh-md: 0 4px 12px rgba(10,92,138,.10);
  --sh-lg: 0 8px 24px rgba(10,92,138,.12);

  /* Typography */
  --ff-display: 'Space Grotesk', system-ui, sans-serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;

  /* Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--clr-text);
  /* Base clara y fija (mismo degradado del login) en vez del gris plano */
  background: radial-gradient(120% 90% at 50% -10%, #ffffff 0%, #eef6fc 38%, #e4f0f8 100%) fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Fondo aurora del dashboard ──────────────────── */
/* Dos capas de manchas difuminadas que flotan, detrás de todo el contenido.
   Reutilizan los mismos colores RGBA del login (teal, cyan, violeta, durazno). */
body::before,
body::after {
  content: "";
  position: fixed;        /* cubre la pantalla y no se mueve con el scroll */
  inset: 0;
  z-index: -1;            /* detrás de header, tabs, cards... */
  pointer-events: none;   /* nunca estorba los clics */
}
body::before {
  background:
    radial-gradient(circle at 12% 15%, rgba(63,196,178,.40), transparent 45%),
    radial-gradient(circle at 88% 10%, rgba(46,168,224,.38), transparent 45%);
  animation: auroraA 24s var(--ease) infinite alternate;
}
body::after {
  background:
    radial-gradient(circle at 22% 92%, rgba(150,135,240,.30), transparent 45%),
    radial-gradient(circle at 82% 88%, rgba(255,190,150,.28), transparent 45%);
  animation: auroraB 28s var(--ease) infinite alternate;
}
@keyframes auroraA {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(40px, 30px, 0); }
}
@keyframes auroraB {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-40px, -30px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none !important; }
}

/* ── Header ──────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Cristal translúcido: deja entrever el aurora al hacer scroll */
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 6px 24px -12px rgba(13, 90, 135, .25);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform .15s ease;
}
.brand:hover { transform: translateY(-1px); }
.brand:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.brand-logo {
  height: 56px;
  width: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 640px) {
  .brand-logo { height: 44px; }
}

.header-date {
  font-family: var(--ff-display);
  font-size: .82rem;
  color: var(--clr-text-muted);
  font-weight: 500;
}

/* ── Main layout ─────────────────────────────────── */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) var(--sp-12);
}

/* ── Tabs ────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-lg);
  padding: var(--sp-1);
  box-shadow: 0 10px 28px -18px rgba(13,90,135,.35);
  margin-bottom: var(--sp-6);
  width: fit-content;
}

.tab {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--clr-text-muted);
  font-family: var(--ff-display);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms var(--ease);
  white-space: nowrap;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--clr-primary); background: var(--clr-primary-lt); }
.tab.active {
  background: linear-gradient(120deg, #0a466b, #1b76b8 60%, #23a7d6);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(13,90,135,.6);
}

/* ── Tab panels ──────────────────────────────────── */
.tab-panel { animation: fadeUp .3s var(--ease) both; }
.tab-panel.hidden { display: none; }

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

/* ── Cards ───────────────────────────────────────── */
.card {
  /* Cristal esmerilado: fondo translúcido + desenfoque del fondo aurora */
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 20px 50px -24px rgba(13,90,135,.40),
    0 6px 18px -14px rgba(13,90,135,.30);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.card:focus-within {
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 26px 60px -24px rgba(13,90,135,.50),
    0 8px 22px -14px rgba(13,90,135,.38);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1.5px solid var(--clr-border);
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--clr-primary-lt);
  display: grid;
  place-items: center;
  color: var(--clr-primary);
  flex-shrink: 0;
}
.card-icon svg { width: 18px; height: 18px; }

.card-header h2 {
  font-family: var(--ff-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--clr-text);
}

/* ── Form grid ───────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5) var(--sp-6);
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field-full { grid-column: 1 / -1; }

.row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5) var(--sp-6);
}
@media (max-width: 640px) {
  .row-3 { grid-template-columns: 1fr; }
}

/* ── Field + Label ───────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--sp-1); }

label {
  font-family: var(--ff-display);
  font-size: .8rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.req { color: var(--clr-danger); }

.field-err {
  font-size: .75rem;
  color: var(--clr-danger);
  min-height: 1rem;
  display: block;
}

/* ── Inputs ──────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="time"],
textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  background: #f8fbfd;
  font-family: var(--ff-body);
  font-size: .95rem;
  color: var(--clr-text);
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
  outline: none;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
input[type="number"]:hover,
input[type="time"]:hover,
textarea:hover { border-color: #a0b8cc; }

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
textarea:focus {
  border-color: var(--clr-border-focus);
  box-shadow: 0 0 0 3px rgba(10,92,138,.12);
  background: #fff;
}

input.invalid, textarea.invalid {
  border-color: var(--clr-danger);
  box-shadow: 0 0 0 3px rgba(185,28,28,.1);
}

/* Uppercase display for inputs */
.ucase { text-transform: uppercase; }
.ucase::placeholder { text-transform: none; opacity: .5; }

textarea { resize: vertical; min-height: 90px; }

/* ── Select ──────────────────────────────────────── */
.select-wrap { position: relative; }

select {
  width: 100%;
  padding: var(--sp-3) var(--sp-10) var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  background: #f8fbfd;
  font-family: var(--ff-body);
  font-size: .95rem;
  color: var(--clr-text);
  appearance: none;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
}
select:focus {
  border-color: var(--clr-border-focus);
  box-shadow: 0 0 0 3px rgba(10,92,138,.12);
  background: #fff;
}
.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--clr-text-muted);
  pointer-events: none;
}

/* ── Currency field ──────────────────────────────── */
.currency-field {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #f8fbfd;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.currency-field:focus-within {
  border-color: var(--clr-border-focus);
  box-shadow: 0 0 0 3px rgba(10,92,138,.12);
  background: #fff;
}
.currency-sign {
  padding: 0 var(--sp-3) 0 var(--sp-4);
  color: var(--clr-text-muted);
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
  border-right: 1.5px solid var(--clr-border);
  background: #eef3f8;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.currency-field input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
}

/* ── Services grid ───────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
}

.service-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: var(--ff-display);
  font-size: .82rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  transition: all 160ms var(--ease);
  user-select: none;
}
.service-chip:hover {
  border-color: var(--clr-accent);
  color: var(--clr-primary);
  background: var(--clr-primary-lt);
}
.service-chip input[type="checkbox"] { display: none; }

.chip-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--clr-border);
  border-radius: 5px;
  flex-shrink: 0;
  position: relative;
  transition: all 160ms var(--ease);
}
.chip-check::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 2px;
  background: var(--clr-primary);
  transform: scale(0);
  transition: transform 150ms var(--ease);
}

.service-chip:has(input:checked) {
  border-color: var(--clr-primary);
  background: var(--clr-primary-lt);
  color: var(--clr-primary);
}
.service-chip:has(input:checked) .chip-check {
  border-color: var(--clr-primary);
}
.service-chip:has(input:checked) .chip-check::after {
  transform: scale(1);
}

/* ── Sub-options (pila / moldes) ─────────────────── */
.suboptions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  background: var(--clr-primary-lt);
  border: 1.5px solid #b3d4ea;
  border-radius: var(--r-md);
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-3);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  transition: max-height .3s var(--ease), opacity .25s var(--ease), padding .25s var(--ease), border-width .1s;
}
.suboptions.open {
  max-height: 120px;
  opacity: 1;
  padding: var(--sp-4) var(--sp-5);
  border-width: 1.5px;
}

.suboptions-label {
  font-family: var(--ff-display);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-primary);
  white-space: nowrap;
}

.radio-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.radio-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4);
  border: 1.5px solid #b3d4ea;
  border-radius: var(--r-full);
  cursor: pointer;
  font-family: var(--ff-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--clr-primary);
  transition: all 140ms;
  user-select: none;
}
.radio-pill input[type="radio"] { display: none; }
.radio-pill:hover { background: #fff; border-color: var(--clr-primary); }
.radio-pill:has(input:checked) {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
}

/* ── Form actions ────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary,
.btn-ghost,
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  font-family: var(--ff-display);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms var(--ease);
  border: none;
  outline: none;
}
.btn-primary svg, .btn-export svg { width: 16px; height: 16px; }

.btn-primary {
  position: relative;
  overflow: hidden;
  /* Gradiente navy → azul → cyan (mismo del botón del login) */
  background: linear-gradient(120deg, #0a466b, #1b76b8 60%, #23a7d6);
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(13,90,135,.7), 0 2px 0 rgba(255,255,255,.18) inset;
}
/* Barrido de luz que cruza el botón al pasar el mouse */
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.30), transparent);
  transform: translateX(-130%);
  transition: transform .6s var(--ease);
  pointer-events: none;
}
.btn-primary:hover {
  box-shadow: 0 20px 34px -14px rgba(13,90,135,.78), 0 2px 0 rgba(255,255,255,.18) inset;
  transform: translateY(-2px);
}
.btn-primary:hover::before { transform: translateX(130%); }
.btn-primary:active { transform: translateY(0) scale(.99); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border: 1.5px solid var(--clr-border);
}
.btn-ghost:hover { background: #f0f4f8; color: var(--clr-text); border-color: #a0b8cc; }

.btn-export {
  background: var(--clr-success);
  color: #fff;
  box-shadow: var(--sh-sm);
}
.btn-export:hover { background: #036847; box-shadow: var(--sh-md); transform: translateY(-1px); }

/* ── History toolbar ─────────────────────────────── */
.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  align-items: center;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--clr-text-muted);
  pointer-events: none;
}
.search-wrap input {
  padding-left: 36px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--clr-text-muted);
}
.date-range input { width: 145px; }

/* ── Data table ──────────────────────────────────── */
.table-wrap {
  /* Más opaco que las cards: prioriza la legibilidad de los datos */
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 20px 50px -24px rgba(13,90,135,.38);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table thead tr {
  background: linear-gradient(120deg, #0a466b, #1b76b8 60%, #23a7d6);
}
.data-table thead th {
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--ff-display);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.85);
  text-align: left;
  white-space: nowrap;
}
.data-table thead th:first-child { border-radius: var(--r-md) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--r-md) 0 0; }

.data-table tbody tr {
  border-bottom: 1px solid var(--clr-border);
  transition: background 120ms;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--clr-primary-lt); }

.data-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--clr-text);
  vertical-align: top;
}
.data-table tbody td:first-child {
  color: var(--clr-text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.badge-list { display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--clr-primary-lt);
  color: var(--clr-primary);
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

.monto-cell { font-weight: 600; color: var(--clr-success); font-variant-numeric: tabular-nums; }

.btn-row {
  display: flex;
  gap: var(--sp-1);
  justify-content: flex-end;
}
.btn-icon {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--clr-text-muted);
  transition: all 140ms;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon.view:hover { background: var(--clr-primary-lt); color: var(--clr-primary); }
.btn-icon.del:hover  { background: var(--clr-danger-lt);  color: var(--clr-danger); }

/* Empty state */
.empty-state td { padding: var(--sp-12) !important; text-align: center; }
.empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  color: var(--clr-text-muted);
}
.empty-inner svg { width: 48px; height: 48px; color: var(--clr-border); }
.empty-inner span { font-size: .9rem; }

.records-count {
  margin-top: var(--sp-3);
  font-size: .8rem;
  color: var(--clr-text-muted);
  text-align: right;
}

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  font-family: var(--ff-display);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.success { background: var(--clr-success); color: #fff; }
.toast.error   { background: var(--clr-danger);  color: #fff; }
.toast.warn    { background: var(--clr-warn);    color: #fff; }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,30,50,.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  animation: fadeIn .2s both;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 40px 80px -30px rgba(13,90,135,.5);
  animation: fadeUp .25s var(--ease) both;
}

.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 32px;
  height: 32px;
  border: none;
  background: var(--clr-bg);
  border-radius: var(--r-full);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--clr-text-muted);
  transition: all 140ms;
}
.modal-close:hover { background: var(--clr-danger-lt); color: var(--clr-danger); }
.modal-close svg { width: 18px; height: 18px; }

.modal h3 {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1.5px solid var(--clr-border);
}

/* Cabecera de modal con titulo + boton de cerrar (modal de citas) */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1.5px solid var(--clr-border);
}
.modal-header span {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-primary);
}

.modal-body { display: flex; flex-direction: column; gap: var(--sp-3); }

.modal-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--sp-2);
  align-items: baseline;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid #f0f4f8;
}
.modal-row:last-child { border-bottom: none; }

.modal-key {
  font-family: var(--ff-display);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-text-muted);
}
.modal-val {
  font-size: .9rem;
  color: var(--clr-text);
  font-weight: 500;
}

/* ── Responsive tweaks ───────────────────────────── */
@media (max-width: 768px) {
  .history-toolbar { flex-direction: column; align-items: stretch; }
  .date-range { justify-content: center; }
  .form-actions { flex-direction: column-reverse; }
  .btn-primary, .btn-ghost { justify-content: center; }
  .modal-row { grid-template-columns: 1fr; gap: var(--sp-1); }
  .modal-key { font-size: .68rem; }
  .header-inner { padding: var(--sp-2) var(--sp-4); }
}

@media (max-width: 480px) {
  .main { padding: var(--sp-4) var(--sp-3) var(--sp-10); }
  .card { padding: var(--sp-4); }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
}

/* ── File protocol warning banner ────────────────── */
.file-warning {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  background: var(--clr-warn-lt);
  border-bottom: 2px solid #d97706;
  color: var(--clr-warn);
  font-size: .9rem;
  line-height: 1.5;
}
.file-warning.hidden { display: none; }
.file-warning svg {
  width: 24px; height: 24px;
  flex-shrink: 0;
  color: #d97706;
}
.file-warning code {
  background: rgba(146, 64, 14, .12);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 600;
}
.file-warning a {
  color: var(--clr-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Minor alert section ─────────────────────────── */
.minor-alert {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  background: #fff7ed;
  border: 1.5px solid #f59e0b;
  border-radius: var(--r-md);
  animation: fadeUp .25s var(--ease) both;
}
.minor-alert.hidden { display: none; }

.minor-alert-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-family: var(--ff-display);
  font-size: .85rem;
  font-weight: 600;
  color: #92400e;
}
.minor-alert-header svg {
  width: 20px; height: 20px;
  color: #f59e0b;
  flex-shrink: 0;
}

/* ── Ear visual indicators ───────────────────────── */
.ear-visual {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  min-height: 40px;
}

.ear-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-full);
  font-family: var(--ff-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.ear-badge.hidden { display: none; }

.ear-badge.ear-left {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1.5px solid #93c5fd;
}
.ear-badge.ear-right {
  background: #fce7f3;
  color: #be185d;
  border: 1.5px solid #f9a8d4;
}

/* ── Ear fields wrapper (inside services card) ───── */
.ear-fields-wrap {
  margin-top: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--clr-border);
  animation: fadeUp .25s var(--ease) both;
}
.ear-fields-wrap.hidden { display: none; }

/* ── Dual ear panels ─────────────────────────────── */
.ear-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

@media (max-width: 640px) {
  .ear-panels { grid-template-columns: 1fr; }
}

.ear-panel {
  padding: var(--sp-4);
  background: #f8fbfd;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
}

.ear-panel-header {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--clr-border);
}

.ear-panel .form-grid {
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

/* ── Age display field ───────────────────────────── */
#edadDisplay {
  background: var(--clr-primary-lt);
  color: var(--clr-primary);
  font-weight: 600;
  font-family: var(--ff-display);
  cursor: default;
}

/* ── Focus visible ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════ */
.login-overlay {
  --cyan:#23a7d6; --blue:#1b76b8; --navy-deep:#0a466b;
  --ink:#13344a; --lmuted:#6b8597;
  --lline:rgba(13,90,135,.14); --lfield:rgba(255,255,255,.66); --lcard:rgba(255,255,255,.62);
  --lease:cubic-bezier(.22,1,.36,1);
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  overflow: hidden;
  isolation: isolate;
  font-family: 'Plus Jakarta Sans', var(--ff-text), system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% -10%, #ffffff 0%, #eef6fc 38%, #e4f0f8 100%);
}
.login-overlay.hidden { display: none; }

/* Fondo aurora: blobs de color difuminados que flotan */
.login-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.login-blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.lb1 { width:780px;height:780px;left:-12%;top:-22%;
  background:radial-gradient(circle at 30% 30%, rgba(63,196,178,.55), rgba(63,196,178,0) 62%);
  animation:ldrift1 22s var(--lease) infinite alternate; }
.lb2 { width:860px;height:860px;right:-16%;top:-12%;
  background:radial-gradient(circle at 50% 50%, rgba(46,168,224,.5), rgba(46,168,224,0) 60%);
  animation:ldrift2 26s var(--lease) infinite alternate; }
.lb3 { width:720px;height:720px;left:18%;bottom:-26%;
  background:radial-gradient(circle at 50% 50%, rgba(150,135,240,.38), rgba(150,135,240,0) 62%);
  animation:ldrift3 28s var(--lease) infinite alternate; }
.lb4 { width:680px;height:680px;right:6%;bottom:-22%;
  background:radial-gradient(circle at 50% 50%, rgba(255,190,150,.36), rgba(255,190,150,0) 62%);
  animation:ldrift1 24s var(--lease) infinite alternate-reverse; }
@keyframes ldrift1{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(60px,40px,0) scale(1.12)}}
@keyframes ldrift2{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(-70px,30px,0) scale(1.08)}}
@keyframes ldrift3{from{transform:translate3d(0,0,0) scale(1)}to{transform:translate3d(40px,-50px,0) scale(1.14)}}

/* Tarjeta con efecto glassmorphism */
.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  background: var(--lcard);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
  padding: 40px 38px 34px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 30px 70px -28px rgba(13,90,135,.45),
    0 8px 24px -16px rgba(13,90,135,.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  animation: lcardIn .9s var(--lease);
}
@keyframes lcardIn{from{transform:translateY(26px) scale(.97);opacity:0}to{transform:none;opacity:1}}

.login-logo {
  height: 78px;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(13,90,135,.18));
  margin-bottom: var(--sp-1);
}

.login-card form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Campos del login con el estilo del nuevo diseño */
.login-card .field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lmuted);
  margin-bottom: 8px;
  padding-left: 2px;
}
.login-card .field input[type="text"],
.login-card .field input[type="password"] {
  width: 100%;
  height: 48px;
  background: var(--lfield);
  border: 1px solid var(--lline);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: none;
  transition: border-color .25s var(--lease), box-shadow .25s var(--lease), background .25s;
}
.login-card .field input::placeholder { color: var(--lmuted); opacity: .75; }
.login-card .field input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(46,168,224,.16);
  background: rgba(255,255,255,.85);
}

/* Password field with toggle */
.pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pass-wrap input {
  padding-right: 44px;
}
.pass-toggle {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--clr-text-muted);
  transition: all 140ms;
}
.pass-toggle:hover { color: var(--clr-primary); background: var(--clr-primary-lt); }
.pass-toggle svg { width: 18px; height: 18px; }
.pass-toggle .hidden { display: none; }

/* File warning inside login card */
.login-file-warn {
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  font-size: .82rem;
  color: #92400e;
  line-height: 1.5;
  width: 100%;
}
.login-file-warn.hidden { display: none; }
.login-file-warn svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: #d97706;
  margin-top: 2px;
}
.login-file-warn code {
  background: rgba(146,64,14,.12);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .8rem;
  font-weight: 600;
}
.login-file-warn a {
  color: var(--clr-primary);
  font-weight: 700;
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: var(--sp-4) var(--sp-6);
  font-size: 1rem;
  margin-top: var(--sp-2);
}

/* ═══════════════════════════════════════════════════
   LOGOUT BUTTON
   ═══════════════════════════════════════════════════ */
.header-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--clr-text-muted);
  font-family: var(--ff-display);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.btn-logout svg { width: 14px; height: 14px; }
.btn-logout:hover {
  background: var(--clr-danger-lt);
  border-color: var(--clr-danger);
  color: var(--clr-danger);
}

/* ═══════════════════════════════════════════════════
   TICKET
   ═══════════════════════════════════════════════════ */
.ticket-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-12) var(--sp-6);
  color: var(--clr-text-muted);
}
.ticket-empty svg { width: 64px; height: 64px; color: var(--clr-border); }
.ticket-empty p { font-size: .95rem; }

.ticket-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ticket-content.hidden { display: none; }

.ticket-print {
  width: 100%;
  max-width: 380px;
  padding: var(--sp-6);
  border: 2px dashed var(--clr-border);
  border-radius: var(--r-md);
  background: #fafcfe;
}

.ticket-header {
  text-align: center;
  margin-bottom: var(--sp-4);
}
.ticket-logo {
  height: 50px;
  width: auto;
  display: inline-block;
  margin-bottom: var(--sp-2);
}
.ticket-biz {
  font-family: var(--ff-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--clr-primary);
  letter-spacing: .05em;
}
.ticket-date {
  font-size: .72rem;
  color: var(--clr-text-muted);
  margin-top: var(--sp-1);
}

.ticket-divider {
  border-top: 1px dashed var(--clr-border);
  margin: var(--sp-4) 0;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.ticket-label {
  font-family: var(--ff-display);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--clr-text-muted);
  white-space: nowrap;
}
.ticket-value {
  font-size: .85rem;
  font-weight: 500;
  color: var(--clr-text);
  text-align: right;
}
.ticket-total .ticket-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-success);
}
.ticket-id .ticket-value {
  font-family: var(--ff-display);
  color: var(--clr-text-muted);
}

.ticket-footer {
  text-align: center;
  font-size: .78rem;
  color: var(--clr-text-muted);
  font-style: italic;
  margin-top: var(--sp-2);
}

/* ── Print ───────────────────────────────────────── */
@media print {
  /* Ocultar todo */
  body * { visibility: hidden; display: none; }

  /* Forzar visibilidad del ticket y sus ancestros */
  body,
  #appContainer,
  #appContainer > main,
  #panel-ticket,
  #ticketCard,
  #ticketContent,
  .ticket-print,
  .ticket-print * {
    display: block !important;
    visibility: visible !important;
  }

  /* Ocultar elementos que no son el ticket */
  header, nav, .tabs, .history-toolbar, .form-actions,
  .toast, .modal-overlay, #ticketEmpty, #printTicketBtn,
  #panel-form, #panel-history, #panel-clientes,
  .login-overlay, .file-warning, #logoutBtn, .header-meta {
    display: none !important;
  }

  @page { margin: 0; padding: 0; }

  html, body {
    width: 57mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .ticket-print {
    position: static !important;
    width: 57mm !important;
    padding: 2mm !important;
    margin: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-family: monospace !important;
  }

  .ticket-header { display: none !important; }
  .ticket-logo { display: none !important; }
  .ticket-date { display: none !important; }
  .ticket-divider { display: none !important; }
  .ticket-body { margin: 0 !important; }
  .ticket-row { margin: 0 !important; padding: 0 !important; }
  .ticket-label { display: none !important; }
  .ticket-value { display: none !important; }
  .ticket-total { display: none !important; }
  .ticket-id { display: none !important; }
  .ticket-footer { display: none !important; }
}

/* ── Badge clickeable (clientes → visitas) ──────── */
.badge-link {
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 150ms var(--ease);
  font-family: var(--ff-display);
}
.badge-link:hover {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary-dk);
  transform: scale(1.1);
}

/* ── Badges de rol ─────────────────────────────── */
.badge-admin {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
  font-weight: 600;
}
.badge-recep {
  background: var(--clr-primary-lt);
  color: var(--clr-primary);
  border: 1px solid var(--clr-border);
  font-weight: 600;
}
.badge-you {
  background: var(--clr-success-lt);
  color: var(--clr-success);
  border: 1px solid #6ee7b7;
  font-size: .65rem;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.user-self {
  background: #f0fdf4;
}

/* ── Visitas modal ──────────────────────────────── */
.visitas-header {
  font-family: var(--ff-display);
  font-size: .95rem;
  color: var(--clr-text);
  padding-bottom: var(--sp-3);
  border-bottom: 1.5px solid var(--clr-border);
  margin-bottom: var(--sp-3);
}

.visitas-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.visita-card {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #f8fbfd;
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  transition: border-color 150ms;
}
.visita-card:hover {
  border-color: var(--clr-primary);
}

.visita-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--clr-primary);
  color: #fff;
  border-radius: var(--r-full);
  font-family: var(--ff-display);
  font-size: .72rem;
  font-weight: 700;
}

.visita-info {
  flex: 1;
  min-width: 0;
}

.visita-top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-1);
}

.visita-fecha {
  font-family: var(--ff-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--clr-text);
}

.visita-folio {
  font-family: var(--ff-display);
  font-size: .7rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  background: var(--clr-bg);
  padding: 1px 8px;
  border-radius: var(--r-full);
}

.visita-monto {
  margin-left: auto;
  font-family: var(--ff-display);
  font-size: .85rem;
  font-weight: 700;
  color: var(--clr-success);
  font-variant-numeric: tabular-nums;
}

.visita-servicios {
  font-size: .78rem;
  font-weight: 600;
  color: var(--clr-primary);
  margin-bottom: var(--sp-1);
}

.visita-detalles {
  font-size: .72rem;
  color: var(--clr-text-muted);
  line-height: 1.4;
}

.visita-comentarios {
  font-size: .72rem;
  color: var(--clr-text-muted);
  font-style: italic;
  margin-top: var(--sp-1);
  padding-top: var(--sp-1);
  border-top: 1px dashed var(--clr-border);
}

/* ── Calendario de citas ────────────────────────── */
.gcal-banner {
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: .82rem;
  min-height: 2rem;
}
.gcal-ok   { color: var(--clr-success); }
.gcal-warn { color: var(--clr-warn); }
.gcal-dot  {
  display: inline-block; width: 6px; height: 6px;
  background: #4285f4; border-radius: 50%; margin-left: 4px; vertical-align: middle;
}
.btn-gcal-connect {
  background: #4285f4; color: #fff; border: none; border-radius: var(--r-sm);
  padding: 3px 12px; font-size: .82rem; cursor: pointer; margin-left: 8px;
}
.btn-gcal-connect:hover { background: #3367d6; }

.cal-nav {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.cal-week-label {
  flex: 1; font-family: var(--ff-display); font-size: .95rem;
  font-weight: 600; color: var(--clr-text); text-align: center;
}
.btn-cal-nav {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--r-sm); width: 32px; height: 32px; font-size: 1.2rem;
  cursor: pointer; color: var(--clr-text); display: flex; align-items: center; justify-content: center;
}
.btn-cal-nav:hover { background: var(--clr-primary-lt); }
.btn-nueva-cita { margin-left: auto; white-space: nowrap; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-2); margin-bottom: var(--sp-4);
}
@media (max-width: 768px) { .cal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .cal-grid { grid-template-columns: repeat(2, 1fr); } }

.cal-col {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--r-md); min-height: 120px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cal-col:hover   { border-color: var(--clr-primary); }
.cal-col.cal-hoy { border-color: var(--clr-primary); background: var(--clr-primary-lt); }
.cal-col.cal-selected { border-color: var(--clr-primary); box-shadow: 0 0 0 2px var(--clr-primary-lt); }

.cal-col-header {
  padding: var(--sp-2) var(--sp-3);
  display: flex; flex-direction: column; align-items: center;
  border-bottom: 1px solid var(--clr-border);
}
.cal-dia-nombre { font-size: .7rem; color: var(--clr-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-dia-num    { font-family: var(--ff-display); font-size: 1.1rem; font-weight: 700; color: var(--clr-text); }
.cal-hoy-num    { color: var(--clr-primary); }

.cal-citas {
  padding: var(--sp-2);
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cita-chip {
  background: var(--clr-primary); color: #fff;
  border-radius: var(--r-sm); padding: 2px 6px;
  font-size: .7rem; cursor: pointer; display: flex; align-items: center; gap: 4px;
  transition: background .1s;
}
.cal-cita-chip:hover { background: var(--clr-primary-dk); }
.cal-hora    { font-weight: 700; white-space: nowrap; }
.cal-paciente{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-libre   { font-size: .7rem; color: var(--clr-text-muted); text-align: center; padding: 4px 0; }
.btn-add-cita {
  margin-top: 2px; background: none; border: 1px dashed var(--clr-border);
  border-radius: var(--r-sm); color: var(--clr-text-muted); font-size: .85rem;
  cursor: pointer; padding: 1px 0; width: 100%; transition: all .15s;
}
.btn-add-cita:hover { background: var(--clr-primary-lt); border-color: var(--clr-primary); color: var(--clr-primary); }

.btn-icon-close {
  margin-left: auto; background: none; border: none; font-size: 1.1rem;
  cursor: pointer; color: var(--clr-text-muted); padding: 2px 6px;
}
.btn-icon-close:hover { color: var(--clr-danger); }

/* Detalle de cita */
.cita-detail     { padding: var(--sp-4) var(--sp-4) var(--sp-2); }
.cita-detail p   { margin: 0 0 var(--sp-2); font-size: .9rem; color: var(--clr-text); }
.cita-detail-actions {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
}
.btn-whatsapp {
  background: #25d366; color: #fff; border: none; border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-4); font-size: .85rem; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-whatsapp:hover { background: #1da851; }
.btn-danger-sm {
  background: var(--clr-danger-lt); color: var(--clr-danger); border: 1px solid var(--clr-danger);
  border-radius: var(--r-md); padding: var(--sp-2) var(--sp-4); font-size: .85rem;
  cursor: pointer;
}
.btn-danger-sm:hover { background: var(--clr-danger); color: #fff; }

/* ── Transferencia de datos (USB) ───────────────── */
.transfer-desc {
  font-size: .85rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}
.transfer-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ── Hidden utility ─────────────────────────────── */
.hidden { display: none !important; }
