/* ============================================
   SaaS de Barbería — Tema Nórdico
   Noche de fiordo: azules profundos + acento de hielo.
   Los negros puros se cambiaron por azul-negro (#070B12): el gris neutro
   apagaba el acento celeste, el fondo con matiz frío lo sostiene.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Superficies: negro real. El fondo es #000 puro y las superficies suben
     con un matiz azul minimo, lo justo para que un panel se despegue del
     fondo sin encender la pantalla. */
  --bg: #000000;
  --bg-1: #05070B;
  --bg-2: #0B0F16;
  --bg-3: #141A24;
  --line: #1A212C;
  --line-strong: #2B3646;

  /* Texto: escarcha. Medido sobre la superficie MÁS CLARA del tema (--bg-3),
     que es donde peor le va a un texto claro:
     ink 15.3:1 · ink-2 9.1:1 · ink-3 5.8:1 · ink-4 solo para adornos, nunca texto */
  --ink: #E8F1FA;
  --ink-2: #A9BDD4;
  --ink-3: #7E97B2;
  --ink-4: #4E6480;

  /* Acento: hielo. El dueño puede cambiarlo desde Configuración (marca blanca);
     esto es el valor por defecto del producto. */
  --accent: #5FD0F5;
  --accent-2: #8FE2FF;
  --accent-soft: rgba(95, 208, 245, 0.14);
  --accent-ink: #04121B;

  --black: #000000;

  /* Segundo color de marca: SANGRE DE FORJA. El hielo solo daba una lectura
     fria y educada; el rojo oxidado es lo que mete el hacha en la sala.
     No es --accent-2 (ese es el hover del acento): es un color de identidad,
     va en runas, trenzas y marcas de seccion, nunca en un dato. */
  --forja: #C4402F;
  --forja-2: #E05B45;
  --forja-soft: rgba(196, 64, 47, 0.16);

  /* Semánticos: se mantienen distinguibles del acento frío para que
     "correcto/atención/error" no se confundan con la marca */
  --ok: #3FD6A8;
  --warn: #F5A524;
  --bad: #FF6B6B;
  --ghost: #4E6480;

  /* Geometría angular: esquinas más cerradas, como talladas */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', sans-serif;
  /* Tipografía tallada, solo para títulos y marca (ver bloque NÓRDICO) */
  --font-rune: 'Cinzel', Georgia, serif;
  --shadow-color: rgba(2, 6, 14, 0.55);
  --modal-bg: rgba(7, 11, 18, 0.62);
}

[data-theme="light"] {
  /* Tema claro: hielo de día. No es el oscuro invertido — los azules se
     desaturan y el acento se oscurece, porque el celeste brillante sobre
     blanco no alcanza 4.5:1 en texto. */
  --bg: #F2F7FB;
  --bg-1: #FFFFFF;
  --bg-2: #E9F1F8;
  --bg-3: #D9E6F1;
  --line: #D3E1EE;
  --line-strong: #B2C7DA;
  --ink: #0A1826;
  --ink-2: #2C4763;
  /* ink-3 era #56718C y se quedaba corto: 4.45:1 sobre --bg-2 y 4.00:1 sobre
     --bg-3, por debajo del 4.5 exigido. El error estaba en medirlo contra el
     blanco de --bg-1 (5.08) y dar por hecho el resto; en cuanto el texto cae
     sobre una tarjeta o un chip, el fondo baja y el contraste con él. Este
     valor se midió contra la superficie más OSCURA del tema (--bg-3), que es
     el peor caso para un texto oscuro: 4.93 ahí, 5.49 sobre --bg-2. */
  --ink-3: #4A6379;
  --ink-4: #8AA3BC;

  --black: #D9E6F1;
  --ghost: #4A6379;   /* mismo tono apagado que ink-3, mismo motivo */

  /* Sobre blanco el acento pasa a azul fiordo: el hielo se usa solo como
     relleno, nunca como texto. */
  --accent: #0E7FA8;
  --accent-2: #0A6688;
  --accent-soft: rgba(14, 127, 168, 0.12);
  --accent-ink: #FFFFFF;

  --forja: #A32E20;
  --forja-2: #8A2418;
  --forja-soft: rgba(163, 46, 32, 0.12);

  --shadow-color: rgba(16, 42, 67, 0.10);
  --modal-bg: rgba(10, 24, 38, 0.35);
}

