/* Turnalo · sistema de color y componentes
   Regla: fondo blanco, texto negro, UN color de marca en 7 tonos.
   --brand-* se recalcula desde el color del logo del negocio (ver theme.js).
   Los colores de estado y de agenda NO cambian con la marca. */
:root {
  --brand-50: #EEF4FC; --brand-100: #D9E6F8; --brand-200: #B3CDF1; --brand-300: #7FAAE6;
  --brand-500: #2B6CD9; --brand-700: #1D4FA8; --brand-900: #12326B; --on-brand: #FFFFFF;
  --g0: #FFFFFF; --g100: #F4F4F4; --g300: #D6D6D6; --g500: #8A8A8A; --g700: #4A4A4A; --g900: #111111;
  --ok: #1E9E5A; --ok-t: #E6F5EC; --warn: #E0A100; --warn-t: #FCF3DC; --bad: #D64545; --bad-t: #FBE7E7;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --display: 'Century Gothic', 'Segoe UI', system-ui, sans-serif;
  --r: 14px; --r-lg: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--g0); color: var(--g900); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-500); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--g900); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
.hidden { display: none !important; }
.muted { color: var(--g700); } .small { font-size: 12px; } .tiny { font-size: 11px; color: var(--g500); }
.row { display: flex; align-items: center; gap: 10px; } .col { display: flex; flex-direction: column; gap: 6px; }
.spread { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* Botones · jerarquía */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--g300); background: var(--g0); color: var(--g900); font-weight: 700; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand-700); color: var(--on-brand); border-color: var(--brand-700); box-shadow: 0 8px 20px rgba(0,0,0,.18); } /* Nivel 1: uno por pantalla */
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { border-color: transparent; color: var(--brand-500); background: transparent; }
.btn-danger { color: var(--bad); }
.btn-lg { height: 56px; border-radius: var(--r-lg); font-size: 17px; font-family: var(--display); width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12px; border-radius: 10px; }

/* Pastillas (chips) */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--g300); background: var(--g0); font-size: 12px; font-weight: 600; color: var(--g900); cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand-100); color: var(--brand-900); border-color: var(--brand-100); font-weight: 700; }  /* Nivel 3 */
.chip.done { background: var(--g100); color: var(--g700); border-color: var(--g100); }
.chip.todo { color: var(--g500); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }

/* Tarjetas seleccionables · Nivel 2 seleccionado, Nivel 4 disponible, Nivel 5 no disponible */
.card { border: 1px solid var(--g300); border-radius: 16px; background: var(--g0); padding: 12px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--g300); background: var(--g0); cursor: pointer; text-align: left; width: 100%; }
.pick.on { background: var(--brand-100); border: 2px solid var(--brand-700); padding: 11px; }
.pick.off { background: var(--g100); border-color: var(--g100); color: var(--g500); cursor: default; }
.radio { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--g300); flex-shrink: 0; display: grid; place-items: center; }
.pick.on .radio { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--g100); object-fit: cover; flex-shrink: 0; }
.thumb.ph { background: linear-gradient(135deg, var(--brand-50), var(--brand-100)); display: grid; place-items: center; color: var(--brand-500); }
.price { font-family: var(--display); font-weight: 700; font-size: 15px; }
.tag { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.tag-ok { background: var(--ok-t); } .tag-warn { background: var(--warn-t); } .tag-bad { background: var(--bad-t); } .tag-brand { background: var(--brand-100); color: var(--brand-900); }

/* Grillas de días y horas */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 12px; border: 1px solid var(--g300); background: var(--g0); cursor: pointer; font-weight: 700; font-size: 15px; }
.day small { font-size: 10px; font-weight: 600; color: var(--g700); }
.day.on { background: var(--brand-100); border: 2px solid var(--brand-700); color: var(--brand-900); padding: 7px 0; }
.day.off { background: var(--g100); border-color: var(--g100); color: var(--g500); cursor: default; }
.times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.time { height: 46px; border-radius: 14px; border: 1px solid var(--g300); background: var(--g0); font-weight: 600; font-size: 14px; cursor: pointer; }
.time.on { background: var(--brand-100); border: 2px solid var(--brand-700); color: var(--brand-900); font-weight: 700; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: 12px; font-weight: 700; color: var(--g700); }
.input { height: 44px; border-radius: 12px; border: 1px solid var(--g300); padding: 0 14px; width: 100%; background: var(--g0); }
.input:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; }
textarea.input { height: auto; padding: 10px 14px; min-height: 72px; resize: vertical; }
.switch { width: 40px; height: 24px; border-radius: 999px; background: var(--g300); position: relative; border: 0; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: left .15s; }
.switch.on { background: var(--ok); } .switch.on::after { left: 19px; }

/* Avisos */
.notice { padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.notice-ok { background: var(--ok-t); } .notice-warn { background: var(--warn-t); } .notice-bad { background: var(--bad-t); } .notice-info { background: var(--brand-50); }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.avatar { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.logo { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-900); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 17px; overflow: hidden; flex-shrink: 0; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--g900); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--g300); border-top-color: var(--brand-700); border-radius: 999px; animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
