/* ============ Tokens ============ */
:root {
  color-scheme: light;
  --bg: #f5f3ef; --surface: #ffffff; --surface-2: #f1eee9; --text: #1d1b19; --muted: #6f6a63; --line: #e6e1d9;
  --brand: #a8741d; --brand-soft: #f6ecd8;
  --gold-1: #e2b04c; --gold-2: #b9821f; --on-gold: #1b1406;
  --barber: #2f5d8a; --barber-soft: #e4eef8; --beauty: #c2416b; --beauty-soft: #fbe6ee;
  --ok: #157347; --ok-soft: #e1f3e8; --warn: #9a5b06; --warn-soft: #fdf0d2;
  --bad: #b42318; --bad-soft: #fde5e3; --info: #2563a8; --info-soft: #e2edf9;
  --shadow: 0 1px 2px rgba(30, 20, 5, .06), 0 6px 20px rgba(30, 20, 5, .07);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .35);
  --r: 16px; --r-sm: 10px;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e11; --surface: #17171c; --surface-2: #202027; --text: #f4f0e9; --muted: #a29c92; --line: #2b2b33;
  --brand: #e3b45a; --brand-soft: #2b2417;
  --barber: #7fb0e3; --barber-soft: #16263a; --beauty: #f08db0; --beauty-soft: #38202b;
  --ok: #5fd08f; --ok-soft: #14301f; --warn: #f0b95a; --warn-soft: #33270f;
  --bad: #ff8f84; --bad-soft: #3a1a17; --info: #8db9f0; --info-soft: #172a41;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
}

/* ============ Temas de color de la marca (Configuración → Marca) ============
   Cada tema cambia el acento (botones, destacados) y, en los femeninos, también el tono del fondo. */