[data-theme="light"] .sidebar {
  border-right: 1px solid var(--line);
}
[data-theme="light"] .hero h1 .accent, [data-theme="light"] .hero-meta .item .v.accent {
  color: var(--accent);
}
[data-theme="light"] .tbl th {
  color: var(--ink-2);
  font-weight: 700;
}
[data-theme="light"] .btn.primary {
  color: #FFFFFF !important;
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100vh; overflow: hidden; width: 100vw; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ============== APP SHELL ============== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ============== SIDEBAR ============== */
.sidebar {
  background: var(--bg-1);
  color: var(--ink);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .nav-section { color: var(--ink-3); }
.sidebar .nav-item { color: var(--ink-2); transition: all 0.2s ease; }
.sidebar .nav-item:hover { background: var(--bg-2); color: var(--ink); transform: translateX(4px); }
.sidebar .nav-item.active { background: var(--bg-2); color: var(--ink); }
.sidebar .nav-item.active::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sidebar .nav-item.active .ico { color: var(--accent); }
.sidebar .nav-item .badge { background: var(--bg-3); color: var(--ink-2); }
.sidebar .nav-item.active .badge { background: var(--accent); color: var(--accent-ink); }
.brand {
  height: 65px;
  box-sizing: border-box;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.05;
  text-transform: uppercase;
}
.brand-mark .accent { color: var(--accent); text-shadow: 0 0 15px var(--accent-soft); }
.brand-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--ink-3);
  letter-spacing: 0.15em;
  margin-left: auto;
  border: 1px solid var(--line);
  padding: 3px 6px;
  border-radius: 3px;
}

.nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.active {
  background: var(--bg-2);
  color: var(--ink);
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .8; }
.nav-item.active .ico { opacity: 1; color: var(--accent); }
.nav-item .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink-2);
}
.nav-item.active .badge { background: var(--accent); color: var(--accent-ink); }

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-family: var(--font-display);
  box-shadow: 0 0 10px var(--accent-soft);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta .n { font-size: 12px; color: var(--ink); font-weight: 600; }
.user-meta .r { font-size: 10px; color: var(--ink-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }

/* ============== MAIN ============== */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; }
/* El wrapper de cada vista dentro de .main (data-screen-label) no debe
   romper la cadena flex entre .main y .content: lo "aplanamos" del layout.
   Acotado a ".main >" para no afectar el sidebar u otros data-screen-label. */
.main > [data-screen-label] { display: contents; }

.topbar {
  height: 65px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.topbar .title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.topbar .clock {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  display: flex; gap: 14px; align-items: center;
}
.clock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.checkin-quick {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform .08s;
}
.checkin-quick:hover { transform: translateY(-1px); }
.checkin-quick:active { transform: translateY(0); }
.checkin-quick .ico { width: 16px; height: 16px; }

.content {
  padding: 28px;
  max-width: 1500px;
  width: 100%;
}

/* ============== HEADLINE ROW ============== */
.headline {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.hero {
  /* Superficie plana: el degradado diagonal ensuciaba el negro y hacia que la
     tarjeta principal pareciera de otro sistema que las de al lado. */
  background: var(--bg-1);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}
.hero p { color: var(--ink-2) !important; }
.hero .hero-meta { border-top-color: var(--line) !important; }
.hero .hero-meta .item .l { color: var(--ink-3) !important; }
.hero .hero-meta .item .v { color: var(--ink); text-shadow: 0 0 20px rgba(255,255,255,0.1); }
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--ink-2); font-size: 13px; margin: 0; max-width: 420px; }

.hero-meta {
  display: flex; gap: 24px; margin-top: 20px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.hero-meta .item .l { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .15em; color: var(--ink-3); }
.hero-meta .item .v { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.1; }
.hero-meta .item .v.accent { color: var(--accent); }

/* ============== KPI CARDS ============== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
/* Variante para cuando hay una tarjeta extra (ej. Caja Fuerte en Reportes).
   La columna es angosta, asi que meter 3 tarjetas a lo ancho las dejaria
   ilegibles: en su lugar la tercera ocupa la fila completa y deja de verse
   como un hueco. */
.kpi-grid.kpi-grid--3 > .kpi:last-child {
  grid-column: 1 / -1;
}
.kpi {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.kpi:hover { 
  border-color: var(--line-strong); 
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--shadow-color);
}
.kpi .label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.kpi .label .ico { width: 12px; height: 12px; }
.kpi .value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.kpi .delta {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 4px;
  color: var(--ink-3);
}
.kpi.accent .value { color: var(--accent); }
.kpi.warn .value { color: var(--warn); }
.kpi.bad .value { color: var(--bad); }
.kpi.ghost .value { color: var(--ghost); }

.kpi .bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ink-4);
}
.kpi.accent .bar { background: var(--accent); }
.kpi.warn .bar { background: var(--warn); }
.kpi.bad .bar { background: var(--bad); }
.kpi.ghost .bar { background: var(--ghost); }

/* ============== PANELS ============== */
.panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  margin: 0;
}
.panel-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }

.panel-body { padding: 6px 0; }

