/* ============================================================
   Apartamentos RD — Reuniones
   Estilo: minimalista + glassmorphism (vidrio esmerilado / blur)
   Marca: azul corporativo + silueta de la isla
   ============================================================ */

:root {
  /* Marca */
  --brand: #1f52a6;         /* azul del logo */
  --brand-strong: #17407f;
  --brand-2: #3b74e8;       /* azul más vivo para acentos */
  --brand-ink: #ffffff;
  --brand-soft: #e8effc;

  /* Superficies (glass) — tarjetas blancas sobre fondo azul */
  --bg: #1f52a6;
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-bg-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-line: rgba(31, 82, 166, 0.14);
  --glass-shadow: 0 14px 44px rgba(10, 33, 74, 0.28);
  --glass-shadow-sm: 0 6px 22px rgba(10, 33, 74, 0.18);

  /* Texto */
  --text: #12233d;
  --text-soft: #4a5a72;
  --text-faint: #8a97ab;

  /* Estados */
  --green: #12855a;   --green-soft: rgba(18,133,90,.12);
  --amber: #b06a12;   --amber-soft: rgba(176,106,18,.14);
  --red:   #cc3a44;   --red-soft:   rgba(204,58,68,.12);
  --slate: #5a6b84;   --slate-soft: rgba(90,107,132,.12);

  /* Espaciado */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --radius: 18px;
  --radius-sm: 12px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 700px at 10% -10%, #3b74e8 0%, rgba(59,116,232,0) 55%),
    radial-gradient(900px 600px at 100% 0%, #4f86ea 0%, rgba(79,134,234,0) 50%),
    linear-gradient(170deg, #2559b0 0%, #1f52a6 45%, #17407f 100%);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }

/* ---------- Blobs decorativos con blur ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-decor span {
  position: absolute; border-radius: 50%; filter: blur(130px); opacity: .55;
}
.bg-decor .b1 { width: 520px; height: 520px; background: #6f9df2; top: -160px; left: -120px; opacity: .5; }
.bg-decor .b2 { width: 560px; height: 560px; background: #ffffff; bottom: -200px; right: -140px; opacity: .22; }
.bg-decor .b3 { width: 420px; height: 420px; background: #8fd0ff; top: 38%; left: 52%; opacity: .3; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand-strong));
  color: #fff; box-shadow: 0 6px 16px rgba(31,82,166,.35);
  flex: none;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark.has-img { background: #fff; padding: 5px; box-shadow: 0 6px 16px rgba(31,82,166,.22); }
.brand-img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 1.02rem; color: var(--text); white-space: nowrap; }
.brand-tag { font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 46px; padding: 0 var(--sp-5);
  border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; line-height: 1;
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid rgba(59,116,232,.4); outline-offset: 2px; }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 var(--sp-4); font-size: .875rem; }

.btn-primary, .btn-accent {
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff; box-shadow: 0 8px 20px rgba(31,82,166,.30);
}
.btn-primary:hover, .btn-accent:hover { box-shadow: 0 10px 26px rgba(31,82,166,.42); }

.btn-ghost {
  background: var(--glass-bg-strong); color: var(--text);
  border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: var(--glass-shadow-sm);
}
.btn-ghost:hover { background: #fff; }

.btn-success { background: linear-gradient(140deg,#15a06b,var(--green)); color: #fff; box-shadow: 0 8px 20px rgba(18,133,90,.28); }
.btn-success:hover { box-shadow: 0 10px 26px rgba(18,133,90,.4); }

.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: none; color: var(--text-soft);
}
.icon-btn:hover { background: rgba(31,82,166,.08); color: var(--text); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
}
.auth-card {
  width: 100%; max-width: 410px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  padding: var(--sp-6);
}
.auth-card .brand { margin-bottom: var(--sp-5); }
.auth-title { margin: 0 0 var(--sp-1); font-size: 1.5rem; letter-spacing: -0.02em; }
.auth-sub { margin: 0 0 var(--sp-5); color: var(--text-soft); font-size: .95rem; }
.auth-divider {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--text-faint); font-size: .8rem; margin: var(--sp-4) 0;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--glass-line);
}
.auth-hint {
  margin-top: var(--sp-5); text-align: center;
  font-size: .8rem; color: var(--text-faint);
}

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field label { font-size: .85rem; font-weight: 600; color: var(--text); }
.field .opt { color: var(--text-faint); font-weight: 400; }
.field-help { margin: 0; font-size: .78rem; color: var(--text-faint); }
.field input, .field textarea, .field select {
  width: 100%; height: 46px; padding: 0 var(--sp-4);
  border: 1px solid rgba(31,82,166,.18); border-radius: 12px;
  background: rgba(255,255,255,.7); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { height: auto; padding: var(--sp-3) var(--sp-4); resize: vertical; line-height: 1.5; }
.field input[type="date"] {
  -webkit-appearance: none; appearance: none;
  text-align: left; min-width: 0; max-width: 100%; display: block;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-2); background: #fff;
  box-shadow: 0 0 0 4px rgba(59,116,232,.15);
}
.input-affix { position: relative; }
.input-affix input { padding-right: 46px; }
.affix-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--text-faint); border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center;
}
.affix-btn:hover { color: var(--brand); background: rgba(31,82,166,.08); }
.form-error {
  margin: 0; padding: var(--sp-3) var(--sp-3);
  background: var(--red-soft); color: var(--red);
  border-radius: 10px; font-size: .85rem; font-weight: 500;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.75);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.topbar-inner {
  max-width: 980px; margin: 0 auto; padding: var(--sp-3) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-right { display: flex; align-items: center; gap: var(--sp-3); }
.user-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: .85rem; color: var(--text-soft);
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem;
}
.badge-role {
  font-size: .66rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; padding: 3px 8px; border-radius: 999px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff;
}

/* ---------- Main ---------- */
.main { max-width: 980px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-7); }

.glass, .panel, .card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow-sm);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

.panel { padding: var(--sp-5); margin-bottom: var(--sp-6); }
.panel-head { margin-bottom: var(--sp-4); }
.panel-title { margin: 0; font-size: 1.2rem; letter-spacing: -0.01em; }
.panel-sub { margin: 3px 0 0; color: var(--text-soft); font-size: .875rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.field-col-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }

/* ---------- Tabs ---------- */
.toolbar { margin-bottom: var(--sp-4); }
.tabs {
  display: inline-flex; gap: 3px; padding: 5px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 14px; box-shadow: var(--glass-shadow-sm);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tab {
  border: none; background: transparent; color: var(--text-soft);
  padding: 9px 18px; border-radius: 10px; font-weight: 600; font-size: .875rem;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { color: var(--brand); }
.tab.is-active {
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff; box-shadow: 0 6px 16px rgba(31,82,166,.3);
}

/* ---------- Lista ---------- */
.list { display: flex; flex-direction: column; gap: var(--sp-4); }
.card { padding: var(--sp-5); transition: transform .15s ease, box-shadow .18s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); }
.card-title { margin: 0 0 var(--sp-1); font-size: 1.12rem; letter-spacing: -0.01em; }
.card-meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); color: var(--text-soft); font-size: .875rem; margin-top: var(--sp-2); }
.card-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.card-meta svg { color: var(--brand); }
.card-desc { margin: var(--sp-3) 0 0; color: var(--text-soft); font-size: .92rem; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--glass-line);
  flex-wrap: wrap;
}
.card-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Chips de estado ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  white-space: nowrap; border: 1px solid transparent;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.is-green { background: var(--green-soft); color: var(--green); border-color: rgba(18,133,90,.2); }
.status.is-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(176,106,18,.22); }
.status.is-red   { background: var(--red-soft);   color: var(--red);   border-color: rgba(204,58,68,.2); }
.status.is-slate { background: var(--slate-soft); color: var(--slate); border-color: rgba(90,107,132,.2); }
.status.is-accent{ background: var(--brand-soft); color: var(--brand); border-color: rgba(31,82,166,.2); }

