/* Citalma — panel de gestión. Responsive: móvil (<640), tablet (640-1023), escritorio (≥1024) */
:root {
  --brand: #087a63;
  --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #f6f3f1;
  --surface: #ffffff;
  --surface-2: #faf8f7;
  --ink: #1f1a1d;
  --muted: #6d646b;
  --line: #e9e3e0;
  --ok: #1f8a5b;
  --warn: #b7791f;
  --danger: #c0392b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(30, 20, 25, .05), 0 6px 24px rgba(30, 20, 25, .06);
  --sidebar: 248px;
  --topbar: 60px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #161214;
  --surface: #211b1e;
  --surface-2: #2a2326;
  --ink: #f3eef0;
  --muted: #a99ea5;
  --line: #3a3135;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.capfirst { display: inline-block; }
.capfirst::first-letter { text-transform: uppercase; }
.svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow-y: auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 1.05rem; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: .93rem;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 6px; }
.sidebar-foot .btn { justify-content: flex-start; }
.trial { background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; font-size: .82rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.15rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-btn { display: none; }
.content { padding: 22px 24px 40px; flex: 1; min-width: 0; }
.bottom-nav { display: none; }

/* ---------- Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--ink);
  min-height: 40px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: .84rem; }
.btn.icon { padding: 8px; min-width: 40px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

.field { display: grid; gap: 5px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 9px 11px; min-height: 42px; outline: none;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; align-items: center; gap: 9px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: transparent; }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: transparent; }
.badge.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: transparent; }
.badge.accent { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.alert { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); font-size: .88rem; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.alert.info { background: var(--brand-soft); color: var(--ink); font-weight: 500; }

.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; flex: none; }

table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .svg { width: 36px; height: 36px; margin-bottom: 8px; opacity: .6; }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: var(--muted); }

.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .86rem; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: .84rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 12, 16, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 11px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); animation: pop .2s; max-width: 90vw; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Autocompletar cliente ---------- */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 5; max-height: 240px; overflow-y: auto; }
.ac-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.ac-item:hover, .ac-item.sel { background: var(--surface-2); }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.agenda-bar .date-title { font-weight: 800; font-size: 1.05rem; min-width: 0; }
.agenda-bar .spacer { flex: 1; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 190px); position: relative; }
.cal-grid { display: grid; position: relative; min-width: 100%; }
.cal-head { position: sticky; top: 0; z-index: 4; display: contents; }
.cal-head-cell { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 8px; font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 8px; justify-content: center; text-align: center; }
.cal-head-cell.corner { left: 0; z-index: 6; }
.cal-head-cell .count { font-weight: 600; color: var(--muted); font-size: .76rem; }
.cal-head-cell.today { color: var(--brand); }
.cal-times { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.cal-time { position: absolute; right: 8px; font-size: .74rem; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-right: 1px solid var(--line); cursor: copy; }
.cal-col:last-child { border-right: 0; }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.cal-line.half { border-top-style: dashed; opacity: .6; }
.cal-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, transparent 6px, transparent 12px); pointer-events: none; }
.cal-block { position: absolute; left: 3px; right: 3px; border-radius: 8px; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--muted) 14%, transparent), color-mix(in srgb, var(--muted) 14%, transparent) 5px, transparent 5px, transparent 10px); border: 1px dashed color-mix(in srgb, var(--muted) 50%, transparent); font-size: .75rem; padding: 4px 6px; color: var(--muted); font-weight: 600; cursor: pointer; overflow: hidden; z-index: 1; }
.cal-ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; font-size: .78rem; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 2;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 4px solid var(--c); color: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 26%, var(--surface)); }
.cal-ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.cancelada { opacity: .45; text-decoration: line-through; }
.cal-ev.completada { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.cal-ev.pendiente { border-left-style: dashed; }
.cal-ev .ev-pausa { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: 0 6px; font-size: .7rem; font-weight: 700; color: var(--muted); cursor: copy; z-index: 1;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--surface) 85%, transparent) 0 5px, transparent 5px 10px); border-top: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); border-bottom: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); }
.cal-ev .ev-pausa .svg { width: 12px; height: 12px; }
.cal-ev .ev-pausa:hover { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); }
.cal-ev.en-pausa { left: 34%; z-index: 4; box-shadow: 0 0 0 2px var(--surface), 0 4px 12px rgba(0,0,0,.12); }
.cal-ev .ev-icons { position: absolute; top: 4px; right: 5px; display: flex; gap: 3px; }
.cal-ev .ev-icons .svg { width: 13px; height: 13px; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.legend-row span { display: inline-flex; gap: 6px; align-items: center; }

/* Lista de citas (vista móvil "Lista") */
.day-list .list-item { align-items: stretch; }
.day-list .hour { width: 56px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.day-list .bar { width: 4px; border-radius: 4px; flex: none; }

/* ---------- Gráficos ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar-mark { fill: var(--brand); }
.chart .bar-mark:hover, .chart .bar-hit:hover + .bar-mark { fill: color-mix(in srgb, var(--brand) 75%, var(--ink)); }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .8rem; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); font-weight: 600; z-index: 5; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; padding: 6px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, var(--brand-soft), transparent), var(--bg); }
.auth .card { width: min(430px, 100%); padding: 28px; }
.auth h1 { margin: 14px 0 4px; }

/* ---------- Horario ---------- */
.horario-row { display: grid; grid-template-columns: 110px auto 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.horario-row:last-child { border-bottom: 0; }
.tramos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tramo { display: flex; gap: 4px; align-items: center; }
.tramo input { width: 120px; }

code.copy { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .8rem; word-break: break-all; }

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 16px 10px; align-items: center; }
  .sidebar .brand span, .nav a span, .sidebar-foot .trial, .sidebar-foot .btn span { display: none; }
  .sidebar .brand { padding: 4px 0 16px; }
  .nav a { justify-content: center; padding: 12px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Móvil ---------- */
@media (max-width: 639px) {
  body { font-size: 15px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-105%); transition: transform .22s; align-items: stretch; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .sidebar .brand span, .nav a span, .sidebar-foot .trial, .sidebar-foot .btn span { display: initial; }
  .nav a { justify-content: flex-start; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .content { padding: 14px 12px 96px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi { padding: 12px 14px; }
  .kpi .value { font-size: 1.3rem; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav .svg { width: 22px; height: 22px; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .cal { max-height: calc(100vh - 230px); }
  .horario-row { grid-template-columns: 1fr auto; }
  .horario-row .tramos { grid-column: 1 / -1; }
  .tramo input { width: 96px; }
  .hide-mobile { display: none !important; }
  .card-head, .list-item { padding-left: 14px; padding-right: 14px; }
  .toolbar input[type=search] { flex: 1 1 100%; max-width: none !important; }
  .toolbar input[type=date] { flex: 1 1 0; min-width: 0; width: auto; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table.responsive td { border: 0; padding: 2px 0; }
  .table.responsive td.num { text-align: right; }
}
@media (min-width: 640px) { .only-mobile { display: none !important; } }

/* ---------- Superadmin «entrar como» ---------- */
.imp-bar { display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: #1f1a1d; color: #fff; font-size: .88rem; flex-wrap: wrap; }
.imp-bar span { flex: 1; min-width: 200px; }
.imp-bar .btn { background: #fff; color: #1f1a1d; border-color: #fff; }

/* ---------- Planes ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plans.plans-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .plans.plans-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .plans.plans-4 { grid-template-columns: minmax(0, 1fr); } }
.alert.oferta { align-items: center; }
.plan-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.plan-card.actual { border: 2px solid var(--brand); }
.plan-card.pop:not(.actual) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.plan-card .precio { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.plan-card .precio small { font-size: .85rem; color: var(--muted); font-weight: 600; }
.plan-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .9rem; }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; }
.plan-card li .svg { width: 16px; height: 16px; color: var(--ok); margin-top: 3px; }
.plan-card .btn { margin-top: auto; }
.plan-tag { position: absolute; top: -11px; left: 18px; background: var(--brand); color: var(--brand-ink); font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.estado-cuenta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.estado-cuenta .grow { flex: 1; min-width: 220px; }

/* ---------- Superadmin ---------- */
.admin-row { cursor: pointer; }
.admin-row:hover td { background: var(--surface-2); }
.kpi.mini .value { font-size: 1.3rem; }

@media (max-width: 1023px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .imp-bar { padding: 8px 14px; }
}

/* ---------- Fotos y consentimientos ---------- */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.foto { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; aspect-ratio: 1; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .badge { position: absolute; top: 6px; left: 6px; }
.foto small { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: .7rem; padding: 10px 6px 4px; text-align: left; }
.doc-texto { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: .9rem; max-height: 34vh; overflow-y: auto; line-height: 1.55; }
canvas.firma { width: 100%; height: 170px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.estrellas { color: #f5a623; letter-spacing: 1px; font-size: 1rem; white-space: nowrap; }
.estrellas span { color: var(--line); }

@media (max-width: 639px) {
  .espera-item { flex-wrap: wrap; }
  .espera-item .grow { flex: 1 1 calc(100% - 60px); }
  .espera-item .acciones { flex: 1 1 100%; justify-content: flex-end; }
}

/* ---------- Seguridad y RGPD ---------- */
.input.sm { padding: 6px 10px; font-size: .85rem; min-height: 0; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; max-width: 240px; }
.auth .code-input { max-width: none; }
.qr-box { background: #fff; border-radius: 12px; padding: 10px; display: inline-block; margin: 6px 0; border: 1px solid var(--line); }
.qr-box img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.pasos { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.codigos-rec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codigos-rec code { background: var(--surface-2); border-radius: 8px; padding: 8px; text-align: center; font-size: .95rem; letter-spacing: .05em; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { position: relative; padding-left: 26px; }
.checklist li::before { content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.checklist li.ok::before { background: var(--ok, #2f9e6b); border-color: var(--ok, #2f9e6b); }
.checklist li.ok::after { content: ''; position: absolute; left: 5px; top: 5px; width: 6px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.banner-2fa { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.alert.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--ink); font-weight: 500; align-items: center; }


.brand-logo.marca { background: none; padding: 0; overflow: hidden; }
.brand-logo.marca img { width: 100%; height: 100%; display: block; }
