/* ==========================================================================
   Barbería del Arca · Admin
   Design system: tinta (black), papel (paper), rojo barbero / azul barbero
   ========================================================================== */

:root {
  color-scheme: light;

  --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", var(--font-ui);
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  /* Base */
  --ink: #0b0b0d;
  --ink-soft: #17171b;
  --ink-line: #2b2b32;
  --paper: #f5f3ee;
  --paper-2: #ece9e1;
  --card: #ffffff;
  --card-alt: #fbfaf7;
  --line: #e3dfd5;
  --line-strong: #cfc9bb;
  --text: #16161a;
  --text-2: #4d4a44;
  --muted: #6d685e;
  --inverse: #fbfaf7;

  /* Barber accents */
  --red: #c8102e;
  --red-deep: #9d0b23;
  --red-soft: #fdecef;
  --blue: #1b3a8c;
  --blue-deep: #122a68;
  --blue-soft: #e9eefb;
  --green: #167a53;
  --green-soft: #e6f5ee;
  --amber: #a86400;
  --amber-soft: #fff3dc;
  --violet: #5b3bb5;
  --violet-soft: #f0ebff;

  --ok: var(--green);
  --warn: var(--amber);
  --danger: var(--red);

  /* Geometry */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 11, 13, .05);
  --shadow-sm: 0 2px 8px rgba(11, 11, 13, .06), 0 1px 2px rgba(11, 11, 13, .04);
  --shadow-md: 0 10px 30px -12px rgba(11, 11, 13, .22);
  --shadow-lg: 0 30px 80px -28px rgba(11, 11, 13, .45);
  --shadow-drawer: -30px 0 80px -30px rgba(11, 11, 13, .5);

  --sidebar-w: 256px;
  --topbar-h: 76px;
  --pad: clamp(16px, 2.2vw, 32px);
  --gap: 18px;
  --density-row: 14px;

  --focus: 0 0 0 3px rgba(200, 16, 46, .22);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b0b0d;
  --paper-2: #121216;
  --card: #141418;
  --card-alt: #191920;
  --line: #2a2a32;
  --line-strong: #3b3b45;
  --text: #f4f2ec;
  --text-2: #c6c2b8;
  --muted: #938e83;
  --inverse: #0b0b0d;
  --red-soft: #3a1019;
  --blue-soft: #16204a;
  --green-soft: #0f2f24;
  --amber-soft: #3a2a0b;
  --violet-soft: #251a4a;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-md: 0 16px 40px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 100px -32px rgba(0, 0, 0, .9);
  --shadow-drawer: -30px 0 80px -30px rgba(0, 0, 0, .9);
}

[data-density="compact"] { --gap: 12px; --density-row: 9px; --topbar-h: 66px; }
[data-density="spacious"] { --gap: 24px; --density-row: 18px; --topbar-h: 84px; }

/* --------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.12;
  margin: 0;
  text-transform: none;
}
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
::selection { background: rgba(200, 16, 46, .18); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
svg.i.xl { width: 30px; height: 30px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 999;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: var(--r-sm); transform: translateY(-200%);
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translateY(0); }
[hidden], .hidden { display: none !important; }

/* ------------------------------------------------------------- shell */
.app-shell { min-height: 100vh; display: flex; }
.sidebar-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(11, 11, 13, .55);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--ink);
  color: #d9d6ce;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 90;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: 220px;
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(200,16,46,.35), transparent 60%),
    radial-gradient(90% 80% at 95% 20%, rgba(27,58,140,.4), transparent 70%);
  opacity: .55; pointer-events: none;
}
.sidebar-brand {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: var(--ink);
  display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; letter-spacing: .04em;
  color: #fff; text-transform: uppercase; line-height: 1;
  white-space: nowrap;
}
.brand-sub {
  font-size: 9.5px; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-top: 5px;
}
.sidebar-nav { position: relative; flex: 1; overflow-y: auto; padding: 14px 12px 8px; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(255,255,255,.34);
  padding: 6px 10px 7px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: rgba(255,255,255,.72); font-size: 13px; font-weight: 600;
  text-decoration: none; border: 0; width: 100%; background: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(200,16,46,.22), rgba(200,16,46,.04));
  color: #fff;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%); width: 3px; height: 20px;
  background: var(--red); border-radius: 0 3px 3px 0;
}
.nav-item svg.i { width: 17px; height: 17px; opacity: .8; }
.nav-item.active svg.i { opacity: 1; stroke: #ff8ea0; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 800;
  background: var(--red); color: #fff; border-radius: var(--r-pill);
  min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 6px;
}
.nav-badge.quiet { background: rgba(255,255,255,.14); }
.sidebar-foot {
  position: relative; padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: rgba(255,255,255,.45);
}
.sync-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-pill); padding: 7px 11px; margin-bottom: 10px;
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,.75);
  width: 100%; text-align: left;
}
.sync-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 0 3px rgba(168,100,0,.2); flex: 0 0 auto;
}
.sync-dot.on { background: #39c78a; box-shadow: 0 0 0 3px rgba(57,199,138,.18); }
.sync-dot.off { background: #8d8d94; box-shadow: none; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-title { min-width: 0; }
.topbar-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.topbar-title h1 {
  font-size: 24px; font-weight: 600; letter-spacing: .015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.view {
  flex: 1; padding: var(--pad);
  padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom));
  max-width: 1600px; width: 100%; margin: 0 auto;
  animation: viewIn .28s var(--ease);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mobile-nav { display: none; }

/* ----------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--card);
  --btn-fg: var(--text);
  --btn-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary {
  --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink);
}
[data-theme="dark"] .btn.primary { --btn-bg: #f4f2ec; --btn-fg: #0b0b0d; --btn-bd: #f4f2ec; }
.btn.red { --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: var(--red); }
.btn.blue { --btn-bg: var(--blue); --btn-fg: #fff; --btn-bd: var(--blue); }
.btn.outline { --btn-bg: transparent; }
.btn.ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; }
.btn.ghost:hover { --btn-bg: var(--paper-2); box-shadow: none; }
.btn.soft { --btn-bg: var(--paper-2); --btn-bd: transparent; box-shadow: none; }
.btn.danger { --btn-bg: transparent; --btn-fg: var(--red); --btn-bd: color-mix(in srgb, var(--red) 35%, var(--line)); }
.btn.sm { height: 31px; padding: 0 10px; font-size: 11.5px; gap: 6px; border-radius: var(--r-xs); }
.btn.sm svg.i { width: 14px; height: 14px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 13.5px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 31px; }
.btn-link {
  background: none; border: 0; padding: 0; color: var(--blue);
  font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px;
}
.btn-link:hover { text-decoration: underline; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  display: inline-grid; place-items: center; position: relative;
  transition: background .15s, color .15s, transform .12s;
  box-shadow: var(--shadow-xs);
}
.icon-btn:hover { background: var(--paper-2); color: var(--text); transform: translateY(-1px); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--red); border: 1.5px solid var(--card);
}
.menu-btn { display: none; }

/* ------------------------------------------------------------ inputs */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.field .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 40px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--card); color: var(--text);
  padding: 0 12px; font-size: 13px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--red); box-shadow: var(--focus);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input.sm, .select.sm { height: 32px; font-size: 12px; padding: 0 9px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a756b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group svg.i { position: absolute; left: 11px; color: var(--muted); width: 16px; height: 16px; }
.input-group .input { padding-left: 34px; }
.input-suffix {
  position: absolute; right: 10px; font-size: 11px; font-weight: 700;
  color: var(--muted); pointer-events: none;
}
.input-group:has(.input-suffix) .input { padding-right: 42px; }

.searchbox { position: relative; width: min(320px, 38vw); }
.searchbox svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.searchbox input {
  width: 100%; height: 38px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card);
  padding: 0 36px 0 34px; font-size: 12.5px;
}
.searchbox input:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
.searchbox kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 9px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px;
  background: var(--paper);
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }
.field-hint { font-size: 11px; color: var(--muted); line-height: 1.4; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: var(--r-pill);
  background: var(--line-strong); position: relative; transition: background .18s; flex: 0 0 auto;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .18s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch .switch-label { font-size: 12.5px; font-weight: 600; }

.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--red); margin-top: 2px; }

