:root {
  --ink: #0b1b2b;
  --ink-2: #334155;
  --mu: #64748b;
  --mu-2: #94a3b8;
  --line: #e4e9ef;
  --line-2: #d3dbe4;
  --bg: #f5f7f9;
  --card: #ffffff;
  --brand: #0f766e;
  --brand-600: #0d9488;
  --brand-700: #115e59;
  --brand-50: #effcf8;
  --brand-100: #d2f5ea;
  --violet: #6d5efc;
  --amber: #b45309; --amber-bg: #fff6e5;
  --green: #047857; --green-bg: #e7f8f0;
  --blue: #1d4ed8; --blue-bg: #eaf1ff;
  --red: #b91c1c; --red-bg: #fdecec;
  --gray-bg: #eef1f4;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgb(11 27 43 / .06);
  --shadow: 0 1px 2px rgb(11 27 43 / .04), 0 6px 20px rgb(11 27 43 / .06);
  --shadow-lg: 0 2px 6px rgb(11 27 43 / .05), 0 24px 60px rgb(11 27 43 / .14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--brand); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--mu); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- botones ---------- */
.btn {
  --b: var(--brand); --t: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--b); color: var(--t); font-weight: 650; font-size: 14.5px; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
  box-shadow: 0 1px 2px rgb(15 118 110 / .25), inset 0 1px 0 rgb(255 255 255 / .12);
}
.btn:hover { background: var(--brand-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.sm svg { width: 15px; height: 15px; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: #f8fafb; border-color: var(--mu-2); }
.btn.quiet { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.quiet:hover { background: var(--gray-bg); }
.btn.danger { background: var(--card); color: var(--red); border-color: #f3c8c8; box-shadow: none; }
.btn.danger:hover { background: var(--red-bg); }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.dark:hover { background: #1c2f44; }
.btn.wa { background: #1faa59; box-shadow: none; }
.btn.wa:hover { background: #178a48; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--mu); cursor: pointer; }
.icon-btn:hover { background: var(--gray-bg); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- formularios ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--mu); font-size: 12.5px; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.field select { appearance: none; padding-right: 34px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-600) 16%, transparent); }
.field input:user-invalid { border-color: #e7a3a3; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid-2 .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--gray-bg); border-radius: 11px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--mu); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

.switch { position: relative; display: inline-flex; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { flex: 1; border-radius: 99px; background: var(--line-2); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .2s; }
.switch input:checked + span { background: var(--brand-600); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ---------- etiquetas ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--gray-bg); color: var(--ink-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.st-scheduled, .chip.amber { background: var(--amber-bg); color: var(--amber); }
.st-confirmed, .chip.green { background: var(--green-bg); color: var(--green); }
.st-completed, .chip.blue { background: var(--blue-bg); color: var(--blue); }
.st-no_show, .chip.red { background: var(--red-bg); color: var(--red); }
.st-cancelled { background: var(--gray-bg); color: var(--mu); }

/* ---------- tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, #14b8a6, var(--brand) 55%, #0b4f4a); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 2px 6px rgb(15 118 110 / .35); }
.logo-mark svg { width: 18px; height: 18px; color: #fff; }

/* ---------- diálogos ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(11 27 43 / .42); backdrop-filter: blur(3px); overflow: hidden; overscroll-behavior: contain; }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.dlg-head h2 { font-size: 19px; }
.dlg-body { padding: 18px 22px; display: grid; gap: 14px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.dlg-foot .left { margin-right: auto; }

/* ---------- avisos ---------- */
.toasts { position: fixed; z-index: 100; bottom: 20px; left: 50%; translate: -50% 0; display: grid; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 550; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; }
.toast.err { background: #8f1d1d; }
.toast svg { width: 18px; height: 18px; flex: none; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--amber-bg); color: #7a3e06; font-size: 13.5px; }
.notice.info { background: var(--brand-50); color: var(--brand-700); }
.notice.err { background: var(--red-bg); color: var(--red); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

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