/* ============== POS (Punto de Venta) ============== */
.pos-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  align-items: stretch;
}
.pos-catalog {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
  align-content: start;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  max-height: 64vh;
}
.pos-ticket {
  padding: 16px;
  display: flex;
  flex-direction: column;
  max-height: 64vh;
  background: var(--bg);
}
.pos-ticket-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-3); margin-bottom: 12px; flex: 0 0 auto;
}
.pos-ticket-items {
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; flex: 1 1 auto; min-height: 0;
}
.pos-ticket-empty { color: var(--ink-3); font-size: 13px; line-height: 1.5; flex: 1 1 auto; }
.pos-ticket-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; flex: 0 0 auto; }

.pos-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  transition: border-color .15s ease, transform .08s ease;
}
.pos-card:hover { border-color: var(--accent); }
.pos-card:active { transform: scale(0.97); }
.pos-card.sinstock { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.3); cursor: not-allowed; opacity: 0.55; }
.pos-card .n { font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.2; }
.pos-card .p { font-family: var(--font-mono); font-size: 17px; font-weight: 800; color: var(--accent); }
.pos-card .p.out { color: var(--bad); }
.pos-card .tag {
  position: absolute; top: -8px; right: -8px;
  color: #000; padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 800; letter-spacing: .03em; box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.pos-line { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pos-line-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pos-line-name { font-weight: 600; font-size: 14px; }
.pos-line-sub { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.pos-line-ctl { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pos-qty { min-width: 30px; padding: 2px 8px !important; }
.pos-line select { margin-top: 8px; padding: 6px 10px; font-size: 13px; width: 100%; }

@media (max-width: 900px) {
  .pos-grid { grid-template-columns: 1fr; }
  .pos-catalog { border-right: none; border-bottom: 1px solid var(--line); max-height: 46vh; }
  .pos-ticket { max-height: none; }
  .pos-ticket-items { max-height: 42vh; }
}

/* ===== Wizard de Nueva Venta ===== */
.wz-hint { color: var(--ink-3); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.wz-who { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 13px; margin-bottom: 16px; }
.wz-who b { font-weight: 700; color: var(--ink); }
.wz-who button { background: rgba(0,0,0,.18); border: none; color: var(--ink-2); font-size: 11px; padding: 4px 11px; border-radius: 999px; cursor: pointer; font-family: var(--font-mono); }
.wz-who button:hover { color: var(--ink); }

.wz-barbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.wz-barber { cursor: pointer; border: 1px solid var(--line); background: var(--bg-2); border-radius: 14px; padding: 16px 10px; text-align: center; transition: border-color .12s, background .12s; }
.wz-barber:hover { border-color: var(--accent); }
.wz-barber.sel { border-color: var(--accent); background: var(--accent-soft); }
.wz-barber .av { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-display); font-size: 16px; }
.wz-barber.sel .av { background: var(--accent); color: var(--accent-ink); }
.wz-barber .bn { font-weight: 600; font-size: 13px; }
.wz-barber .be { font-size: 10px; color: var(--ink-3); margin-top: 2px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }

.wz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 38vh; overflow-y: auto; padding: 2px; margin: 0 -2px; }
.wz-item { position: relative; border: 1px solid var(--line); background: var(--bg-2); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 12px; min-height: 84px; transition: border-color .12s, background .12s, transform .06s; }
.wz-item:hover { border-color: var(--accent); background: var(--bg-3); }
.wz-item:active { transform: scale(.98); }
.wz-item.out { opacity: .5; cursor: not-allowed; }
.wz-item .nm { font-weight: 600; font-size: 14px; line-height: 1.25; color: var(--ink); }
.wz-item .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.wz-item .pr { font-family: var(--font-mono); font-weight: 800; font-size: 17px; color: var(--accent); }
.wz-item .cap { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.wz-item .qty { position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }

.wz-ticket { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 6px; }
.wz-ticket-empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 14px 0 4px; }
.wz-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.wz-row:last-of-type { border-bottom: none; }
.wz-row .nm { flex: 1; font-size: 13px; }
.wz-row .sub { font-family: var(--font-mono); font-weight: 700; color: var(--accent); min-width: 58px; text-align: right; }
.wz-stepper { display: inline-flex; align-items: center; gap: 6px; }
.wz-stepper button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-1); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.wz-stepper button:hover { border-color: var(--accent); color: var(--accent); }
.wz-stepper .n { min-width: 20px; text-align: center; font-family: var(--font-mono); font-weight: 700; }
.wz-step-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.wz-step-total .t { font-weight: 800; }
.wz-step-total .v { font-family: var(--font-mono); font-weight: 900; font-size: 20px; color: var(--accent); }

.wz-summary { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.wz-summary .l { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.wz-summary .l .k { color: var(--ink-3); }
.wz-summary .l.big { font-weight: 800; font-size: 20px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.wz-summary .l.big .v { color: var(--accent); font-family: var(--font-mono); }
.wz-pay { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0 14px; }
.wz-pay button { padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); font-weight: 600; cursor: pointer; font-size: 14px; transition: border-color .12s, background .12s, color .12s; }
.wz-pay button:hover { border-color: var(--accent); }
.wz-pay button.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

/* ============== STATUS PILLS ============== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill.activo      { color: var(--accent); border-color: rgba(30,91,255,0.35); background: rgba(30,91,255,0.08); }
.pill.activo .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.pill.por_renovar { color: var(--warn); border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); }
.pill.por_renovar .dot { background: var(--warn); }
.pill.vencido     { color: var(--bad); border-color: rgba(185,28,28,0.4); background: rgba(185,28,28,0.08); }
.pill.vencido .dot { background: var(--bad); }
.pill.ausente     { color: var(--ghost); border-color: rgba(107,119,144,0.4); background: rgba(107,119,144,0.08); }
.pill.ausente .dot { background: var(--ghost); }

/* ============== TABLE ============== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0;
}
.tbl td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
.tbl tbody tr { transition: background .1s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl tbody tr:last-child td { border-bottom: none; }

.cell-name { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  flex: 0 0 34px;
  border: 1px solid rgba(30,91,255,0.15);
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; flex: 0 0 64px; border-radius: var(--radius); }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; flex: 0 0 96px; border-radius: var(--radius); }
.cell-name .meta .n { font-weight: 600; color: var(--ink); }
.cell-name .meta .s { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

.streak-cell { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); }
.streak-cell .flame { color: var(--accent); font-size: 14px; }
.streak-cell.zero { color: var(--ink-3); }

/* ============== SCROLLABLE TABLE VIEWS ==============
   Vistas donde el toolbar/filtros quedan fijos y solo el
   cuerpo de la tabla scrollea dentro de su propio contenedor,
   con el <thead> pegado arriba (sensacion de app fija). */
.content.content-table {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content-table .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.content-table .toolbar { flex: 0 0 auto; }
.content-table .tbl-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Tablas secundarias dentro de una vista con varios paneles apilados
   (ej. Inventario: Membresias + Productos): no ocupan todo el viewport,
   solo se les pone un techo razonable con scroll propio. */
.tbl-wrap.capped {
  max-height: 420px;
  overflow-y: auto;
}

/* ============== ALERTAS (app-shell) ==============
   El hero, el panel de email masivo y las pestanas quedan fijos;
   solo la lista de socios scrollea dentro de su propio contenedor. */
.content.alertas-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content.alertas-shell > .headline,
.content.alertas-shell > .panel:not(.alertas-list-panel) {
  flex: 0 0 auto;
}
.content.alertas-shell > .alertas-list-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.alertas-list-panel .alertas-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}
.btn:hover { background: var(--bg-3); border-color: var(--ink-4); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 800;
  box-shadow: 0 0 15px var(--accent-soft);
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); box-shadow: 0 0 25px var(--accent-soft); }
.btn.ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); transform: translateY(0); box-shadow: none; }
.btn.danger { color: var(--bad); border-color: rgba(239,68,68,0.3); box-shadow: none; }
.btn.danger:hover { background: rgba(239,68,68,0.08); border-color: var(--bad); transform: translateY(0); box-shadow: none; }
.btn.lg { padding: 12px 18px; font-size: 13px; }
.btn .ico { width: 14px; height: 14px; }

