/* ==========================================================================
   PeluOra — Sistema visual
   Mobile-first. Fondo claro, morado y dorado como colores de marca, tarjetas redondeadas,
   sombras discretas, iconos SVG (Lucide). Sin dependencias externas.
   ========================================================================== */

:root {
  --green-50: #eefaf3;
  --green-100: #d7f3e3;
  --green-200: #b0e6c9;
  --green-500: #1fae6c;
  --green-600: #16a36a;
  --green-700: #0f8455;
  --green-800: #0c6a45;
  --primary: var(--green-700);          /* 4,7:1 con texto blanco (WCAG AA) */
  --primary-hover: var(--green-800);
  --primary-soft: var(--green-50);

  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #f9fbfa;
  --text: #1b2a23;
  --text-2: #4c5d55;
  --muted: #5f6f68;
  --border: #e3ebe7;
  --border-strong: #cfdcd5;

  --blue: #2457c5;   --blue-soft: #eaf1fe;
  --amber: #9a5f00;  --amber-soft: #fff5e0;
  --red: #b42b2b;    --red-soft: #fdecec;
  --violet: #6236c9; --violet-soft: #f1ecfd;
  --gray-soft: #eef2f0;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 45, 35, .06);
  --shadow: 0 1px 3px rgba(20, 45, 35, .06), 0 6px 18px rgba(20, 45, 35, .06);
  --shadow-lg: 0 10px 40px rgba(20, 45, 35, .14);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 64px;
  --sidebar-w: 248px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-hover); text-decoration: none; }
p a, .sub a, .hint a, dd a, td a, .alert a, label a, .small a { text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem } .mb-3 { margin-bottom: 1.5rem }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(22, 163, 106, .45); outline-offset: 2px; border-radius: 6px; }

/* Iconos */
.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 26px; height: 26px; }
.i-xl { width: 36px; height: 36px; }

/* ------------------------------------------------------------------ Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.15rem;
  border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .98rem; line-height: 1.1;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(22, 163, 106, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--green-800); }
.btn-soft:hover { background: var(--green-100); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fadada; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-lg { min-height: 54px; padding: .8rem 1.5rem; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .88rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 44px; min-width: 44px; padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary-hover); cursor: pointer; }

/* ------------------------------------------------------------------ Tarjetas */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.1rem;
}
.card + .card { margin-top: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card-header h2, .card-header h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-soft { background: var(--primary-soft); border-color: var(--green-100); }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 1.5rem 0 .6rem; }
.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.stack > * + * { margin-top: 1rem; }

/* Indicadores (KPI) */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-label { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.kpi-value { font-size: 1.45rem; font-weight: 750; margin-top: .2rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: .5rem; }
.kpi.blue .ic { background: var(--blue-soft); color: var(--blue); }
.kpi.amber .ic { background: var(--amber-soft); color: var(--amber); }
.kpi.red .ic { background: var(--red-soft); color: var(--red); }
.kpi.violet .ic { background: var(--violet-soft); color: var(--violet); }

/* Insignias / estados */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.st-confirmed { background: var(--green-100); color: var(--green-800); }
.st-completed { background: var(--blue-soft); color: var(--blue); }
.st-pending_payment, .st-pending_approval { background: var(--amber-soft); color: var(--amber); }
.st-cancelled { background: var(--gray-soft); color: var(--muted); }
.st-no_show { background: var(--red-soft); color: var(--red); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* Avisos */
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; border: 1px solid; margin-bottom: 1rem; font-size: .95rem; }
.alert .i { margin-top: 1px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--green-50); border-color: var(--green-200); color: var(--green-800); }
.alert-error { background: var(--red-soft); border-color: #f6c5c5; color: #a32727; }
.alert-warning { background: var(--amber-soft); border-color: #f4dca8; color: #8a5600; }
.alert-info { background: var(--blue-soft); border-color: #cddcfb; color: #1f4fb0; }

/* ------------------------------------------------------------------ Formularios */
.form-group { margin-bottom: 1rem; }
label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--text); }
.hint { font-size: .83rem; color: var(--muted); margin-top: .3rem; }
.input, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], input[type=color], select, textarea {
  width: 100%; min-height: 48px; padding: .65rem .85rem;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  font: inherit; font-size: 16px; color: var(--text);
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
input[type=color] { padding: .25rem; width: 64px; }
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='%237a8a82' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.4rem; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(22, 163, 106, .14); }
.is-invalid { border-color: var(--red) !important; }
.field-error { color: var(--red); font-size: .85rem; margin: .3rem 0 0; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; cursor: pointer; margin-bottom: .6rem; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; accent-color: var(--primary); flex: none; appearance: auto; -webkit-appearance: checkbox; }
.check input[type=radio] { -webkit-appearance: radio; }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 .9rem; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 12px 12px 0; background: var(--surface-2); color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 700; margin-bottom: .5rem; }