/* chips / segmented */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 29px; padding: 0 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card);
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
  white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: var(--line-strong); background: var(--card-alt); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
[data-theme="dark"] .chip.active { background: #f4f2ec; color: #0b0b0d; border-color: #f4f2ec; }
.chip.red.active { background: var(--red); border-color: var(--red); color: #fff; }
.chip svg.i { width: 13px; height: 13px; }
.chip .count { font-size: 10px; opacity: .6; }

.segmented {
  display: inline-flex; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 3px; gap: 2px;
}
.segmented button {
  border: 0; background: none; border-radius: 6px;
  padding: 6px 11px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.segmented button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-xs); }
.segmented button svg.i { width: 14px; height: 14px; }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card.pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head.wrap { flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }
.card-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card-alt); border-radius: 0 0 var(--r-md) var(--r-md);
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h2 { font-size: clamp(22px, 2.6vw, 30px); }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* grid */
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split-2-1 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.split-1-2 { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); }
.split-3-2 { grid-template-columns: minmax(0, 3fr) minmax(290px, 2fr); }
.mt { margin-top: var(--gap); }
.mt-sm { margin-top: 10px; }
.mb { margin-bottom: var(--gap); }

/* ------------------------------------------------------------ kpis */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpi {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 17px 14px;
  box-shadow: var(--shadow-xs);
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--kpi-tint, rgba(200,16,46,.07)), transparent 70%);
}
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.kpi-icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--kpi-soft, var(--red-soft)); color: var(--kpi-color, var(--red));
}
.kpi-icon svg.i { width: 16px; height: 16px; }
.kpi-value {
  font-family: var(--font-display); font-size: 34px; font-weight: 600;
  letter-spacing: .01em; line-height: 1; margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 800; font-size: 11px; padding: 1px 6px; border-radius: var(--r-pill);
}
.delta svg.i { width: 12px; height: 12px; }
.delta.up { color: var(--green); background: var(--green-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--muted); background: var(--paper-2); }

/* ------------------------------------------------------------ table */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 9.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--card-alt); white-space: nowrap; position: sticky; top: 0;
}
table.data td {
  padding: var(--density-row) 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--card-alt); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .cell-main { font-weight: 700; }
table.data .cell-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
table.data tr.clickable { cursor: pointer; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }

/* ------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  background: var(--paper-2); color: var(--text-2); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.red { background: var(--red-soft); color: var(--red-deep); }
[data-theme="dark"] .badge.red { color: #ff9aab; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
[data-theme="dark"] .badge.blue { color: #9db4f7; }
.badge.green { background: var(--green-soft); color: var(--green); }
[data-theme="dark"] .badge.green { color: #62d5a8; }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
[data-theme="dark"] .badge.amber { color: #f0bc5e; }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
[data-theme="dark"] .badge.violet { color: #b9a6ff; }
.badge.gray { background: var(--paper-2); color: var(--muted); }

/* avatars */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  overflow: hidden; border: 1px solid rgba(0,0,0,.08);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 21px; }
.avatar.xl { width: 76px; height: 76px; font-size: 30px; }
.avatar.red { background: var(--red); }
.avatar.blue { background: var(--blue); }
.avatar.green { background: var(--green); }
.avatar.violet { background: var(--violet); }
.avatar.amber { background: var(--amber); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--card); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person .who { min-width: 0; }
.person .who b { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------- toolbar */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-bottom: 14px;
}
.toolbar .searchbox { width: 260px; }

/* -------------------------------------------------------------- empty */
.empty {
  padding: 42px 20px; text-align: center; color: var(--muted);
}
.empty .empty-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper-2); color: var(--muted);
}
.empty .empty-icon svg.i { width: 24px; height: 24px; }
.empty h3 { font-size: 18px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 40ch; margin: 0 auto 14px; }