/* ============== INPUTS ============== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
}
.input, .select {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color .12s;
}
.input:focus, .select:focus { border-color: var(--accent); }
/* El texto de ayuda de un campo hay que poder leerlo: --ink-4 es para adornos
   (barras, bordes) y daba 2.6:1 en claro y 3.2:1 en oscuro. */
.input::placeholder { color: var(--ink-3); }

/* ===== Señalética de validación =====
   El color nunca es la única señal (WCAG 1.4.1): el campo con error suma borde
   rojo + texto explicativo debajo, y el obligatorio suma un asterisco al label. */
.req {
  color: var(--bad);
  margin-left: 3px;
  font-weight: 800;
}
.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--bad);
}
.input[aria-invalid="true"]:focus,
.select[aria-invalid="true"]:focus {
  border-color: var(--bad);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.error-campo {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--bad);
  display: flex;
  align-items: center;
  gap: 5px;
}
.error-campo::before { content: "▲"; font-size: 9px; }

.aviso-faltantes {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 14px;
  animation: avisoIn .18s ease-out;
}
.aviso-faltantes-head {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bad);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.aviso-faltantes ul { margin: 0; padding-left: 16px; }
.aviso-faltantes li { margin: 3px 0; }
.aviso-faltantes li::marker { color: var(--bad); }
.aviso-faltantes li button {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.aviso-faltantes li button:hover { color: var(--bad); }
@keyframes avisoIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.8;
}

.search {
  position: relative;
  display: flex; align-items: center;
}
.search .ico {
  position: absolute; left: 12px; width: 14px; height: 14px;
  color: var(--ink-3); pointer-events: none;
}
.search .input { padding-left: 34px; width: 100%; }