/* Selector segmentado (chips) */
.segmented { display: flex; flex-wrap: wrap; gap: .5rem; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: .35rem; min-height: 42px; padding: .45rem .95rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .92rem; cursor: pointer; }
.segmented input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid rgba(22, 163, 106, .45); }

/* Interruptor */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; min-height: 0; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; flex: none; padding: 0; border: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(20px); }
.switch .txt strong { display: block; }
.switch .txt small { color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------ Listas y tablas */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; min-height: 60px; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: #fff; background: var(--primary); flex: none; }
.avatar-soft { background: var(--primary-soft); color: var(--green-800); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .7rem .9rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .i { width: 40px; height: 40px; color: var(--border-strong); margin: 0 auto .6rem; display: block; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dl .total { border-top: 1px solid var(--border); padding-top: .5rem; font-size: 1.1rem; }

/* ------------------------------------------------------------------ Layout del panel */
.app-shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border); padding: calc(.6rem + var(--safe-top)) 1rem .6rem; display: flex; align-items: center; gap: .75rem; min-height: 60px;
}
.topbar .title { font-weight: 750; font-size: 1.1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .actions { display: flex; gap: .4rem; }
.main { padding: 1rem 1rem calc(var(--tabbar-h) + 1.5rem + var(--safe-bottom)); max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: .2rem 0 0; }

/* Barra inferior móvil */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
}
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none !important; background: none; border: 0; font-family: inherit; cursor: pointer; padding: 0; }
.tabbar .active { color: var(--primary); }
.tabbar .i { width: 23px; height: 23px; }
.tabbar .fab { position: relative; }
.tabbar .fab span.circle { width: 52px; height: 52px; border-radius: 18px; background: var(--primary); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 6px 18px rgba(22, 163, 106, .4); }
.tabbar .fab .i { width: 26px; height: 26px; }

