@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #121212;
  --surface: #1c1c1e;
  --surface-alt: #26262a;
  --surface-raised: #2e2e33;
  --border: #36363c;
  --text: #f2f1ee;
  --text-muted: #9a9890;
  --accent: #ff6a2b;
  --accent-dim: #3d2418;
  --accent-ink: #ffffff;
  --success: #3fbf7f;
  --danger: #ef5350;
  --warning: #f2b233;
  --info: #4ea4ff;
  --radius: 14px;
  --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}


/* ---------- Tema de dia (Mi perfil → Apariencia). "auto" sigue al sistema ---------- */
html[data-theme="light"] {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-alt: #f1eeea;
  --surface-raised: #ffffff;
  --border: #e4e0da;
  --text: #1f1d1a;
  --text-muted: #6d6860;
  --accent: #f05a1a;
  --accent-dim: #ffe8dc;
  --accent-ink: #ffffff;
  --success: #1f8f55;
  --danger: #d33a2c;
  --warning: #b7791f;
  --info: #1f6fd1;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --bg: #f7f5f2;
    --surface: #ffffff;
    --surface-alt: #f1eeea;
    --surface-raised: #ffffff;
    --border: #e4e0da;
    --text: #1f1d1a;
    --text-muted: #6d6860;
    --accent: #f05a1a;
    --accent-dim: #ffe8dc;
    --accent-ink: #ffffff;
    --success: #1f8f55;
    --danger: #d33a2c;
    --warning: #b7791f;
    --info: #1f6fd1;
    color-scheme: light;
  }
}
html[data-theme="dark"], html:not([data-theme]) { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  min-height: 100vh;
}

a { color: inherit; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
}

::selection { background: var(--accent-dim); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Layout raiz ---------- */
#app { display: flex; width: 100%; min-height: 100vh; }

.gate-mark {
  width: 34px; height: 34px; border-radius: 8px;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 800; font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand strong { font-size: 1.05rem; letter-spacing: -0.01em; }
.sidebar-brand span { display: block; font-size: 0.72rem; color: var(--text-muted); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---------- Contenido principal ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  flex-shrink: 0;
}

.topbar h1 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.topbar .who { font-size: 0.82rem; color: var(--text-muted); }

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  padding-bottom: 90px; /* espacio para tab bar movil */
}

/* ---------- Bottom tab bar (movil) ---------- */
.tabbar { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  #app { flex-direction: column; }
  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    justify-content: flex-start;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 20;
    /* si no caben todas las opciones, la barra se desliza hacia los lados */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar .nav-item {
    flex: 1 0 68px;
    max-width: 96px;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.66rem;
    line-height: 1.15;
    padding: 6px 4px;
    width: auto;
    text-align: center;
    scroll-snap-align: start;
    position: relative;
  }
  .tabbar .nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar .nav-item .i { width: 22px; height: 22px; }
  .tabbar .nav-item .nav-badge { position: absolute; top: 2px; right: 10px; }
  /* indicador de que hay mas opciones a los lados */
  .tabbar.more-right { box-shadow: inset -18px 0 14px -14px rgba(0,0,0,.25); }
  .tabbar.more-left { box-shadow: inset 18px 0 14px -14px rgba(0,0,0,.25); }
  .tabbar.more-left.more-right { box-shadow: inset -18px 0 14px -14px rgba(0,0,0,.25), inset 18px 0 14px -14px rgba(0,0,0,.25); }
}

/* ---------- Componentes ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }

.stat {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 14px;
}
.stat .value { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; }
.stat .label { font-size: 0.78rem; color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { background: var(--surface-raised); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(225, 82, 82, 0.12); }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
}

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
thead th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 10px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--surface-alt); }
.mono { font-family: var(--font-mono); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-success { background: rgba(79, 174, 124, 0.15); color: var(--success); }
.badge-danger { background: rgba(225, 82, 82, 0.15); color: var(--danger); }
.badge-muted { background: var(--surface-alt); color: var(--text-muted); }

.door-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.door-card .name { font-weight: 700; font-size: 1rem; }
.door-card .location { font-size: 0.8rem; color: var(--text-muted); }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%; max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}

.toast {
  position: fixed; top: 18px; right: 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  z-index: 100;
  max-width: 320px;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 0.9rem;
}

.login-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.login-box .gate-mark { margin-bottom: 18px; }
.login-box h1 { font-size: 1.3rem; margin: 0 0 4px 0; }
.login-box p { color: var(--text-muted); font-size: 0.86rem; margin: 0 0 24px 0; }

.qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.qr-preview img { border-radius: 8px; background: #fff; padding: 10px; }
.qr-preview .expires { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

.tag-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.field-help {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.field input[type="checkbox"] { width: auto; margin: 0; }

textarea { font-family: var(--font-mono); font-size: 0.82rem; resize: vertical; }

a.btn { text-decoration: none; }

.tag-row .btn { white-space: nowrap; }

/* ---------- Rostros: captura de foto ---------- */
.photo-capture { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pc-preview {
  width: 96px; height: 128px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-alt); border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
}
.pc-preview img { width: 100%; height: 100%; object-fit: cover; }
.pc-placeholder { font-size: 2.6rem; color: var(--text-muted); }
.pc-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 1; min-width: 160px; }
.pc-upload { cursor: pointer; }