[data-accent="azul"] { --gold-1: #6db3ff; --gold-2: #2563b8; --on-gold: #04152b; --brand: #1f5aa8; --brand-soft: #e0ecfb; }
[data-accent="verde"] { --gold-1: #5fd28f; --gold-2: #1f8a55; --on-gold: #03170d; --brand: #17794a; --brand-soft: #dff3e8; }
[data-accent="turquesa"] { --gold-1: #5eead4; --gold-2: #0d9488; --on-gold: #02211d; --brand: #0b7a70; --brand-soft: #d9f5f1; }
[data-accent="rosita"] { --gold-1: #ffb3cb; --gold-2: #ec6d9d; --on-gold: #3a0a1d; --brand: #c9437a; --brand-soft: #ffe3ee; --bg: #fff6f9; --surface-2: #ffeaf1; --line: #f6d6e2; --muted: #85606f; }
[data-accent="rosa"] { --gold-1: #ff7ab8; --gold-2: #d6247d; --on-gold: #ffffff; --brand: #c01870; --brand-soft: #fde0ee; --bg: #fff4f9; --surface-2: #fde8f2; --line: #f4d3e4; --muted: #7e5b6c; }
[data-accent="coral"] { --gold-1: #ff9a7a; --gold-2: #e8503a; --on-gold: #2b0904; --brand: #c93f2a; --brand-soft: #fde5df; }
[data-accent="lila"] { --gold-1: #c9b0ff; --gold-2: #8b5cf6; --on-gold: #12062e; --brand: #6d3fc4; --brand-soft: #ece4fd; --bg: #f8f5ff; --surface-2: #f0eafd; --line: #e2d8f7; --muted: #6f6488; }
[data-accent="vino"] { --gold-1: #d6607a; --gold-2: #8f1736; --on-gold: #fff3f5; --brand: #8f1736; --brand-soft: #f7e0e6; }
[data-accent="grafito"] { --gold-1: #d9d9de; --gold-2: #71717a; --on-gold: #0b0b0d; --brand: #3f3f46; --brand-soft: #ececef; }

[data-theme="dark"][data-accent="azul"] { --brand: #8ec2ff; --brand-soft: #16263a; }
[data-theme="dark"][data-accent="verde"] { --brand: #6ee0a2; --brand-soft: #14301f; }
[data-theme="dark"][data-accent="turquesa"] { --brand: #5eead4; --brand-soft: #0f2f2b; }
[data-theme="dark"][data-accent="rosita"] { --brand: #ff9fc2; --brand-soft: #3a1f2b; --bg: #150d11; --surface: #20141a; --surface-2: #2b1a22; --line: #3d2631; --muted: #b59aa6; }
[data-theme="dark"][data-accent="rosa"] { --brand: #ff8ec4; --brand-soft: #3a1528; --bg: #150c11; --surface: #1f1217; --surface-2: #2a171f; --line: #3b2230; --muted: #b8949f; }
[data-theme="dark"][data-accent="coral"] { --brand: #ff9a85; --brand-soft: #3a1c16; }
[data-theme="dark"][data-accent="lila"] { --brand: #c4a8ff; --brand-soft: #251c3d; --bg: #0f0c16; --surface: #181321; --surface-2: #221a30; --line: #32284a; --muted: #a79bc0; }
[data-theme="dark"][data-accent="vino"] { --brand: #ff8da3; --brand-soft: #3a1520; }
[data-theme="dark"][data-accent="grafito"] { --brand: #d9d9de; --brand-soft: #26262b; }

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.55rem; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 1.1rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============ Layout ============ */
.shell { min-height: 100dvh; }
.content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.01em; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); box-shadow: 0 4px 12px color-mix(in srgb, var(--gold-2) 35%, transparent);
}
.logo .icon { width: 20px; height: 20px; }
.logo.sm { width: 32px; height: 32px; border-radius: 10px; }
.logo.sm .icon { width: 17px; height: 17px; }
.logo-img { background: #fff; padding: 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); overflow: hidden; }
.logo-img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
.topbar .spacer { flex: 1; }
main { padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1100px; margin: 0 auto; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 2px; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack-lg { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.stack > *, .stack-lg > *, .list > *, .sheet-body > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-auto { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Navegación inferior (celular) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%;
  color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; border: 0; background: none; position: relative; min-width: 0;
}
.nav-item .icon { width: 22px; height: 22px; }
.nav-item.active { color: var(--brand); }
.nav-item.active::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.nav-item.cta .pill {
  width: 48px; height: 48px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--gold-2) 45%, transparent); border: 3px solid var(--bg);
}
.nav-item.cta.active::before { display: none; }
.sidebar { display: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .bottom-nav, .topbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 20px 14px;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 4px 8px 18px; font-size: 1.05rem; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600;
  }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link.active { background: var(--brand-soft); color: var(--brand); }
  .side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
  main { padding: 28px 32px 48px; }
  .fab { bottom: 28px !important; right: 32px !important; }
}

/* ============ Componentes ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tap { cursor: pointer; transition: transform .12s, border-color .12s; }
.card.tap:active { transform: scale(.985); }
.card.tap:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 650; text-decoration: none; color: var(--text); transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.primary { border: 0; color: var(--on-gold); background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); box-shadow: 0 4px 14px color-mix(in srgb, var(--gold-2) 30%, transparent); }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: .86rem; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 0; width: 44px; }
.btn.sm.icon-only { width: 36px; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: var(--on-gold); background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); box-shadow: 0 8px 24px color-mix(in srgb, var(--gold-2) 50%, transparent);
}
.fab .icon { width: 26px; height: 26px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: .88rem; white-space: nowrap; color: var(--text);
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.barber { background: var(--barber-soft); color: var(--barber); }
.badge.beauty { background: var(--beauty-soft); color: var(--beauty); }

.segmented { display: flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 12px; }
.segmented button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; font-weight: 650; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Formularios */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: .8rem; font-weight: 650; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 60%, transparent); border-color: var(--brand); }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; min-height: 0; height: 28px; padding: 0; border-radius: 999px; background: var(--line); position: relative; border: 0; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty input { width: 84px; min-height: 40px; text-align: center; padding: 6px; }

/* Listas */
.list { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; background: var(--brand-soft); color: var(--brand); flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.barber { background: var(--barber); } .dot.beauty { background: var(--beauty); }

/* Citas */
.appt { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; }
.appt-time { text-align: center; line-height: 1.15; }
.appt-time b { font-size: 1.05rem; display: block; }
.appt-time span { font-size: .72rem; color: var(--muted); }
.appt.cancelled { opacity: .55; }
.appt-side { display: grid; gap: 6px; justify-items: end; }

/* KPIs */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.kpi .label { display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--gold-2) 14%, #0e0e11), color-mix(in srgb, var(--gold-2) 34%, #0e0e11)); color: #f6ead0; border-color: transparent; }
.kpi.hero .label, .kpi.hero .sub { color: #cdb98a; }

/* Stock */
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.bar.low > i { background: var(--bad); }
.bar.mid > i { background: var(--warn); }
.mov-plus { color: var(--ok); font-weight: 700; } .mov-minus { color: var(--bad); font-weight: 700; }

/* Selector de fecha y horas */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.day { flex: none; width: 58px; padding: 10px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: center; scroll-snap-align: start; }
.day small { display: block; font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.day b { font-size: 1.15rem; }
.day.active { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); border-color: transparent; color: var(--on-gold); }
.day.active small { color: var(--on-gold); opacity: .8; }
.day[disabled] { opacity: .35; pointer-events: none; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; }
.slot.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Reservar: pasos */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.done { background: var(--brand); }
.service-card { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; }
.service-card .price { font-weight: 750; font-size: 1.05rem; }
.summary { display: grid; gap: 10px; }
.summary .line { display: flex; justify-content: space-between; gap: 12px; }
.summary .line span:first-child { color: var(--muted); }

/* Gráfica */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.chart .col { flex: 1; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .col i { display: block; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); min-height: 2px; }
.rank { display: grid; gap: 10px; }
.rank .r { display: grid; gap: 4px; }
.rank .r .bar > i { background: var(--brand); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; }
table.tbl td { padding: 10px 8px; border-top: 1px solid var(--line); }
table.tbl td.num, table.tbl th.num { text-align: right; white-space: nowrap; }
.scroll-x { overflow-x: auto; margin: 0 -4px; }

.hours-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hours-row:first-of-type { border-top: 0; }
.hours-row .times { display: flex; align-items: center; gap: 6px; }
.hours-row input[type=time] { min-height: 40px; padding: 6px 10px; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty .icon { width: 36px; height: 36px; opacity: .5; }
.skeleton { height: 78px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ============ Sheet / modal ============ */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 6, 3, .55); display: flex; align-items: flex-end; justify-content: center; animation: fadein .18s; }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  width: 100%; max-height: 92dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  animation: up .25s cubic-bezier(.2, .9, .3, 1); padding-bottom: var(--safe-b);
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.sheet-head::before { content: ""; position: absolute; left: 50%; top: 8px; width: 38px; height: 4px; border-radius: 4px; background: var(--line); transform: translateX(-50%); }
.sheet { position: relative; }
.sheet-body { padding: 4px 18px 22px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 22px; max-height: 88dvh; }
  .sheet-head::before { display: none; }
}

.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 84px); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 440px; padding: 12px 16px; border-radius: 14px; background: #1d1b19; color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); animation: up .25s; display: flex; gap: 10px; align-items: center; }
.toast.ok { background: #166a43; } .toast.error { background: #a82a1f; }
@media (min-width: 900px) { .toasts { bottom: 28px; } }

/* ============ Acceso ============ */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1000px 500px at 20% -10%, color-mix(in srgb, var(--gold-2) 38%, #0e0e11) 0%, transparent 60%), radial-gradient(800px 400px at 100% 110%, color-mix(in srgb, var(--gold-1) 22%, #0e0e11) 0%, transparent 60%), #0e0e11; }
.auth-box { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.auth-brand { text-align: center; color: #f6ead0; display: grid; gap: 8px; justify-items: center; }
.auth-brand .logo { width: 64px; height: 64px; border-radius: 20px; }
.auth-brand .logo .icon { width: 34px; height: 34px; }
.auth-brand h1 { font-size: 1.9rem; }
.auth-brand p { color: #cdb98a; }
.auth .card { padding: 20px; display: grid; gap: 16px; }
.demo-box { border-color: color-mix(in srgb, var(--gold-1) 55%, var(--line)); background: linear-gradient(180deg, var(--brand-soft), var(--surface)); }
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); font-size: .78rem; font-weight: 700; color: var(--on-gold); background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); }
.demo-bar button { border: 0; background: rgba(0, 0, 0, .15); color: inherit; font-weight: 700; font-size: .75rem; padding: 3px 10px; border-radius: 99px; }
.logo-edit { display: flex; align-items: center; gap: 14px; }
.logo-edit .logo { width: 72px; height: 72px; border-radius: 20px; flex: none; }
.logo-edit .logo .icon { width: 36px; height: 36px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.theme-opt { display: grid; gap: 6px; padding: 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: center; font-weight: 650; font-size: .8rem; }
.theme-opt i { display: block; height: 34px; border-radius: 9px; }
.theme-opt[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.hint { font-size: .8rem; color: var(--muted); text-align: center; }

.hero-card { background: linear-gradient(135deg, color-mix(in srgb, var(--gold-2) 14%, #0e0e11) 0%, color-mix(in srgb, var(--gold-2) 40%, #0e0e11) 100%); color: #f6ead0; border-radius: 22px; padding: 20px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.hero-card p { color: #cdb98a; }
.hero-card .btn:not(.primary) { color: #f6ead0; background: rgba(255, 255, 255, .12); border-color: transparent; }
.menu-link { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 650; }
.menu-link .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

/* ============ Notificaciones (campanita, contadores y panel) ============ */
.bell { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--text); }
.bell-badge, .nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: inline-grid; place-items: center; line-height: 1; }
.bell-badge[hidden], .nav-badge[hidden] { display: none; }
.bell .bell-badge { position: absolute; top: -6px; right: -6px; }
.nav-item .nav-badge { position: absolute; top: 5px; left: calc(50% + 7px); }
.side-link .nav-badge, .side-link .bell-badge { margin-left: auto; }
button.side-link { border: 0; background: none; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.notif.new { border-color: var(--brand); background: var(--brand-soft); }
.notif-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.notif.new .notif-ic { background: var(--surface); }
.how { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ============ Modo cliente: se ve como una app (columna de celular, botones abajo), nunca como un sistema ============ */
body.client-app .sidebar { display: none; }
body.client-app .shell { display: block; max-width: 560px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
body.client-app .topbar { display: flex; }
body.client-app main { padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: none; margin: 0; }
body.client-app .bottom-nav { display: flex; left: 50%; right: auto; width: 100%; max-width: 560px; transform: translateX(-50%); }
@media (min-width: 900px) {
  body.client-app { background: radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--gold-1) 16%, transparent), transparent 60%), var(--surface-2); }
  body.client-app .shell { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .25); }
  body.client-app .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 20px); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .bottom-nav, .sidebar, .topbar, .fab { display: none !important; } }