/* ============== ALERTS LIST ============== */
.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s;
}
.alert-row:hover { background: var(--bg-2); }
.alert-row:last-child { border-bottom: none; }
.alert-row .meta { flex: 1; min-width: 0; }
.alert-row .n { font-weight: 600; }
.alert-row .s { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.alert-row .act { display: flex; gap: 6px; }

/* ============== LEADERBOARD ============== */
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: none; }
.lb-row .rank {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--ink-3);
  text-align: center;
}
.lb-row.top1 .rank { color: var(--accent); font-size: 22px; }
.lb-row.top2 .rank { color: var(--ink); }
.lb-row.top3 .rank { color: var(--ink-2); }
.lb-row .meta { display: flex; flex-direction: column; }
.lb-row .meta .n { font-weight: 600; font-size: 13px; }
.lb-row .meta .s { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.lb-row .streak {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
  display: flex; align-items: center; gap: 4px;
}

/* ============== CHECK-IN MODAL ============== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px var(--shadow-color);
}
.modal.lg { max-width: 720px; }
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.modal-head h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0;
}
.modal-head .close {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.modal-head .close:hover { background: var(--bg-2); color: var(--ink); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--bg);
}

/* ============== FORM GRID ============== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ============== SECTION HEADER (generic) ============== */
.section-header { display: flex; }
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0;
}
.section-subtitle {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0;
}

/* ============== SETTINGS (Ajustes) ============== */
.settings-shell { display: flex; flex-direction: column; gap: 20px; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 4px 0 14px;
}
.settings-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
}
.settings-header p {
  font-size: 13px;
  color: var(--ink-3);
  margin: 4px 0 0;
}

.settings-subtabs-sticky {
  position: sticky;
  top: 68px;
  z-index: 19;
  background: var(--bg);
  padding-bottom: 4px;
}

.settings-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.settings-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.settings-card-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.settings-card-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--ink); margin: 0; }
.settings-card-subtitle { font-size: 12px; color: var(--ink-3); margin: 3px 0 0; }
.settings-card-body { padding: 24px; }

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.plan-badge.trial { background: color-mix(in srgb, var(--ink-3) 20%, transparent); color: var(--ink-2); }
.plan-badge.starter { background: color-mix(in srgb, var(--ok, #3ad07a) 18%, transparent); color: var(--ok, #3ad07a); }
.plan-badge.premium { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.emp-card {
  display: flex; flex-direction: column;
  padding: 18px 20px;
  background: var(--bg-1);
  border-radius: 14px;
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.emp-card:hover { border-color: var(--line-strong); }
.pin-display {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 20px; font-weight: 300;
  letter-spacing: 6px; color: var(--ink);
}
.pin-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); padding: 4px; display: flex; align-items: center;
}
.pin-toggle:hover { color: var(--ink); }

.plan-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.plan-card {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
}
.plan-card:hover { border-color: var(--ink-4); }
.plan-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.plan-card.selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  width: 18px; height: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.plan-card .name {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
}
.plan-card .duration { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.plan-card .price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: var(--accent);
  margin-top: 6px;
  line-height: 1;
}
.plan-card .price small { font-size: 11px; color: var(--ink-3); font-weight: 500; }

/* ============== CHECK-IN BIG SUCCESS ============== */
.checkin-success {
  text-align: center;
  padding: 30px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.checkin-success .badge {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.checkin-success h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: -0.01em;
}
.checkin-success .name { color: var(--accent); }
.checkin-success .streak-big {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  color: var(--ink);
}
.checkin-success .streak-big small {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-top: 4px;
}

/* ============== CLIENT DETAIL ============== */
.detail-head {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.detail-head .info { flex: 1; }
.detail-head h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.detail-head .sub {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.detail-head .sub span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-mini {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-mini .l {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
}
.stat-mini .v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  margin-top: 4px;
  line-height: 1;
}
.stat-mini.accent .v { color: var(--accent); }

/* ============== ATTENDANCE GRID ============== */
.att-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  padding: 16px 20px 4px;
}
.att-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  position: relative;
}
.att-cell.has { background: var(--accent); border-color: var(--accent); }
.att-cell.today {
  outline: 2px solid var(--black);
  outline-offset: 1px;
}
.att-legend {
  display: flex; gap: 14px;
  padding: 10px 20px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.att-legend .swatch { display: inline-flex; align-items: center; gap: 6px; }
.att-legend .sq { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line); }
.att-legend .sq.has { background: var(--accent); border-color: var(--accent); }
.att-legend .sq.empty { background: var(--bg-3); }

.history-list {
  max-height: 320px;
  overflow-y: auto;
}
.history-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.history-row:last-child { border-bottom: none; }
.history-row .day {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}
.history-row .time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}
.history-row .badge-mini {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============== EMPTY STATE ============== */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 16px;
  margin: 0 0 6px;
  color: var(--ink);
}
.empty p { margin: 0; font-size: 12px; }

/* ============== FILTER CHIPS ============== */
.chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-4); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Toolbar above tables */
.toolbar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap;
}
.toolbar .search { flex: 1; min-width: 220px; }

/* ============== UTILITY ============== */
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }
.sp-y > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }

/* progress bar (plan progress) */
.progress {
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.progress.warn > i { background: var(--warn); }
.progress.bad > i { background: var(--bad); }

/* sparkline / mini chart */
.spark {
  display: flex; align-items: flex-end; gap: 3px;
  height: 36px;
  margin-top: 8px;
}
.spark .b {
  flex: 1;
  background: var(--ink-4);
  border-radius: 2px;
  min-width: 0;
}
.spark .b.has { background: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--black);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(11,18,32,0.25);
  display: flex; align-items: center; gap: 8px;
  z-index: 200;
  animation: toastIn .25s;
}
.toast.bad { background: var(--bad); color: white; }
.toast.ok { background: var(--accent); color: var(--accent-ink); }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ===== Tweaks panel overrides (force light) ===== */
[data-tweaks-panel] { background: #FFFFFF !important; border-color: var(--line) !important; color: var(--ink) !important; }

/* ============== DASHBOARD SHELL (Fixed Viewport) ============== */
/* When the dashboard is active, prevent the main wrapper from scrolling */
.main:has(.dashboard-shell) {
  overflow-y: hidden;
  height: 100vh;
}

.content.dashboard-shell {
  height: calc(100vh - 65px); /* Full height minus topbar */
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.dashboard-shell .headline {
  flex: 0 0 auto;
  margin-bottom: 0; /* Override */
}

.dashboard-shell .panels {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 0;
}

/* Columns */
.dashboard-shell .panels > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.dashboard-shell .right-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  gap: 20px;
  padding-right: 4px;
}

/* Panels inside right column */
.dashboard-shell .right-column > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dashboard-shell .right-column > .panel:first-child {
  flex: 0 0 auto; /* Weekly attendance panel fits its content */
}

.dashboard-shell .right-column > .panel:last-child {
  flex: 1; /* Leaderboard takes the rest of the height */
}

/* Scrollable body inside panels */
.panel-body-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  box-sizing: border-box;
}

/* Custom scrollbar to keep it sleek globally across all elements */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
}

/* ============== REPORTES SHELL (Fixed Viewport) ============== */
.main:has(.reportes-shell) {
  overflow-y: hidden;
  height: 100vh;
}