/* Hoja "Más" (menú móvil) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 22, .4); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--surface); border-radius: 22px 22px 0 0; padding: .6rem 1rem calc(1.2rem + var(--safe-bottom)); transform: translateY(105%); transition: transform .22s ease; max-height: 85vh; overflow: auto; }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto .8rem; }
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
body.sheet-open .sheet { transform: translateY(0); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.menu-grid a, .menu-grid button { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .4rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .82rem; font-weight: 600; text-align: center; text-decoration: none !important; font-family: inherit; cursor: pointer; }
.menu-grid .i { color: var(--primary); width: 24px; height: 24px; }

/* Barra de modo soporte */
.support-bar { position: sticky; top: 0; z-index: 50; background: #3b2a7a; color: #fff; padding: .55rem 1rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: .9rem; }
.support-bar strong { font-weight: 750; }
.support-bar form { margin-left: auto; }
.support-bar .btn { background: #fff; color: #3b2a7a; }

/* ------------------------------------------------------------------ Agenda */
.agenda-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.date-nav { display: flex; align-items: center; gap: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .25rem; }
.date-nav .btn { min-height: 40px; }
.date-nav .current { font-weight: 700; padding: 0 .4rem; text-align: center; min-width: 0; }
.date-nav input[type=date] { min-height: 40px; border: 0; padding: .3rem .4rem; width: auto; max-width: 150px; }
.day-strip { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .8rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip a { flex: none; width: 52px; padding: .45rem 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; color: var(--text); text-decoration: none !important; }
.day-strip a small { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.day-strip a strong { font-size: 1.1rem; }
.day-strip a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.day-strip a.active small { color: rgba(255, 255, 255, .85); }
.day-strip a.closed { opacity: .5; }
.staff-filter { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
.staff-filter::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: .3rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .88rem; white-space: nowrap; text-decoration: none !important; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* Agenda móvil: lista agrupada por franja horaria */
.timeline { position: relative; }
.slot-group { display: grid; grid-template-columns: 52px 1fr; gap: .6rem; margin-bottom: .6rem; }
.slot-time { font-weight: 750; font-size: .92rem; color: var(--text-2); padding-top: .65rem; font-variant-numeric: tabular-nums; }
.slot-items { display: grid; gap: .5rem; min-width: 0; }
.appt {
  display: block; position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--c, var(--primary));
  border-radius: 14px; padding: .65rem .8rem; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); min-width: 0;
}
.appt:hover { box-shadow: var(--shadow); }
.appt .top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.appt .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt .what { font-size: .88rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt .meta { font-size: .8rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .15rem; }
.appt.is-cancelled { opacity: .55; border-left-style: dashed; }
.appt.is-cancelled .who { text-decoration: line-through; }
.appt .flags { display: flex; gap: .3rem; }
.flag { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); }
.flag.red { background: var(--red-soft); color: var(--red); }
.flag .i { width: 14px; height: 14px; }
.gap-item { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border: 1px dashed var(--green-200); border-radius: 12px; color: var(--green-800); background: var(--green-50); font-size: .88rem; font-weight: 600; text-decoration: none !important; }
.gap-item:hover { background: var(--green-100); }
.agenda-grid { display: none; }

/* Resumen del día */
.day-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.day-summary .kpi { padding: .7rem .8rem; }
.day-summary .kpi-value { font-size: 1.2rem; }

/* ------------------------------------------------------------------ Modal y diálogos */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(15, 30, 22, .45); }
.modal-body { padding: 1.3rem; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; padding: 0 1.3rem 1.3rem; flex-wrap: wrap; }

/* PIN */
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: .8rem; justify-content: center; margin: 1.2rem 0; }
.pin-pad button { height: 72px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 1.5rem; font-weight: 650; cursor: pointer; color: var(--text); font-family: inherit; }
.pin-pad button:active { background: var(--primary-soft); }
.pin-dots { display: flex; gap: .8rem; justify-content: center; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); }
.pin-dots span.on { background: var(--primary); border-color: var(--primary); }
.pin-input { letter-spacing: .6em; text-align: center; font-size: 1.6rem !important; max-width: 220px; margin: 0 auto; }

/* Selector de horas (huecos) */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.slots button, .slots label span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; width: 100%; }
.slots button small { font-weight: 500; font-size: .7rem; color: var(--muted); }
.slots button:hover { border-color: var(--primary); }
.slots button.selected, .slots input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.slots button.selected small { color: rgba(255, 255, 255, .85); }
.slots label { margin: 0; }
.slots input { position: absolute; opacity: 0; }

