/* ============ Boxeo Ullate Roche — hoja de estilos ============ */
:root {
  color-scheme: light;
  --bg: #fbf7f0;                 /* crema cálido, igual que la web pública */
  --bar: 251, 247, 240;          /* crema en RGB para las barras translúcidas */
  --surface: #ffffff;
  --surface-2: #f6f6f8;
  --surface-3: #ececf0;
  --line: #dcdce2;
  --line-soft: #e9e9ee;
  --text: #16161a;
  --muted: #5b5b66;
  --faint: #8a8a95;
  --red: #7a1f3d;
  --red-dim: #5c162e;
  --red-soft: #f5eaef;
  --green: #1f9d4c;
  --green-soft: #e8f6ed;
  --amber: #c27c0e;
  --amber-soft: #fdf4e3;
  --blue: #1f6fd1;
  --blue-soft: #e9f1fc;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 10px 30px rgba(20,20,30,.12);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  /* Lavado de escenario de la web pública: crema con un halo granate arriba
     a la derecha y otro dorado abajo a la izquierda. */
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(156, 44, 78, .16), transparent 60%),
    radial-gradient(55% 45% at 10% 100%, rgba(176, 135, 63, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text); font-family: var(--sans);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 8px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(150deg, var(--red), var(--red-dim));
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  box-shadow: 0 3px 10px rgba(208,24,47,.25);
}
.brand-name { font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .13s, border-color .13s, transform .08s, opacity .13s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: #c9c9d1; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #b81429; border-color: #b81429; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { color: #8a2140; border-color: #e2b6c2; background: var(--red-soft); }
.btn-danger:hover:not(:disabled) { background: #fad9dd; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

/* Fila seleccionable (elegir forma de pago, opciones de un diálogo). */
.pick {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; font: inherit;
  transition: background .13s, border-color .13s, transform .08s;
}
.pick:hover { background: var(--surface-2); border-color: #c9c9d1; }
.pick:active { transform: translateY(1px); }
.pick[aria-current='true'] { border-color: #b9e3c7; background: var(--green-soft); }
.pick .chev { color: var(--faint); font-size: 22px; line-height: 1; flex: none; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  /* 16px evita que el móvil (iOS) haga zoom automático al enfocar el campo. */
  font-size: 16px;
  border: 1px solid var(--line); background: var(--surface-2); outline: none;
  transition: border-color .13s, box-shadow .13s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft);
}
.input::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 72px; font-family: inherit; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a9aa3' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.checkline { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.checkline input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 16px;
}
.card-pad-0 { padding: 0; overflow: hidden; }
.card-head {
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Etiquetas ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line);
}
.tag-red    { background: var(--red-soft);   color: #8a2140; border-color: #e2b6c2; }
.tag-green  { background: var(--green-soft); color: #17773a; border-color: #b9e3c7; }
.tag-amber  { background: var(--amber-soft); color: #92590a; border-color: #f1d8a6; }
.tag-blue   { background: var(--blue-soft);  color: #1b5fb3; border-color: #bcd4f3; }
/* Tintes muy suaves para estados neutros (Terminada / Próxima). */
.tag-tint-green { background: #eef7f1; color: #3e7d58; border-color: #dcece0; }
.tag-tint-blue  { background: #eef3fb; color: #3f68a4; border-color: #dde7f5; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* categorias */
.tag[class*='cat-'] { text-transform: capitalize; }
.cat-elemental { background: #fdeef5; color: #b0276a; border-color: #f5c2da; }
.cat-infantil  { background: #e8f5fc; color: #0f6a96; border-color: #b6ddf1; }
.cat-juvenil   { background: #eef7e1; color: #4a7a0c; border-color: #cfe6a9; }
.cat-adultos   { background: #f1f1f4; color: #45454f; border-color: #dcdce2; }

/* ---------- Avisos ---------- */
.notice {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; line-height: 1.45;
}
.notice-amber { background: var(--amber-soft); border-color: #f1d8a6; color: #7a4a06; }
.notice-red   { background: var(--red-soft);   border-color: #e2b6c2; color: #6e1930; }
.notice-blue  { background: var(--blue-soft);  border-color: #bcd4f3; color: #174f94; }
.notice-green { background: var(--green-soft); border-color: #b9e3c7; color: #146532; }
.notice b { color: inherit; }

/* ---------- Barra de ocupacion ---------- */
.meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--green); transition: width .25s; }
.meter.warn > i { background: var(--amber); }
.meter.full > i { background: var(--red); }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.auth-card { width: 100%; max-width: 390px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand { justify-content: center; margin-bottom: 16px; }
.auth-card .card { padding: 22px; }
.auth-links { margin-top: 16px; text-align: center; font-size: 13.5px; }
.auth-links button { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 4px; }
.auth-links button:hover { color: var(--text); }

/* ---------- Estructura de la app ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(var(--bar), .82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 11px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.main { flex: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: 18px 16px 96px; }
@media (min-width: 900px) { .main { padding-bottom: 40px; } }

.tabs { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 11px; padding: 3px; overflow-x: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 8px 13px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface-3); color: var(--text); }

/* nav inferior en movil */
.botnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: rgba(var(--bar), .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.botnav button {
  flex: 1; border: 0; background: none; padding: 9px 4px 8px; cursor: pointer;
  color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600;
}
.botnav button.on { color: var(--red); }
.botnav svg { width: 21px; height: 21px; }
@media (min-width: 900px) { .botnav { display: none; } }

.usermenu { position: relative; }
.avatar {
  width: 33px; height: 33px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-3); font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; overflow: hidden; padding: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xl {
  width: 96px; height: 96px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-3); display: grid; place-items: center; overflow: hidden;
  font-size: 30px; font-weight: 700; color: var(--muted); margin: 0 auto;
}
.avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-3); display: grid; place-items: center; overflow: hidden;
  font-size: 18px; font-weight: 700; color: var(--muted); flex: none;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.t-avatar {
  width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-3); display: grid; place-items: center; overflow: hidden;
  font-size: 20px; font-weight: 700; color: var(--muted); flex: none;
}
.t-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pause-log { margin-top: 12px; }
.pause-log > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 2px; }
.pause-log[open] > summary { margin-bottom: 6px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 7px); min-width: 190px; z-index: 50;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden; padding: 4px;
}
.menu button {
  display: block; width: 100%; text-align: left; padding: 9px 11px; border: 0;
  background: none; cursor: pointer; border-radius: 8px; font-size: 14px;
}
.menu button:hover { background: var(--surface-3); }

/* ---------- Clases ---------- */
.daygroup { margin-bottom: 20px; }
.dayhead {
  display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px;
  padding-bottom: 7px; border-bottom: 1px solid var(--line-soft);
}
.dayhead .d { font-weight: 650; }
.dayhead .n { font-size: 12.5px; color: var(--faint); }
.dayhead.today .d { color: var(--red); }

.slot {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px;
  border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface);
  transition: border-color .13s;
}
.slot + .slot { margin-top: 8px; }
.slot:hover { border-color: var(--line); }
.slot.is-booked { border-color: #9fd6b2; background: linear-gradient(90deg, var(--green-soft), transparent 55%); }
.slot.is-full   { opacity: .62; }
.slot.is-past   { opacity: .42; }
.slot.is-closed { opacity: .6; border-style: dashed; }
.slot-time { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -.02em; flex: none; width: 52px; }
.slot-body { flex: 1; min-width: 0; }
.slot-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.slot-act { flex: none; }
@media (max-width: 420px) {
  .slot { gap: 10px; padding: 12px 11px; }
  .slot-time { width: 46px; font-size: 14px; }
  .btn-sm { padding: 6px 9px; }
}

/* ---------- Tablas ---------- */
.tablewrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.num { text-align: right; font-family: var(--mono); white-space: nowrap; }

/* ---------- Estadisticas ---------- */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 13px 14px; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .k { font-size: 11.5px; color: var(--faint); margin-top: 3px; font-weight: 600; }
.stat.alert .v { color: var(--amber); }
.stat.bad .v { color: var(--red); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,20,30,.38);
  backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center;
  padding: 0; animation: fade .16s ease;
}
@media (min-width: 620px) { .overlay { align-items: center; padding: 24px; } }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { transform: translateY(14px); opacity: 0 } }
.modal {
  background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 560px;
  max-height: 92dvh; overflow-y: auto; border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow); animation: rise .18s ease;
}
@media (min-width: 620px) { .modal { border-radius: var(--r-lg); } }
.modal-lg { max-width: 800px; }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
.iconbtn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 21px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.iconbtn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Avisos flotantes ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 28px)); }
@media (min-width: 900px) { .toasts { bottom: 22px; } }
.toast {
  padding: 12px 15px; border-radius: var(--r); font-size: 14px; font-weight: 550;
  border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow);
  animation: rise .18s ease; line-height: 1.4;
}
.toast.ok  { background: #ecf8f0; border-color: #9fd6b2; color: #135e2f; }
.toast.err { background: #fdecee; border-color: #f0a9b3; color: #6e1930; }

/* ---------- Varios ---------- */
.empty { text-align: center; padding: 34px 18px; color: var(--faint); font-size: 14px; }
.spinner { width: 17px; height: 17px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading { display: grid; place-items: center; padding: 48px; }
.pwbox {
  font-family: var(--mono); font-size: 17px; letter-spacing: .06em; padding: 12px 14px;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; word-break: break-all;
}
.kv { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.scroll-x { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.scroll-x::-webkit-scrollbar { height: 0; }
.chip {
  flex: none; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip small { display: block; font-size: 10.5px; font-weight: 500; opacity: .7; }

/* ============ v2: actividades, cuadrante, asistente ============ */
.actchip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650;
  padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.actchip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.slot.has-color { border-left: 4px solid var(--c, var(--line)); }
.cls-name { font-weight: 650; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--text);
}
.chip-btn i { width: 8px; height: 8px; border-radius: 50%; }
.chip-btn.on { border-color: var(--red); background: var(--red-soft); color: #6e1930; }
.mcard { border-top: 4px solid var(--c, var(--line)); }
.acard { cursor: pointer; text-align: left; width: 100%; transition: border-color .13s, box-shadow .13s; }
.acard:hover { border-color: var(--line); box-shadow: 0 4px 16px rgba(20,20,30,.06); }
.agrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid rgba(0,0,0,.08); }
.checklist { max-height: 340px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 10px; }
.checklist .checkline { padding: 5px 0; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.linkbox code { font-family: var(--mono); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cuadrante semanal por sala */
.gw-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--surface); }
.gw { display: grid; grid-template-columns: 54px repeat(var(--days, 6), minmax(120px, 1fr)); min-width: 820px; }
.gw-head { position: sticky; top: 0; z-index: 2; background: var(--surface); font-size: 12px; font-weight: 700; text-align: center;
  padding: 9px 4px; border-bottom: 1px solid var(--line); }
.gw-head small { display: block; font-weight: 500; color: var(--faint); }
.gw-hours, .gw-col { position: relative; }
.gw-col { border-left: 1px solid var(--line-soft); }
.gw-hour { position: absolute; right: 7px; font-size: 11px; color: var(--faint); font-family: var(--mono); transform: translateY(-7px); }
.gw-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.gw-block {
  position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 5px 7px; font-size: 11.5px; line-height: 1.25;
  overflow: hidden; cursor: pointer; border: 1px solid rgba(0,0,0,.07); color: #1b1b20; text-align: left; font: inherit; font-size: 11.5px;
}
.gw-block b { display: block; font-size: 12px; font-weight: 700; }
.gw-block .occ { font-family: var(--mono); font-size: 11px; opacity: .8; }
.gw-block:hover, .gw-block:focus-visible { box-shadow: 0 3px 10px rgba(0,0,0,.16); outline: none; z-index: 1; }
.gw-block.off { opacity: .45; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.5) 6px 12px); }

/* Asistente de IA */
.fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 60; height: 48px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--text); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 8px;
}
.fab:hover { background: #2a2a31; }
.chat {
  position: fixed; right: 18px; bottom: 80px; z-index: 61; width: min(430px, calc(100vw - 24px)); height: min(660px, calc(100dvh - 110px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-head { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-foot { border-top: 1px solid var(--line-soft); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.chat-foot textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0 6px; padding-left: 18px; }
.msg.user { align-self: flex-end; background: var(--red); color: #fff; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); }
.msg.system { align-self: center; font-size: 12px; color: var(--muted); padding: 2px 8px; }
.action-card { align-self: stretch; border: 1px solid #f1d8a6; background: var(--amber-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.action-card.done { border-color: #b9e3c7; background: var(--green-soft); }
.action-card.no { opacity: .6; }
.typing { align-self: flex-start; color: var(--faint); font-size: 13px; }
@media (max-width: 620px) {
  .chat { right: 0; left: 0; bottom: 0; width: auto; height: 100dvh; border-radius: 0; }
}

/* ===== v4: avisos, festivos, bajas ===== */
.bell { position: relative; font-size: 15px; }
.bell-n { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.aviso { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); font: inherit; color: inherit; }
.aviso[data-link] { cursor: pointer; }
.aviso.unread { border-color: var(--red); background: color-mix(in srgb, var(--red) 5%, var(--surface)); }
.aviso span { white-space: pre-line; color: var(--muted); font-size: 13px; }
.aviso small { color: var(--faint); font-size: 11.5px; }
.gw-head.holiday { color: var(--red); }
.gw-head em { display: block; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--red); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-block.closed { opacity: .5; filter: grayscale(.7); text-decoration: line-through; }
.gw-block.leave { box-shadow: inset 0 0 0 2px var(--red); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent, var(--red)); text-decoration: underline; cursor: pointer; font: inherit; }
