/* =========================================================
   Agendia — hoja de estilos
   Paleta propia: verde azulado + acento coral sobre fondo cálido
   ========================================================= */
:root {
  --brand: #0e7c66;
  --brand-600: #0b6654;
  --brand-50: #e7f4f0;
  --brand-100: #cfe9e1;
  --accent: #ff7a59;
  --ink: #17202f;
  --ink-2: #3d4757;
  --muted: #6b7585;
  --line: #e7e5df;
  --bg: #f7f6f2;
  --card: #fff;
  --danger: #d64545;
  --danger-50: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 47, .05), 0 8px 24px rgba(23, 32, 47, .06);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strike { text-decoration: line-through; color: var(--muted); }

/* ---------- Iconos y avatares ---------- */
svg.i { flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
/* Iniciales centradas: sin espaciado extra a la derecha y con la altura de la letra (no la de la línea) */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex: none;
  letter-spacing: 0; line-height: 1; text-align: center; text-indent: 0; padding: 0; overflow: hidden; text-box: trim-both cap alphabetic; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-ghost.is-copied { border-color: var(--brand); color: var(--brand-600); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b93838; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; white-space: normal; text-align: center; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none;
  border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
label, .label { font-weight: 600; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=url], input[type=tel], input[type=datetime-local], .people-filters input[type=search], .search-combo input[type=search], .contact-pick input[type=search], select, textarea {
  font: inherit; font-size: 15px; padding: 10px 12px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea { min-height: 96px; resize: vertical; }
textarea.code { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; background: var(--bg); margin-bottom: 12px; }
.input-prefix { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.input-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.input-prefix span { padding: 10px 0 10px 12px; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; align-self: center; }
.input-prefix input { border: 0; border-radius: 0; box-shadow: none !important; padding-left: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input, .day-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-layout { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.section-title { font-size: 17px; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.section-title + .muted { margin: -10px 0 18px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-success { background: #e6f6ee; color: #14663f; }
.alert-error { background: var(--danger-50); color: #9b2c2c; }
.alert-info { background: var(--brand-50); color: var(--brand-600); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); }
.swatches input:checked + span { outline: 3px solid var(--c); outline-offset: 3px; }
.swatches input:focus-visible + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }

.switch { position: relative; display: inline-block; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { display: block; width: 40px; height: 22px; border-radius: 999px; background: #d4d2cb; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }

.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.badge-on { background: var(--brand-50); color: var(--brand-600); }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 26px; }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { color: var(--ink); font-size: 18px; }
.empty p { margin: 0 0 8px; }
.empty-inline { padding: 18px 0 0; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- Estructura del panel ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: none; background: #fff; border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none !important; letter-spacing: -.02em; }
.sidebar .brand { padding: 0 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--brand-50); color: var(--brand-600); }
.nav-mobile-only { display: none !important; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.side-link { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 0 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip > div { min-width: 0; flex: 1; }
.user-chip strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; padding: 34px 40px 72px; }
.content { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }

/* Barra del propietario */
.owner-bar { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 24px; }
.owner-bar .grow { flex: 1; min-width: 0; }
.owner-bar strong { display: block; }

/* Tarjetas de tipos de evento */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.event-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 14px 26px; display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .2s, transform .2s;
}
.event-card:hover { box-shadow: 0 2px 4px rgba(23,32,47,.06), 0 14px 32px rgba(23,32,47,.09); }
.event-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); border-radius: var(--radius) 0 0 var(--radius); }
.event-card.off { background: #fbfaf8; }
.event-card.off::before { background: #d4d2cb; }
.event-card.off h3 a { color: var(--muted); }
.event-card h3 { font-size: 18px; font-weight: 700; }
.event-card h3 a { color: var(--ink); }
.event-card .meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.event-card .card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.event-card .card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; gap: 8px; }

/* Menú desplegable */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(23,32,47,.14); min-width: 230px; padding: 6px; z-index: 30;
}
.menu-list form { margin: 0; }
.menu-list a, .menu-list button {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 8px;
  border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none;
}
.menu-list a:hover, .menu-list button:hover { background: var(--bg); }
.menu-list .danger { color: var(--danger); }

/* ---------- Reuniones ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; }
.tabs a.active { color: var(--brand-600); border-color: var(--brand); }
.tabs .count { background: var(--bg); border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 8px; }
.tabs a.active .count { background: var(--brand-50); }
.tz-note { display: flex; align-items: center; gap: 6px; margin: 0 0 20px; }
.day-group { margin-bottom: 24px; }
.day-group > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; font-weight: 700; }
.booking { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.booking summary { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
.booking summary::-webkit-details-marker { display: none; }
.booking summary:hover { background: #fcfbf9; }
.booking .when { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.booking .who strong { display: block; }
.booking .who span { color: var(--muted); font-size: 14px; }
.booking .chev { color: var(--muted); transition: transform .2s; display: grid; }
.booking[open] .chev { transform: rotate(90deg); }
.booking.is-cancelled .when, .booking.is-cancelled .who strong { text-decoration: line-through; color: var(--muted); }
.booking-body { border-top: 1px solid var(--line); padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; font-size: 14px; background: #fcfbf9; }
.booking-body dl { margin: 0; }
.booking-body dl.full { grid-column: 1 / -1; }
.booking-body dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.booking-body dd { margin: 3px 0 0; word-break: break-word; }
.booking-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; border-top: 1px dashed var(--line); padding-top: 14px; }
.booking-actions input { flex: 1; min-width: 0; padding: 7px 12px; font-size: 14px; }

/* ---------- Disponibilidad ---------- */
.day-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.day-row:last-of-type { border-bottom: 0; }
.day-toggle { display: flex; align-items: center; gap: 10px; padding-top: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.ranges { display: flex; flex-direction: column; gap: 8px; }
.range { display: flex; align-items: center; gap: 8px; }
.range input { width: 120px; }
.range span { color: var(--muted); }
.unavailable { color: var(--muted); padding-top: 8px; font-size: 14px; }
.day-row.on .unavailable { display: none; }
.day-row:not(.on) .range, .day-row:not(.on) [data-add-range] { display: none; }
.override-form { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.override-form .field { margin: 0; }
.seg { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; }
.seg label { flex: 1; text-align: center; padding: 8px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); color: var(--brand-600); }
.override-list { list-style: none; margin: 0; padding: 0; }
.override-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.override-list li > div { display: flex; flex-direction: column; }
.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-row p { margin: 0; }
img.avatar { object-fit: cover; background: #e5e7eb; }
.profile-photo { display: flex; flex-direction: column; gap: 6px; }
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-pick .btn { cursor: pointer; }
.file-input:focus-visible + .btn { outline: 2px solid var(--brand); outline-offset: 2px; }
.file-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Respaldo: cualquier selector de archivo sin .file-pick toma el aspecto de la web */
input[type=file] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 13px; padding: 6px 12px; margin-right: 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); transition: border-color .15s;
}
input[type=file]::file-selector-button:hover { border-color: var(--ink-2); }

/* ---------- Login / registro ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 15% 10%, var(--brand-50), transparent 45%), radial-gradient(circle at 90% 90%, #fff0eb, transparent 40%); }
.auth-card { width: 100%; max-width: 430px; padding: 36px; }
.auth .brand { justify-content: center; margin-bottom: 22px; }
.auth h1 { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth .sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin: 20px 0 0; }

/* ---------- Páginas públicas ---------- */
.public { min-height: 100vh; padding: 48px 16px 32px; display: flex; flex-direction: column; align-items: center; }
.embed { background: #fff; }
.embed .public { padding: 0; min-height: 0; }
.embed .booker, .embed .profile { box-shadow: none; }
.powered { margin-top: 24px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.profile { max-width: 780px; width: 100%; padding: 40px; text-align: center; }
.profile h1 { font-size: 24px; font-weight: 800; margin: 14px 0 6px; }
.profile > p { max-width: 520px; margin: 0 auto; }
.profile-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; text-align: left; margin-top: 30px; }
.profile-event {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 44px 20px 26px;
  border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none !important;
  transition: border-color .15s, transform .15s, box-shadow .15s; overflow: hidden;
}
.profile-event::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.profile-event:hover { border-color: var(--c); transform: translateY(-2px); box-shadow: var(--shadow); }
.profile-event strong { font-size: 16px; }
.profile-event .meta { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.profile-event .go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Reservar */
.booker {
  width: 100%; max-width: 1080px; display: grid; grid-template-columns: 330px minmax(0, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); min-height: 580px;
  transition: max-width .25s;
}
.booker:not(.has-slots):not(.on-form) { max-width: 960px; }
.booker-info { position: relative; padding: 30px; border-right: 1px solid var(--line); }
.booker-info::before { content: ""; position: absolute; top: 0; left: 30px; right: 30px; height: 4px; border-radius: 0 0 4px 4px; background: var(--c); }
.round-back { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--brand); margin-bottom: 8px; }
.round-back:hover { background: var(--brand-50); text-decoration: none; }
.booker-info .host { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; margin: 12px 0 8px; }
.booker-info h1 { font-size: 25px; font-weight: 800; margin-bottom: 18px; letter-spacing: -.02em; }
.meta-list { display: flex; flex-direction: column; gap: 12px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.meta-list > div { display: flex; gap: 10px; align-items: flex-start; }
.meta-list svg { margin-top: 1px; color: var(--muted); }
.meta-list .chosen-info { color: var(--brand-600); }
.meta-list .chosen-info svg { color: var(--brand); }
.booker-info .desc { margin: 20px 0 0; color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.resched-box { margin-top: 20px; padding: 14px; border-radius: 12px; background: #fff4ef; color: #9a3b1f; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.booker-main { padding: 30px; min-width: 0; }
.booker-main h2 { font-size: 20px; font-weight: 800; margin-bottom: 22px; }
.pick-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.booker.has-slots .pick-grid { grid-template-columns: minmax(0, 1fr) 230px; }

.cal { max-width: 460px; width: 100%; margin: 0 auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-head strong { font-size: 16px; }
.cal-nav { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.cal-nav:hover { background: var(--brand-100); }
.cal-nav:disabled { background: transparent; color: #c9c7c0; cursor: default; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-week span { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0 8px; }
.cal-grid { transition: opacity .2s; }
.cal-grid.loading { opacity: .35; pointer-events: none; }
.cal-grid button {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 54px; justify-self: center;
  border: 0; border-radius: 12px; background: transparent; font: inherit; font-size: 15px; color: #b2b6bd; cursor: default;
}
.cal-grid button.avail { background: var(--brand-50); color: var(--brand-600); font-weight: 700; cursor: pointer; transition: background .15s, transform .1s; }
.cal-grid button.avail:hover { background: var(--brand-100); }
.cal-grid button.sel { background: var(--brand); color: #fff; }
.cal-grid button.today::after { content: ""; position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.cal-empty { text-align: center; margin: 14px 0 0; }

.slots h3 { font-size: 15px; font-weight: 700; margin: 8px 0 16px; }
.slot-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.slot-row { display: flex; gap: 6px; }
.slot {
  flex: 1; padding: 12px 8px; border: 1.5px solid var(--brand-100); border-radius: 10px; background: #fff;
  color: var(--brand-600); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; transition: border-color .15s, background .15s;
}
.slot:hover { border-color: var(--brand); }
.slot-row.selected .slot { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.slot-next { flex: 1; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; cursor: pointer; animation: grow .18s ease-out; }
.slot-next:hover { background: var(--brand-600); }
@keyframes grow { from { opacity: 0; transform: scaleX(.6); } to { opacity: 1; transform: none; } }

.tz-row { display: flex; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; max-width: 460px; }
.tz-row label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.tz-row select { flex: 1; min-width: 200px; padding: 8px 10px; font-size: 14px; }
.fmt-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.fmt-toggle button { border: 0; background: none; padding: 4px 11px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.fmt-toggle button.on { background: var(--brand-50); color: var(--brand-600); }

.step-form { max-width: 520px; }
.back-link { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; font-size: 14px; color: var(--brand); cursor: pointer; margin-bottom: 18px; }
.chosen { display: flex; gap: 10px; align-items: center; background: var(--brand-50); color: var(--brand-600); padding: 12px 14px; border-radius: 12px; font-weight: 700; margin-bottom: 22px; }

/* Confirmación / gestión */
.confirm-card { max-width: 640px; width: 100%; padding: 40px; text-align: center; }
.confirm-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.confirm-icon { width: 62px; height: 62px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; box-shadow: 0 0 0 8px var(--brand-50); }
.confirm-icon svg { stroke-width: 2.6; }
.confirm-icon.is-muted { background: var(--muted); box-shadow: 0 0 0 8px var(--bg); }
.confirm-details { position: relative; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 22px 28px; margin: 26px 0; overflow: hidden; }
.confirm-details::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.confirm-details h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cancel-box { margin-top: 26px; text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.cancel-box summary { cursor: pointer; color: var(--danger); font-weight: 600; font-size: 14px; text-align: center; }
.cancel-box form { margin-top: 16px; }

/* ---------- Portada ---------- */
.landing-body { background: radial-gradient(circle at 85% 0%, #fff0eb, transparent 35%), radial-gradient(circle at 0% 100%, var(--brand-50), transparent 45%), var(--bg); min-height: 100vh; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1180px; margin: 0 auto; padding: 22px 24px; flex-wrap: wrap; }
.landing-nav-actions { display: flex; gap: 10px; }
.hero { max-width: 1180px; margin: 0 auto; padding: 56px 24px 80px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--brand-600); }
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.035em; line-height: 1.06; margin: 20px 0; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-copy > p { font-size: 18px; color: var(--ink-2); max-width: 520px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-points { list-style: none; padding: 0; margin: 30px 0 0; display: flex; gap: 10px 22px; flex-wrap: wrap; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.hero-points li { display: flex; align-items: center; gap: 6px; }
.hero-points svg { color: var(--brand); }
.mock { display: grid; grid-template-columns: 150px 1fr 90px; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 30px 60px -20px rgba(23,32,47,.25); transform: rotate(-1.5deg); }
.mock-side { display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--line); padding-right: 14px; }
.mock-side b { font-size: 15px; margin-top: 4px; }
.mock-side small { color: var(--muted); display: flex; align-items: center; gap: 5px; font-weight: 600; }
.mock-cal b { display: block; font-size: 14px; margin-bottom: 10px; }
.mock-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mock-grid i, .mock-slots i { font-style: normal; font-size: 11px; text-align: center; border-radius: 7px; padding: 5px 0; color: #b2b6bd; }
.mock-grid i.a { background: var(--brand-50); color: var(--brand-600); font-weight: 700; }
.mock-grid i.s { background: var(--brand); color: #fff; font-weight: 700; }
.mock-slots { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.mock-slots i { border: 1.5px solid var(--brand-100); color: var(--brand-600); font-weight: 700; padding: 7px 0; }
.mock-slots i.s { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  /* minmax(0, …): la columna no se estira con contenidos anchos (código, tablas); éstos se desplazan dentro */
  .grid-2, .grid-2.equal { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: sticky; top: 0; z-index: 40; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .btn-block { width: auto; margin-left: auto; padding: 8px 14px; }
  .sidebar .nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 4px; }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 12px; white-space: nowrap; }
  .nav-mobile-only { display: flex !important; }
  .sidebar-foot { display: none; }
  .main { padding: 22px 16px 56px; }
}
@media (max-width: 860px) {
  .public { padding-top: 16px; }
  .booker { grid-template-columns: 1fr; border-radius: 18px; }
  .booker-info { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .booker-main { padding: 22px; }
  .booker.has-slots .pick-grid { grid-template-columns: 1fr; }
  .slot-list { max-height: none; }
}
@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .booking summary { grid-template-columns: 1fr auto; }
  .booking .when { grid-column: 1 / -1; }
  .booking-body { grid-template-columns: 1fr; }
  .booking-actions { flex-direction: column; align-items: stretch; }
  .day-row { grid-template-columns: 1fr auto; }
  .day-row .ranges { grid-column: 1 / -1; grid-row: 2; }
  .range input { width: 100%; }
  .owner-bar .btn span { display: none; }
  .confirm-card, .profile, .auth-card { padding: 28px 20px; }
  .mock { grid-template-columns: 1fr; transform: none; }
  .mock-side { border-right: 0; padding-right: 0; }
  .mock-slots { flex-direction: row; }
  .mock-slots i { flex: 1; }
}

/* ---------- Fase 1: opciones avanzadas ---------- */
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-weight: 600; }
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.badges { display: inline-flex; gap: 6px; }

/* Chips de selección múltiple (duraciones, recordatorios) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; font-weight: 600; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 13.5px; color: var(--ink-2); background: #fff; transition: .15s; }
.chip:hover span { border-color: var(--brand-100); }
.chip input:checked + span { background: var(--brand-50); border-color: var(--brand); color: var(--brand-600); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }

/* Filas repetibles del editor */
[data-repeat] { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.repeat-row { display: flex; gap: 8px; align-items: center; }
.loc-row select { width: 210px; flex: none; }
.q-row { flex-direction: column; align-items: stretch; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf9; }
.q-main { display: flex; gap: 8px; }
.q-main select { width: 190px; flex: none; }
.q-foot { display: flex; justify-content: space-between; align-items: center; }
.check.small { font-size: 13.5px; }

/* Página de reserva */
.dur-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.dur-pills button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.dur-pills button:hover { border-color: var(--brand-100); }
.dur-pills button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--brand-100); }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.option input { accent-color: var(--brand); width: 17px; height: 17px; margin: 0; }
.option svg { color: var(--muted); }
.guests-field [data-guests-box] { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 640px) {
  .loc-row, .q-main { flex-wrap: wrap; }
  .loc-row select, .q-main select { width: 100%; }
  .field[style*="max-width"] { max-width: none !important; }
}

/* ---------- Fase 2: equipo ---------- */
.group-title { font-size: 15px; font-weight: 800; color: var(--ink-2); margin: 30px 0 14px; text-transform: uppercase; letter-spacing: .05em; }
.owner-bar + .group-title { margin-top: 6px; }
.group-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.group-title-row .small { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }

/* Tipo de evento */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.kind-card { position: relative; display: flex; cursor: pointer; }
.kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card > span { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; transition: .15s; }
.kind-card small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.kind-card:hover > span { border-color: var(--brand-100); }
.kind-card input:checked + span { border-color: var(--brand); background: var(--brand-50); }
.kind-card input:checked + span strong { color: var(--brand-600); }
.kind-card input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.kind-card.is-disabled { cursor: not-allowed; opacity: .55; }

/* Miembros e invitaciones */
.member-list, .link-list { list-style: none; margin: 0; padding: 0; }
.member-list li, .link-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-list li:last-child, .link-list li:last-child { border-bottom: 0; }
.member-list .grow, .link-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-list select { width: auto; padding: 6px 10px; font-size: 13.5px; }
.inline-form { margin: 0; }
.inline-create { display: flex; gap: 10px; margin-bottom: 8px; }
.inline-create input { flex: 1; min-width: 0; }
.link-list li.is-used strong { color: var(--muted); text-decoration: line-through; }
.form-layout-card { max-width: 760px; margin-top: 20px; }

/* Selector «Mis reuniones / Todo el equipo» */
.seg-inline { display: inline-flex; margin-bottom: 16px; }
.seg-inline a { padding: 7px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg-inline a.on { background: #fff; color: var(--brand-600); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Páginas públicas de equipo */
.team-avatars, .avatar-stack { display: inline-flex; }
.team-avatars .avatar, .avatar-stack .avatar { box-shadow: 0 0 0 3px #fff; }
.team-avatars .avatar + .avatar { margin-left: -12px; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.profile-subtitle { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 32px 0 -14px; text-align: left; font-weight: 700; }
.profile-event.person { flex-direction: row; align-items: center; gap: 12px; padding-left: 18px; }
.profile-event.person::before { display: none; }
.profile-event.person > span:not(.go) { display: flex; flex-direction: column; }

/* Enlace con varias personas: el cliente elige con quién */
.host-pick { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.host-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; font: inherit; color: var(--ink); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.host-opt:hover, .host-opt:focus-visible { border-color: var(--c, var(--brand)); background: var(--bg); }
.host-opt strong { flex: 1; min-width: 0; }
.host-opt .go { color: var(--muted); display: inline-flex; }
.host-opt[hidden] { display: none; }
.menu-note { display: block; padding: 8px 10px; }
.pin-badge { font-size: 11px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.member-list li.is-new { background: var(--brand-50); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; }

/* Plazas en eventos de grupo */
.slot .seats { display: block; font-size: 11.5px; font-weight: 600; opacity: .75; margin-top: 2px; }

/* Encuestas */
.poll-item { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: var(--ink); text-decoration: none !important; transition: border-color .15s; }
.poll-item:hover { border-color: var(--brand); }
.poll-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.poll-item > svg { color: var(--muted); }
.poll-table-wrap { overflow-x: auto; }
.poll-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.poll-table th, .poll-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.poll-table th:first-child, .poll-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.poll-table td:first-child { display: flex; flex-direction: column; white-space: normal; min-width: 170px; }
.poll-table th { font-weight: 700; vertical-align: bottom; }
.poll-table th span, .poll-table th strong { display: block; }
.poll-table th.chosen { background: var(--brand-50); color: var(--brand-600); }
.poll-table tfoot td { border-bottom: 0; background: #fcfbf9; }
.poll-table tfoot form { margin-top: 6px; }
.poll-table .yes { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); }
.poll-table .best strong { color: var(--brand-600); font-size: 16px; }
.poll-public { max-width: 640px; width: 100%; padding: 36px; }
.poll-public .host { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.poll-public h1 { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.poll-public .desc { color: var(--ink-2); white-space: pre-line; }
.poll-public .option .grow { flex: 1; }
.danger-text { color: var(--danger) !important; }

@media (max-width: 640px) {
  .inline-create { flex-direction: column; }
  .member-list li { flex-wrap: wrap; }
  .poll-public { padding: 26px 20px; }
}

/* ---------- Fase 3: gestión ---------- */
.nav-sep { display: block; height: 1px; background: var(--line); margin: 8px 12px; }
.badge-warn { background: #fdf0e1; color: #9a4d0b; }
.ok-text { color: #14663f !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .seg-inline { margin-bottom: 0; }
.search input { width: 280px; max-width: 100%; }

/* Pestañas de horarios */
.schedule-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.schedule-tabs > a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.schedule-tabs > a.on { border-color: var(--brand); color: var(--brand-600); background: var(--brand-50); }
.menu-form { padding: 12px; min-width: 260px; }
.menu-form form { display: flex; flex-direction: column; gap: 8px; }
.menu-form form + form { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.menu-list button.btn-primary { background: var(--brand); color: #fff; justify-content: center; font-weight: 600; }
.menu-list button.btn-primary:hover { background: var(--brand-600); }

/* Notas y «no se presentó» */
.notes-form { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.dt-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.notes-form textarea { min-height: 60px; font-size: 14px; }
.notes-actions { display: flex; justify-content: flex-end; }

/* Cifras clave */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-size: 12px; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table.compact td, .data-table.compact th { padding: 7px 10px; }
.contact-cell { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.contact-cell > span:not(.avatar) { display: flex; flex-direction: column; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history .dot { margin-top: 5px; }
.history .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.history li.is-cancelled strong { text-decoration: line-through; color: var(--muted); }
.history-notes { margin: 6px 0 0; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 13.5px; }
.profile-dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.profile-dl dt { color: var(--muted); }
.profile-dl dd { margin: 0; }

/* Gráficos: una sola serie en el color de marca, tooltip propio */
.chart-card { margin-bottom: 20px; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; z-index: 10;
}
.vbars { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 240px; }
.vb-grid { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--muted); text-align: right; padding-bottom: 22px; }
.vb-cols { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 50%; position: relative; }
.vb-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; cursor: default; }
.vb-col:hover { background: rgba(14, 124, 102, .05); }
.vb-bar { width: 60%; max-width: 36px; background: var(--brand); border-radius: 4px 4px 0 0; transition: height .3s; }
.vb-label { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.vb-col { position: relative; }
.vb-col:nth-child(even) .vb-label { visibility: hidden; }
.vb-cols:has(.vb-col:nth-child(-n+8):last-child) .vb-label { visibility: visible; }
.vbars { padding-bottom: 22px; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 36px; gap: 10px; align-items: center; font-size: 14px; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hb-track { height: 14px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.hb-bar { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.hb-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-view { margin-top: 16px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.table-view table { margin-top: 10px; max-width: 360px; }
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: 11.5px; }
.heat th { color: var(--muted); font-weight: 600; padding: 0 4px; }
.heat th[scope=row] { text-align: right; padding-right: 8px; }
.heat td { width: 30px; height: 26px; border-radius: 5px; }
.lvl-0 { background: #f1f0eb; }
.lvl-1 { background: #cfe9e1; }
.lvl-2 { background: #8fcdb9; }
.lvl-3 { background: #3f9f86; }
.lvl-4 { background: #0b6654; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.heat-legend i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* Marca */
.public-logo { max-height: 56px; max-width: 220px; object-fit: contain; margin-bottom: 20px; }
.logo-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.logo-preview img { max-height: 48px; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.color-row { display: flex; align-items: center; gap: 14px; }
.color-row input[type=color] { width: 52px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }

/* Insertar / integraciones */
.embed-option { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.embed-option textarea { margin: 6px 0 4px; }
.embed-option .btn { align-self: flex-start; }
.webhook-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.key-box { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.key-box code, .secret code { background: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.secret summary { cursor: pointer; color: var(--brand); }
.secret code { display: block; margin-top: 6px; background: var(--bg); }
.docs h3 { font-size: 15px; margin: 18px 0 6px; }
.docs { min-width: 0; }
.docs pre { background: #17202f; color: #e7f4f0; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; max-width: 100%; }
.docs table { display: block; max-width: 100%; overflow-x: auto; }
.stack > * { min-width: 0; }
.docs code { font-family: Consolas, "Courier New", monospace; }

/* Enrutamiento */
.rule-row { flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf9; }
.rule-row select, .rule-row input { width: auto; flex: 1; min-width: 120px; }
.rule-word { font-weight: 700; color: var(--muted); }
.target-fields { display: flex; gap: 8px; flex: 2; min-width: 260px; flex-wrap: wrap; }
.target-fields select, .target-fields input { flex: 1; min-width: 140px; }

@media (max-width: 1000px) { .grid-2.equal { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .hbars li { grid-template-columns: 1fr 36px; }
  .hbars .hb-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Fase 4: integraciones ---------- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.provider-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fcfbf9; }
.provider-card.is-on { background: #fff; border-color: var(--brand-100); }
.provider-card p { margin: 0; }
.provider-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.provider-options { display: flex; flex-direction: column; gap: 6px; }
.provider-card form:last-child { margin-top: auto; }

/* ---------- Varios calendarios, auditoría ---------- */
.write-target { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; background: var(--brand-50); border-radius: 12px; margin: 6px 0 16px; }
.write-target label { font-weight: 700; color: var(--brand-600); display: flex; align-items: center; gap: 6px; }
.write-target select { flex: 1; min-width: 240px; }
.account { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.calendar-checks { display: flex; flex-direction: column; gap: 4px; }
.account-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.filters .field { margin: 0; min-width: 160px; }
.nowrap { white-space: nowrap; }
.row-warn td { background: #fffaf3; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
/* Números de página (Reuniones) */
.pager-nums { display: inline-flex; align-items: center; gap: 4px; }
.pager-num { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; border: 1px solid transparent; }
a.pager-num:hover { background: #fff; border-color: var(--line); }
.pager-num.is-current { background: var(--brand); color: #fff; }
.pager-gap { color: var(--muted); padding: 0 2px; }
@media (max-width: 640px) {
  .pager { justify-content: center; }
  .pager-info { width: 100%; text-align: center; }
  .pager-word { display: none; }   /* en el móvil, sólo las flechas */
  .pager { gap: 6px; }
  .pager-nums { gap: 2px; }
  .pager-num { min-width: 30px; height: 32px; padding: 0 6px; }
  .pager-num.is-far { display: none; }   /* una página a cada lado de la actual */
  .pager .btn-sm { padding-left: 10px; padding-right: 10px; }
}
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; font-family: Consolas, monospace; color: var(--brand-600); cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); background: var(--brand-50); }
.locked-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
fieldset.locked { opacity: .65; }
section.is-locked { background: #fbfaf8; }
section.is-locked input:disabled, section.is-locked select:disabled, section.is-locked textarea:disabled { background: #f3f2ee; color: var(--muted); }
.managed-banner { display: flex; gap: 10px; align-items: flex-start; }
.managed-setup { border-color: var(--brand-100); }
.badge-managed { background: #eef2ff; color: #3b4fb5; display: inline-flex; align-items: center; gap: 4px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Encuestas: diseño visual ---------- */
/* Tarjeta de fecha tipo calendario (reutilizada en selector, votación y resultados) */
.date-card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; flex: none;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; line-height: 1.05; box-shadow: 0 1px 2px rgba(23,32,47,.05); }
.date-card .dc-wd { width: 100%; text-align: center; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 0; }
.date-card .dc-day { font-size: 21px; font-weight: 800; color: var(--ink); padding-top: 4px; }
.date-card .dc-mon { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: lowercase; padding-bottom: 5px; }

/* Selector al crear */
/* Calendario arriba y horas debajo; uno al lado del otro sólo si la propia caja tiene sitio (no según la pantalla:
   en el formulario de Encuestas la columna es estrecha aunque la pantalla sea grande, y se solapaban) */
.sp-wrap { container-type: inline-size; }
.slot-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fcfbf9; }
@container (min-width: 640px) { .slot-picker { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.sp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sp-head strong { font-size: 15px; }
.sp-week, .sp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.sp-week span { min-width: 0; overflow: hidden; }
.sp-grid button { min-width: 0; padding: 0; }
.sp-times { min-width: 0; }
.sp-week span { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; padding-bottom: 4px; }
.sp-grid button { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.sp-grid button:hover:not(:disabled) { background: var(--brand-50); color: var(--brand-600); }
.sp-grid button:disabled { background: transparent; color: #c9c7c0; cursor: default; }
.sp-grid button.today { box-shadow: inset 0 0 0 1.5px var(--brand-100); }
.sp-grid button.has::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.sp-grid button.sel { background: var(--brand); color: #fff; }
.sp-grid button.sel.has::after { background: #fff; }
.sp-day-title { margin: 2px 0 10px; font-weight: 700; font-size: 14px; color: var(--ink); }
.sp-time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding-right: 2px; }
.sp-time { border: 1.5px solid var(--brand-100); background: #fff; color: var(--brand-600); border-radius: 9px; padding: 7px 0; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: .12s; }
.sp-time:hover { border-color: var(--brand); }
.sp-time.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.sp-custom { display: flex; gap: 8px; margin-top: 10px; }
.sp-custom input { width: 120px; padding: 6px 10px; font-size: 14px; }
.sp-selected { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.sp-count { margin: 0; font-size: 13px; font-weight: 700; color: var(--brand-600); }
.sp-empty { margin: 0; font-size: 13px; color: var(--muted); padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; }
.sp-day-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-50); color: var(--brand-600); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 700; }
.sp-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--brand-600); font-size: 15px; line-height: 1; cursor: pointer; }
.sp-chip button:hover { background: var(--brand-100); }

/* Página de votación */
.pv-days { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.pv-day { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fcfbf9; }
.pv-day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pv-day-name { font-size: 15px; }
.pv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pv-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 10px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.pv-tile:hover { border-color: var(--brand-100); box-shadow: 0 2px 8px rgba(23,32,47,.06); }
.pv-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pv-tile:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-100); }
.pv-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; background: #fff; transition: .15s; }
.pv-check svg { stroke-width: 3; }
.pv-time strong { font-size: 18px; font-weight: 800; color: var(--ink); }
.pv-time small { color: var(--muted); font-weight: 600; }
.pv-votes { display: flex; align-items: center; gap: 8px; }
.pv-votes small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pv-bar { flex: 1; height: 5px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.pv-bar i { display: block; height: 100%; background: var(--brand-100); border-radius: 999px; }
.pv-tile:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.pv-tile:has(input:checked) .pv-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.pv-tile:has(input:checked) .pv-bar i { background: var(--brand); }

/* Resultados (panel) */
.poll-table th { padding: 14px 10px; vertical-align: top; }
.poll-table th .date-card { margin-bottom: 8px; }
.poll-table th .pt-time { display: block; font-weight: 800; font-size: 15px; }
.poll-table th .pt-time small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
.poll-table th .badge { margin-top: 6px; display: inline-block; }
.badge-best { background: #fff4ef; color: #b4441f; }
.poll-table th.best-col, .poll-table td.best-col { background: #f3faf7; }
.poll-table th.chosen { background: var(--brand-50); }
.poll-table .pt-corner { vertical-align: bottom; }
.poll-table td.pt-person { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.poll-table td.pt-person > span { display: flex; flex-direction: column; min-width: 0; }
.poll-table .no { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--line); }
.poll-table .yes { background: var(--brand); color: #fff; width: 28px; height: 28px; }
.poll-table .yes svg { stroke-width: 3; }
.poll-table .pt-empty { text-align: center; padding: 28px !important; }
.pt-count { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pt-count strong { font-size: 17px; }
.pt-bar { width: 56px; height: 5px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.pt-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- Buscador ---------- */
.search-box { position: relative; display: flex; align-items: center; flex: 1; max-width: 460px; min-width: 240px; }
.search-box input[type=search] { width: 100%; padding: 12px 74px 12px 44px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  font-size: 15px; box-shadow: 0 1px 2px rgba(23,32,47,.04); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.search-box input[type=search]::-webkit-search-cancel-button { display: none; }
.search-box input[type=search]:hover { border-color: #d6d3cb; }
.search-box input[type=search]:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.search-icon { position: absolute; left: 16px; color: var(--muted); display: grid; pointer-events: none; }
.search-box:focus-within .search-icon { color: var(--brand); }
.search-kbd { position: absolute; right: 14px; font: 600 12px/1 Consolas, monospace; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 3px 7px; background: var(--bg); pointer-events: none; }
.search-box:focus-within .search-kbd { display: none; }
.search-clear { position: absolute; right: 12px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; text-decoration: none !important; }
.search-clear:hover { background: var(--brand-50); color: var(--brand-600); }
/* La «×» está siempre en el mismo sitio (si se moviera al enfocar, el clic empezaría sobre ella y acabaría sobre el campo, y no llegaría a completarse).
   Cuando hay «×», ocupa el lugar de la pista «/». */
.search-box:has(.search-clear:not([hidden])) .search-kbd { display: none; }
.search-summary { margin: -6px 0 14px; }
.search-none { padding: 40px 20px; }
@media (max-width: 640px) { .search-box { max-width: none; } }

/* Pestañas de sección (Disponibilidad: Horario | Festivos) */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -10px 0 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.page-tabs a:hover { color: var(--ink); }
.page-tabs a.on { color: var(--brand-600); border-bottom-color: var(--brand); }
/* Botón «Filtros» con panel desplegable y etiquetas de filtros activos (filter_menu) */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-menu summary { cursor: pointer; }
.filter-menu summary.has-filters { border-color: var(--brand-100); color: var(--brand-600); }
.filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.filter-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 340px; max-width: calc(100vw - 32px); padding: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(23,32,47,.14);
  display: flex; flex-direction: column; gap: 12px; }
.filter-panel.to-left { left: auto; right: 0; } /* si no cabe hacia la derecha (app.js) */
.filter-panel .field { margin: 0; min-width: 0; }
.filter-panel .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-panel input[type=date] { min-width: 0; }
.filter-panel .ss-pick { min-width: 0; width: 100%; }
.filter-panel .ss-pick .ss-input, .filter-panel select, .filter-panel input[type=date] { width: 100%; }
/* Texto y fechas del panel, con la misma altura que los buscadores de departamento y persona */
.filter-panel input[type=text], .filter-panel input[type=date] { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.filter-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--brand-50);
  color: var(--brand-600); font-size: 13px; font-weight: 600; }
.filter-chip:not(:has(a)) { padding-right: 12px; }
.filter-chip a { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  color: var(--brand-600); text-decoration: none; font-size: 15px; line-height: 1; }
.filter-chip a:hover { background: var(--brand-100); text-decoration: none; }
/* Usuarios: buscador con el botón dentro, siempre juntos */
.search-combo { position: relative; display: flex; flex: 1 1 260px; min-width: 0; max-width: 520px; }
.search-combo input[type=search] { width: 100%; padding-right: 96px; }
.search-combo .btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.people-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }

/* Ajustes: una columna de ancho cómodo por pestaña */
.settings-pane { max-width: 760px; }

/* Festivos */
.year-nav { display: inline-flex; align-items: center; gap: 12px; }
.year-nav strong { font-size: 18px; min-width: 48px; text-align: center; }
.holiday-list li > div { gap: 2px; }
.holiday-list li > div .badge { align-self: flex-start; margin-top: 4px; }
.holiday-list li.is-skipped strong { text-decoration: line-through; color: var(--muted); }
.holiday-list .menu-list { right: 0; left: auto; }
.override-list .ov-label { font-weight: 600; color: var(--ink); }

/* Vacaciones del equipo */
.vac-person { padding: 18px 0 6px; border-top: 1px solid var(--line); }
.vac-person:first-of-type { border-top: 0; padding-top: 4px; }
.vac-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vac-head .vac-edit { margin-left: auto; }
.vac-list { margin-left: 42px; }
.vac-list li:last-child { border-bottom: 0; }
.vac-list li > div { gap: 2px; }
.vac-list li.is-past { opacity: .55; }
.vac-days { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.vac-none { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .vac-list { margin-left: 0; } }

/* Campo trampa contra programas automáticos: fuera de la vista y del lector de pantalla */
/* Departamentos */
.dep-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dep-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f1f0ec; color: var(--ink-2); }
.dep-tag.is-leader { background: var(--brand-50); color: var(--brand-600); }
.dep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dep-head .section-title { margin: 0; }
.dep-card .member-list { margin-top: 8px; }
.dep-card .member-list form { margin: 0; }
.dep-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.dep-add select { flex: 1; min-width: 180px; width: auto; }
.dep-rename { display: flex; gap: 6px; padding: 8px; }
.dep-rename input { min-width: 0; flex: 1; padding: 6px 10px; }
.menu-list .dep-rename button { width: auto; }
/* Filtro por departamento / persona */
.team-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.team-filter select { width: auto; max-width: 260px; padding: 8px 36px 8px 12px; font-size: 14px; }
/* Dueños de cada contacto */
.owner-cell { white-space: nowrap; }
.owner-chip { display: inline-flex; align-items: center; gap: 6px; margin: 2px 8px 2px 0; font-size: 13.5px; }
.owner-chip .avatar { font-size: 10px; }
.contact-owners { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 640px) {
  .team-filter, .team-filter label { width: 100%; }
  .team-filter select { max-width: none; width: 100%; }
}

/* Microsoft Teams */
.btn-ms { background: #fff; color: #1f1f1f; border: 1px solid #c8c6c4; font-weight: 600; gap: 10px; }
.btn-ms:hover { background: #f3f2f1; text-decoration: none; }
.ms-hint { text-align: center; margin: 6px 0 12px; }
.teams-section .section-title svg { vertical-align: -3px; }
.teams-status { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.teams-status li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.teams-status li > svg { margin-top: 3px; color: #9a4d0b; }
.teams-status li.is-ok > svg { color: #14663f; }
.teams-consent { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.teams-grid { margin-top: 12px; }
.teams-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.teams-box h3 { font-size: 15px; margin: 0 0 4px; }
.teams-box select { margin-top: 6px; }
.teams-channels { list-style: none; margin: 10px 0 0; padding: 0; }
.teams-channels li { padding: 10px 0; border-top: 1px solid var(--line); }
.teams-ch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.teams-channels .inline-create input { min-width: 0; flex: 1; }
.connect-nudge { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 0 0 18px; border-left: 4px solid #5b5fc7; }
.connect-nudge .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nudge-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #eef0fb; flex: none; }
.cal-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #9a4d0b; margin-top: 2px; }
.cal-status.is-on { color: #14663f; }
@media (max-width: 640px) { .connect-nudge { flex-wrap: wrap; } }

/* Personas a escala: buscador, filtros, ficha */
.people-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.people-head .section-title { margin: 0; }
.people-counts { margin: 0; }
.people-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.people-filters input[type=search] { flex: 1 1 220px; min-width: 0; }
.people-filters select { width: auto; max-width: 220px; }
.member-list li.is-off { opacity: .72; }
.member-list li.is-off strong a { color: var(--ink-2); }
/* Usuarios: tabla como la de Contactos (los menús «⋯» deben poder salir de la tarjeta) */
.people-top { padding-bottom: 6px; }
.people-result { margin: 0 0 6px; }
.people-wrap { border-top: 1px solid var(--line); }
.people-table .contact-cell > span { min-width: 0; }
.people-table .contact-cell strong a { color: inherit; }
.people-table .dep-tags { margin-top: 0; }
.people-table .col-menu { width: 1%; text-align: right; }
.people-table tr.is-off td { opacity: .72; }
.people-card .empty { border-top: 1px solid var(--line); }
.people-card .show-more { margin-top: 0; }
.team-settings { margin-top: 24px; }
.dep-new { display: flex; gap: 8px; margin-top: 14px; }
.dep-new input { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .people-table .col-cal { display: none; }
  .people-table th, .people-table td { padding-left: 10px; padding-right: 10px; }
}
.dep-add-pick { flex: 1; min-width: 200px; }
.filter-person { min-width: 260px; flex: 1 1 260px; }
@media (max-width: 640px) { .filter-person { min-width: 0; width: 100%; } }
.person-pick { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.person-pick:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.person-pick .pp-chips { display: contents; }
.person-pick .pp-input { flex: 1 1 140px; min-width: 120px; border: 0; padding: 6px 4px; box-shadow: none; background: transparent; }
.person-pick .pp-input:focus { outline: none; box-shadow: none; }
.pp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: 13.5px; font-weight: 600; }
.pp-x { border: 0; background: none; cursor: pointer; color: inherit; font-size: 16px; line-height: 1; padding: 0 6px; border-radius: 50%; }
.pp-x:hover { background: var(--brand-100); }
.pp-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.pp-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; }
.pp-list li small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.pp-list li.on, .pp-list li[role=option]:hover { background: var(--brand-50); }
.pp-list li.pp-none { cursor: default; color: var(--muted); font-size: 13px; }
.person-form .sub-title { font-size: 15px; margin: 18px 0 8px; }
.plan-all { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-all select { width: auto; }
.plan-to, .plan-cancel { flex: 1 1 260px; min-width: 0; }
.plan-rows summary { cursor: pointer; margin: 6px 0; }
.plan-rows td .person-pick { margin-top: 6px; }
.data-table tr.row-warn td { background: #fff8ef; }
.danger-bg { background: var(--danger); border-color: var(--danger); }
.danger-bg:hover { background: #b93838; }
.danger-bg:disabled { opacity: .5; cursor: not-allowed; }
.danger-zone { border: 1px solid #f3c4c4; }
@media (max-width: 640px) {
  .people-filters select { max-width: none; flex: 1 1 45%; }
  .plan-rows table, .plan-rows tbody, .plan-rows tr, .plan-rows td { display: block; width: 100%; }
  .plan-rows thead { display: none; }
}

/* Ventanas (dialog) */
.modal { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--card); color: var(--ink);
  box-shadow: 0 24px 64px rgba(23, 32, 47, .28); overflow: visible; }
.modal::backdrop { background: rgba(23, 32, 47, .45); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-body { padding: 20px 22px 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { font-size: 18px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
/* En una ventana, las sugerencias van debajo del campo (no flotan encima tapando lo demás) y son compactas */
.modal .person-pick { padding: 4px 6px; }
.modal .pp-list { position: static; flex: 1 0 100%; order: 3; margin: 4px -2px -2px; max-height: 172px; padding: 4px;
  border: 0; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; box-shadow: none; background: transparent; }
.modal .pp-list li { flex-direction: row; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.modal .pp-list li strong { font-size: 14px; white-space: nowrap; }
.modal .pp-list li small { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal .pp-list li.pp-none { padding: 8px; }
.modal .pp-list::-webkit-scrollbar { width: 6px; }
.modal .pp-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.role-pick { border: 0; padding: 0; margin: 14px 0 0; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.role-opt input { margin-top: 3px; }
.role-opt span { display: flex; flex-direction: column; }
.role-opt small { color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }
@media (max-width: 640px) { .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; } }

.badge-hidden { background: #f1f0ec; color: var(--muted); font-size: 11.5px; vertical-align: middle; }
/* Pie de la tarjeta de departamento: «Se ven 5 de 9 · Mostrar más» a la izquierda y «Añadir persona» a la derecha */
.dep-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.dep-more a { font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.dep-card .member-list li:last-child { border-bottom: 0; }
/* Disponibilidad en sólo lectura (trabajador) */
.ro-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ro-fieldset .icon-btn { display: none; }
.ro-fieldset input, .ro-fieldset select { background: #f7f6f2; color: var(--ink); opacity: 1; }
.show-more { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* Lista con buscador (departamentos) */
.ss-pick { position: relative; min-width: 220px; }
.ss-pick .ss-input { width: 100%; padding: 8px 32px 8px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7585' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.ss-pick .ss-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.ss-pick .ss-input::placeholder { color: var(--ink); opacity: 1; }
.ss-pick .ss-input:focus::placeholder { color: var(--muted); }
.ss-pick .ss-input.has-value::placeholder { color: var(--brand-600); font-weight: 600; }
.ss-pick .ss-input::-webkit-search-cancel-button { display: none; }
.ss-pick .pp-list li.is-current strong { color: var(--brand-600); }
.ss-pick .pp-list li { flex-direction: row; align-items: baseline; gap: 8px; }
.ss-pick .pp-list li small { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .ss-pick { width: 100%; } }

/* Buscar en mis contactos */
.contact-pick { position: relative; }
.contact-pick .pp-list { top: 100%; }
.just-filled { box-shadow: 0 0 0 3px var(--brand-100) !important; border-color: var(--brand) !important; transition: box-shadow .2s; }

/* Nueva reunión y agenda de otros */
.meeting-form { margin-bottom: 18px; }
.meeting-form .sub-title { font-size: 15px; margin: 18px 0 8px; }
.slot-days { display: grid; gap: 12px; margin: 10px 0 16px; }
.slot-day { border: 0; padding: 0; margin: 0; }
.slot-day legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip input { position: absolute; opacity: 0; pointer-events: none; }
.slot-chip span { display: inline-block; padding: 7px 12px; border: 1px solid var(--brand-100); border-radius: 10px; color: var(--brand-600); font-weight: 600; font-size: 14px; cursor: pointer; }
.slot-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.badge-internal { background: #eef0fb; color: #4b4fae; }
.agenda-of { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; }
.agenda-of-label { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.agenda-of-pick { flex: 1 1 260px; min-width: 0; }
.ov-by { display: inline-block; font-size: 11.5px; font-weight: 600; color: #4b4fae; background: #eef0fb; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.person-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

/* Estado del sistema */
.sys-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; text-align: center; }
.sys-summary strong { display: block; font-size: 28px; color: #14663f; }
.sys-summary .warn strong { color: #9a4d0b; }
.sys-summary .err strong { color: var(--danger); }
.sys-summary .off strong { color: var(--muted); }
.sys-summary span { font-size: 13px; color: var(--muted); }
.sys-title { font-size: 16px; margin: 28px 0 10px; }
.sys-list { list-style: none; margin: 0; padding: 0; }
.sys-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.sys-item:first-child { border-top: 0; }
.sys-item p { margin: 3px 0 0; overflow-wrap: anywhere; }
.sys-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; margin-top: 1px; }
.sys-ok { background: #e6f6ee; color: #14663f; }
.sys-warn { background: #fdf0e1; color: #9a4d0b; }
.sys-err { background: var(--danger-50); color: var(--danger); }
.sys-off { background: #f1f0ec; color: var(--muted); }
.sys-badge-ok { background: #e6f6ee; color: #14663f; }
.sys-badge-warn { background: #fdf0e1; color: #9a4d0b; }
.sys-badge-err { background: var(--danger-50); color: #9b2c2c; }
.sys-badge-off { background: #f1f0ec; color: var(--muted); }
.sys-test p { margin: 0 0 14px; }
@media (max-width: 640px) {
  .sys-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-item { grid-template-columns: auto minmax(0, 1fr); }
  .sys-item .badge { grid-column: 2; justify-self: start; }
}
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Contactos */
.narrow { max-width: 760px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.owner-bar .grow > .small { display: block; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.stack > form.contact-actions { justify-content: flex-start; }
.contact-form .row { gap: 12px; }
.badge-manual { background: #eef2ff; color: #3b4fb5; }
.import-help { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.import-help code { background: var(--bg); padding: 1px 6px; border-radius: 5px; }

/* Aviso de privacidad en el formulario de reserva */
.privacy-check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 16px; font-size: 14px; line-height: 1.4; }
.privacy-check input { margin-top: 3px; flex: none; }
.privacy-note { margin: 4px 0 16px; }
.privacy-form .row { margin-top: 12px; }

/* Teléfono oculto con «Mostrar» */
.masked { letter-spacing: .04em; }
.link-btn { background: none; border: 0; padding: 0 2px; color: var(--brand); cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn[disabled] { opacity: .5; cursor: default; }
label .link-btn { margin-left: 6px; font-size: 13px; }

/* Cambiar el nombre desde la ficha de una persona (superadmin) */
.rename-box summary { cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--brand); }
.rename-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.rename-form .field { flex: 1 1 260px; margin: 0; }
.rename-box .hint { margin: 8px 0 0; }

/* ---------- Tarjeta de visita digital (/usuario) ---------- */
.card-body { min-height: 100vh; padding: 24px 16px 40px; background: var(--bg); }
.card-body-bold { background: var(--brand-50); }
.card-body-dark { background: #0b1020; }
.vcard { max-width: 440px; margin: 0 auto; border-radius: 26px; overflow: hidden; text-align: center; padding-bottom: 26px;
  background: #fff; color: var(--ink); box-shadow: 0 18px 50px rgba(23, 32, 47, .14); }
.vcard-cover { height: 118px; display: flex; align-items: flex-start; justify-content: flex-end; padding: 16px 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-600)); }
.vcard-logo { max-height: 34px; max-width: 120px; object-fit: contain; background: #fff; padding: 5px 8px; border-radius: 10px; }
.vcard-photo { margin-top: -60px; }
.vcard-photo .avatar { box-shadow: 0 0 0 5px #fff; }
.vcard-name { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 14px 20px 2px; }
.vcard-sub { margin: 0 20px; color: var(--muted); font-weight: 600; }
.vcard-about { margin: 12px 28px 0; font-size: 14.5px; color: var(--ink-2); }
.vcard-actions { display: flex; justify-content: center; gap: 14px; margin: 22px 16px 0; flex-wrap: wrap; }
.vcard-act { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; font-size: 12.5px; font-weight: 600;
  color: var(--ink); text-decoration: none !important; }
.vcard-act span { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600);
  transition: transform .15s; }
.vcard-act:hover span { transform: translateY(-2px); }
.vcard-book { display: flex; margin: 22px 22px 0; background: var(--brand); color: #fff; justify-content: center; }
.vcard-book:hover { background: var(--brand-600); }
.vcard-info { list-style: none; margin: 20px 22px 0; padding: 0; text-align: left; border-radius: 16px; background: var(--bg); }
.vcard-info li + li { border-top: 1px solid var(--line); }
.vcard-info a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none !important; font-size: 14.5px; }
.vcard-info a > .i { color: var(--brand); flex: none; }
.vcard-info a span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.vcard-info small { font-size: 11.5px; color: var(--muted); }
.vcard-social { display: flex; justify-content: center; gap: 10px; margin: 20px 16px 0; }
.vcard-social a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); color: var(--ink); }
.vcard-social a:hover { color: var(--brand); }
.vcard-buttons { display: flex; gap: 10px; justify-content: center; margin: 20px 22px 0; flex-wrap: wrap; }
.vcard-buttons .btn { flex: 1 1 150px; }
.vcard-qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; color: var(--muted); }
.vcard-qr { width: 132px; height: 132px; padding: 10px; background: #fff; border-radius: 14px; border: 1px solid var(--line); box-sizing: border-box; }
.vcard-qr svg { width: 100%; height: 100%; display: block; }
.vcard-owner { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 22px 22px 0; padding-top: 16px;
  border-top: 1px dashed var(--line); color: var(--muted); }
.vcard-powered { display: flex; justify-content: center; margin-top: 18px; }

/* Diseño «Color» */
.vcard-bold { background: linear-gradient(165deg, var(--brand), var(--brand-600)); color: #fff; }
.vcard-bold .vcard-cover { background: none; height: 84px; }
.vcard-bold .vcard-photo { margin-top: -30px; }
.vcard-bold .vcard-photo .avatar { box-shadow: 0 0 0 5px rgba(255, 255, 255, .35); }
.vcard-bold .vcard-sub, .vcard-bold .vcard-about, .vcard-bold .vcard-qr-box, .vcard-bold .vcard-owner { color: rgba(255, 255, 255, .85); }
.vcard-bold .vcard-act { color: #fff; }
.vcard-bold .vcard-act span { background: rgba(255, 255, 255, .16); color: #fff; }
.vcard-bold .vcard-book { background: #fff; color: var(--brand-600); }
.vcard-bold .vcard-info, .vcard-bold .vcard-social a { background: rgba(255, 255, 255, .12); }
.vcard-bold .vcard-info a, .vcard-bold .vcard-social a, .vcard-bold .vcard-info a > .i { color: #fff; }
.vcard-bold .vcard-info small { color: rgba(255, 255, 255, .7); }
.vcard-bold .vcard-info li + li { border-color: rgba(255, 255, 255, .16); }
.vcard-bold .vcard-buttons .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.vcard-bold .vcard-owner { border-color: rgba(255, 255, 255, .3); }

/* Diseño «Oscuro» */
.vcard-dark { background: #131a2a; color: #f1f3f7; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.vcard-dark .vcard-cover { height: 96px; }
.vcard-dark .vcard-photo { margin-top: -50px; }
.vcard-dark .vcard-photo .avatar { box-shadow: 0 0 0 5px #131a2a; }
.vcard-dark .vcard-sub, .vcard-dark .vcard-qr-box, .vcard-dark .vcard-owner { color: #9aa4b6; }
.vcard-dark .vcard-about { color: #c9cfdb; }
.vcard-dark .vcard-act { color: #e6e9f0; }
.vcard-dark .vcard-act span { background: rgba(255, 255, 255, .07); color: var(--brand-100); }
.vcard-dark .vcard-info, .vcard-dark .vcard-social a { background: rgba(255, 255, 255, .05); }
.vcard-dark .vcard-info a, .vcard-dark .vcard-social a { color: #e6e9f0; }
.vcard-dark .vcard-info a > .i { color: var(--brand-100); }
.vcard-dark .vcard-info li + li { border-color: rgba(255, 255, 255, .08); }
.vcard-dark .vcard-info small { color: #8a94a7; }
.vcard-dark .vcard-buttons .btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #e6e9f0; }
.vcard-dark .vcard-qr { border-color: transparent; }
.vcard-dark .vcard-owner { border-color: rgba(255, 255, 255, .14); }
.card-body-dark .vcard-powered, .card-body-dark .vcard-powered * { color: #8a94a7; }

/* Formulario de la tarjeta (Ajustes / ficha) */
.card-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-form-head .section-title { margin: 0; }
.card-form-head + .muted { margin-top: 8px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.theme-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt > span:last-child { display: flex; flex-direction: column; }
.theme-opt small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.theme-swatch { position: relative; height: 62px; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding-top: 22px; gap: 4px; box-sizing: border-box; }
.theme-swatch i { width: 18px; height: 18px; border-radius: 50%; background: #cbd2dc; }
.theme-swatch b { height: 4px; width: 46%; border-radius: 4px; background: #cbd2dc; }
.theme-swatch b + b { width: 30%; }
.social-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.social-field { position: relative; display: block; }
.social-field .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.social-field input { padding-left: 38px; }
@media (max-width: 640px) {
  .theme-pick { grid-template-columns: 1fr; }
  .theme-opt { flex-direction: row; align-items: center; }
  .theme-swatch { width: 74px; flex: none; }
  .social-fields { grid-template-columns: 1fr; }
}

/* Imprimir la tarjeta (85 × 55 mm, delante y detrás) */
.card-print { background: #f1f2f4; padding: 24px 16px; }
.print-tools { max-width: 640px; margin: 0 auto 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.print-tools p { flex: 1 0 100%; margin: 0; }
.print-sheet { display: flex; flex-wrap: wrap; gap: 10mm; justify-content: center; }
.bc { width: 85mm; height: 55mm; box-sizing: border-box; position: relative; overflow: hidden; border-radius: 3mm; background: #fff; color: #17202f;
  outline: .2mm dashed #b8bec8; outline-offset: 1mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bc-front { padding: 6mm 6mm 5mm 9mm; display: flex; flex-direction: column; }
.bc-band { position: absolute; left: 0; top: 0; bottom: 0; width: 3mm; background: var(--brand); }
.bc-logo { position: absolute; top: 5mm; right: 5mm; max-height: 8mm; max-width: 24mm; object-fit: contain; }
.bc-main { display: flex; flex-direction: column; margin-top: 3mm; }
.bc-name { font-size: 13pt; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; max-width: 52mm; }
.bc-sub { font-size: 7.5pt; color: var(--brand-600); font-weight: 700; margin-top: 1mm; }
.bc-lines { margin-top: auto; display: flex; flex-direction: column; gap: .6mm; font-size: 7pt; }
.bc-lines span { display: flex; align-items: center; gap: 1.5mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-lines .i { color: var(--brand); flex: none; }
.bc-back { display: flex; align-items: center; gap: 5mm; padding: 6mm; background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; }
.bc-qr { width: 32mm; height: 32mm; flex: none; background: #fff; padding: 2mm; border-radius: 2mm; box-sizing: border-box; }
.bc-qr svg { width: 100%; height: 100%; display: block; }
.bc-back-text { display: flex; flex-direction: column; gap: 1.5mm; font-size: 7pt; min-width: 0; }
.bc-back-text strong { font-size: 10pt; }
.bc-logo-back { max-height: 7mm; max-width: 26mm; object-fit: contain; background: #fff; padding: 1mm 1.5mm; border-radius: 1.5mm; align-self: flex-start; }
.bc-bold.bc-front { background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; padding-left: 6mm; }
.bc-bold .bc-band { display: none; }
.bc-bold .bc-sub, .bc-bold .bc-lines .i { color: rgba(255, 255, 255, .85); }
.bc-bold .bc-logo { background: #fff; padding: 1mm 1.5mm; border-radius: 1.5mm; }
.bc-bold.bc-back { background: #fff; color: #17202f; }
.bc-dark.bc-front, .bc-dark.bc-back { background: #131a2a; color: #f1f3f7; }
.bc-dark .bc-sub, .bc-dark .bc-lines .i { color: var(--brand-100); }
.bc-dark .bc-logo { background: #fff; padding: 1mm 1.5mm; border-radius: 1.5mm; }
@media print {
  @page { size: A4; margin: 15mm; }
  .card-print { background: #fff; padding: 0; }
  .print-tools { display: none; }
  .print-sheet { justify-content: flex-start; }
}

/* ---------- Tarjeta horizontal: «Corporativo» (2/3 blanco + 1/3 color) y «Banda» ----------
   Pauta de marca corporativa: tipografía Lato (títulos Black, encabezados Bold, cuerpo Regular),
   logo sin sombras ni deformar. Esquinas rectas. Márgenes: un único margen exterior (--hc-m)
   en los cuatro lados y espacios internos en múltiplos de 8. */
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/lato-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/lato-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 900; font-display: swap; src: url('../fonts/lato-latin-900-normal.woff2') format('woff2'); }

.card-body-hz { background: #edeced; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hcard { --hc-m: 48px; --hc-ink: #010101; --hc-ink-2: #45484d; --hc-line: #e3e2e3;
  width: 100%; max-width: 920px; aspect-ratio: 85 / 55; border-radius: 0; background: #fff; color: var(--hc-ink);
  font-family: 'Lato', system-ui, sans-serif; box-shadow: 0 1px 2px rgba(1, 1, 1, .06), 0 16px 44px rgba(1, 1, 1, .10);
  box-sizing: border-box; overflow: hidden; }
.hcard *, .hcard *::before, .hcard *::after { box-sizing: border-box; }
.hcard a { color: inherit; text-decoration: none; }
.hc-name { font-family: inherit; font-weight: 900; font-size: 34px; line-height: 1.1; letter-spacing: 0; margin: 0; color: var(--hc-ink); }
.hc-role { margin: 8px 0 0; font-weight: 700; font-size: 13px; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.hc-photo { width: 120px; aspect-ratio: 1; flex: none; background: var(--brand-600); overflow: hidden; }
.hc-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; border-radius: 0; }
.hc-initials { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 46px; letter-spacing: .02em; background: rgba(255, 255, 255, .14); }
.hc-logo { display: block; width: 180px; height: auto; flex: none; } /* 180 px: tamaño mínimo digital del manual */
.hc-logo-text { font-weight: 900; font-size: 20px; color: var(--brand); }

/* Datos de contacto */
.hc-data { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14.5px; line-height: 1.35; }
.hc-data li { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.hc-data li > a:last-child { padding-top: 3px; } /* primera línea centrada con el icono; las siguientes debajo */
.hc-data li > a:last-child { overflow-wrap: anywhere; color: var(--hc-ink-2); }
.hc-data li > a:last-child:hover { color: var(--brand); }
.hc-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; color: var(--brand); border: 1px solid var(--hc-line); }
.hcard a.hc-ic-wa { color: #fff; background: #25d366; border-color: #25d366; }
.hcard a.hc-ic-wa:hover { background: #1ebe5a; }

/* Reservar: icono en círculo + texto subrayado, con aire de tarjeta impresa (no de botón web) */
.hc-book { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hc-book-ic { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand); display: grid; place-items: center; transition: background .15s, color .15s; }
.hc-book-txt { font-weight: 700; font-size: 15px; line-height: 1.2; padding-bottom: 5px; border-bottom: 1.5px solid var(--hc-ink); transition: color .15s, border-color .15s; }
.hc-book:hover .hc-book-ic { background: var(--brand); color: #fff; }
.hc-book:hover .hc-book-txt { color: var(--brand); border-color: var(--brand); }
.hc-book:focus-visible, .hc-data a:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }

/* «Corporativo»: una rejilla 2 × 2 para que todo cuadre:
   logo arriba a la altura de la foto, y la reserva abajo a la altura de los datos.
   [logo · nombre · cargo] [foto ]
   [reserva              ] [datos]   ← la columna derecha (1/3) en el color de la empresa */
.hcard-split { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto 1fr; }
.hcard-split .hc-cell { min-width: 0; }
.hcard-split .hc-id { grid-area: 1 / 1; padding: var(--hc-m) var(--hc-m) 0; }
.hcard-split .hc-id .hc-logo, .hcard-split .hc-id .hc-logo-text { margin-bottom: 32px; }
.hcard-split .hc-photo-cell { grid-area: 1 / 2; background: var(--brand); padding: var(--hc-m) var(--hc-m) 0 36px; }
.hcard-split .hc-photo { width: 100%; aspect-ratio: 6 / 5; outline: 1px solid rgba(255, 255, 255, .35); outline-offset: -1px; }
.hcard-split .hc-book-cell { grid-area: 2 / 1; align-self: end; padding: 32px var(--hc-m) var(--hc-m); }
.hcard-split .hc-data-cell { grid-area: 2 / 2; background: var(--brand); display: flex; align-items: flex-end; padding: 32px var(--hc-m) var(--hc-m) 36px; }
.hcard-split .hc-data { gap: 10px; font-size: 13.5px; }
.hcard-split .hc-data li { gap: 10px; }
.hcard-split .hc-data li > a:last-child { color: #fff; }
.hcard-split .hc-data li > a:last-child:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.hcard-split .hc-ic { width: 24px; height: 24px; color: #fff; border-color: rgba(255, 255, 255, .45); }
.hcard-split .hc-data a:focus-visible { outline-color: #fff; }

/* «Banda»: franja lateral, cabecera con foto, nombre y logo; datos en dos columnas; reserva en banda */
.hcard-band { display: flex; flex-direction: column; border-left: 8px solid var(--brand); }
.hcard-band .hc-top { display: flex; align-items: center; gap: 32px; margin: 0 var(--hc-m); padding: var(--hc-m) 0 40px; border-bottom: 1px solid var(--hc-line); }
.hcard-band .hc-photo { width: 152px; }
.hcard-band .hc-id { flex: 1; min-width: 0; }
.hcard-band .hc-name { font-size: 36px; }
.hcard-band .hc-role { margin-top: 10px; font-size: 14px; }
.hcard-band .hc-logo, .hcard-band .hc-logo-text { align-self: flex-start; }
.hcard-band .hc-data { grid-template-columns: 1fr 1fr; column-gap: 32px; row-gap: 20px; padding: 32px var(--hc-m); flex: 1; align-content: center; font-size: 16px; }
.hcard-band .hc-ic { width: 30px; height: 30px; }
.hcard .hc-book-band { flex-direction: row; align-items: center; gap: 16px; background: var(--brand); color: #fff; padding: 22px var(--hc-m); width: 100%; }
.hc-book-band .hc-book-ic { width: 40px; height: 40px; border-radius: 0; border-color: rgba(255, 255, 255, .8); color: #fff; }
.hc-book-band .hc-book-txt { border: 0; padding: 0; font-size: 16px; letter-spacing: .02em; flex: 1; }
.hc-book-band > .i { transition: transform .15s; }
.hcard .hc-book-band:hover { background: var(--brand-600); }
.hc-book-band:hover .hc-book-ic { background: #fff; color: var(--brand); }
.hc-book-band:hover .hc-book-txt { color: #fff; }
.hc-book-band:hover > .i { transform: translateX(4px); }
.hc-book-band:focus-visible { outline-offset: -6px; outline-color: #fff; }

.hc-tools { width: 100%; max-width: 920px; }
.hc-tools .vcard-buttons { margin: 24px 0 0; }
.hc-tools .vcard-buttons .btn { border-radius: 0; background: #fff; }
.hc-tools .vcard-owner { margin: 16px 0 0; }

/* Pantallas medianas: márgenes algo menores y la tarjeta crece en alto si hace falta */
@media (max-width: 900px) {
  .hcard { --hc-m: 40px; aspect-ratio: auto; }
  .hc-name { font-size: 30px; }
  .hcard-band .hc-name { font-size: 30px; }
  .hcard-band .hc-photo { width: 128px; }
}
/* Móvil: mismo orden de lectura del boceto, en columna.
   [logo · nombre · cargo | foto] → [reserva] → [datos en el color de la empresa] */
@media (max-width: 600px) {
  .card-body-hz { justify-content: flex-start; padding-top: 16px; }
  .hcard { --hc-m: 24px; }
  .hc-name { font-size: 24px; }
  .hc-logo { width: 150px; }
  .hcard-split { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; }
  .hcard-split .hc-id { grid-area: 1 / 1; padding: var(--hc-m) 16px 0 var(--hc-m); }
  .hcard-split .hc-id .hc-logo, .hcard-split .hc-id .hc-logo-text { margin-bottom: 20px; }
  .hcard-split .hc-photo-cell { grid-area: 1 / 2; background: none; padding: var(--hc-m) var(--hc-m) 0 0; }
  .hcard-split .hc-photo { width: 96px; outline: 0; }
  .hcard-split .hc-book-cell { grid-area: 2 / 1 / 3 / 3; padding: 24px var(--hc-m); }
  .hcard-split .hc-data-cell { grid-area: 3 / 1 / 4 / 3; padding: 24px var(--hc-m); }
  .hcard-band { border-left-width: 6px; }
  .hcard-band .hc-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: var(--hc-m) 0 20px; }
  .hcard-band .hc-logo, .hcard-band .hc-logo-text { grid-column: 1 / -1; grid-row: 1; }
  .hcard-band .hc-photo { width: 84px; }
  .hcard-band .hc-name { font-size: 22px; }
  .hcard-band .hc-role { font-size: 12.5px; }
  .hcard-band .hc-top { gap: 16px; }
  .hcard-band .hc-data { grid-template-columns: 1fr; padding: 24px var(--hc-m); }
  .hcard .hc-book-band { padding: 16px var(--hc-m); }
}

/* «Ejecutivo»: la tarjeta impresa (85 × 55 mm) a tamaño de pantalla, con la foto.
   Franja de color a la izquierda (3 mm de 85 en papel), nombre y cargo arriba a la izquierda, logo arriba a la derecha,
   datos abajo a la izquierda y la foto abajo a la derecha, alineada con la última línea. */
.hcard-print { --hc-m: 56px; --hc-band: 28px; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr;
  column-gap: 40px; padding: var(--hc-m) var(--hc-m) var(--hc-m) calc(var(--hc-m) + var(--hc-band)); }
.hcard-print::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--hc-band); background: var(--brand); }
.hcard-print .hc-id { grid-area: 1 / 1; min-width: 0; }
.hcard-print .hc-name { font-size: 54px; line-height: 1.05; }
.hcard-print .hc-role { margin-top: 14px; font-size: 16px; }
.hcard-print .hc-id::after { content: ''; display: block; width: 56px; height: 4px; margin-top: 24px; background: var(--brand); } /* rayita de acento, como en la tarjeta impresa */
.hcard-print .hc-logo { width: 200px; }
.hcard-print .hc-logo, .hcard-print .hc-logo-text { grid-area: 1 / 2; justify-self: end; align-self: start; }
.hcard-print .hc-foot { grid-area: 2 / 1; align-self: end; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; min-width: 0; }
.hcard-print .hc-photo { grid-area: 2 / 2; align-self: end; justify-self: end; width: 232px; aspect-ratio: 4 / 5; margin-top: 32px; }
.hcard-print .hc-data { gap: 14px; font-size: 18px; line-height: 1.4; }
.hcard-print .hc-data li { gap: 14px; }
.hcard-print .hc-data li > a:last-child { padding-top: 1px; color: var(--hc-ink); }
.hcard-print .hc-ic { width: 26px; height: 26px; border: 0; }
.hcard-print .hc-ic .i { width: 20px; height: 20px; }
.hcard-print a.hc-ic-wa { width: 26px; height: 26px; }
/* Reservar: una línea más, en el color de la empresa, como un enlace impreso */
.hcard .hc-book-line { flex-direction: row; align-items: center; gap: 12px; color: var(--brand); }
.hc-book-line .hc-book-ic { width: 26px; height: 26px; border: 0; border-radius: 0; }
.hc-book-line .hc-book-ic .i { width: 24px; height: 24px; }
.hc-book-line .hc-book-txt { font-size: 18px; color: var(--brand); border-bottom-color: var(--brand); padding-bottom: 3px; }
.hc-book-line > .i { transition: transform .15s; }
.hc-book-line:hover .hc-book-ic { background: none; color: var(--brand-600); }
.hc-book-line:hover .hc-book-txt { color: var(--brand-600); border-color: var(--brand-600); }
.hc-book-line:hover > .i { transform: translateX(4px); }
@media (max-width: 900px) {
  .hcard-print { --hc-m: 40px; --hc-band: 20px; }
  .hcard-print .hc-name { font-size: 42px; }
  .hcard-print .hc-data, .hc-book-line .hc-book-txt { font-size: 16px; }
  .hcard-print .hc-photo { width: 190px; }
}
@media (max-width: 600px) {
  .hcard-print { --hc-m: 24px; --hc-band: 12px; grid-template-rows: auto auto auto; column-gap: 16px; }
  .hcard-print .hc-logo, .hcard-print .hc-logo-text { grid-area: 1 / 1 / 2 / 3; justify-self: start; margin-bottom: 24px; }
  .hcard-print .hc-id { grid-area: 2 / 1; align-self: center; }
  .hcard-print .hc-name { font-size: 28px; }
  .hcard-print .hc-role { font-size: 13px; margin-top: 10px; }
  .hcard-print .hc-id::after { margin-top: 16px; width: 40px; height: 3px; }
  .hcard-print .hc-logo { width: 160px; }
  .hcard-print .hc-photo { grid-area: 2 / 2; align-self: start; width: 96px; margin-top: 0; }
  .hcard-print .hc-data, .hc-book-line .hc-book-txt { font-size: 16px; }
  .hcard-print .hc-foot { grid-area: 3 / 1 / 4 / 3; margin-top: 28px; }
}
.theme-swatch-print { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: 0; align-items: flex-start; padding: 12px 0 0 8px; }
.theme-swatch-print i { position: absolute; right: 8px; bottom: 8px; width: 16px; height: 16px; border-radius: 0; }
.theme-swatch-print b { width: 40%; }

/* Miniaturas del selector de diseño */
.theme-swatch-split { background: linear-gradient(90deg, #fff 0 64%, var(--brand) 64%); border: 1px solid var(--line); border-radius: 0; align-items: flex-start; padding: 18px 0 0 8px; }
.theme-swatch-band { background: linear-gradient(#fff 0 70%, var(--brand) 70%); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 0; align-items: flex-start; padding: 12px 0 0 8px; }
.theme-swatch-split i, .theme-swatch-band i { border-radius: 0; width: 14px; height: 14px; }
.theme-swatch-split i { display: none; }
.theme-swatch-split b, .theme-swatch-band b { width: 40%; }

/* Franja del entorno de pruebas (config → env = 'staging') */
.env-banner { position: sticky; top: 0; z-index: 1000; background: #f59e0b; color: #1f1300; text-align: center; font-size: 13px; font-weight: 700; padding: 5px 12px; letter-spacing: .02em; }

/* Vista previa de imágenes antes de guardar (foto de perfil, logo) */
.preview-slot { display: inline-flex; flex-shrink: 0; }
.preview-slot.is-preview img { outline: 2px dashed var(--brand); outline-offset: 3px; }
.preview-note { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--brand-50); color: var(--ink); }
.logo-empty { display: inline-flex; align-items: center; justify-content: center; height: 48px; min-width: 96px; padding: 0 12px;
  border: 1px dashed var(--line); border-radius: 8px; background: #fff; }

/* Cuenta recién creada: contraseña provisional (se muestra una sola vez) */
.new-user-card { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); margin-bottom: 20px; }
.temp-pass { font-size: 18px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; background: var(--brand-50); border-radius: 8px; margin-right: 8px; user-select: all; }