/* Pasos (asistente / reserva) */
.steps { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.steps span.done { background: var(--primary); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ok { color: var(--primary); }
.checklist .ko { color: var(--amber); }

/* Gráficas sencillas (SVG/CSS) */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: .5rem; }
.bars .bar { flex: 1; background: var(--green-200); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover { background: var(--primary); }
.bars-labels { display: flex; gap: 3px; font-size: .68rem; color: var(--muted); margin-top: .3rem; }
.bars-labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.hbar { height: 10px; border-radius: 5px; background: var(--gray-soft); overflow: hidden; }
.hbar > span { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.progress-ring { font-weight: 750; }

/* Utilidades de color de profesional */
.color-swatch { width: 18px; height: 18px; border-radius: 6px; display: inline-block; vertical-align: middle; border: 1px solid rgba(0, 0, 0, .08); }

/* ------------------------------------------------------------------ Autenticación */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .brand { justify-content: center; margin-bottom: 1.2rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none !important; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand-mark .i { width: 21px; height: 21px; }

/* ------------------------------------------------------------------ Web comercial */
.mk-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.mk-nav { max-width: 1160px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; gap: 1rem; }
.mk-nav .links { display: none; gap: 1.4rem; margin-left: 1.5rem; }
.mk-nav .links a { color: var(--text-2); font-weight: 600; font-size: .95rem; }
.mk-nav .cta { margin-left: auto; display: flex; gap: .5rem; }
.mk-nav .cta .btn { min-height: 40px; }
.mk-nav .cta .login { display: none; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 1rem; }
.hero { padding: 2.5rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.035em; line-height: 1.05; margin-bottom: .9rem; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { font-size: 1.12rem; color: var(--text-2); max-width: 560px; }
.hero .btn-row { margin-top: 1.4rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.3rem; color: var(--text-2); font-size: .9rem; }
.hero-proof span { display: inline-flex; align-items: center; gap: .35rem; }
.hero-proof .i { color: var(--primary); width: 18px; height: 18px; }
.mk-section { padding: 3rem 0; }
.mk-section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mk-section h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -.025em; text-align: center; }
.mk-section .intro { text-align: center; color: var(--text-2); max-width: 640px; margin: 0 auto 2rem; font-size: 1.05rem; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.feature .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: .9rem; }
.feature h3 { margin-bottom: .35rem; }
.feature p { color: var(--text-2); margin: 0; font-size: .96rem; }
.shot { border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); background: var(--surface); }
.shot img { width: 100%; height: auto; }
.phone-shot { max-width: 300px; margin: 0 auto; border-radius: 34px; border: 8px solid #17241e; overflow: hidden; box-shadow: var(--shadow-lg); background: #17241e; }
.shots { display: grid; gap: 1.5rem; align-items: center; }
.price-card { max-width: 460px; margin: 0 auto; text-align: center; border: 2px solid var(--primary); border-radius: 26px; padding: 2rem 1.5rem; background: var(--surface); box-shadow: var(--shadow-lg); position: relative; }
.price-card .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: .3rem 1rem; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.price { font-size: 3.2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: .6rem 0 .2rem; }
.price small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price-old { color: var(--muted); text-decoration: line-through; }
.price-list { list-style: none; text-align: left; padding: 0; margin: 1.4rem 0; }
.price-list li { display: flex; gap: .6rem; padding: .4rem 0; }
.price-list .i { color: var(--primary); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: .7rem; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--primary); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: .7rem 0 0; color: var(--text-2); }
.mk-footer { background: #13211b; color: #b8c7bf; padding: 2.5rem 0 calc(2rem + var(--safe-bottom)); font-size: .92rem; }
.mk-footer a { color: #e3ece7; }
.mk-footer .cols { display: grid; gap: 1.5rem; }
.mk-footer h4 { color: #fff; font-size: .95rem; }
.mk-footer ul { list-style: none; padding: 0; margin: 0; }
.mk-footer li { margin-bottom: .4rem; }
.legal-doc { max-width: 820px; margin: 2rem auto; }
.legal-doc h2 { margin-top: 1.8rem; }
.draft-banner { background: var(--amber-soft); border: 1px solid #f4dca8; color: #8a5600; padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1.5rem; font-weight: 600; }

/* ------------------------------------------------------------------ Página pública de la peluquería */
.pub-cover { height: 210px; background: linear-gradient(135deg, var(--green-600), #0b5a3a); background-size: cover; background-position: center; position: relative; }
.pub-cover img { width: 100%; height: 100%; object-fit: cover; }
.pub-head { max-width: 860px; margin: -48px auto 0; padding: 0 1rem; position: relative; }
.pub-id { background: var(--surface); border-radius: var(--radius-lg); padding: 1.2rem; box-shadow: var(--shadow); display: flex; gap: 1rem; align-items: center; }
.pub-logo { width: 76px; height: 76px; border-radius: 20px; background: var(--primary-soft); flex: none; overflow: hidden; display: grid; place-items: center; font-weight: 800; color: var(--primary); font-size: 1.5rem; border: 3px solid #fff; box-shadow: var(--shadow-sm); margin-top: -40px; }
.pub-logo img { width: 100%; height: 100%; object-fit: cover; }
.pub-id h1 { margin: 0; font-size: 1.4rem; }
.pub-body { max-width: 860px; margin: 1rem auto 0; padding: 0 1rem calc(6rem + var(--safe-bottom)); }
.pub-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: .75rem 1rem calc(.75rem + var(--safe-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--border); z-index: 30; backdrop-filter: blur(6px); }
.pub-cta .btn { width: 100%; }
.service-row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.service-row:last-child { border-bottom: 0; }
.service-row .price-tag { font-weight: 700; white-space: nowrap; text-align: right; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.gallery img { aspect-ratio: 1; object-fit: cover; border-radius: 12px; width: 100%; }
.hours-table { width: 100%; font-size: .93rem; }
.hours-table td { padding: .3rem 0; }
.hours-table td:last-child { text-align: right; }
.hours-table tr.today td { font-weight: 750; color: var(--primary-hover); }
.svc-pick { display: flex; align-items: center; gap: .8rem; padding: .85rem; border: 1px solid var(--border); border-radius: 14px; margin-bottom: .55rem; cursor: pointer; background: var(--surface); }
.svc-pick:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.svc-pick input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; appearance: auto; -webkit-appearance: checkbox; min-height: 0; }
.svc-pick .grow { flex: 1; min-width: 0; }
.person-card { border: 1px solid var(--border); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; background: var(--surface); }
.summary-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; }
.deposit-note { display: flex; gap: .5rem; align-items: flex-start; background: var(--green-50); border: 1px solid var(--green-200); color: var(--green-800); border-radius: 12px; padding: .75rem .9rem; font-size: .92rem; font-weight: 600; }

/* Onboarding */
.wizard { max-width: 720px; margin: 0 auto; }

/* Impresión */
@media print {
  .sidebar, .tabbar, .topbar, .support-bar, .btn { display: none !important; }
  .main { padding: 0; }
}

/* ======================================================================
   Tablet / ordenador
   ====================================================================== */
@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pub-cover { height: 300px; }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .mk-footer .cols { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .mk-nav .cta .login { display: inline-flex; }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { padding: 4.5rem 0 3.5rem; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 3rem; }
  .shots { grid-template-columns: 1.6fr 1fr; }
  .mk-nav .links { display: flex; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
  .split.wide-side { grid-template-columns: minmax(0, 1fr) 420px; }
}

@media (min-width: 1024px) {
  .tabbar { display: none; }
  .app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border); padding: 1.1rem .8rem;
  }
  .sidebar .brand { padding: .3rem .6rem 1.1rem; }
  .sidebar .salon-name { font-size: .82rem; color: var(--muted); padding: 0 .7rem .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .new-btn { margin: 0 .3rem 1rem; }
  .nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: 11px; color: var(--text-2); font-weight: 600; font-size: .95rem; text-decoration: none !important; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.active { background: var(--primary-soft); color: var(--green-800); }
  .nav a.active .i { color: var(--primary); }
  .nav .sep { height: 1px; background: var(--border); margin: .6rem .4rem; }
  .sidebar .bottom { margin-top: auto; padding-top: 1rem; }
  .topbar { display: none; }
  .topbar.desktop { display: flex; }
  .main { padding: 1.6rem 2rem 2.5rem; }
  h1 { font-size: 1.75rem; }

  /* Agenda de escritorio: columnas por profesional, bloques proporcionales a la duración */
  .timeline.mobile-only { display: none; }
  .agenda-grid { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); box-shadow: var(--shadow-sm); position: relative; }
  .agenda-grid .head { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); padding: .6rem .7rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; min-height: 50px; font-size: .93rem; }
  .agenda-grid .head.corner { left: 0; z-index: 6; }
  .agenda-grid .times { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--border); }
  .agenda-grid .times div:first-child { transform: none; }
  .agenda-grid .times div { position: absolute; left: 0; right: 0; font-size: .74rem; color: var(--muted); text-align: right; padding-right: .5rem; transform: translateY(-.55em); font-variant-numeric: tabular-nums; }
  .agenda-grid .col { position: relative; border-right: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--border) calc(var(--hour) - 1px), var(--border) var(--hour)); }
  .agenda-grid .col:last-child { border-right: 0; }
  .agenda-grid .closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f3f5f4 0, #f3f5f4 6px, #eaeeec 6px, #eaeeec 12px); }
  .agenda-grid .free { position: absolute; left: 3px; right: 3px; border-radius: 8px; display: flex; align-items: flex-start; justify-content: center; color: transparent; font-size: .75rem; font-weight: 700; text-decoration: none !important; padding-top: 2px; }
  .agenda-grid .free:hover { background: var(--green-50); color: var(--green-700); outline: 1px dashed var(--green-200); }
  .agenda-grid .block { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: .3rem .5rem; overflow: hidden; color: var(--text); background: #fff; background: color-mix(in srgb, var(--c) 14%, white); border: 1px solid var(--border); border: 1px solid color-mix(in srgb, var(--c) 35%, white); border-left: 4px solid var(--c); text-decoration: none !important; font-size: .82rem; line-height: 1.25; box-shadow: var(--shadow-sm); z-index: 2; }
  .agenda-grid .block:hover { z-index: 3; box-shadow: var(--shadow); }
  .agenda-grid .block .who { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .agenda-grid .block .what, .agenda-grid .block .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
  .agenda-grid .block.is-cancelled { opacity: .5; background: #f6f7f7; border-style: dashed; }
  .agenda-grid .block.overlap { box-shadow: 0 0 0 2px var(--amber-soft), 0 0 0 3px var(--amber); }
  .agenda-grid .block .flags { position: absolute; top: 4px; right: 4px; }
  .agenda-grid .now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 4; pointer-events: none; }
  .day-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1023px) { .desktop-only { display: none !important; } }
@media (min-width: 1024px) { .mobile-only-el { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Identidad PeluOra. Se conservan los colores semánticos de estado. */
:root {
 --primary: #2c1c3e; --primary-hover: #432b5d; --primary-soft: #f1edf5;
 --brand-gold: #a77418; --bg: #f7f5f9; --surface-2: #faf8fc;
 --text: #2c1c3e; --text-2: #594e65; --muted: #70677a;
 --border: #e8e2ed; --border-strong: #d7cde0;
}
.brand { flex-shrink: 0; }
.peluora-logo { display: block; width: 220px; height: 76px; object-fit: cover; background: #fff; border-radius: 8px; }
.sidebar .peluora-logo { width: 198px; height: 70px; }
.mk-footer { background: #2c1c3e; color: #ded5e8; }
.mk-footer a { color: #f6f0fb; }
.nav a.active { color: var(--primary); }
.price-card.featured { border-color: var(--brand-gold); }
@media (max-width: 480px) { .mk-nav .peluora-logo { width: 170px; height: 62px; } }
