:root {
  --bg: #071510;
  --bg-2: #0a1f18;
  --panel: #0f2a20;
  --panel-2: #13362a;
  --line: rgba(232,199,133,0.18);
  --line-2: rgba(232,199,133,0.08);
  --ivory: #f4ead5;
  --ivory-dim: #d9cfb8;
  --muted: rgba(244,234,213,0.58);
  --gold: #d4a24c;
  --gold-2: #e8c785;
  --gold-3: #b5823a;
  --teal: #3ab0a0;
  --teal-deep: #1f6f63;
  --danger: #e07b6a;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --tabbar-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ivory);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

a { color: var(--gold-2); text-decoration: none; }

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Boot splash */
.boot-splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  background: var(--bg);
}
.boot-splash img { border-radius: 18px; opacity: 0.92; }
.boot-label {
  font-size: 12px; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold-2);
  margin: 0;
}

/* Centered standalone screens (PIN / onboarding) */
.center-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(40px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
}
.center-screen .brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 32px;
}
.center-screen .brand img { width: 72px; height: 72px; border-radius: 18px; }
.center-screen .brand .eyebrow {
  font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold-2);
}
.center-screen h1 {
  margin: 0 0 8px; text-align: center;
  font-size: 22px; font-weight: 500; color: var(--ivory);
}
.center-screen .subtitle {
  margin: 0 0 28px; text-align: center;
  color: var(--muted); font-size: 14px;
}

/* PIN dots */
.pin-dots {
  display: flex; justify-content: center; gap: 18px;
  margin: 8px 0 28px;
}
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--gold);
  transition: all 0.15s;
}
.pin-dot.filled { background: var(--gold); box-shadow: 0 0 14px rgba(212,162,76,0.4); }
.pin-error .pin-dot { border-color: var(--danger); animation: shake 0.3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.pin-error-msg {
  text-align: center; color: var(--danger);
  font-size: 13px; min-height: 18px; margin-bottom: 12px;
}

/* Numpad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px; width: 100%;
  margin: auto auto 0;
}
.numpad button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ivory);
  font-size: 24px; font-weight: 400;
  padding: 18px 0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.1s;
}
.numpad button:active { background: var(--panel-2); transform: scale(0.97); }
.numpad button.muted { background: transparent; border-color: transparent; color: var(--muted); font-size: 14px; }

/* Form (onboarding, edits) */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold-2);
}
.field input, .field select, .field textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ivory);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--panel-2);
}
.field .hint { color: var(--muted); font-size: 12px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gold); color: #0a1a13; border-color: var(--gold); }
.btn-primary:active { background: var(--gold-2); }
.btn-ghost { border-color: var(--line); color: var(--ivory-dim); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* App shell */
.app-header {
  position: sticky; top: 0; z-index: 50;
  padding: calc(14px + var(--safe-top)) 20px 14px;
  background: rgba(7,21,16,0.92);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.app-header h1 {
  margin: 0; font-size: 22px; font-weight: 500;
  color: var(--ivory);
}
.app-header .header-action {
  background: transparent; border: 1px solid var(--line);
  color: var(--gold-2);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
}
.app-header .header-action svg { width: 20px; height: 20px; }

.view {
  padding: 16px 20px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  min-height: 60vh;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty .glyph {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  color: var(--gold-3);
  opacity: 0.7;
}
.empty h2 {
  margin: 0 0 6px;
  font-size: 16px; font-weight: 500; color: var(--ivory-dim);
  letter-spacing: 0.04em;
}
.empty p { margin: 0; font-size: 13px; }

/* Card */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.card + .card { margin-top: 12px; }

/* Tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: rgba(10,31,24,0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px;
  border: 0; background: transparent;
  color: var(--muted);
  font-size: 10px; letter-spacing: 0.06em;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.15s;
}
.tabbar button .tab-icon { width: 22px; height: 22px; }
.tabbar button.active { color: var(--gold-2); }
.tabbar button.active .tab-icon { filter: drop-shadow(0 0 6px rgba(212,162,76,0.35)); }

/* Toast */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  z-index: 200;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ivory);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* Connection badge in header */
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); display: inline-block;
}
.conn-dot.off { background: var(--danger); }