.camera-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.88);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.camera-box { width: 100%; max-width: 420px; }
.camera-frame { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: #000; }
.camera-frame video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame video.mirror { transform: scaleX(-1); }
.camera-guide {
  position: absolute; left: 50%; top: 44%; width: 58%; height: 62%; transform: translate(-50%, -50%);
  border: 3px dashed rgba(255, 106, 43, 0.9); border-radius: 50%; pointer-events: none;
}

/* ---------- Rostros: tarjetas ---------- */
.person-card { display: flex; gap: 12px; align-items: flex-start; }
.person-card .avatar {
  width: 64px; height: 84px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-alt); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.6rem;
}
.person-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-card .info { flex: 1; min-width: 0; }
.person-card .name { font-weight: 700; }
.sync-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.quota-bar { height: 8px; background: var(--surface-alt); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.quota-bar > div { height: 100%; background: var(--accent); }
.mono-copy { font-family: var(--font-mono); font-size: 0.78rem; word-break: break-all; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Menu del usuario (barra superior) y boton de actualizar la app */
.user-menu { position: relative; }
.topbar button.who {
  background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  padding: 6px 10px; font: inherit; font-size: 0.82rem; color: var(--text-muted);
}
.topbar button.who:hover, .topbar button.who[aria-expanded="true"] { border-color: var(--border); color: var(--text); }
.user-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 250px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); padding: 6px; display: flex; flex-direction: column;
}
.user-menu-list[hidden] { display: none; }
.user-menu-list button {
  background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 8px;
  color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer;
}
.user-menu-list button:hover { background: var(--surface-alt); }
.user-menu-list button:disabled { opacity: 0.6; cursor: wait; }
.link-btn {
  background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 0.82rem;
  margin-top: 16px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }

/* ---------- Finanzas ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 640px; }
.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.fin-range { display: flex; gap: 10px; flex-wrap: wrap; }
.fin-range .field { min-width: 140px; flex: 1; }
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; margin-bottom: 18px; }
.fin-kpis.small { margin-bottom: 0; }
.fin-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--border); }
.fin-kpis.small .fin-kpi { background: var(--bg); }
.fin-kpi .label { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.fin-kpi .value { font-size: 1.3rem; font-weight: 600; margin-top: 4px; }
.fin-kpi.good { border-top-color: var(--success); }
.fin-kpi.bad { border-top-color: var(--danger); }
.fin-kpi.accent { border-top-color: var(--accent); }
.fin-kpi.warn .value { color: var(--danger); }
.fin-bars { display: flex; flex-direction: column; gap: 12px; }
.fin-bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; margin-bottom: 4px; }
.fin-bar-track { position: relative; height: 8px; border-radius: 6px; background: var(--surface-alt); }
.fin-bar-fill { height: 100%; border-radius: 6px; min-width: 2px; }
.fin-bar-budget { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); opacity: 0.6; }
.fin-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; overflow-x: auto; padding-bottom: 4px; }
.fin-chart-col { flex: 1; min-width: 34px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.fin-chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fin-chart-bar { width: 40%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 1px; }
.fin-chart-bar.in, .fin-legend i.in { background: var(--success); }
.fin-chart-bar.out, .fin-legend i.out { background: var(--danger); }
.fin-chart-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; white-space: nowrap; }
.fin-legend { display: flex; gap: 14px; font-size: 0.76rem; color: var(--text-muted); margin-top: 8px; }
.fin-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fin-balance { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.fin-alert { border-left: 3px solid var(--danger); }
.fin-ok { border-left: 3px solid var(--success); }
.fin-charge { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fin-charge:last-child { border-bottom: 0; }
.fin-charge .grow { flex: 1; min-width: 0; }
.fin-charge input[type=checkbox] { width: 18px; height: 18px; }
.cat-child td:first-child { padding-left: 28px; }
.tabs-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.tabs-scroll .btn { white-space: nowrap; }
.panel-title { flex-wrap: wrap; gap: 8px; }
.badge { white-space: nowrap; }
.wa-btn { background: #25d366; border-color: #25d366; color: #fff; }
.wa-btn:hover { background: #1ebe5b; }

/* ---------- Tutores (escuelas) ---------- */
.notice-text { white-space: pre-wrap; max-height: 320px; overflow-y: auto; padding: 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.86rem; line-height: 1.5; }
.consent-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.consent-item input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.consent-item input:disabled + span { opacity: 0.5; }
.sign-pad { width: 100%; height: auto; aspect-ratio: 3 / 1; background: #fff; border-radius: 8px; border: 1px solid var(--border); touch-action: none; cursor: crosshair; }
.kid-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kid-times .label { font-size: 0.76rem; color: var(--text-muted); }
.kid-times .value { font-size: 1.5rem; font-weight: 600; }
.var-chip { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-alt); margin: 2px; cursor: pointer; }