/* -------------------------------------------------------------- agenda */
.agenda-wrap { display: grid; grid-template-columns: 72px repeat(var(--agenda-cols, 1), minmax(150px, 1fr)); }
.agenda-scroll { overflow: auto; max-height: calc(100vh - 250px); border-radius: 0 0 var(--r-md) var(--r-md); }
.agenda-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border-bottom: 1px solid var(--line); background: var(--card);
  position: sticky; top: 0; z-index: 3;
}
.agenda-head .who b { font-size: 12px; }
.agenda-head .who span { font-size: 10px; color: var(--muted); }
.agenda-time-head { background: var(--card-alt); }
.agenda-grid { position: relative; }
.agenda-row { display: grid; grid-template-columns: 72px repeat(var(--agenda-cols, 1), minmax(150px, 1fr)); }
.agenda-row .slot-time {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-align: right; padding: 4px 8px 0 0; border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums; background: var(--card-alt);
}
.agenda-slot {
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  min-height: 54px; position: relative; padding: 3px;
  transition: background .12s;
}
.agenda-slot:hover { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
.agenda-slot.clickable { cursor: pointer; }
.appt-card {
  position: relative; border-radius: 8px; padding: 6px 8px 6px 10px;
  background: var(--blue-soft); border-left: 3px solid var(--blue);
  font-size: 11px; line-height: 1.3; min-height: 0;
  overflow: hidden; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.appt-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.appt-card b { display: block; font-size: 11.5px; font-weight: 800; color: var(--text); }
.appt-card span { display: block; color: var(--text-2); font-size: 10px; }
.appt-card .appt-time { font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.appt-card.st-confirmada { background: var(--blue-soft); border-left-color: var(--blue); }
.appt-card.st-pendiente { background: var(--amber-soft); border-left-color: var(--amber); }
.appt-card.st-encurso { background: var(--red-soft); border-left-color: var(--red); }
.appt-card.st-completada { background: var(--green-soft); border-left-color: var(--green); }
.appt-card.st-cancelada, .appt-card.st-noasistio { background: var(--paper-2); border-left-color: var(--muted); opacity: .72; }
.appt-card.st-completada .appt-time { color: var(--green); }
.appt-card.st-pendiente .appt-time { color: var(--amber); }
.appt-card.st-encurso .appt-time { color: var(--red); }

.agenda-list { display: flex; flex-direction: column; }
.agenda-day-row {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center;
}
.agenda-day-row:last-child { border-bottom: 0; }
.agenda-day-time { font-family: var(--font-display); font-size: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.agenda-day-time b { color: var(--text); display: block; font-size: 15px; font-family: var(--font-ui); }

/* ------------------------------------------------------------ calendar */
.calendar { padding: 4px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h3 { font-size: 18px; text-transform: capitalize; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }
.cal-weekdays span {
  text-align: center; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding: 4px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day {
  aspect-ratio: 1 / .82; border-radius: 8px; border: 1px solid transparent;
  background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 12px; font-weight: 600; color: var(--text-2); position: relative;
}
.cal-day:hover { background: var(--paper-2); }
.cal-day.out { color: var(--line-strong); }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--red); color: var(--red); font-weight: 800; }
.cal-day.selected { background: var(--ink); color: #fff; }
.cal-day .cal-badge {
  font-size: 8.5px; font-weight: 800; background: var(--red); color: #fff;
  border-radius: var(--r-pill); padding: 0 4px; min-width: 13px; height: 13px;
  display: grid; place-items: center;
}
.cal-day.selected .cal-badge { background: #fff; color: var(--ink); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: 10px 14px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--red); }
.tab svg.i { width: 15px; height: 15px; }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs button {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--r-pill);
  padding: 6px 13px; font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.pill-tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* -------------------------------------------------------------- charts */
.chart { width: 100%; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 8px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bars .bar-track { width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; }
.bars .bar {
  width: 100%; border-radius: 5px 5px 2px 2px; min-height: 2px;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  transition: height .5s var(--ease), opacity .15s;
  position: relative;
}
.bars .bar.blue { background: linear-gradient(180deg, #2f55b8, var(--blue-deep)); }
.bars .bar:hover { opacity: .8; }
.bars .bar-col span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.bars .bar-col b { font-size: 10px; font-weight: 800; color: var(--text-2); }

.hbar { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: 100px 1fr 46px; gap: 9px; align-items: center; font-size: 11.5px; }
.hbar-row .label { color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row .track { height: 8px; border-radius: var(--r-pill); background: var(--paper-2); overflow: hidden; }
.hbar-row .fill { height: 100%; border-radius: var(--r-pill); background: var(--red); }
.hbar-row .fill.blue { background: var(--blue); }
.hbar-row .fill.green { background: var(--green); }
.hbar-row .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-2); }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.donut .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.donut .center b { font-family: var(--font-display); font-size: 24px; line-height: 1; }
.donut .center span { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.donut-legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 7px; }
.donut-legend .item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.donut-legend .item i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.donut-legend .item b { margin-left: auto; font-variant-numeric: tabular-nums; }

.spark { display: block; width: 100%; height: 34px; overflow: visible; }

/* ------------------------------------------------------------- progress */
.progress { height: 7px; border-radius: var(--r-pill); background: var(--paper-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--red); }
.progress > span.blue { background: var(--blue); }
.progress > span.green { background: var(--green); }
.progress > span.amber { background: var(--amber); }

/* --------------------------------------------------------------- lists */
.stat-list { display: flex; flex-direction: column; }
.stat-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: 0; }
.stat-row .ico {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--paper-2); color: var(--text-2); flex: 0 0 auto;
}
.stat-row .ico svg.i { width: 16px; height: 16px; }
.stat-row .txt { min-width: 0; flex: 1; }
.stat-row .txt b { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-row .txt span { display: block; font-size: 10.5px; color: var(--muted); }
.stat-row .amt { font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-row .amt.pos { color: var(--green); }
.stat-row .amt.neg { color: var(--red); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 15px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -19px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--line-strong);
}
.timeline-item.red::before { border-color: var(--red); }
.timeline-item.blue::before { border-color: var(--blue); }
.timeline-item.green::before { border-color: var(--green); }
.timeline-item b { display: block; font-size: 12px; font-weight: 700; }
.timeline-item span { font-size: 10.5px; color: var(--muted); }
.timeline-item p { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

/* ---------------------------------------------------------------- cuts */
.cut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cut-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; position: relative;
}
.cut-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.cut-art {
  position: relative; aspect-ratio: 4 / 3.4; background: var(--paper-2);
  display: grid; place-items: center; overflow: hidden;
}
.cut-art svg { width: 100%; height: 100%; display: block; }
.cut-art img { width: 100%; height: 100%; object-fit: cover; }
.cut-art .cut-fav {
  position: absolute; top: 8px; right: 8px; width: 27px; height: 27px;
  border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink);
  display: grid; place-items: center; border: 0; box-shadow: var(--shadow-xs);
}
.cut-art .cut-fav.on { color: var(--red); }
.cut-art .cut-fav svg.i { width: 14px; height: 14px; }
.cut-art .cut-price {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--ink); color: #fff; border-radius: var(--r-pill);
  padding: 3px 9px; font-size: 10.5px; font-weight: 800;
}
.cut-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cut-body h4 { font-size: 15px; font-weight: 600; letter-spacing: .015em; }
.cut-body p { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.cut-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 7px; }
.cut-tags .tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--paper-2); color: var(--muted); padding: 2px 6px; border-radius: 4px;
}
.cut-spec { display: flex; gap: 10px; font-size: 9.5px; color: var(--muted); padding-top: 5px; }
.cut-spec b { color: var(--text-2); font-weight: 700; }

.cut-detail-art { border-radius: var(--r-md); overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.cut-detail-art svg, .cut-detail-art img { width: 100%; display: block; }
.spec-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.spec-table td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table td:first-child { color: var(--muted); width: 38%; font-weight: 600; }
.spec-table tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- social */
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.post-media {
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, #1a1a1f, #2c2c35);
  position: relative; display: grid; place-items: center; color: rgba(255,255,255,.5);
}
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-media .platform-tag {
  position: absolute; top: 9px; left: 9px;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(11,11,13,.74); color: #fff; backdrop-filter: blur(6px);
  border-radius: var(--r-pill); padding: 3px 8px; font-size: 9.5px; font-weight: 800;
}
.post-media .platform-tag svg.i { width: 12px; height: 12px; }
.post-media .post-type {
  position: absolute; bottom: 9px; right: 9px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: var(--r-pill); padding: 3px 8px; font-size: 9px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em; backdrop-filter: blur(6px);
}
.post-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-body h4 { font-size: 13px; font-weight: 700; font-family: var(--font-ui); line-height: 1.35; }
.post-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: auto; }
.post-metrics > div { text-align: center; padding: 5px 2px; border-radius: 6px; background: var(--paper-2); }
.post-metrics b { display: block; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.post-metrics span { font-size: 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.post-footer { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); padding-top: 2px; }
.score {
  display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 10.5px;
  color: var(--green); background: var(--green-soft); padding: 2px 7px; border-radius: var(--r-pill);
}
.score.mid { color: var(--amber); background: var(--amber-soft); }
.score.low { color: var(--muted); background: var(--paper-2); }

.insight-card {
  border-left: 3px solid var(--red); background: var(--card);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 12px 14px;
  display: flex; gap: 11px; align-items: flex-start;
}
.insight-card.blue { border-left-color: var(--blue); }
.insight-card.green { border-left-color: var(--green); }
.insight-card .ico { width: 30px; height: 30px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center; flex: 0 0 auto; }
.insight-card b { display: block; font-size: 12.5px; }
.insight-card p { font-size: 11.5px; color: var(--text-2); line-height: 1.45; }

/* ---------------------------------------------------------------- rates */
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rate-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px;
  background: var(--card); position: relative;
}
.rate-card .rate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rate-card .rate-name { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rate-card .rate-value { font-family: var(--font-display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rate-card .rate-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.rate-card.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.rate-card.primary .rate-name, .rate-card.primary .rate-sub { color: rgba(255,255,255,.55); }

/* ---------------------------------------------------------------- receipt */
.receipt {
  font-family: var(--font-mono); font-size: 11px; color: #000;
  width: 320px; max-width: 100%; background: #fff; padding: 18px;
  margin: 0 auto; line-height: 1.5;
}
.receipt h2 { font-family: var(--font-display); color: #000; }
.receipt .rc-head { text-align: center; padding-bottom: 10px; border-bottom: 1px dashed #999; margin-bottom: 10px; }
.receipt .rc-brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: .12em; }
.receipt .rc-sub { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt td.r { text-align: right; }
.receipt .rc-total { border-top: 1px dashed #999; margin-top: 8px; padding-top: 6px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; }
.receipt .rc-foot { text-align: center; margin-top: 12px; font-size: 9px; color: #444; border-top: 1px dashed #999; padding-top: 8px; }

.screenshot-thumb {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); cursor: zoom-in; background: var(--paper-2);
  display: grid; place-items: center; color: var(--muted);
}
.screenshot-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  padding: 20px; text-align: center; color: var(--muted); cursor: pointer;
  background: var(--card-alt); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--red); background: var(--red-soft); color: var(--red-deep); }
.dropzone svg.i { width: 24px; height: 24px; margin-bottom: 6px; }
.dropzone b { display: block; font-size: 12px; color: var(--text); }
.dropzone span { font-size: 10.5px; }
.shot-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.shot-preview .shot { position: relative; width: 78px; height: 78px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.shot-preview .shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-preview .shot button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(11,11,13,.7); color: #fff; border: 0;
  display: grid; place-items: center;
}

/* ---------------------------------------------------------------- modal */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: flex-end; }
.overlay .overlay-bg {
  position: absolute; inset: 0; background: rgba(11,11,13,.5);
  backdrop-filter: blur(3px); animation: fadeIn .2s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay .drawer {
  position: relative; width: min(560px, 100%); height: 100%;
  background: var(--paper); box-shadow: var(--shadow-drawer);
  display: flex; flex-direction: column;
  animation: drawerIn .3s var(--ease);
}
.overlay .drawer.wide { width: min(820px, 100%); }
.overlay .drawer.narrow { width: min(440px, 100%); }
@keyframes drawerIn { from { transform: translateX(36px); opacity: .7; } to { transform: none; opacity: 1; } }
.overlay.center { align-items: center; justify-content: center; padding: 20px; }
.overlay .modal {
  position: relative; width: min(560px, 100%); max-height: min(86vh, 760px);
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: modalIn .24s var(--ease);
}
.overlay .modal.wide { width: min(760px, 100%); }
.overlay .modal.narrow { width: min(420px, 100%); }
@keyframes modalIn { from { transform: scale(.97) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head, .modal-head {
  display: flex; align-items: flex-start; gap: 12px; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.drawer-head h2, .modal-head h2 { font-size: 24px; line-height: 1.1; }
.drawer-head .sub, .modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.drawer-body, .modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-body.flush { padding: 0; }
.drawer-foot, .modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  background: var(--card-alt); flex: 0 0 auto;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.drawer > .drawer-foot, .drawer > .drawer-foot { border-radius: 0; }
.drawer-foot .spacer { flex: 1; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center; color: var(--muted); flex: 0 0 auto;
}
.modal-close:hover { background: var(--paper-2); color: var(--text); }

.section-title {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 9px;
}
.section-title:first-child { margin-top: 0; }
.overlay-section + .overlay-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }

/* ---------------------------------------------------------------- toasts */
.toast-root {
  position: fixed; bottom: 20px; right: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto; min-width: 260px; max-width: 380px;
  background: var(--ink); color: #fff; border-radius: var(--r-md);
  padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s var(--ease);
  font-size: 12px;
}
.toast.out { animation: toastOut .2s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(8px); opacity: 0; } }
.toast .t-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255,255,255,.14); }
.toast .t-ico svg.i { width: 13px; height: 13px; }
.toast.ok .t-ico { background: #1d8f63; }
.toast.err .t-ico { background: var(--red); }
.toast.warn .t-ico { background: var(--amber); }
.toast .t-body { flex: 1; }
.toast .t-body b { display: block; font-size: 12px; font-weight: 700; }
.toast .t-body span { font-size: 11px; color: rgba(255,255,255,.7); }
.toast .t-close { background: none; border: 0; color: rgba(255,255,255,.5); padding: 0; line-height: 1; }
.toast .t-close:hover { color: #fff; }

/* --------------------------------------------------------------- charts svg */
.chart-tip {
  position: fixed; z-index: 500; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 5px 8px; border-radius: 6px; transform: translate(-50%, -130%);
  white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.chart-tip.on { opacity: 1; }

/* ------------------------------------------------------------- utilities */
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.tiny { font-size: 10px; }
.mono { font-family: var(--font-mono); font-size: 11px; }
.strong { font-weight: 800; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.row.gap-sm { gap: 6px; }
.row.gap-lg { gap: 18px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.warn-t { color: var(--amber); }
.blue-t { color: var(--blue); }
.red-t { color: var(--red); }
.big-num { font-family: var(--font-display); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.vdiv { width: 1px; align-self: stretch; background: var(--line); }
.kbd { font-family: var(--font-mono); font-size: 9px; border: 1px solid var(--line); padding: 1px 4px; border-radius: 3px; color: var(--muted); }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* --------------------------------------------------------------- print */
.print-area { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .mobile-nav, .toast-root, #overlay-root, .sidebar-scrim, .page-actions, .toolbar, .no-print { display: none !important; }
  .app-main { display: block; }
  .view { padding: 0; max-width: none; }
  .print-area { display: block; }
  .card { border: 0; box-shadow: none; }
  body.printing-receipt > *:not(.print-area) { display: none; }
  .receipt { width: 80mm; }
  @page { margin: 8mm; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-3-2, .split-2-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-1-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --pad: 14px; --gap: 13px; --topbar-h: 62px; }
  body { font-size: 13.5px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-eyebrow { display: none; }
  .topbar .searchbox { display: none; }
  .topbar-actions .hide-sm { display: none; }
  .view { padding-bottom: 84px; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; border-radius: 10px; color: var(--muted);
    font-size: 8.5px; font-weight: 700; text-decoration: none;
  }
  .mobile-nav a.active { color: var(--red); background: var(--red-soft); }
  .mobile-nav a svg.i { width: 19px; height: 19px; }
  .page-head { align-items: flex-start; }
  .page-head h2 { font-size: 23px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 27px; }
  .kpi { padding: 12px; }
  .kpi-icon { width: 26px; height: 26px; }
  .cols-2, .cols-3, .cols-4, .cols-5 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .toolbar .searchbox { width: 100%; }
  .toolbar .spacer { display: none; }
  .toolbar > .btn, .toolbar > .segmented { flex: 1 1 auto; }
  .cut-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .cut-body { padding: 9px 10px 10px; }
  .cut-body h4 { font-size: 13.5px; }
  .social-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .overlay .drawer { width: 100%; }
  .overlay.center { padding: 0; align-items: flex-end; }
  .overlay .modal { width: 100%; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .toast-root { left: 12px; right: 12px; bottom: 78px; align-items: stretch; }
  .toast { max-width: none; }
  .agenda-scroll { max-height: calc(100vh - 300px); }
  .table-wrap { border: 1px solid var(--line); }
  table.data th, table.data td { padding-left: 10px; padding-right: 10px; }
  .hide-mobile { display: none !important; }
  .donut-wrap { justify-content: center; }
  .modal-foot .btn, .drawer-foot .btn { flex: 1; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: minmax(0,1fr); }
  .kpi-value { font-size: 30px; }
}

/* motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Shell · búsqueda global, notificaciones y barra superior
   ========================================================================== */
.topbar-left .searchbox { margin-left: auto; width: min(330px, 30vw); }
.topbar-left .searchbox input { cursor: pointer; }
.topbar-page-actions { display: flex; align-items: center; gap: 7px; }
.topbar-rate {
  height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card);
  display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start;
  line-height: 1.05; box-shadow: var(--shadow-xs);
  transition: background .15s, transform .12s;
}
.topbar-rate:hover { background: var(--paper-2); transform: translateY(-1px); }
.topbar-rate span { font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.topbar-rate b { font-size: 12px; font-variant-numeric: tabular-nums; }
.sync-pill .grow { min-width: 0; }
.sync-pill .grow > span { display: block; }
.sync-pill [data-sync-label] { font-size: 10.5px; font-weight: 700; }
.sync-pill .sync-sub { font-size: 9px; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-pill svg.i { width: 13px; height: 13px; opacity: .5; margin-left: auto; }

/* Búsqueda global */
.cmd { display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.cmd-box { width: 100%; }
.cmd-box input { cursor: text; }
.cmd-results { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.cmd-group { display: flex; flex-direction: column; gap: 2px; }
.cmd-group-title { font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 4px 4px 5px; }
.cmd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px;
}
.cmd-item:hover, .cmd-item:focus-visible { background: var(--paper-2); }
.cmd-item .grow b { display: block; font-size: 12.5px; font-weight: 700; }
.cmd-item .grow small { display: block; font-size: 10.5px; color: var(--muted); }
.cmd-item > svg.i { width: 14px; height: 14px; color: var(--muted); }
.cmd-icon {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--paper-2); color: var(--text-2); flex: 0 0 auto;
}
.cmd-icon svg.i { width: 15px; height: 15px; }
.cmd-tag { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--paper-2); border-radius: var(--r-pill); padding: 2px 7px; white-space: nowrap; }
.cmd-empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.cmd-empty svg.i { width: 26px; height: 26px; margin-bottom: 8px; }
.cmd-empty b { display: block; font-size: 14px; color: var(--text); }
.cmd-empty p { font-size: 11.5px; margin-top: 3px; }

/* Notificaciones */
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--card); border-radius: var(--r-sm);
  padding: 11px 12px; transition: background .15s, border-color .15s;
}
.notif-item:hover { background: var(--paper-2); }
.notif-item.unread { border-left: 3px solid var(--red); background: var(--red-soft); }
.notif-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.notif-icon svg.i { width: 15px; height: 15px; }
.notif-item .grow b { display: block; font-size: 12px; font-weight: 700; }
.notif-item .grow small { display: block; font-size: 10.5px; color: var(--text-2); line-height: 1.45; }
.notif-item .grow i { display: block; font-style: normal; font-size: 9.5px; color: var(--muted); margin-top: 3px; }

/* ==========================================================================
   Agenda · tablero por barbero y vista semanal
   ========================================================================== */
.agenda-board { display: flex; align-items: flex-start; overflow-x: auto; background: var(--card); }
.agenda-time-col { flex: 0 0 62px; background: var(--card-alt); border-right: 1px solid var(--line); }
.agenda-hr {
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 2px 8px 0 0; border-top: 1px solid var(--line);
  font-size: 9.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.agenda-barber-col { flex: 1 0 172px; min-width: 172px; border-right: 1px solid var(--line); }
.agenda-barber-col:last-child { border-right: 0; }
.agenda-body { position: relative; background: var(--card); }
.agenda-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.agenda-slot-hit { position: absolute; left: 0; right: 0; border: 0; background: transparent; padding: 0; z-index: 1; }
.agenda-slot-hit:hover { background: color-mix(in srgb, var(--paper-2) 65%, transparent); }
.agenda-slot-hit::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); opacity: 0; font-weight: 700; }
.agenda-slot-hit:hover::after { opacity: .6; }
.appt-block { position: absolute; left: 3px; right: 3px; z-index: 2; }
.agenda-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.agenda-now::before {
  content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card);
}
.agenda-head { position: sticky; top: 0; z-index: 4; }
.agenda-time-head { display: flex; align-items: center; justify-content: flex-end; padding: 0 8px; background: var(--card-alt); border-bottom: 1px solid var(--line); }
.agenda-barber-col .agenda-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--card-alt); border-bottom: 1px solid var(--line); min-width: 0;
}
.agenda-barber-col .agenda-head .who { min-width: 0; }
.agenda-barber-col .agenda-head .who b {
  display: block; font-size: 11.5px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agenda-barber-col .agenda-head .who span { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.agenda-barber-col .agenda-head:hover { background: var(--paper-2); }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; padding: 14px; overflow-x: auto; }
.week-col {
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  display: flex; flex-direction: column; min-height: 250px; overflow: hidden;
}
.week-col.today { border-color: var(--red); }
.week-col.selected { box-shadow: 0 0 0 2px var(--red-soft); }
.week-head {
  border: 0; border-bottom: 1px solid var(--line); background: var(--card-alt);
  padding: 7px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.week-head span { font-size: 8.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.week-head b { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.week-head i {
  font-style: normal; font-size: 8.5px; font-weight: 800; background: var(--red); color: #fff;
  border-radius: var(--r-pill); padding: 0 5px; margin-top: 2px;
}
.week-body { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.week-appt {
  border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 6px;
  padding: 4px 6px; font-size: 9.5px; line-height: 1.3; cursor: pointer;
}
.week-appt:hover { filter: brightness(.97); }
.week-appt b { display: block; font-size: 9px; color: var(--blue); font-variant-numeric: tabular-nums; }
.week-appt span { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-appt i { display: block; font-style: normal; font-size: 8.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-appt.st-pendiente { border-left-color: var(--amber); background: var(--amber-soft); }
.week-appt.st-pendiente b { color: var(--amber); }
.week-appt.st-completada { border-left-color: var(--green); background: var(--green-soft); }
.week-appt.st-completada b { color: var(--green); }
.week-appt.st-cancelada, .week-appt.st-noasistio { border-left-color: var(--muted); background: var(--paper-2); opacity: .7; }
.week-empty { color: var(--muted); font-size: 9.5px; text-align: center; padding: 18px 0; }
.week-foot { border-top: 1px solid var(--line); padding: 5px 6px; font-size: 9px; color: var(--muted); text-align: center; white-space: nowrap; }

/* ==========================================================================
   Clientes · tarjetas
   ========================================================================== */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.client-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.client-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.client-card h4 { font-size: 19px; margin-top: 10px; }

/* ==========================================================================
   Banco de cortes · hero
   ========================================================================== */
.cuts-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px;
  background: var(--ink); color: #fff; border-radius: var(--r-lg);
  padding: 26px 28px; overflow: hidden; position: relative; align-items: center;
}
.cuts-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(200,16,46,.5), transparent 62%);
  pointer-events: none;
}
.cuts-hero::after {
  content: ""; position: absolute; inset: auto auto -50% -10%; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(27,58,140,.55), transparent 62%);
  pointer-events: none;
}
.cuts-hero-text { position: relative; z-index: 1; min-width: 0; }
.cuts-hero-text h3 { font-size: clamp(28px, 3.4vw, 40px); color: #fff; margin: 10px 0 7px; }
.cuts-hero-text p { font-size: 12px; color: rgba(255,255,255,.72); max-width: 58ch; line-height: 1.55; }
.cuts-search {
  display: flex; align-items: center; gap: 9px; height: 42px; max-width: 460px;
  margin-top: 16px; padding: 0 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.6);
}
.cuts-search svg.i { width: 16px; height: 16px; flex: 0 0 auto; }
.cuts-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: #fff; font-size: 12.5px; }
.cuts-search input::placeholder { color: rgba(255,255,255,.45); }
.cuts-search kbd { font-size: 9px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; padding: 1px 5px; color: rgba(255,255,255,.6); }
.cuts-hero-art {
  position: relative; z-index: 1; width: 190px; height: 190px; justify-self: end;
  border-radius: 50%; overflow: hidden; background: #f7f5ef;
  border: 2px solid rgba(255,255,255,.2); box-shadow: 0 18px 40px -18px rgba(0,0,0,.7);
}
.cuts-hero-art svg { width: 100%; height: 100%; display: block; }

/* ==========================================================================
   Finanzas · gráficos y estado de resultados
   ========================================================================== */
.month-chart { display: flex; align-items: flex-end; gap: 10px; height: 185px; padding-top: 16px; }
.month-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.month-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; }
.mbar {
  width: 36%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--red), var(--red-deep)); position: relative;
  transition: height .4s var(--ease);
}
.mbar.expense { background: linear-gradient(180deg, #3a3a44, var(--ink)); }
.mbar span {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  font-size: 8.5px; font-weight: 800; color: var(--text-2); white-space: nowrap;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.month-col:hover .mbar span { opacity: 1; }
.month-col > b, .month-col > span { font-size: 8.5px; }
.pnl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px 112px; gap: 10px;
  align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px;
}
.pnl-row > :nth-child(2), .pnl-row > :nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.pnl-row.header {
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border-bottom-color: var(--line-strong);
}
.pnl-row.total { border-bottom: 0; border-top: 2px solid var(--line-strong); padding-top: 10px; font-size: 14px; }

/* ==========================================================================
   Tasas · calculadora
   ========================================================================== */
.calc-result { margin-top: 14px; padding: 18px; border-radius: var(--r-md); background: var(--paper-2); text-align: center; }
.calc-result .big-num { font-size: clamp(30px, 4vw, 40px); margin: 3px 0; }

/* ==========================================================================
   Servicios · tarjetas
   ========================================================================== */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.service-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.service-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.service-card.is-off { opacity: .58; }
.service-card h3 { font-size: 20px; }
.service-card > p { font-size: 11.5px; color: var(--muted); line-height: 1.45; min-height: 33px; }
.service-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.service-meta span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.service-meta b { font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Ajustes · apariencia y sincronización
   ========================================================================== */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 540px; }
.theme-option {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--r-sm);
  padding: 9px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-2);
}
.theme-option:hover { border-color: var(--line-strong); }
.theme-option.active { border-color: var(--red); box-shadow: var(--focus); color: var(--text); }
.theme-option svg.i { width: 15px; height: 15px; }
.theme-preview {
  width: 100%; height: 46px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--paper); display: flex; gap: 3px; padding: 6px; overflow: hidden;
}
.theme-preview span { border-radius: 2px; background: var(--line-strong); }
.theme-preview span:nth-child(1) { width: 13px; height: 100%; }
.theme-preview span:nth-child(2) { flex: 1; height: 9px; }
.theme-preview span:nth-child(3) { flex: 1; height: 9px; }
.theme-preview.dark { background: #0b0b0d; border-color: #2a2a32; }
.theme-preview.dark span { background: #34343e; }
.theme-preview.system { background: linear-gradient(90deg, #f5f3ee 50%, #0b0b0d 50%); }
.color-swatch { width: 26px; height: 26px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px var(--line), inset 0 0 0 2px var(--card); }
.sync-status-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.about-logo { width: 84px; height: 84px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.about-logo svg.i { width: 36px; height: 36px; }
.spec-table-wrap { overflow-x: auto; }

/* ==========================================================================
   Redes sociales · conexiones y contenido
   ========================================================================== */
.connect-card { display: flex; flex-direction: column; gap: 10px; }
.connect-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.connect-head > div:nth-child(2) { flex: 1; min-width: 120px; }
.connect-head h3 { font-size: 18px; }
.connect-head .badge { margin-left: auto; }
.connect-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.connect-card > p { font-size: 11.5px; line-height: 1.55; }
.type-card { background: var(--card-alt); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.template-card { background: var(--card-alt); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }

/* ==========================================================================
   Equipo · tarjetas y horarios
   ========================================================================== */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.team-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.team-card.is-off { opacity: .58; }
.team-top { display: flex; align-items: center; gap: 12px; }
.team-top h3 { font-size: 19px; }
.team-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center;
  padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.team-stats span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.team-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }
.schedule-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.sched {
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 0;
  text-align: center; font-size: 8.5px; background: var(--paper-2); color: var(--muted);
}
.sched span { display: block; font-weight: 800; }
.sched i { font-style: normal; font-size: 8px; line-height: 1; }
.sched.on { background: var(--green-soft); border-color: transparent; color: var(--green); }
.sched.off { opacity: .5; }

/* ==========================================================================
   Overlays · fichas, caja, cortes y formularios
   ========================================================================== */
.profile-head {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; background: var(--card-alt); border-bottom: 1px solid var(--line);
}
.profile-head h3 { font-size: 24px; }
.profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.profile-stats > div { padding: 12px 8px; text-align: center; border-right: 1px solid var(--line); min-width: 0; }
.profile-stats > div:last-child { border-right: 0; }
.profile-stats span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.profile-stats b { font-family: var(--font-display); font-size: 17px; }
.profile-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.mini-history { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--card); cursor: pointer; }
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: var(--paper-2); }
.mini-date { flex: 0 0 38px; text-align: center; background: var(--paper-2); border-radius: 6px; padding: 3px 0; line-height: 1; }
.mini-date b { display: block; font-family: var(--font-display); font-size: 15px; }
.mini-date span { font-size: 8px; text-transform: uppercase; color: var(--muted); }
.cash-hero { margin-bottom: 16px; padding: 16px; border-radius: var(--r-md); background: var(--ink); color: #fff; text-align: center; }
.cash-hero .big-num { font-size: 38px; color: #fff; }
.cut-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.cut-detail-art { border-radius: 0; border: 0; border-right: 1px solid var(--line); display: grid; place-items: center; background: var(--paper-2); }
.cut-detail-art svg { width: 100%; height: auto; max-height: 440px; }
.cut-detail-body { padding: 18px 20px; min-width: 0; }
.svc-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card-alt); padding: 4px 12px; max-height: 250px; overflow-y: auto; }
.svc-group { display: flex; flex-direction: column; }
.svc-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; cursor: pointer; }
.svc-check:last-child { border-bottom: 0; }
.svc-check input { accent-color: var(--red); }
.svc-check i { font-style: normal; font-size: 10px; color: var(--muted); }
.booking-summary {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px; background: var(--card-alt);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.booking-summary > div { display: flex; flex-direction: column; }
.booking-summary b { font-size: 14px; }
.booking-summary .tiny { margin-left: auto; }
.drawer-form { display: flex; flex-direction: column; gap: 14px; }
.schedule-edit { display: flex; flex-direction: column; gap: 7px; }
.sched-edit-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr 1fr; gap: 8px; align-items: center; }
.payment-items { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 12px; background: var(--card-alt); }
.green-t { color: var(--green); }

/* ==========================================================================
   Varios
   ========================================================================== */
.confetti-root { position: fixed; inset: 0; z-index: 500; pointer-events: none; overflow: hidden; }
.noscript-card { max-width: 420px; margin: 12vh auto; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.noscript-card h1 { font-size: 28px; margin-bottom: 6px; }
.noscript-card p { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1500px) {
  .topbar-page-actions { display: none; }
}
@media (max-width: 1080px) {
  .topbar-left .searchbox { display: none; }
  .cuts-hero { grid-template-columns: minmax(0, 1fr) 170px; padding: 22px; }
  .cuts-hero-art { width: 150px; height: 150px; }
  .week-grid { grid-template-columns: repeat(7, minmax(130px, 1fr)); }
}
@media (max-width: 720px) {
  .cuts-hero { grid-template-columns: minmax(0, 1fr); }
  .cuts-hero-art { display: none; }
  .cuts-hero-text h3 { font-size: 30px; }
  .month-chart { height: 150px; gap: 6px; }
  .service-grid, .team-grid, .client-grid { grid-template-columns: minmax(0, 1fr); }
  .cut-detail { grid-template-columns: minmax(0, 1fr); }
  .cut-detail-art { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-head { padding: 14px; }
  .profile-head > .col { width: 100%; flex-direction: row; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats > div:nth-child(2) { border-right: 0; }
  .profile-stats > div:nth-child(1), .profile-stats > div:nth-child(2) { border-bottom: 1px solid var(--line); }
  .profile-body { padding: 14px; }
  .pnl-row { grid-template-columns: minmax(0, 1fr) 78px; }
  .pnl-row > :nth-child(3) { display: none; }
  .sched-edit-row { grid-template-columns: minmax(0, 1fr) 82px 82px; }
  .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-rate { display: none; }
  .booking-summary .tiny { margin-left: 0; }
}

/* ==========================================================================
   Extensiones 2026 � dashboard, promos, lealtad, gr�ficos, listas
   ========================================================================== */

/* ------------------------------------------------------------ dashboard hero */
.dash-hero {
  position: relative; overflow: hidden;
  align-items: center;
  padding: 24px 26px;
  border-radius: var(--r-lg);
  border: 1px solid #2b2b32;
  background:
    radial-gradient(120% 180% at 100% 0%, rgba(200,16,46,.30) 0%, rgba(200,16,46,0) 52%),
    radial-gradient(120% 180% at 0% 100%, rgba(27,58,140,.35) 0%, rgba(27,58,140,0) 55%),
    linear-gradient(120deg, #08080a 0%, #141419 55%, #1a0c11 100%);
  box-shadow: 0 18px 46px -26px rgba(11,11,13,.65);
}
.dash-hero h2 { color: #fff; letter-spacing: -.02em; }
.dash-hero p { color: rgba(255,255,255,.62); }
.dash-hero .topbar-eyebrow { color: rgba(255,255,255,.52); }
.dash-hero .hero-copy { position: relative; z-index: 2; }
.dash-hero .page-actions { position: relative; z-index: 2; }
.dash-hero .btn {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff;
  backdrop-filter: blur(6px);
}
.dash-hero .btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); }
.dash-hero .btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.dash-hero .btn.red:hover { background: var(--red-deep); }
.hero-orbe { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; filter: blur(2px); }
.hero-orbe.red { width: 300px; height: 300px; right: -70px; top: -140px; background: radial-gradient(circle, rgba(200,16,46,.55), transparent 68%); }
.hero-orbe.blue { width: 260px; height: 260px; left: 34%; bottom: -190px; background: radial-gradient(circle, rgba(27,58,140,.55), transparent 68%); }

/* ------------------------------------------------------- misi�n y visi�n */
.strategy-card { position: relative; overflow: hidden; }
.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.strategy-block {
  position: relative; padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--card-alt);
}
.strategy-block::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px;
  background: var(--red);
}
.strategy-block.blue::before { background: var(--blue); }
.strategy-block span {
  display: inline-block; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 800; color: var(--red); margin-bottom: 5px;
}
.strategy-block.blue span { color: var(--blue); }
.strategy-block p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.goal-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.goal-item {
  padding: 11px 13px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--paper-2) 55%, transparent);
}
.goal-item b { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 4px; }
.goal-item span { font-size: 11.5px; color: var(--text-2); line-height: 1.5; }

/* -------------------------------------------------------------- promociones */
.promo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.promo-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.promo-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--red), var(--red-deep));
}
.promo-card.blue::before { background: linear-gradient(90deg, var(--blue), #3a63d8); }
.promo-card.green::before { background: linear-gradient(90deg, var(--green), #22a06b); }
.promo-card.violet::before { background: linear-gradient(90deg, var(--violet), #8b6cf0); }
.promo-card.amber::before { background: linear-gradient(90deg, var(--amber), #e0a020); }
.promo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--red) 24%, var(--line)); }
.promo-card.is-off { opacity: .6; filter: saturate(.55); }
.promo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.promo-card h3 { font-size: 18px; letter-spacing: -.01em; margin-bottom: 4px; }
.promo-card p { font-size: 12px; color: var(--muted); line-height: 1.5; min-height: 36px; }
.promo-price {
  font-family: var(--font-display); font-size: 30px; line-height: 1; letter-spacing: -.02em;
  margin: 12px 0 10px; color: var(--red);
}
.promo-card.blue .promo-price { color: var(--blue); }
.promo-card.green .promo-price { color: var(--green); }
.promo-card.violet .promo-price { color: var(--violet); }
.promo-card.amber .promo-price { color: var(--amber); }
.promo-meta { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); }
.promo-meta span { display: inline-flex; align-items: center; gap: 6px; }
.promo-meta svg.i { width: 13px; height: 13px; opacity: .7; }

/* ---------------------------------------------------------------- lealtad */
.loyalty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.loyalty-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 16px; box-shadow: var(--shadow-xs);
}
.loyalty-card.has-reward {
  border-color: color-mix(in srgb, var(--amber) 46%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--amber-soft) 55%, var(--card)), var(--card));
}
.stamp-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.stamp {
  width: 27px; height: 27px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--muted);
  border: 1.5px dashed var(--line-strong); background: var(--paper-2);
}
.stamp.on {
  border-style: solid; border-color: var(--red);
  background: radial-gradient(circle at 30% 25%, #e63b57, var(--red));
  color: #fff; box-shadow: 0 3px 9px -3px rgba(200,16,46,.55);
}
.stamp svg.i { width: 13px; height: 13px; }

/* ------------------------------------------------------- mapa de horas */
.heat-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.heat-cell {
  position: relative; border-radius: 8px; padding: 9px 4px 6px; text-align: center;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--red) calc(var(--heat) * 72%), var(--paper-2));
  transition: transform .15s ease;
}
.heat-cell:hover { transform: translateY(-1px) scale(1.04); }
.heat-cell b { display: block; font-size: 14px; line-height: 1; color: color-mix(in srgb, var(--ink) 88%, #fff); }
.heat-cell span { display: block; font-size: 9px; margin-top: 3px; color: var(--text-2); font-weight: 700; letter-spacing: .04em; }
.heat-cell.peak { outline: 2px solid var(--red); outline-offset: 1px; }
.heat-cell.peak b { color: var(--red-deep); }
.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; justify-content: flex-end; font-size: 10px; color: var(--muted); }
.heat-legend i { width: 14px; height: 9px; border-radius: 3px; background: var(--paper-2); border: 1px solid var(--line); }
.heat-legend i:nth-of-type(1) { background: color-mix(in srgb, var(--red) 14%, var(--paper-2)); }
.heat-legend i:nth-of-type(2) { background: color-mix(in srgb, var(--red) 32%, var(--paper-2)); }
.heat-legend i:nth-of-type(3) { background: color-mix(in srgb, var(--red) 54%, var(--paper-2)); }
.heat-legend i:nth-of-type(4) { background: color-mix(in srgb, var(--red) 74%, var(--paper-2)); }
.heat-legend i:nth-of-type(5) { background: var(--red); }
.hours-bars .hbar-row { grid-template-columns: 74px 1fr 34px; }

/* --------------------------------------------------------- gr�fico finance */
.fin-chart { position: relative; width: 100%; }
.fin-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-axis { fill: var(--muted); font-size: 9.5px; font-family: var(--font-ui); font-weight: 600; }
.chart-hit { cursor: pointer; transition: opacity .15s ease, transform .15s ease; }
.chart-hit:hover { opacity: .82; }
.chart-bar { filter: drop-shadow(0 5px 9px rgba(200,16,46,.18)); }
.chart-dot { fill: var(--card); stroke: var(--red); stroke-width: 2; }
.chart-tip {
  position: absolute; z-index: 5; max-width: 210px;
  padding: 7px 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 10.5px; line-height: 1.4;
  box-shadow: var(--shadow-md); pointer-events: none; white-space: normal;
}

/* ------------------------------------------------------- vista presupuesto */
.quote-preview {
  display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 14px;
  align-items: start; padding: 14px; border-radius: var(--r-md);
  border: 1px dashed var(--line-strong); background: var(--paper-2);
}
.quote-preview img { width: 100%; border-radius: 10px; box-shadow: var(--shadow-sm); display: block; }
.quote-preview textarea { min-height: 320px; font-size: 11px; }
@media (max-width: 720px) {
  .quote-preview { grid-template-columns: minmax(0, 1fr); }
  .quote-preview textarea { min-height: 220px; }
}

/* ------------------------------------------------------------ vaciar listas */
.clear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.clear-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card-alt);
  font: inherit; font-size: 11.5px; font-weight: 700; color: var(--text-2);
  cursor: pointer; text-align: left; transition: all .15s ease;
}
.clear-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--red) 42%, var(--line)); color: var(--red); background: var(--red-soft); }
.clear-btn:disabled { opacity: .42; cursor: not-allowed; }
.clear-btn span { flex: 1; }
.clear-btn b { font-variant-numeric: tabular-nums; color: var(--muted); }
.clear-btn svg.i { width: 13px; height: 13px; opacity: .55; }