@media (min-width: 720px) {
  #app { max-width: 720px; margin: 0 auto; }
}

/* Compras list */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.compra-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.compra-card:active { transform: scale(0.995); background: var(--panel-2); }
.compra-row-1 {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.compra-row-2 {
  font-size: 16px; font-weight: 500; color: var(--ivory);
  margin-bottom: 4px;
  word-break: break-word;
}
.compra-row-3 {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
}
.compra-row-3 .cost { color: var(--gold-2); font-weight: 500; }
.compra-row-3 .meta { color: var(--muted); }
.foto-pin {
  margin-left: auto;
  color: var(--gold-2);
  display: inline-flex; align-items: center;
  padding: 2px 4px;
}
.badge {
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold-2);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(232,199,133,0.05);
}
.compra-row-1 .date {
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.04em;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Floating action button */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: #0a1a13;
  border: 0;
  font-size: 30px; line-height: 1;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 2px 8px rgba(212,162,76,0.35);
  z-index: 90;
  display: grid; place-items: center;
  transition: transform 0.1s;
}
.fab:active { transform: scale(0.94); }
@media (min-width: 720px) {
  .fab { right: calc(50vw - 360px + 18px); }
}

/* Form screen (replaces app-header when active) */
body.in-form .app-header { display: none; }
body.in-form .view { padding: 0; }

.form-header {
  position: sticky; top: 0;
  z-index: 60;
  background: rgba(7,21,16,0.96);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line-2);
  padding: calc(12px + var(--safe-top)) 12px 12px;
  display: grid;
  grid-template-columns: minmax(80px, auto) 1fr minmax(80px, auto);
  align-items: center;
  gap: 8px;
}
.form-header h2 {
  margin: 0;
  font-size: 17px; font-weight: 500;
  color: var(--ivory);
  text-align: center;
  letter-spacing: 0.01em;
}
.form-action {
  background: transparent;
  border: 0;
  color: var(--gold-2);
  font-size: 15px; font-weight: 400;
  padding: 8px 6px;
  cursor: pointer;
  text-align: left;
}
.form-action:nth-child(3) { text-align: right; }
.form-action.primary { font-weight: 600; color: var(--gold); }
.form-action:disabled { opacity: 0.45; }

.form-body {
  padding: 16px 20px calc(var(--tabbar-h) + var(--safe-bottom) + 40px);
}

/* Photo upload slot */
.foto-slot {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 0;
  text-align: center;
  position: relative;
  background: var(--panel);
  overflow: hidden;
  min-height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.foto-slot.has-foto { border-style: solid; padding: 0; min-height: auto; }
.foto-slot img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}
.foto-placeholder {
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  color: var(--muted);
  padding: 22px 16px 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.foto-placeholder svg { color: var(--gold-3); opacity: 0.85; }
.foto-cta {
  display: inline-block;
  font-size: 13px;
  color: var(--gold-2);
  cursor: pointer;
  padding: 10px 16px 16px;
}
.foto-slot.has-foto .foto-cta {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(7,21,16,0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.foto-cta input { display: none; }

/* Read-only computed pill */
.readonly-pill {
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--ivory-dim);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  letter-spacing: 0.02em;
}

/* Subtle danger button variant for delete actions */
.btn.btn-danger-text {
  border-color: var(--line);
  color: var(--danger);
}
.btn.btn-danger-text:active { background: rgba(224,123,106,0.08); }

textarea {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}

/* ── Phase 3: Pedidos + Menú ───────────────────────────────────────────────── */

/* Form section dividers */
.form-section-label {
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold-3);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-2);
  margin-top: 8px;
}
.field-hint-text {
  margin: 0;
  font-size: 12px; color: var(--muted);
}

/* Badge variants */
.badge-ok      { border-color: var(--teal-deep); color: var(--teal); background: rgba(58,176,160,0.08); }
.badge-warn    { border-color: rgba(224,123,106,0.5); color: var(--danger); background: rgba(224,123,106,0.08); }
.badge-neutral { border-color: var(--line); color: var(--muted); }

/* ── Pedido list cards ─────────────────────────────────────────────────────── */