/* ---------- Campana de notificaciones ---------- */
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.notif-wrap { position: relative; }
.notif-btn {
  position: relative; background: none; border: 1px solid transparent; border-radius: 8px;
  font-size: 1.15rem; padding: 4px 9px; cursor: pointer; color: var(--text-muted); line-height: 1.3;
}
.notif-btn:hover, .notif-btn[aria-expanded="true"] { border-color: var(--border); color: var(--text); }
.notif-count {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-ui);
}
.notif-count[hidden] { display: none; }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 61; width: min(360px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; max-height: 70vh;
}
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-head button, .notif-settings-btn {
  background: none; border: 0; color: var(--accent); font: inherit; font-size: 0.8rem; cursor: pointer;
}
.notif-settings-btn { padding: 10px 12px; border-top: 1px solid var(--border); text-align: left; color: var(--text-muted); }
.notif-items { overflow-y: auto; flex: 1; }
.notif-empty { padding: 22px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.notif-item {
  display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--border); padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer;
}
.notif-item:hover { background: var(--surface-alt); }
.notif-item.unread { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.notif-item.unread strong::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.notif-ic { font-size: 1.2rem; line-height: 1.2; }
.notif-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.86rem; }
.notif-txt span { color: var(--text-muted); }
.notif-txt small { color: var(--text-muted); font-size: 0.72rem; }
.notif-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 200;
  width: min(440px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-raised); border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); cursor: pointer;
  animation: notif-in 0.25s ease-out;
}
.notif-banner.kind-visitor_in { border-color: var(--success); }
.notif-banner div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.notif-banner div span { color: var(--text-muted); font-size: 0.86rem; }
.notif-banner button { background: none; border: 0; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }
@keyframes notif-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.check-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; cursor: pointer; }
.check-row input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.btn[hidden] { display: none; }
@media (max-width: 760px) {
  .notif-panel { position: fixed; top: 58px; left: 12px; right: 12px; width: auto; max-height: 75vh; }
  .topbar .who { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Aviso para instalar la app ---------- */
.install-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 190;
  width: min(460px, calc(100vw - 24px)); display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface-raised); border: 1px solid var(--accent); border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); animation: notif-in 0.25s ease-out;
}
.install-banner img { border-radius: 10px; flex-shrink: 0; }
.install-text { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.install-text span { color: var(--text-muted); }
.install-actions { display: flex; gap: 8px; margin-top: 8px; }
@media (min-width: 861px) { .install-banner { bottom: 24px; } }

/* ---------- Mi perfil ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; align-items: start; }
.profile-grid .panel { margin-bottom: 0; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.profile-rows { display: flex; flex-direction: column; }
.profile-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.profile-row span { color: var(--text-muted); }
.profile-row strong { text-align: right; font-weight: 600; word-break: break-word; }
.segmented { display: flex; gap: 4px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.seg-btn { flex: 1; white-space: nowrap; background: none; border: 0; border-radius: 8px; padding: 10px 8px; cursor: pointer; color: var(--text-muted); font: inherit; font-size: 0.9rem; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); font-weight: 600; }
.session-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }

/* ---------- Mensajes (chat con la administracion) ---------- */
.chat-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: calc(100vh - 170px); min-height: 420px; margin-bottom: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-msg { max-width: min(78%, 560px); align-self: flex-start; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.chat-msg.mine { align-self: flex-end; background: var(--accent-dim); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.chat-text { white-space: pre-wrap; word-break: break-word; font-size: 0.95rem; line-height: 1.4; }
.chat-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; text-align: right; }
.chat-who { font-size: 0.72rem; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.chat-sys { align-self: center; font-size: 0.78rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; font-family: var(--font-ui); font-size: 0.95rem; padding: 11px 12px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.chat-compose textarea:focus { outline: none; border-color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); opacity: 0.5; flex-shrink: 0; }
.dot.on { background: var(--success); opacity: 1; }
.chat-inbox { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.chat-list-panel { height: calc(100vh - 170px); min-height: 420px; display: flex; flex-direction: column; margin-bottom: 0; }
.chat-threads { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.chat-thread { display: flex; gap: 10px; align-items: center; text-align: left; background: none; border: 1px solid transparent; border-radius: 10px; padding: 10px; color: var(--text); font: inherit; cursor: pointer; }
.chat-thread:hover { background: var(--surface-alt); }
.chat-thread.active { background: var(--accent-dim); }
.chat-thread .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-thread small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { display: none; margin: 10px 12px 0; align-self: flex-start; }
@media (max-width: 860px) {
  .chat-inbox { grid-template-columns: 1fr; }
  .chat-inbox.has-selected .chat-list-panel { display: none; }
  .chat-inbox:not(.has-selected) #chat-conv { display: none; }
  .chat-back { display: inline-flex; }
  .chat-panel, .chat-list-panel { height: calc(100vh - 210px); }
}
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 9px; font-size: 0.68rem; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge[hidden] { display: none; }

/* ---------- Llamada de voz ---------- */
.call-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(8, 10, 16, 0.72); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.call-card { width: min(380px, 100%); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 20px; padding: 30px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.call-avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.call-avatar.ringing { animation: call-pulse 1.2s ease-in-out infinite; }
@keyframes call-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 174, 124, 0.55); } 50% { box-shadow: 0 0 0 18px rgba(79, 174, 124, 0); } }
.call-name { font-size: 1.25rem; }
.call-sub { color: var(--text-muted); font-size: 0.9rem; }
.call-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.call-btn { border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; }
.call-btn.call-accept { background: var(--success); border-color: var(--success); color: #fff; }
.call-btn.call-hang { background: var(--danger); border-color: var(--danger); color: #fff; }
.call-btn[aria-pressed="true"] { background: var(--accent-dim); }

/* ---------------- Caseta de vigilancia ---------------- */
:root { --warning: #e0a030; }
.badge-warning { background: rgba(224, 160, 48, 0.18); color: var(--warning); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(1.1); }
.btn-lg { padding: 14px 20px; font-size: 1.02rem; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 140px; flex: 1 1 140px; }
.filters .check-row { margin: 0 0 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.simple-list li:last-child { border-bottom: 0; }
.simple-list li .btn { margin-left: auto; }
.caseta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.arrivals { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.arrival-card { border: 2px solid var(--warning); border-radius: 14px; padding: 16px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 8px; animation: arrival-in .35s ease-out; }
.arrival-card header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.arrival-name { margin: 2px 0 0; font-size: 1.5rem; line-height: 1.2; overflow-wrap: anywhere; }
.arrival-dest { font-size: 1.02rem; }
.arrival-car { font-size: 1.08rem; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arrival-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 4px; }
.arrival-actions .btn { justify-content: center; }
@keyframes arrival-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.plate { display: inline-block; font-family: var(--font-mono); font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border: 2px solid var(--text); border-radius: 6px; background: var(--surface); color: var(--text); font-size: .92em; }
.visit-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: 6px 12px; margin: 4px 0; }
.visit-data div { background: var(--surface); border-radius: 8px; padding: 6px 10px; }
.visit-data div.hl { outline: 2px solid var(--accent); }
.visit-data dt { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.visit-data dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.visit-fields { border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; }
.visit-fields legend { padding: 0 6px; font-weight: 700; font-size: .85rem; }
.doc-preview { min-height: 120px; border: 1px dashed var(--border); border-radius: var(--radius); display: grid; place-items: center; background: var(--surface-alt); color: var(--text-muted); margin-bottom: 8px; overflow: hidden; }
.doc-preview img { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.field .doc-capture .tag-row label.btn, .doc-capture .tag-row label.btn { display: inline-flex; margin: 0; font-size: 0.78rem; color: var(--text); cursor: pointer; }
.doc-capture .tag-row label.btn-primary { color: #1b1508; }
.package-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.package-card:last-child { border-bottom: 0; }
.package-card.delivered { opacity: .72; }
.package-ico { font-size: 1.6rem; line-height: 1; }
.package-card .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.package-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@media (max-width: 520px) {
  .package-card { flex-wrap: wrap; }
  .package-actions { flex-direction: row; flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .arrival-actions { grid-template-columns: 1fr; }
}
.mp-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-alt); display: grid; gap: 10px; }
.mp-box .tag-row { flex-wrap: wrap; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { flex: 1; font-family: var(--font-mono); font-size: .78rem; }
@media (max-width: 640px) {
  .table-wrap:has(.caseta-table) { overflow: visible; }
  .caseta-table { min-width: 0 !important; width: 100%; }
  .caseta-table thead { display: none; }
  .caseta-table, .caseta-table tbody, .caseta-table tr, .caseta-table td { display: block; }
  .caseta-table tr { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
  .caseta-table td { border: 0 !important; padding: 4px 0 4px 92px !important; position: relative; overflow-wrap: anywhere; }
  .caseta-table td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 6px; width: 84px; color: var(--text-muted); font-size: .75rem; font-weight: 600; }
  .caseta-table td.actions { padding-left: 0 !important; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
}

/* ---------------- Membresias ---------------- */
.gym-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.gym-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.gym-bar i { display: block; width: 100%; min-height: 1px; background: var(--accent); border-radius: 4px 4px 0 0; }
.gym-bar:hover i { filter: brightness(1.15); }
.gym-bars-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-muted); margin: 4px 0 8px; }
.gym-heat { display: grid; gap: 2px; font-size: .68rem; color: var(--text-muted); overflow-x: auto; }
.gym-heat-h { text-align: center; }
.gym-heat-d { align-self: center; }
.gym-heat-c { height: 18px; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--surface-alt)); }
.gym-hbar { margin-bottom: 10px; }
.gym-hbar-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.gym-hbar-track { height: 10px; background: var(--surface-alt); border-radius: 5px; overflow: hidden; }
.gym-hbar-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.rc-search { display: flex; gap: 8px; margin-bottom: 10px; }
.rc-search input { flex: 1; font-size: 1.05rem; padding: 12px 14px; }
.rc-list { display: grid; gap: 6px; }
.rc-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.rc-row:hover { background: var(--surface-alt); }
.rc-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-row small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-no { font-family: var(--font-mono); color: var(--text-muted); min-width: 40px; }
.rc-state { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .78rem; color: var(--text-muted); text-align: right; }
.rc-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 2px solid var(--border); margin-bottom: 12px; }
.rc-card.rc-active { border-color: var(--success); }
.rc-card.rc-expired, .rc-card.rc-exhausted { border-color: var(--danger); }
.rc-card .grow { flex: 1; min-width: 0; }
.rc-photo { width: 84px; height: 112px; border-radius: 10px; background: var(--surface-alt); display: grid; place-items: center; color: var(--text-muted); font-size: .72rem; overflow: hidden; flex-shrink: 0; }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-big { font-size: 1.02rem; margin-bottom: 4px; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rc-plans { display: grid; gap: 6px; margin-bottom: 12px; }
.rc-plan { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.rc-plan:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.rc-plan input { width: auto; }
.rc-plan span { flex: 1; display: flex; flex-direction: column; }
.rc-plan small { color: var(--text-muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: .86rem; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #1b1508; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cls-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); width: 100%; }
.cls-row:last-child { border-bottom: 0; }
.cls-row.cancelled { opacity: .55; }
.cls-row .grow { flex: 1; min-width: 0; }
.cls-btn { background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.cls-btn:hover { background: var(--surface-alt); }
.cls-time { font-family: var(--font-mono); font-weight: 700; min-width: 58px; display: flex; flex-direction: column; }
.cls-time small, .cls-occ small { font-weight: 400; color: var(--text-muted); font-size: .72rem; }
.cls-occ { display: flex; flex-direction: column; align-items: flex-end; }
.mb-hero { border-radius: 14px; padding: 18px; margin: 8px 0; background: var(--surface-alt); border: 2px solid var(--border); }
.mb-hero.ok { border-color: var(--success); }
.mb-hero.bad { border-color: var(--danger); }
.mb-state { font-size: 1.5rem; font-weight: 800; }
.mb-hero.ok .mb-state { color: var(--success); }
.mb-hero.bad .mb-state { color: var(--danger); }
.mb-until { font-size: 1.1rem; margin-top: 4px; }
.mb-sub { color: var(--text-muted); margin-top: 4px; }
.mb-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 10px; margin-bottom: 8px; }
.mb-plan { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.mb-price { font-size: 1.35rem; font-weight: 700; }
.mb-plan small { color: var(--text-muted); }
/* ---------------- Punto de venta ---------------- */
.pos-wrap { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .pos-wrap { grid-template-columns: minmax(0, 1fr); } }
.pos-wrap > * { min-width: 0; }
.pos-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.pos-top > span:empty { display: none; }
.pos-top input { flex: 1 1 180px; min-width: 0; font-size: 1rem; padding: 11px 12px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 8px; }
.pos-item { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px; min-height: 86px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); color: var(--text); cursor: pointer; font: inherit; }
.pos-item:hover { border-color: var(--accent); }
.pos-item.out { opacity: .45; cursor: not-allowed; }
.pos-item small { color: var(--text-muted); font-size: .72rem; }
.pos-cart { position: sticky; top: 12px; }
.pos-line { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pos-line .grow { flex: 1; min-width: 0; }
.pos-total { display: flex; justify-content: space-between; font-size: 1.3rem; margin: 12px 0; }
.pos-ticket { font-family: var(--font-mono); font-size: .85rem; background: #fff; color: #111; padding: 14px; border-radius: 6px; }
.pos-ticket hr { border: 0; border-top: 1px dashed #999; }
.pos-tline { display: flex; justify-content: space-between; gap: 8px; }
.pos-change-big { font-size: 1.6rem; font-weight: 800; text-align: center; margin-top: 12px; color: var(--success); }

/* ---------------- Iconos SVG ---------------- */
.i { width: 1.15em; height: 1.15em; vertical-align: -0.22em; flex-shrink: 0; stroke-width: 1.8; }
.nav-item .i { width: 20px; height: 20px; }
.btn .i { width: 1.1em; height: 1.1em; }
.notif-btn .i { width: 22px; height: 22px; vertical-align: middle; }
.status-icon .i { width: 56px; height: 56px; }
.call-avatar .i { width: 40px; height: 40px; }
.period { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.period .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.door-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.door-head > .i { width: 28px; height: 28px; color: var(--accent); }
/* ---------------- Marca, soporte, seguridad ---------------- */
.powered { display: flex; align-items: center; gap: 8px; padding: 12px 8px 0; margin-top: 8px; border-top: 1px solid var(--border); font-size: .74rem; color: var(--text-muted); line-height: 1.2; }
.powered img { width: 34px; height: 28px; object-fit: contain; }
.powered small { font-size: .7rem; }
.brand-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.brand-preview img { height: 64px; max-width: 120px; object-fit: contain; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.sec-role { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.sec-role h4 { margin: 0 0 6px; }
.sec-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sec-item:last-child { border-bottom: 0; }
.sec-item input { width: auto; }
.sec-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sec-item small { color: var(--text-muted); font-size: .72rem; }
.sec-item .i { color: var(--text-muted); }
.support-card { text-align: center; max-width: 520px; margin: 0 auto; padding: 28px 20px; }
.support-ic .i { width: 54px; height: 54px; color: var(--accent); }
.support-card h2 { margin: 8px 0; }
.support-card p { color: var(--text-muted); }
.support-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; font-size: .78rem; color: var(--text-muted); }
.support-brand img { height: 34px; }
.bc-preview .notif-banner { position: static; transform: none; margin-top: 12px; max-width: 420px; animation: none; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; font-size: .78rem; color: var(--text-muted); }
.login-brand img { height: 40px; max-width: 90px; object-fit: contain; }
/* ---------------- Guia animada de instalacion en iPhone ---------------- */
.ios-guide-backdrop { position: fixed; inset: 0; background: rgba(8,10,14,.55); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 861px) { .ios-guide-backdrop { align-items: center; } }
.ios-guide { background: var(--surface); color: var(--text); width: min(420px, 100%); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: ios-up .3s ease-out; }
@media (min-width: 861px) { .ios-guide { border-radius: 18px; } }
@keyframes ios-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ios-title { display: block; font-size: 1.05rem; text-align: center; margin-bottom: 12px; }
.ios-stage { display: flex; justify-content: center; margin-bottom: 12px; }
.ios-phone { width: 168px; height: 300px; border-radius: 28px; background: #111; padding: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ios-screen { position: relative; width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: #f2f2f7; color: #111; font-size: 9px; }
.ios-safari { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ios-url { margin: 14px 10px 6px; background: #e3e3e8; border-radius: 7px; padding: 4px 6px; text-align: center; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-page { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 7px; }
.ios-page span { height: 9px; border-radius: 4px; background: #d9d9e0; }
.ios-page span.short { width: 60%; }
.ios-toolbar { height: 30px; background: #f9f9fb; border-top: 1px solid #ddd; display: flex; align-items: center; justify-content: space-around; }
.ios-toolbar i { width: 11px; height: 11px; border-radius: 3px; background: #c7c7cc; }
.ios-share { color: #0a84ff; display: grid; place-items: center; animation: ios-share 9s infinite; }
.ios-share .i { width: 16px; height: 16px; }
.ios-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 12px 12px 0 0; padding: 8px; box-shadow: 0 -4px 14px rgba(0,0,0,.15); transform: translateY(105%); animation: ios-sheet 9s infinite; }
.ios-sheet-head { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid #eee; margin-bottom: 4px; font-weight: 700; }
.ios-sheet-head img { width: 18px; height: 18px; border-radius: 4px; }
.ios-row { padding: 6px 4px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.ios-row .i { width: 12px; height: 12px; }
.ios-add { animation: ios-add 9s infinite; border-radius: 6px; }
.ios-home { position: absolute; inset: 0; background: linear-gradient(160deg, #6a5acd, #2a9df4); opacity: 0; animation: ios-home 9s infinite; padding: 22px 12px; }
.ios-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
.ios-grid span { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.35); justify-self: center; }
.ios-grid .ios-app { background: none; width: auto; height: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; animation: ios-app 9s infinite; }
.ios-app img { width: 26px; height: 26px; border-radius: 7px; }
.ios-app small { font-size: 7px; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ios-tap { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(10,132,255,.9); background: rgba(10,132,255,.25); opacity: 0; animation: ios-tap 9s infinite; pointer-events: none; }
.ios-steps { margin: 0 0 8px; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 6px; }
.ios-steps li { counter-increment: s; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); opacity: .55; font-size: .9rem; }
.ios-steps li::before { content: counter(s); flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--border); font-weight: 700; font-size: .78rem; }
.ios-steps li .i { width: 18px; height: 18px; color: #0a84ff; }
.ios-steps .s1 { animation: ios-step1 9s infinite; }
.ios-steps .s2 { animation: ios-step2 9s infinite; }
.ios-steps .s3 { animation: ios-step3 9s infinite; }
@keyframes ios-share { 0%, 8% { transform: scale(1); } 14% { transform: scale(1.35); } 20%, 100% { transform: scale(1); } }
@keyframes ios-sheet { 0%, 26% { transform: translateY(105%); } 34%, 62% { transform: translateY(0); } 68%, 100% { transform: translateY(105%); } }
@keyframes ios-add { 0%, 46% { background: transparent; } 50%, 62% { background: rgba(10,132,255,.18); } 66%, 100% { background: transparent; } }
@keyframes ios-home { 0%, 64% { opacity: 0; } 70%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ios-app { 0%, 70% { transform: scale(0); } 78% { transform: scale(1.2); } 84%, 100% { transform: scale(1); } }
@keyframes ios-tap {
  0%, 9% { opacity: 0; left: 64px; bottom: 6px; transform: scale(.6); }
  12% { opacity: 1; transform: scale(1); } 18% { opacity: 0; left: 64px; bottom: 6px; transform: scale(1.4); }
  44% { opacity: 0; left: 100px; bottom: 20px; transform: scale(.6); }
  50% { opacity: 1; left: 100px; bottom: 20px; transform: scale(1); } 57% { opacity: 0; left: 100px; bottom: 20px; transform: scale(1.4); }
  100% { opacity: 0; }
}
@keyframes ios-step1 { 0%, 30% { opacity: 1; background: var(--accent-dim); } 34%, 100% { opacity: .55; background: var(--surface-alt); } }
@keyframes ios-step2 { 0%, 30% { opacity: .55; background: var(--surface-alt); } 34%, 64% { opacity: 1; background: var(--accent-dim); } 68%, 100% { opacity: .55; background: var(--surface-alt); } }
@keyframes ios-step3 { 0%, 64% { opacity: .55; background: var(--surface-alt); } 68%, 100% { opacity: 1; background: var(--accent-dim); } }
@media (prefers-reduced-motion: reduce) {
  .ios-share, .ios-sheet, .ios-add, .ios-home, .ios-app, .ios-tap, .ios-steps li { animation: none !important; }
  .ios-sheet { transform: translateY(0); }
  .ios-steps li { opacity: 1; }
}
/* ---------------- Celular: nada se sale de la pantalla ---------------- */
@media (max-width: 860px) {
  /* tablas anchas: se desplazan dentro de su panel en vez de empujar la pagina */
  .panel table:not(.caseta-table), .modal table:not(.caseta-table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel, .modal { min-width: 0; }
  .field input, .field select, .field textarea { max-width: 100%; min-width: 0; }
  .tag-row { flex-wrap: wrap; }
  .panel-title { flex-wrap: wrap; gap: 8px; }
  .content { padding: 16px 12px 96px; }
  .modal { max-width: calc(100vw - 20px); }
}
.bc-preview .notif-banner { max-width: 100%; box-sizing: border-box; }
.grid > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
img { max-width: 100%; }
.rc-search { flex-wrap: wrap; }
.rc-search input { min-width: 0; flex: 1 1 200px; }