/* --------------------------------------------------------------- helpers */
.segmented.sm button { padding: 5px 9px; font-size: 10.5px; }
.segmented.sm button svg.i { width: 12px; height: 12px; }
.chip.static { pointer-events: none; background: var(--paper-2); border-color: var(--line); }
.promo-card .btn.sm, .loyalty-card .btn.sm { font-size: 11px; }

@media (max-width: 1080px) {
  .promo-grid, .loyalty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .goal-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .promo-grid, .loyalty-grid, .strategy-grid { grid-template-columns: minmax(0, 1fr); }
  .heat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-hero { padding: 20px 18px; }
  .dash-hero .hero-orbe.red { width: 220px; height: 220px; }
  .clear-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Tutorial guiado y centro de ayuda
   ========================================================================== */
.sidebar-help {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 11px; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-pill);
  background: transparent; color: rgba(255,255,255,.62);
  font-size: 11px; font-weight: 700; text-align: left;
  transition: background .15s, color .15s;
}
.sidebar-help:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-help span { flex: 1; }
.sidebar-help svg.i { width: 15px; height: 15px; opacity: .8; }

/* ------------------------------------------------------------ welcome */
.tutorial-welcome { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.tutorial-welcome-mark {
  width: 58px; height: 58px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 18px; color: #fff;
  background: linear-gradient(145deg, var(--red), var(--red-deep));
  box-shadow: 0 14px 30px -14px rgba(200,16,46,.7);
}
.tutorial-welcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tutorial-welcome-item {
  display: flex; flex-direction: column; gap: 5px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card-alt);
}
.tutorial-welcome-item b { font-size: 12.5px; }
.tutorial-welcome-item span { font-size: 11px; color: var(--muted); line-height: 1.45; }
.tutorial-welcome-ico {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 10px; margin-bottom: 2px;
}
.tutorial-welcome-ico.red { background: var(--red-soft); color: var(--red); }
.tutorial-welcome-ico.blue { background: var(--blue-soft); color: var(--blue); }
.tutorial-welcome-ico.green { background: var(--green-soft); color: var(--green); }

