:root {
  --ink: #0f2a29;
  --muted: #5a7371;
  --paper: #f3faf9;
  --paper-2: #e8f4f2;
  --card: #ffffff;
  --line: #d5e5e3;
  --teal: #0b6e6b;
  --teal-d: #0a4f4d;
  --teal-s: #d5f0ed;
  --accent: #d97706;
  --coral: #d97706;
  --gold: #f59e0b;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b42318;
  --wait: #4361a6;
  --shadow: 0 18px 48px rgba(11, 110, 107, .14);
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: "Syne", sans-serif;
  --ui: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--ui);
  background:
    radial-gradient(1200px 600px at 10% -10%, #9fd9d4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #cfe8f5 0%, transparent 50%),
    #0c1f1e;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.device {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.app {
  width: 100%;
  max-width: 430px;
  min-height: 100%;
  background:
    linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 28%, #f7fafb 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.app::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 180px;
  background:
    radial-gradient(circle at 18% 20%, rgba(11,110,107,.16), transparent 42%),
    radial-gradient(circle at 86% 0%, rgba(56, 160, 180, .12), transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.app > * { position: relative; z-index: 1; }
@media (min-width: 800px) {
  body { padding: 24px 0; }
  .device { align-items: center; }
  .app {
    min-height: 860px;
    height: min(900px, calc(100vh - 48px));
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(213, 229, 227, .55);
  }
}

.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  text-align: center;
  animation: fadeUp .45s ease both;
}
.mark {
  width: 76px; height: 76px; border-radius: 22px;
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 28px; font-weight: 700;
  letter-spacing: -.02em;
  box-shadow: 0 14px 30px rgba(11, 110, 107, .28);
}
.splash h1 { font-family: var(--display); font-size: 34px; letter-spacing: -.03em; }
.splash p { color: var(--muted); }

.top {
  padding: calc(14px + var(--safe-t)) 18px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-family: var(--display); font-size: 20px; display: block; line-height: 1; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

.screen {
  flex: 1; overflow: auto; padding: 0 16px 24px;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  animation: fadeUp .32s ease both;
}
.screen.nopad { padding-left: 0; padding-right: 0; }

h2.page { font-family: var(--display); font-size: 26px; margin: 4px 0 14px; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 16px; }

.pills { display: flex; gap: 8px; overflow: auto; padding-bottom: 12px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  border: 1px solid var(--line); background: rgba(255,255,255,.72);
  border-radius: 12px; padding: 8px 14px; font-size: 13px; white-space: nowrap;
  color: var(--ink); cursor: pointer; font-family: inherit;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.pill.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.pill:active { transform: translateY(1px); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
  transition: transform .14s ease, border-color .18s ease;
}
.card.tap { cursor: pointer; }
.card.tap:hover { border-color: #b7d4d1; }
.row { display: flex; gap: 12px; align-items: flex-start; }
.time {
  min-width: 52px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal-d);
}
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 8px; text-transform: uppercase;
  transition: transform .15s ease;
}
.chip.reservada { background: #fff1d6; color: #92400e; }
.chip.confirmada { background: var(--teal-s); color: var(--teal-d); }
.chip.en_curso { background: #dbeafe; color: #1e40af; }
.chip.atendida { background: #dcfce7; color: var(--ok); }
.chip.no_asistio { background: #fee2e2; color: var(--bad); }
.chip.cancelada { background: #eef2f1; color: #64748b; }
.chip.oferta_temporal { background: #e0e7ff; color: var(--wait); }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.kpi b { display: block; font-family: var(--display); font-size: 26px; letter-spacing: -.02em; }
.kpi span { color: var(--muted); font-size: 12px; }
.home-actions { display: flex; flex-direction: column; gap: 10px; }
.home-actions .card { margin: 0; }
.card.tap:active { transform: scale(.985); }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 16px; font-family: inherit;
  font-weight: 600; font-size: 15px; cursor: pointer; width: 100%;
  transition: transform .12s ease, filter .18s ease, background .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(145deg, #0d7f7b, var(--teal-d)); color: #fff; }
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: rgba(255,255,255,.8); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #fee2e2; color: var(--bad); }
.btn.warn { background: #fff1d6; color: #92400e; }
.btn.sm { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fab {
  position: absolute; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 56px; height: 56px; border-radius: 16px; border: 0;
  background: linear-gradient(145deg, #0d7f7b, var(--teal-d)); color: #fff; font-size: 28px; cursor: pointer;
  box-shadow: 0 12px 28px rgba(11, 110, 107, .32);
  transition: transform .14s ease;
}
.fab:active { transform: scale(.96); }

.nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(247, 250, 251, .9); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: center;
}
.nav a {
  color: var(--muted); text-decoration: none; font-size: 10px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px;
  transition: color .18s ease, transform .14s ease;
}
.nav a.on { color: var(--teal); }
.nav a.on svg { transform: translateY(-1px); }
.nav svg { width: 22px; height: 22px; transition: transform .18s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 12px; font-family: inherit; font-size: 15px; color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px 12px 40px; font: inherit; }
.search i { position: absolute; left: 14px; top: 12px; color: var(--muted); }

.login { padding: 32px 20px 20px; }
.login h1 {
  font-family: var(--display); font-size: 34px; margin: 18px 0 6px;
  letter-spacing: -.03em;
}
.login > .muted { max-width: 28ch; }
.demo { display: grid; gap: 8px; margin-top: 18px; }
.demo button {
  text-align: left; background: rgba(255,255,255,.88); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .18s ease, transform .12s ease, background .18s ease;
}
.demo button:hover { border-color: #b7d4d1; background: #fff; }
.demo button:active { transform: translateY(1px); }
.demo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; flex-shrink: 0;
}
.demo-text { min-width: 0; }
.demo button b { display: block; }
.demo button span { color: var(--muted); font-size: 12px; display: block; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-icons { display: flex; gap: 6px; color: var(--teal); opacity: .9; }
.login-icons span {
  width: 28px; height: 28px; border-radius: 8px; background: var(--teal-s);
  display: grid; place-items: center;
}

.wa {
  background: linear-gradient(180deg, #e7f3f1 0%, #f3faf9 100%);
  min-height: 100%; padding: 12px 12px 24px;
}
.bubble {
  background: #fff; border-radius: 8px 16px 16px 16px; padding: 12px;
  margin: 10px 28px 10px 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.bubble .who { font-size: 12px; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
.bubble p { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.bubble .when { font-size: 11px; color: var(--muted); text-align: right; margin-top: 6px; }
.wa-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.orient {
  background: #fff7e8; border: 1px solid #f2dfb0; border-radius: 14px; padding: 12px; margin: 10px 0;
  font-size: 14px; line-height: 1.45;
}
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.slot.on { background: var(--teal); color: #fff; border-color: var(--teal); }

.picker-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  margin: 14px 0 16px;
}
.picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.picker-head b { font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.date-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 132px;
}
.date-chip input[type="date"] {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}
.day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 0 0 auto;
  width: 58px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
.day-pill .d { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.day-pill .n { font-family: var(--display); font-size: 22px; line-height: 1.1; font-weight: 700; }
.day-pill .m { font-size: 11px; color: var(--muted); text-transform: lowercase; }
.day-pill.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.day-pill.on .d,
.day-pill.on .m { color: rgba(255,255,255,.82); }
.time-summary {
  background: var(--teal-s);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.4;
}
.time-group { margin-bottom: 12px; }
.time-group h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.time-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 92px;
  padding: 10px 12px;
}
.time-slot .t { font-size: 14px; font-weight: 700; }
.time-slot .e { font-size: 11px; font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }
.time-slot.on .e { opacity: .9; }

.save-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  background: rgba(243, 250, 249, .94);
  backdrop-filter: blur(10px);
  padding: 10px 0 6px;
  margin-top: 8px;
  z-index: 5;
}
.save-bar .muted { margin-bottom: 8px; font-size: 12px; }
.save-bar .btn:disabled { opacity: .65; cursor: wait; }

.wa-sent { padding-bottom: 12px; }
.wa-badge {
  display: inline-block;
  background: #25D366;
  color: #053b1f;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.wa-preview { margin: 12px 8px 16px; }
.wa-head-bar {
  background: #075E54;
  color: #fff;
  padding: 12px 14px;
  margin: -12px -12px 12px;
}
.wa-head-bar b { display: block; }
.wa-head-bar span { font-size: 12px; opacity: .85; }
.bubble-pendiente { border: 1px solid #25D366; }
.btn.sm.danger { background: #f8d7d4; color: var(--bad); }

.agenda-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.vista-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #dfeceb;
  padding: 4px;
  border-radius: 14px;
}
.vista-tab {
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 10px 8px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.vista-tab.on {
  background: #fff;
  color: var(--teal-d);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.agenda-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.nav-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  min-width: 44px;
  height: 40px;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.nav-btn.today {
  flex: 1;
  font-size: 14px;
  max-width: 120px;
}
.agenda-date-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.agenda-date-row input[type="date"] {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  font: inherit;
}
.section-h {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 16px 0 8px;
}

.week-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.week-col {
  flex: 0 0 132px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 220px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.week-col.is-today {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal-s);
}
.week-head {
  border: 0;
  background: transparent;
  padding: 10px 8px 8px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 1px solid var(--line);
}
.week-head .wlabel {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.week-head .wnum {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}
.week-head .wcount {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  background: var(--teal-s);
  color: var(--teal-d);
  border-radius: 999px;
  padding: 1px 7px;
}
.week-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.week-item {
  border: 0;
  border-left: 3px solid var(--teal);
  background: #eef8f6;
  border-radius: 8px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.week-item b { font-size: 12px; font-variant-numeric: tabular-nums; }
.week-item span { font-size: 12px; font-weight: 600; }
.week-item small { align-self: flex-start; }
.tiny { font-size: 12px; padding: 8px 2px; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.month-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
  text-transform: uppercase;
}
.month-cell {
  aspect-ratio: 1 / 1.05;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 6px 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 54px;
}
.month-cell.empty-cell {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.month-cell.is-today {
  border-color: var(--teal);
  background: var(--teal-s);
}
.month-cell.has-citas { background: #fff; }
.month-cell .mday {
  font-weight: 700;
  font-size: 13px;
}
.month-cell .mbadge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.mdots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  align-items: center;
}
.mdots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.mmore { font-size: 9px; color: var(--muted); font-weight: 700; }

.cfg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.cfg-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--teal);
}
.cfg-hora input[type="time"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

/* —— Config tipos (diseño árbol) —— */
.tipos-panel {
  background: #123c3a;
  color: #eef7f6;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 14px 32px rgba(18, 60, 58, .28);
}
.tipos-panel-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.tipos-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9fd4d1;
  margin: 0 0 4px;
}
.tipos-panel-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.15;
  color: #fff;
}
.tipos-panel-desc {
  margin: 0;
  font-size: 13px;
  color: #c9e4e2;
  line-height: 1.4;
  max-width: 210px;
}
.tipos-ring {
  --pct: 0;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at center, #123c3a 58%, transparent 59%),
    conic-gradient(#3ecfc7 calc(var(--pct) * 1%), rgba(255,255,255,.18) 0);
  border: 1px solid rgba(255,255,255,.12);
}
.tipos-ring b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  color: #fff;
}
.tipos-ring span {
  font-size: 10px;
  color: #9fd4d1;
  font-weight: 600;
}
.tipos-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  margin: 14px 0 12px;
  overflow: hidden;
}
.tipos-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2bb8b0, #7ee0d8);
  border-radius: inherit;
  transition: width .25s ease;
}
.tipos-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tipos-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 0 12px;
  color: #9fd4d1;
}
.tipos-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  padding: 12px 0;
  outline: none;
  min-width: 0;
}
.tipos-search input::placeholder { color: rgba(255,255,255,.45); }
.tipos-tools-btns {
  display: flex;
  gap: 8px;
}
.chip-btn {
  flex: 1;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn:active { background: rgba(255,255,255,.16); }
.tipos-filter-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9fd4d1;
}

.tipos-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.esp-stack,
.tipo-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.area-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(28, 25, 21, .06);
}
.area-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 8px;
  color: #fff;
}
.area-medicina .area-bar {
  background: linear-gradient(135deg, #0b6e6b, #14918c);
}
.area-odontologia .area-bar {
  background: linear-gradient(135deg, #a84a1f, #c45c26);
}
.area-card:not(.area-medicina):not(.area-odontologia) .area-bar {
  background: linear-gradient(135deg, #3d4a5c, #55657a);
}
.area-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
}
.area-bar-main {
  flex: 1;
  min-width: 0;
}
.area-bar-main b {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.15;
}
.area-bar-main > span {
  display: block;
  font-size: 11px;
  opacity: .85;
  margin-top: 2px;
}
.mini-meter {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  margin-top: 8px;
  overflow: hidden;
  max-width: 140px;
}
.mini-meter i {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: inherit;
  transition: width .25s ease;
}
.area-bar-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.esp-bar-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sw-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.sw-label.light { color: rgba(255,255,255,.8); }
.pill-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-d);
  background: var(--teal-s);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-count.light {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.fold-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(11, 110, 107, .08);
  color: var(--teal-d);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .2s ease, background .15s;
}
.fold-btn.light {
  background: rgba(255,255,255,.16);
  color: #fff;
}
.fold-btn[aria-expanded="false"] { transform: rotate(-90deg); }
.area-card.is-collapsed > .esp-stack,
.esp-card.is-collapsed > .tipo-rows { display: none; }

.esp-stack {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f7f2ea;
}
.esp-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.esp-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 6px;
  background: #fff;
}
.esp-bar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.esp-bar-main b {
  font-size: 14px;
  font-weight: 700;
}

.tipo-rows {
  border-top: 1px solid var(--line);
  background: #fbfaf7;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tipo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.tipo-row.is-on {
  border-color: #bfe3e1;
  background: #f0faf9;
  box-shadow: inset 3px 0 0 var(--teal);
}
.tipo-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tipo-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: .03em;
}
.tipo-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.tipo-extra {
  font-size: 12px;
  color: var(--muted);
}

/* Switch tipo iOS */
.sw {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}
.sw input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sw-track {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d5cfc5;
  display: block;
  position: relative;
  transition: background .2s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.sw-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
.sw input:checked + .sw-track {
  background: var(--teal);
}
.sw input:checked + .sw-track .sw-thumb {
  transform: translateX(18px);
}
.sw input:indeterminate + .sw-track {
  background: #7a9e9c;
}
.sw input:indeterminate + .sw-track .sw-thumb {
  transform: translateX(9px);
}
.area-bar .sw-track {
  background: rgba(255,255,255,.28);
}
.area-bar .sw input:checked + .sw-track {
  background: #fff;
}
.area-bar .sw input:checked + .sw-track .sw-thumb {
  background: var(--teal);
}
.area-bar .sw input:indeterminate + .sw-track {
  background: rgba(255,255,255,.55);
}
.area-bar .sw input:indeterminate + .sw-track .sw-thumb {
  background: var(--teal-d);
}

.medicos-panel { margin-bottom: 8px; }
.medicos-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.medico-form .field { margin-top: 10px; }
.medico-card { margin-bottom: 8px; }
.cfg-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  gap: 8px;
  padding-bottom: 2px;
}
.cfg-tabs::-webkit-scrollbar { display: none; }
.cfg-tab {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 12px !important;
}
.cfg-tab-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  opacity: .85;
}
.cfg-tab-icon svg { display: block; }
.cfg-tab.on .cfg-tab-icon { opacity: 1; color: var(--teal); }

.cfg-hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.cfg-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--teal-s);
  color: var(--teal-d);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cfg-hero-especialidades .cfg-hero-icon { background: #e8f0ff; color: #3a5fad; }
.cfg-hero-horarios .cfg-hero-icon { background: #fff3e0; color: #b86a12; }
.cfg-hero-cerradas .cfg-hero-icon { background: #fde8e6; color: #b42318; }
.cfg-hero-politicas .cfg-hero-icon { background: #eef6ee; color: #2f7d4a; }
.cfg-hero-text h3 {
  font-family: var(--display);
  font-size: 18px;
  margin: 0 0 4px;
}
.cfg-hero-text p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.cfg-stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.cfg-stat b { color: var(--teal); margin-right: 4px; }
.esp-cfg-list { display: flex; flex-direction: column; gap: 8px; }
.esp-cfg-row { margin-bottom: 0; }
.esp-cfg-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.esp-cfg-icon.med { background: var(--teal-s); color: var(--teal-d); }
.esp-cfg-icon.odo { background: #fce8de; color: #a84a1f; }
.cfg-mini-icon {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  color: var(--teal);
}
.cfg-mini-icon.inline { margin-right: 4px; }
.section-h-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-h-icon svg { color: var(--teal); flex-shrink: 0; }
.card-icon-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-d);
}
.card-icon-title b { color: var(--ink); }
.meta-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-with-icon svg { color: var(--muted); }
.dia-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cerrada-row { align-items: flex-start; }
.cerrada-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fde8e6;
  color: #b42318;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.medicos-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(145deg, #0b6e6b, #14918c);
  color: #fff;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}
.medicos-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
}
.medicos-banner .tipos-kicker { color: #9fd4d1; }
.medicos-banner-title {
  font-family: var(--display);
  font-size: 20px;
  margin: 0 0 4px;
  color: #fff;
}
.medicos-banner-desc {
  margin: 0;
  font-size: 13px;
  opacity: .9;
  line-height: 1.4;
}
.medicos-banner-stat {
  text-align: center;
  background: rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 8px 10px;
  min-width: 64px;
  flex-shrink: 0;
}
.medicos-banner-stat b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.1;
}
.medicos-banner-stat span { font-size: 10px; opacity: .85; }
.medico-form-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.medico-form-head .muted { display: block; font-size: 12px; }
.tipos-panel-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #7ee0d8;
}
.tipos-panel-top .grow { min-width: 0; }

/* —— Config WhatsApp —— */
.wa-cfg { display: flex; flex-direction: column; gap: 12px; }
.wa-cfg-hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(145deg, #075E54, #128C7E);
  color: #fff;
  border-radius: 18px;
  padding: 16px;
}
.wa-cfg-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #25D366;
}
.wa-cfg-hero h3 {
  font-family: var(--display);
  font-size: 20px;
  margin: 0 0 4px;
}
.wa-cfg-hero p {
  margin: 0;
  font-size: 13px;
  opacity: .9;
  line-height: 1.4;
}
.wa-cfg-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.wa-cfg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 0 4px rgba(37, 211, 102, .2);
  flex-shrink: 0;
}
.wa-cfg-preview b { display: block; font-size: 15px; }
.wa-cfg-preview small { color: var(--muted); font-size: 13px; }

@media (min-width: 800px) {
  .week-grid { overflow: visible; }
  .week-col { flex: 1; min-width: 0; }
}

.toast {
  position: absolute; left: 16px; right: 16px; top: calc(12px + var(--safe-t));
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px;
  z-index: 20; font-size: 14px; display: none;
}
.toast.show { display: block; }

.back {
  border: 0; background: transparent; font: inherit; color: var(--teal); font-weight: 600; cursor: pointer; padding: 0;
}
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty-rich {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 36px 20px;
}
.empty-icon {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; margin-bottom: 4px;
}
.empty-rich b { color: var(--ink); font-size: 16px; }

.page-head {
  display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 14px;
}
.page-head .page { margin: 0; }
.page-head .sub { margin: 4px 0 0; }
.page-head-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; flex-shrink: 0;
}

.home-hero {
  display: flex; gap: 12px; align-items: center; margin-bottom: 10px;
}
.home-hero-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(145deg, #0b6e6b, #14918c);
  color: #fff; display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(11, 110, 107, .25);
}
.flow-title {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 10px; font-size: 15px; color: var(--ink);
}
.flow-title svg { color: var(--teal); }

.action-card {
  display: flex !important; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; margin: 0;
}
.action-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; flex-shrink: 0;
}
.action-icon.sm { width: 36px; height: 36px; border-radius: 12px; }
.action-icon.wa { background: #e7f8ef; color: #128C7E; }
.action-text { flex: 1; min-width: 0; }
.action-text b { display: block; font-size: 15px; }
.action-text .muted { margin: 2px 0 0; }
.action-chev { color: var(--muted); font-size: 22px; line-height: 1; }

.kpi-iconed { position: relative; padding-top: 28px; }
.kpi-icon {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center;
}

.time-block { min-width: 52px; text-align: center; }
.time-icon { color: var(--teal); display: inline-grid; margin-bottom: 2px; }

.profile-card {
  display: flex; align-items: center; gap: 12px;
}
.profile-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; flex-shrink: 0;
}
.btn-logout {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; width: 100%;
}

.search-iconed .search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: grid;
}
.pac-row, .bit-row, .wa-alert-card {
  display: flex; gap: 12px; align-items: flex-start;
}
.pac-avatar, .bit-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--teal-s); color: var(--teal-d);
  display: grid; place-items: center; flex-shrink: 0;
}
.bit-ico { width: 36px; height: 36px; }
.wa-alert-card { border-color: #25D366 !important; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; }
.pill-ico { display: grid; }
.tipo-ico {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.tipo-ico.med { background: var(--teal-s); color: var(--teal-d); }
.tipo-ico.odo { background: #fce8de; color: #a84a1f; }

.nav a svg { width: 22px; height: 22px; }
.tag-no { background: #f8d7d4; color: var(--bad); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps span { height: 4px; flex: 1; background: var(--line); border-radius: 4px; }
.steps span.on { background: var(--teal); }

.list-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.mono { font-variant-numeric: tabular-nums; }
.warn-box { background: #fff4f0; color: #8a3510; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }

/* Plan y facturación */
.cfg-hero-plan .cfg-hero-icon { background: #e8f4f2; color: #0d6e6a; }
.bill-cfg { display: flex; flex-direction: column; gap: 12px; }
.bill-freeze {
  background: #fdecea; border: 1px solid #f5c2c0; border-radius: 14px;
  padding: 14px 16px; color: #7a1f16;
}
.bill-freeze p { margin: 6px 0 10px; font-size: 14px; }
.bill-status-row { display: flex; gap: 12px; align-items: flex-start; }
.bill-pill {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 999px; background: #e8f4f2; color: #0d6e6a; flex-shrink: 0;
}
.bill-pill.piloto { background: #fff3e0; color: #b86a12; }
.bill-pill.past_due { background: #fdecea; color: #b42318; }
.bill-plans { display: flex; flex-direction: column; gap: 10px; }
.bill-plan {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: #fff;
}
.bill-plan.on { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(26,155,148,.15); }
.bill-plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bill-price { font-weight: 700; color: var(--ink); white-space: nowrap; }
.bill-piloto { font-size: 13px; color: #0d6e6a; margin: 6px 0 12px; }
.bill-onboard {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center;
}
.bill-onboard-act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bill-orders { display: flex; flex-direction: column; gap: 8px; }
.bill-order {
  display: flex; justify-content: space-between; gap: 10px; font-size: 13px;
  padding: 10px 12px; background: var(--teal-s); border-radius: 10px;
}
.bill-demo-tools { margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bill-ciclo { display: flex; gap: 8px; margin: 4px 0 8px; }
.bill-ciclo .vista-tab { flex: 1; justify-content: center; }
.bill-quien { margin: 2px 0 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.bill-plan-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bill-plan-libre { background: #f7faf9; }
.bill-iva, .bill-mes13 { font-size: 13px; line-height: 1.45; }
.bill-addons { display: flex; flex-direction: column; gap: 8px; }
.bill-addon {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.bill-addon-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.bill-pill.gratis { background: #eef6ee; color: #2f7d4a; }