.content.reportes-shell {
  height: calc(100vh - 65px); /* Full height minus topbar */
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.reportes-shell .headline {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.reportes-body-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* Los reportes cargan async y crecen de golpe. El "scroll anchoring" de
     Chrome compensa ese crecimiento moviendo el scroll, y eso empujaba el
     panel de Caja Fuerte detras de las pestanas sticky (parecia que
     desaparecia). Anclar el scroll aqui no aporta nada: siempre queremos
     empezar arriba. */
  overflow-anchor: none;
}

.reportes-subtabs-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-top: 4px;
  padding-bottom: 8px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (min-width: 769px) {
  .hamburger { display: none !important; }
  .mobile-overlay { display: none !important; }
}

@media (max-width: 768px) {
  /* Layout principal.
     En escritorio la app es un "shell" de alto fijo (html/body/#root/.app a 100vh
     con overflow hidden) y el scroll vive dentro de .main o de contenedores internos
     como .reportes-body-scroll. En móvil/tablet ese modelo rompía el scroll: las vistas
     de alto fijo (Reportes, Dashboard) pasan a fluir a su alto real, pero .app seguía
     recortado a 100vh con overflow hidden, así que todo lo que excedía la pantalla
     quedaba cortado y no se podía scrollear. Aquí .app pasa a ser el contenedor que
     scrollea toda la página. */
  html, body, #root {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .app {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  /* Topbar */
  .topbar {
    height: auto;
    padding: 15px;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
  }
  .topbar .title {
    font-size: 18px;
    margin-right: auto;
  }
  .topbar .clock {
    display: none;
  }
  
  /* Hamburger Button */
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    padding: 4px;
    margin-right: 4px;
  }

  /* Sidebar -> Slide-out Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
  .sidebar.open {
    left: 0;
  }
  
  /* Mobile Overlay */
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Grids */
  .dashboard-grid, .detail-grid, .form-grid, .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Tables */
  .panel-body {
    overflow-x: auto;
    padding: 10px;
  }
  .tbl {
    min-width: 500px;
  }

  /* Modals */
  .modal-box {
    width: 95%;
    max-width: none;
    padding: 20px;
    margin: 10px;
  }
  
  /* Main Content */
  .main {
    padding: 10px;
    height: auto !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
  }
  .panel {
    padding: 15px;
  }
  
  .login-screen .panel {
    width: 90% !important;
  }
  .content.dashboard-shell,
  .content.reportes-shell {
    height: auto !important;
    overflow: visible !important;
    padding: 16px 12px !important;
  }
  .headline {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .dashboard-shell .panels, .panels {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    height: auto !important;
    overflow: visible !important;
  }
  .dashboard-shell .panels > .panel,
  .dashboard-shell .right-column,
  .dashboard-shell .right-column > .panel {
    height: auto !important;
    overflow: visible !important;
  }
  .panel-body-scroll,
  .reportes-body-scroll {
    overflow-y: visible !important;
    height: auto !important;
  }
  .hero-meta {
    flex-wrap: wrap !important;
    gap: 16px !important;
  }
  .hero {
    padding: 24px !important;
  }
  .hero-meta .item {
    flex: 1 1 40%;
  }
}

/* (La capa de identidad nórdica —runas, trenza, rombos y tipografía tallada— se retiró:
   el sistema visual ahora vive en ui.css.) */

/* Quien pida menos movimiento no ve el deslizamiento del menu */
@media (prefers-reduced-motion: reduce) {
  .sidebar .nav-item:hover { transform: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   ALINEACION Y RITMO
   Una sola regla, en vez de decidirlo elemento por elemento (que es como
   nacieron las columnas centradas sueltas):

     texto        -> izquierda
     cantidades   -> derecha, cifras de ancho fijo
     dinero       -> derecha, cifras de ancho fijo
     rangos/ids   -> izquierda (son etiquetas, no magnitudes)

   El encabezado de una columna se alinea SIEMPRE con su contenido, si no
   el ojo pierde el eje al bajar por la tabla.
   ============================================================ */

/* Cifras de ancho fijo: sin esto un 111 ocupa menos que un 999 y la columna
   "baila" al cambiar de mes. */
.mono,
.tbl .num,
.kpi .value,
.stat-mini .v,
.hero-meta .item .v { font-variant-numeric: tabular-nums; }

.tbl th.num,
.tbl td.num { text-align: right; }

/* La columna de acciones se ancla a la derecha, donde el pulgar y la mirada
   ya terminan de recorrer la fila. */
.tbl .acciones { text-align: right; }

/* Fila de acciones de un asistente (Corte Z). Antes eran dos botones
   estirados a lo ancho, mientras el resto de dialogos de la app cierra con un
   pie alineado a la derecha: el usuario tenia que buscar el boton en un sitio
   distinto segun la pantalla. Ahora comparten eje y jerarquia — la accion
   primaria siempre al final del recorrido. */
.wizard-acciones {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.wizard-acciones .btn { min-width: 128px; justify-content: center; }

/* Avatar con silueta: el SVG ocupa el 62% de la caja y queda centrado, para
   que respire igual que las iniciales y no se pegue al borde. */
.avatar.avatar-silueta { padding: 0; }
.avatar.avatar-silueta svg { width: 62%; height: 62%; display: block; opacity: 0.9; }

/* Campos opcionales del formulario de empleado: la casilla revela el dato en
   vez de mostrarlo siempre. Un formulario con todo desplegado da sensacion de
   tramite; asi solo se ve lo que el negocio realmente usa. */
.field.opcional {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-1);
}
.opcional-check {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
.opcional-check:last-child { margin-bottom: 0; }
.opcional-check input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}
.opcional-nota { margin: 0; font-size: 12px; color: var(--ink-3); }

/* ============== CONTROL SEGMENTADO ==============
   Opciones excluyentes visibles de un vistazo, en vez de escondidas tras un
   desplegable. El bloque activo se rellena con el acento; los demas quedan
   como superficie neutra, sin bordes que compitan. */
.segmento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.segmento-op {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* 56px de alto: por encima del minimo tactil de 44px, porque en el mostrador
     se toca con el pulgar y a veces con la tablet en la mano. */
  min-height: 56px;
  padding: 10px 8px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.segmento-op:hover { background: var(--bg-3); color: var(--ink-2); }
.segmento-op.activo {
  background: var(--accent);
  color: var(--accent-ink);
}
.segmento-op.activo:hover { background: var(--accent); }
.segmento-op:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============== CITAS DEL DÍA EN EL POS ==============
   Una fila por cita, con la hora como ancla a la izquierda y las acciones a la
   derecha, donde termina el recorrido. Las cerradas bajan de opacidad y
   cambian los botones por un sello: siguen visibles como registro del dia,
   pero ya no invitan a tocarlas. */
.cita-fila {
  display: grid;
  grid-template-columns: 74px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.cita-fila:first-child { border-top: 0; }
.cita-hora { font-size: 15px; font-weight: 700; color: var(--accent); }
.cita-nombre { font-weight: 600; font-size: 14px; color: var(--ink); }
.cita-detalle { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cita-monto { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.cita-acciones { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cita-sello {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
@media (max-width: 700px) {
  .cita-fila { grid-template-columns: 54px 1fr; grid-template-areas: 'hora quien' 'monto acciones'; }
  .cita-monto { grid-area: monto; }
  .cita-acciones { grid-area: acciones; }
}

/* ============================================================
   AGENDA EN EL PANEL — la cita manda sobre la cifra
   Los ingresos del mes son una revision de lo que ya paso; la cita es lo
   unico del panel sobre lo que todavia se puede actuar. Por eso la proxima
   sube a la cabecera y la fila que sigue se marca en la lista.
   ============================================================ */
.hero-cita {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 9px 15px;
  /* Superficie neutra, no un teñido del acento: sobre un teñido al 15% el
     acento como texto cae a 4.4:1 en tema claro (medido), por debajo del 4.5
     exigido. El borde y el punto ya marcan de quién es la franja. */
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  max-width: 100%;
}
.hero-cita .punto {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.hero-cita b {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--accent);
  white-space: nowrap;
}
.hero-cita .con { color: var(--ink-2); font-size: 12px; white-space: nowrap; }

/* La que sigue se distingue por un canto, no por color de fondo: el fondo
   teñido compite con el estado de la fila (atendida, no llego, va tarde). */
.lb-row.cita-dash { border-left: 3px solid transparent; }
.lb-row.cita-dash.sigue { border-left-color: var(--accent); background: var(--bg-2); }
.hero-cita em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

/* Pie de panel: rótulo a la izquierda, total y acción a la derecha. Se apila
   en pantalla angosta en vez de aplastarse — antes eran estilos en línea
   repetidos, y en el teléfono el rótulo y la cifra se tocaban. */
.panel-pie {
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.panel-pie .etq { font-size: 12px; color: var(--ink-2); }
.panel-pie .der { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.panel-pie .tot { font-family: var(--font-mono); font-weight: 800; color: var(--ink); }
.panel-pie .lnk { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; padding: 0; }

/* ============================================================
   NUEVA CITA / REPROGRAMAR — el mostrador agendando
   Mismos ladrillos que la pantalla publica de reservas (elegir servicios,
   elegir hora), pero en la densidad del panel: aqui se agenda entre
   llamada y llamada, no con calma desde el telefono del cliente.
   ============================================================ */
.cita-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.cita-sugerencias {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 8px;
}
.cita-sugerencia {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--bg-2); border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink); font-family: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.cita-sugerencia:last-child { border-bottom: none; }
.cita-sugerencia:hover { background: var(--bg-3); }
.cita-sugerencia .mono { color: var(--ink-3); font-size: 12px; }

.cita-servicios { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cita-serv {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.cita-serv:hover { border-color: var(--accent); }
.cita-serv.on { border-color: var(--accent); background: var(--accent-soft); }
.cita-serv .mono { font-size: 11px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }

.cita-resumen {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}

.cita-horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; max-height: 176px; overflow-y: auto; }
.cita-hora-op {
  padding: 10px 4px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--ink);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; cursor: pointer;
}
.cita-hora-op:hover { border-color: var(--accent); }
.cita-hora-op.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.cita-link {
  align-self: flex-start; margin-top: 8px; padding: 0;
  background: none; border: none; color: var(--accent);
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.cita-vacio {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--bg-2); color: var(--ink-2); font-size: 13px;
}
.cita-error {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 13px;
  border: 1px solid var(--bad); border-radius: var(--radius);
  background: var(--bg-2); color: var(--ink); font-size: 13px;
}
.cita-error svg { color: var(--bad); flex: 0 0 auto; }

@media (max-width: 560px) {
  .cita-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   BLOQUEOS DE AGENDA — dentro del horario del barbero
   Van aqui y no en una pantalla aparte porque son el mismo asunto:
   cuando trabaja esta persona. El horario semanal dice "los martes de 9
   a 6"; el bloqueo dice "este martes no".
   ============================================================ */
.bloqueos-sec { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.bloqueos-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bloqueos-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink);
}
.bloqueos-head .muted { font-size: 11px; }

.bloqueos-lista { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bloqueo-fila {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.bloqueo-fila > svg { color: var(--ink-3); flex: 0 0 auto; }
.bloqueo-que { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bloqueo-que .n { font-size: 13px; font-weight: 600; color: var(--ink); }
.bloqueo-que .s { font-size: 11px; color: var(--ink-3); }
.bloqueo-quitar {
  flex: 0 0 auto;
  background: none; border: none; padding: 6px;
  color: var(--ink-3); cursor: pointer; border-radius: var(--radius-sm);
}
.bloqueo-quitar:hover { color: var(--bad); background: var(--bg-3); }

.bloqueo-nuevo { display: flex; flex-direction: column; gap: 9px; }
.bloqueo-opciones { display: flex; gap: 18px; flex-wrap: wrap; }
.bloqueo-check { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.bloqueo-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.bloqueo-campos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bloqueo-campos .input { padding: 8px 10px; }
.bloqueo-a { color: var(--ink-3); font-size: 12px; }