/* ------------------------------------------------------------- help hub */
.help-hub { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.help-hub-top { display: flex; gap: 10px; align-items: center; }
.help-search { flex: 1; }
.help-topics { display: flex; flex-direction: column; gap: 8px; max-height: min(48vh, 430px); overflow-y: auto; padding-right: 3px; }
.help-topic {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
.help-topic:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.help-topic.done { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); background: color-mix(in srgb, var(--green-soft) 48%, var(--card)); }
.help-topic-ico {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 11px; background: var(--paper-2); color: var(--text-2);
}
.help-topic.done .help-topic-ico { background: var(--green-soft); color: var(--green); }
.help-topic-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.help-topic-copy b { font-size: 12.5px; }
.help-topic-copy p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.help-topic-meta { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.help-topic.done .help-topic-meta { color: var(--green); }
.help-hub-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Ajustes → Ayuda */
.help-list { display: flex; flex-direction: column; gap: 6px; }
.help-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.help-row:last-child { border-bottom: 0; }
.help-row-ico { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--paper-2); color: var(--text-2); }
.help-row .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.help-row .grow b { font-size: 12px; }
.help-row .grow span { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.help-big-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.help-row .badge { flex: 0 0 auto; }

/* ------------------------------------------------------------- tour */
body.tutorial-open { overflow: hidden !important; }
.tutorial-layer {
  position: fixed; inset: 0; z-index: 1000;
  pointer-events: none;
}
.tutorial-layer.is-centered::before {
  content: ''; position: fixed; inset: 0;
  background: rgba(8,8,10,.66);
}
.tutorial-ring {
  position: fixed; display: none; pointer-events: none;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 0 0 4px rgba(200,16,46,.55), 0 0 0 9999px rgba(8,8,10,.66);
  transition: left .2s var(--ease), top .2s var(--ease), width .2s var(--ease), height .2s var(--ease);
}
.tutorial-card-host { position: fixed; inset: 0; pointer-events: none; }
.tutorial-card {
  position: fixed; width: min(380px, calc(100vw - 28px));
  max-height: calc(100vh - 24px);
  display: flex; flex-direction: column;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  overflow: hidden;
  animation: tutorialIn .22s var(--ease);
}
@keyframes tutorialIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.tutorial-card.centered {
  left: 50% !important; top: 50% !important;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100vw - 28px));
}
.tutorial-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--card-alt);
}
.tutorial-topic-ico {
  width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 11px; background: var(--blue-soft); color: var(--blue);
}
.tutorial-kicker { flex: 1; min-width: 0; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tutorial-kicker small { display: block; margin-top: 1px; font-size: 9.5px; letter-spacing: .04em; text-transform: none; color: var(--muted); font-weight: 600; }
.tutorial-x {
  width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--muted);
}
.tutorial-x:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.tutorial-card-body { padding: 15px 16px 13px; overflow-y: auto; }
.tutorial-card-body h3 { font-size: 21px; line-height: 1.12; margin-bottom: 7px; }
.tutorial-card-body p { font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.tutorial-tip {
  display: flex; gap: 7px; align-items: flex-start;
  margin-top: 10px; padding: 8px 10px;
  font-size: 11px; line-height: 1.45; color: var(--blue);
  background: var(--blue-soft); border-radius: var(--r-sm);
}
.tutorial-card-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-top: 1px solid var(--line); background: var(--card-alt);
}
.tutorial-dots { display: flex; gap: 4px; flex: 0 0 auto; }
.tutorial-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.tutorial-dots span.past { background: color-mix(in srgb, var(--red) 45%, var(--line-strong)); }
.tutorial-dots span.on { width: 16px; border-radius: 99px; background: var(--red); }
.tutorial-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.tutorial-actions .btn { height: 33px; padding: 0 10px; font-size: 11.5px; }
.tutorial-complete-mark {
  width: 58px; height: 58px; margin: 0 auto 8px; display: grid; place-items: center;
  border-radius: 50%; background: var(--green-soft); color: var(--green);
}
.tutorial-card.is-complete { padding: 24px 20px 20px; text-align: center; }
.tutorial-card.is-complete h3 { font-size: 24px; margin-bottom: 6px; }
.tutorial-card.is-complete p { font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.tutorial-complete-actions { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 720px) {
  .tutorial-welcome-grid { grid-template-columns: 1fr; }
  .tutorial-welcome-item { flex-direction: row; align-items: flex-start; gap: 9px; }
  .tutorial-welcome-ico { margin-bottom: 0; flex: 0 0 auto; }
  .tutorial-card { width: calc(100vw - 20px); }
  .tutorial-card-body h3 { font-size: 19px; }
  .help-hub-top { flex-direction: column; align-items: stretch; }
  .help-topic { align-items: flex-start; flex-wrap: wrap; }
  .help-topic .btn { margin-left: 49px; }
  .help-hub-foot { flex-direction: column; align-items: flex-start; }
  .help-row { flex-wrap: wrap; }
  .help-row .grow { flex-basis: calc(100% - 46px); }
}