.rsvp-count { font-size: .8rem; color: var(--text-soft); display: inline-flex; align-items: center; gap: 6px; }
.rsvp-count svg { color: var(--brand); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: var(--sp-7) var(--sp-5); color: rgba(255,255,255,.85); }
.empty-icon {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto var(--sp-4);
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--brand); box-shadow: var(--glass-shadow-sm);
}
.empty h3 { margin: 0 0 var(--sp-2); color: #fff; font-size: 1.05rem; }
.empty p { margin: 0; font-size: .9rem; color: rgba(255,255,255,.8); }

/* ---------- Footer ---------- */
.footer { max-width: 980px; margin: 0 auto; padding: var(--sp-5); text-align: center; }
.footer p { margin: 0; font-size: .78rem; color: rgba(255,255,255,.7); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(18,35,61,.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal-card {
  position: relative; width: 100%; max-width: 520px; max-height: 85dvh; overflow: auto;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  animation: pop .2s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--glass-line);
  position: sticky; top: 0; z-index: 10; background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
}
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: var(--sp-5); }
.attendee-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--glass-line); gap: var(--sp-3);
}
.attendee-row:last-child { border-bottom: none; }
.attendee-name { display: flex; align-items: center; gap: var(--sp-3); font-size: .92rem; }

/* ---------- Contador ---------- */
.reg-count { display: inline-block; padding: 6px 16px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }

/* ---------- Asistencia (lista + toggle) ---------- */
.asist-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.asist-export { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-dest { width: 100%; padding: 10px 12px; border: 1px solid rgba(31,82,166,.2); border-radius: 10px; font: inherit; font-size: .9rem; resize: vertical; background: #fff; }
.rep-dest:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59,116,232,.15); }
.asist-search { width: 100%; height: 42px; padding: 0 14px; border: 1px solid rgba(31,82,166,.18); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.asist-search:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59,116,232,.15); }
.asist-row { padding: 11px 12px; border-radius: 14px; background: rgba(31,82,166,.05); }
.asist-row + .asist-row { margin-top: 7px; }
.asist-row.is-on { background: var(--green-soft); }
.asist-row.is-excusa { background: var(--amber-soft); }
.asist-row.is-excusa .asist-idx { background: var(--amber); color: #fff; }
.asist-main { display: flex; align-items: center; gap: 12px; }
.asist-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.btn-xs { height: 32px; padding: 0 10px; font-size: .78rem; border-radius: 9px; }
.asist-exc { display: inline-flex; align-items: flex-start; gap: 4px; font-size: .78rem; color: var(--amber); font-weight: 600; line-height: 1.3; }
.asist-exc svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.asist-editor { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(31,82,166,.22); display: flex; flex-direction: column; gap: 8px; }
.asist-editor textarea { width: 100%; padding: 10px 12px; border: 1px solid rgba(31,82,166,.2); border-radius: 10px; font: inherit; font-size: .92rem; resize: vertical; background: #fff; }
.asist-editor textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59,116,232,.15); }
.asist-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.asist-idx { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: #fff; color: var(--text-soft); font-size: .78rem; font-weight: 700; flex: none; box-shadow: var(--glass-shadow-sm); }
.asist-row.is-on .asist-idx { background: var(--green); color: #fff; }
.asist-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.asist-name { font-size: .96rem; font-weight: 600; color: var(--text); line-height: 1.25; }
.asist-sub { font-size: .76rem; color: var(--text-faint); }
.asist-hora { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--green); font-weight: 700; }
.asist-hora svg { width: 13px; height: 13px; }

.roster-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(31,82,166,.05); }
.roster-row + .roster-row { margin-top: 7px; }
.roster-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.roster-email { width: 100%; height: 34px; padding: 0 10px; border: 1px solid rgba(31,82,166,.16); border-radius: 8px; background: #fff; font: inherit; font-size: .85rem; color: var(--text); }
.roster-email:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59,116,232,.15); }
.roster-email.is-bad { border-color: var(--red); }