.pedido-card {
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.pedido-card:active { transform: scale(0.995); background: var(--panel-2); }
.pedido-row-1 {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.pedido-name { font-size: 16px; font-weight: 500; color: var(--ivory); }
.pedido-date { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.pedido-row-2 {
  font-size: 13px; color: var(--muted);
  margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pedido-row-3 {
  display: flex; justify-content: space-between; align-items: center;
}
.pedido-total { font-size: 15px; font-weight: 500; color: var(--gold-2); }
.pedido-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Customer info block (edit mode) ───────────────────────────────────────── */

.pedido-info-card { background: var(--panel-2); }
.pedido-info-name { font-size: 17px; font-weight: 500; color: var(--ivory); margin-bottom: 4px; }
.pedido-info-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Read-only items summary (edit mode) ───────────────────────────────────── */

.items-summary-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.items-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px;
  font-size: 14px; color: var(--ivory);
}
.items-summary-row + .items-summary-row { border-top: 1px solid var(--line-2); }
.items-summary-qty { color: var(--muted); font-size: 13px; }
.items-summary-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 15px; font-weight: 500; color: var(--gold-2);
  background: var(--panel-2);
}

/* ── Stepper list (new order) ──────────────────────────────────────────────── */

.stepper-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.stepper-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; gap: 12px;
  transition: background 0.15s;
}
.stepper-row + .stepper-row { border-top: 1px solid var(--line-2); }
.stepper-row.active { background: rgba(58,176,160,0.06); }
.stepper-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.stepper-name  { font-size: 15px; color: var(--ivory); }
.stepper-price { font-size: 12px; color: var(--gold-2); }
.stepper-ctrl {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.stepper-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ivory);
  font-size: 20px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.stepper-btn:active:not(:disabled) { background: var(--panel-2); transform: scale(0.9); }
.stepper-btn:disabled { opacity: 0.22; cursor: default; }
.stepper-qty {
  font-size: 16px; font-weight: 500; color: var(--ivory);
  min-width: 24px; text-align: center;
}

/* Running total bar */
.order-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--gold-3);
  border-radius: 12px;
  font-size: 17px; font-weight: 500;
  color: var(--gold-2);
}

/* Empty inline (when menu has no items) */
.empty-inline {
  text-align: center; padding: 20px 16px;
  color: var(--muted); font-size: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.empty-inline strong { color: var(--ivory-dim); }

/* ── Toggle switch ─────────────────────────────────────────────────────────── */

.toggle-field {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-label { font-size: 15px; color: var(--ivory); }
.toggle { flex-shrink: 0; }
.toggle input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block;
  width: 44px; height: 26px;
  background: rgba(232,199,133,0.10);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  transition: background 0.22s, border-color 0.22s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--ivory-dim);
  border-radius: 50%;
  transition: transform 0.22s;
}
.toggle input:checked + .toggle-track {
  background: var(--teal-deep);
  border-color: var(--teal);
}
.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}

/* ── Send-receipt button ───────────────────────────────────────────────────── */

.receipt-btn { gap: 8px; }

/* ── Menú list cards ───────────────────────────────────────────────────────── */