/* Switch iOS-style */
.switch { border: none; background: none; padding: 6px; flex: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.switch-track { display: block; width: 52px; height: 30px; border-radius: 999px; background: #cdd5e0; position: relative; transition: background .2s ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: left .2s ease; }
.switch.is-on .switch-track { background: var(--green); }
.switch.is-on .switch-thumb { left: 25px; }
.switch:focus-visible .switch-track { outline: 3px solid rgba(59,116,232,.4); outline-offset: 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: rgba(18,35,61,.9); color: #fff; padding: 13px 20px; border-radius: 12px;
  font-size: .9rem; font-weight: 500; box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  z-index: 200; max-width: 90vw;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Calendario ---------- */
#new-meeting-btn {
  margin-bottom: var(--sp-6);
  background: var(--glass-bg-strong); color: var(--brand);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow-sm);
}
#new-meeting-btn:hover { background: #fff; box-shadow: var(--glass-shadow); }
.calendar { padding: var(--sp-4); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.cal-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-weekdays span { text-align: center; font-size: .7rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; border: none; background: transparent;
  border-radius: 12px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font: inherit; color: var(--text); cursor: pointer;
  transition: background .15s ease, transform .06s ease;
}
.cal-cell.is-empty { visibility: hidden; cursor: default; }
.cal-cell:hover:not(.is-empty):not(.is-selected) { background: rgba(31,82,166,.08); }
.cal-cell:active { transform: scale(.94); }
.cal-num { font-size: .95rem; font-weight: 600; line-height: 1; }
.cal-cell.is-today { box-shadow: inset 0 0 0 1.6px rgba(31,82,166,.45); }
.cal-cell.is-today .cal-num { color: var(--brand); font-weight: 800; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); }
.cal-cell.is-selected { background: linear-gradient(140deg, var(--brand-2), var(--brand)); box-shadow: 0 6px 16px rgba(31,82,166,.32); }
.cal-cell.is-selected .cal-num { color: #fff; }
.cal-cell.is-selected .cal-dot { background: #fff; }

/* ---------- Encabezado de lista ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.list-title { margin: 0; font-size: 1.1rem; letter-spacing: -0.01em; color: #fff; }

/* ---------- Selector de hora ---------- */
.time-row { display: flex; align-items: center; gap: var(--sp-2); }
.time-row select { flex: 1; min-width: 0; text-align: center; }
.time-row #m-ampm { flex: 0 0 76px; }
.time-sep { font-weight: 700; color: var(--text-faint); }

/* ---------- Form acciones ---------- */
.form-actions-row { display: flex; gap: var(--sp-3); }
.form-actions-row .btn { flex: 1; }

/* ---------- Avatares / modal ---------- */
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .72rem; }
.modal-sub { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .card-top { flex-direction: column; }
  .main { padding: var(--sp-5) var(--sp-4) var(--sp-6); }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1; text-align: center; padding: 9px 4px; }
  .brand-tag { display: none; }
  .user-chip span:not(.avatar) { display: none; }
  .topbar-inner { padding: var(--sp-3) var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Sucursales, invitados y diseño adaptable (PC · tablet · teléfono)
   ============================================================ */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body.modal-open { overflow: hidden; }
.topbar { padding-top: env(safe-area-inset-top); }
.topbar-inner, .main { max-width: 1200px; }
.btn-icon { gap: 6px; }
.btn-icon svg { flex: none; }
.user-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout: una columna en móvil; dos columnas en PC */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
.col-side, .col-main { min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: var(--sp-4); }
.col-side .panel { margin-bottom: 0; }
#new-meeting-btn { margin-bottom: 0; }

/* Tarjetas: chips de sucursal / reporte */
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.suc-chip, .rep-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; }
.suc-chip { background: var(--brand-soft); color: var(--brand); }
.suc-chip.is-muted { background: var(--slate-soft); color: var(--slate); }
.rep-chip { background: var(--green-soft); color: var(--green); }
.rep-chip svg { width: 12px; height: 12px; }

/* Modal: más ancho para listas; hoja inferior en teléfonos */
.modal-card.is-wide { max-width: 720px; }
.modal-body { overscroll-behavior: contain; }
.asist-title { margin: 0 0 2px; font-weight: 700; font-size: 1.02rem; }
.asist-when { margin: 0 0 14px; color: var(--text-soft); font-size: .88rem; }

/* Asistencia: grupos, invitados y otras sucursales */
.asist-group { margin: 16px 2px 8px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.asist-suc { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .66rem; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.asist-idx svg { width: 13px; height: 13px; }
.asist-vacio { margin: 8px 2px; color: var(--text-soft); font-size: .88rem; }
.asist-otras { margin-top: 16px; border: 1px dashed rgba(31,82,166,.28); border-radius: 14px; padding: 4px 10px 10px; background: rgba(255,255,255,.5); }
.asist-otras > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 2px; font-weight: 700; color: var(--brand); font-size: .92rem; }
.asist-otras > summary::-webkit-details-marker { display: none; }
.asist-otras > summary svg { transition: transform .15s ease; }
.asist-otras[open] > summary svg { transform: rotate(45deg); }
.asist-otras-list .asist-row { background: #fff; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(31,82,166,.2); background: #fff; color: var(--text-soft); font-weight: 600; font-size: .82rem; }
.chip span { font-size: .72rem; font-weight: 700; color: var(--text-faint); }
.chip.is-active { background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }
.chip.is-active span { color: rgba(255,255,255,.85); }

/* Personas */
.rt-suc { margin: 0 0 10px; color: var(--text-soft); }
.rt-form { margin-bottom: 10px; }
.rt-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rt-form-grid input, .dir-row input, .form-2col select { height: 44px; padding: 0 12px; border: 1px solid rgba(31,82,166,.2); border-radius: 10px; background: #fff; font: inherit; font-size: .92rem; color: var(--text); min-width: 0; width: 100%; }
.rt-form-grid input:focus, .dir-row input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59,116,232,.15); }
.rt-bulk { margin-bottom: 12px; }
.rt-bulk > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.rt-bulk textarea { width: 100%; margin: 8px 0; padding: 10px; border: 1px solid rgba(31,82,166,.18); border-radius: 10px; font: inherit; }
.rt-director { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); }
.rt-director label { display: block; font-size: .8rem; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.rt-help { margin: 0 0 8px; color: var(--text-soft); font-size: .85rem; }
.roster-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.suc-select { height: 32px; max-width: 150px; padding: 0 8px; border: 1px solid rgba(31,82,166,.2); border-radius: 8px; background: #fff; font: inherit; font-size: .78rem; color: var(--text); }
.dir-list { display: grid; gap: 8px; }
.dir-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: .82rem; font-weight: 700; color: var(--text-soft); }
.form-2col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }

/* ---------- Tablet (640px o más) ---------- */
@media (min-width: 640px) {
  .rt-form-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; }
  .rt-dir-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .form-2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-2col-full { grid-column: 1 / -1; }
  .dir-row { grid-template-columns: 170px minmax(0, 1fr); align-items: center; }
}
/* ---------- Tablet horizontal / PC (900px o más): tarjetas en rejilla ---------- */
@media (min-width: 900px) {
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
}
/* ---------- PC (1100px o más): calendario fijo a la izquierda ---------- */
@media (min-width: 1100px) {
  .layout { grid-template-columns: 380px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
  .col-side { position: sticky; top: 88px; max-height: calc(100dvh - 104px); overflow: auto; scrollbar-width: thin; padding-bottom: 4px; }
  .list { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
}
/* ---------- Pantallas grandes (1600px o más) ---------- */
@media (min-width: 1600px) {
  .topbar-inner, .main { max-width: 1440px; }
  .layout { grid-template-columns: 420px minmax(0, 1fr); }
}
/* ---------- Teléfono (menos de 640px) ---------- */
@media (max-width: 639px) {
  .btn-label { display: none; }
  .btn-icon { width: 40px; padding: 0; }
  .topbar-right { gap: 6px; }
  .user-chip .user-name { display: none; }
  .brand-name { font-size: .95rem; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card, .modal-card.is-wide { max-width: 100%; width: 100%; max-height: 94dvh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .asist-actions .btn-xs { padding: 0 8px; }
  .asist-export { width: 100%; }
  .asist-export .btn { flex: 1; }
  .roster-row { flex-wrap: wrap; }
  .roster-actions { width: 100%; justify-content: flex-end; }
}
/* ---------- Pantallas táctiles: objetivos más grandes ---------- */
@media (pointer: coarse) {
  .btn-sm { height: 42px; }
  .btn-xs { height: 38px; }
  .chip { height: 38px; }
}
/* ---------- Teléfono horizontal (poca altura) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-card, .modal-card.is-wide { max-height: 100dvh; border-radius: 0; }
  .col-side { position: static; max-height: none; }
}

/* Interruptor guardando: no acepta toques repetidos */
.switch.is-pending { opacity: .6; pointer-events: none; }
.switch.is-pending .switch-thumb { box-shadow: 0 0 0 3px rgba(59,116,232,.25), 0 1px 3px rgba(0,0,0,.28); }

/* Reunión culminada: ausentes en rojo */
.asist-row.is-ausente { background: var(--red-soft); }
.asist-row.is-ausente .asist-idx { background: var(--red); color: #fff; }
.asist-aus { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--red); }
.asist-counts { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aus-count { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-weight: 700; font-size: .9rem; }
.cul-chip { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 700; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; background: var(--slate-soft); color: var(--slate); }