.menu-item-card {
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item-card:active { background: var(--panel-2); }
.menu-item-inactive { opacity: 0.48; }
.menu-row-1 {
  display: flex; justify-content: space-between; align-items: center;
}
.menu-nombre { font-size: 16px; font-weight: 500; color: var(--ivory); }
.menu-precio { font-size: 15px; color: var(--gold-2); font-weight: 500; }
.menu-row-2  { margin-top: 8px; }

/* ── Phase 4: Clientes ─────────────────────────────────────────────────────── */

/* Cliente list cards */
.cliente-card {
  cursor: pointer;
  transition: background 0.15s;
}
.cliente-card:active { background: var(--panel-2); }
.cliente-row-main {
  display: flex; align-items: center; gap: 14px;
}
.cliente-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--teal-deep);
  color: var(--ivory);
  font-size: 15px; font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.cliente-avatar-lg {
  width: 64px; height: 64px;
  font-size: 22px;
  margin: 0 auto 12px;
}
.cliente-info { flex: 1; min-width: 0; }
.cliente-nombre  { font-size: 16px; font-weight: 500; color: var(--ivory); }
.cliente-contact { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cliente-stats   { text-align: right; flex-shrink: 0; }
.cliente-gastado        { font-size: 15px; font-weight: 500; color: var(--gold-2); }
.cliente-pedidos-count  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Detail back button */
.detail-header {
  padding: 12px 20px 0;
}
.detail-back {
  background: transparent; border: 0;
  color: var(--gold-2); font-size: 14px;
  padding: 6px 0; cursor: pointer;
}

/* Cliente detail hero */
.cliente-detail-hero {
  text-align: center;
  padding: 20px 24px 24px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 0;
}
.cliente-detail-name    { font-size: 20px; font-weight: 500; color: var(--ivory); margin-bottom: 4px; }
.cliente-detail-contact { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cliente-detail-stats   { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.stat-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-value { font-size: 18px; font-weight: 600; color: var(--gold-2); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }

/* Section label for detail view */
.detail-section-label {
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold-3);
  padding: 20px 20px 12px;
}

/* Order history cards */
.history-card { cursor: default; }
.history-row-1 {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.history-date  { font-size: 12px; color: var(--muted); }
.history-total { font-size: 15px; font-weight: 500; color: var(--gold-2); }
.history-row-2 { font-size: 13px; color: var(--ivory-dim); margin-bottom: 8px; }
.history-row-3 { display: flex; gap: 6px; }

/* ── Phase 5: Resumen + Menú segments ─────────────────────────────────────── */

/* Segment control (Platos / Categorías in Menú tab) */
.segment-control {
  display: flex; gap: 0;
  margin: 0 20px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.segment-btn {
  flex: 1;
  background: transparent; border: 0;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.segment-btn.active {
  background: var(--panel-2);
  color: var(--gold-2);
}

/* Categorías chips section */
.cats-section { padding: 0 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.cats-hint    { margin: 0; font-size: 13px; color: var(--muted); }
.cats-chips   { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 14px;
  font-size: 13px; color: var(--ivory);
}
.cat-delete-btn {
  background: transparent; border: 0;
  color: var(--muted);
  font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0 2px;
  transition: color 0.15s;
}
.cat-delete-btn:hover { color: var(--danger); }

/* ── Resumen dashboard ─────────────────────────────────────────────────────── */

/* Month navigator */
.month-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 4px 20px 16px;
}
.month-nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--gold-2); font-size: 20px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.15s;
}
.month-nav-btn:disabled { opacity: 0.3; cursor: default; }
.month-nav-btn:not(:disabled):active { background: var(--panel-2); }
.month-nav-label {
  font-size: 16px; font-weight: 500; color: var(--ivory);
  min-width: 180px; text-align: center;
}

/* Stat cards */
.resumen-cards {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 20px 8px;
}
.resumen-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
}
.resumen-card-label {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold-3);
  margin-bottom: 4px;
}
.resumen-card-value {
  font-size: 28px; font-weight: 600;
  color: var(--ivory); letter-spacing: -0.02em;
}
.resumen-card-hint {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.resumen-income .resumen-card-value { color: var(--teal); }
.resumen-expense .resumen-card-value { color: var(--ivory-dim); }

/* Net card — horizontal layout */
.resumen-net {
  display: flex; align-items: center; justify-content: space-between;
  border-color: var(--line);
}
.resumen-net-left { display: flex; flex-direction: column; gap: 3px; }
.resumen-net-value {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em;
}
.resumen-positive { border-color: var(--teal-deep); }
.resumen-positive .resumen-net-value { color: var(--teal); }
.resumen-negative { border-color: rgba(224,123,106,0.4); }
.resumen-negative .resumen-net-value { color: var(--danger); }

/* Section + table */
.resumen-section { padding: 16px 20px 0; }
.resumen-section-label {
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold-3);
  margin-bottom: 10px;
}
.resumen-table { padding: 0; overflow: hidden; }
.resumen-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
}
.resumen-row-sep { border-bottom: 1px solid var(--line-2); }
.resumen-rank {
  width: 20px; text-align: center;
  font-size: 12px; color: var(--gold-3); font-weight: 600;
  flex-shrink: 0;
}
.resumen-row-name { flex: 1; font-size: 14px; color: var(--ivory); min-width: 0; }
.resumen-row-qty  { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.resumen-row-val  { font-size: 14px; font-weight: 500; color: var(--gold-2); flex-shrink: 0; min-width: 56px; text-align: right; }
