/* ===================================================================
   The Castle — hoja de estilos con lenguaje de diseño iOS.
   Tipografía y colores del sistema, listas agrupadas, hojas que suben
   desde abajo, tab bar, alertas centradas y resortes de animación.
   =================================================================== */

:root {
  /* --- Colores del sistema (modo claro) --- */
  --ios-fondo: #F2F2F7;
  --ios-card: #FFFFFF;
  --ios-relleno: rgba(120,120,128,.08);
  --ios-relleno-fuerte: rgba(120,120,128,.14);
  --ios-separador: rgba(60,60,67,.29);
  --ios-separador-opaco: #C6C6C8;
  --ios-label: #000000;
  --ios-label2: rgba(60,60,67,.6);
  --ios-label3: rgba(60,60,67,.3);

  --ios-azul: #007AFF;
  --ios-verde: #34C759;
  --ios-rojo: #FF3B30;
  --ios-naranja: #FF9500;
  --ios-violeta: #5E5CE6;
  --ios-gris: #8E8E93;

  /* --- Nombres que usan las pantallas (no renombrar) --- */
  --fondo: var(--ios-fondo);
  --card: var(--ios-card);
  --texto: var(--ios-label);
  --gris: var(--ios-label2);
  --borde: var(--ios-separador-opaco);
  --suave: #F2F2F7;
  --ink: #1C1C2E;
  --primario: var(--ios-violeta);
  --primario-suave: rgba(94,92,230,.12);
  --libre: var(--ios-verde);
  --tuyo: var(--ios-azul);
  --ocupado: var(--ios-rojo);
  --reunion: #AF52DE;
  --rojo: var(--ios-rojo);
  --verde: #248A3D;
  --naranja: #C93400;
  --azul: var(--ios-azul);

  --radio: 12px;
  --radio-chico: 10px;
  --sombra: 0 0 0 .5px rgba(0,0,0,.04);
  --sombra-media: 0 4px 16px rgba(0,0,0,.08);
  --sombra-alta: 0 12px 40px rgba(0,0,0,.18);
  --alto-nav: 52px;
  --alto-tab: 54px;
  --arriba: env(safe-area-inset-top, 0px);
  --abajo: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--fondo); color: var(--ios-label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 17px; line-height: 1.35; letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  padding-bottom: calc(var(--alto-tab) + var(--abajo) + 20px);
}
button, input, select, textarea { font-family: inherit; font-size: 17px; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--primario); text-decoration: none; }
h1, h2, h3 { letter-spacing: -.028em; }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--primario); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(94,92,230,.22); }

button, label, th, .topbar, .tab-bar, .bottom-nav, .tabs, .filtros, .puesto, .avatar, .chip { -webkit-user-select: none; user-select: none; }

/* En iOS al tocar las cosas se apagan, no se iluminan */
button:active, a.modulo:active, .ticket:active, .pub:active, .periodo:active { opacity: .45; }

* { scrollbar-width: thin; scrollbar-color: rgba(60,60,67,.3) transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(60,60,67,.28); border-radius: 20px; }

/* ===================================================================
   Barra de navegación
   =================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 30; padding-top: var(--arriba);
  background: rgba(249,249,249,.82);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .5px;
  background: var(--ios-separador); opacity: 0; transition: opacity .25s ease;
}
.topbar.compacta::after { opacity: 1; }
.topbar .fila {
  height: var(--alto-nav); display: flex; align-items: center; gap: 8px;
  padding: 0 16px; max-width: 1180px; margin: 0 auto; position: relative;
}
.topbar .titulo-chico {
  position: absolute; left: 60px; right: 60px; text-align: center; font-size: 17px; font-weight: 600;
  letter-spacing: -.022em; opacity: 0; transform: translateY(7px);
  transition: opacity .2s ease, transform .2s ease; pointer-events: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar.compacta .titulo-chico { opacity: 1; transform: none; }
.topbar .marca { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 600; color: var(--ios-label); flex-shrink: 0; }
.topbar .marca .ico { font-size: 20px; }
.topbar .espacio { flex: 1; }
.topbar .usuario { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 500; color: var(--primario); flex-shrink: 0; margin-left: 10px; }
.topbar .usuario .nombre { display: none; }
.almenas { display: none; }

.titulo-grande {
  max-width: 1180px; margin: 0 auto; padding: 2px 16px 12px;
  font-size: 34px; font-weight: 700; letter-spacing: -.037em; line-height: 1.08;
}

.topbar .menu { display: none; gap: 2px; margin-left: 14px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar .menu::-webkit-scrollbar { display: none; }
.topbar .menu a { white-space: nowrap; }
.topbar .menu a { color: var(--ios-label2); font-size: 15px; font-weight: 500; padding: 7px 11px; border-radius: 9px; }
.topbar .menu a.activa { color: var(--primario); background: var(--primario-suave); font-weight: 600; }
@media (min-width: 900px) {
  .topbar .menu { display: flex; }
  .topbar .usuario .nombre { display: inline; }
  /* Con el menú a la vista no hace falta el título chico: se superponen */
  .topbar .titulo-chico { display: none; }
}

/* ===================================================================
   Tab bar
   =================================================================== */
.tab-bar, .bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; padding: 7px 4px calc(5px + var(--abajo));
  background: rgba(249,249,249,.88);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-top: .5px solid var(--ios-separador);
}
.tab-bar a, .bottom-nav a {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ios-gris); font-size: 10px; font-weight: 500; letter-spacing: -.01em; padding: 2px;
}
.tab-bar a .ico, .bottom-nav a .ico { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(.5); transition: filter .18s ease, transform .18s ease; }
.tab-bar a.activa, .bottom-nav a.activa { color: var(--primario); font-weight: 600; }
.tab-bar a.activa .ico, .bottom-nav a.activa .ico { filter: none; transform: scale(1.08); }
.tab-bar a span:not(.ico) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tab-bar a:active { opacity: .5; }
/* En pantallas grandes ya está el menú de arriba: la barra de abajo sobra y tapaba botones */
@media (min-width: 900px) {
  .tab-bar, .bottom-nav { display: none; }
  body { padding-bottom: 32px; }
}

/* ===================================================================
   Contenido
   =================================================================== */
.contenido { max-width: 1180px; margin: 0 auto; padding: 6px 16px 24px; }
.contenido.angosto { max-width: 760px; }

.card {
  background: var(--ios-card); border-radius: var(--radio); padding: 16px; border: none;
  box-shadow: var(--sombra); margin-bottom: 16px;
}
.card + .card { margin-top: 0; }
.card h2 { margin: 0 0 3px; font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.card .ayuda { color: var(--ios-label2); font-size: 14px; line-height: 1.4; margin-bottom: 14px; }
.vacio { color: var(--ios-label2); font-size: 15px; line-height: 1.45; }
.vacio.caja {
  background: var(--ios-card); border-radius: var(--radio); border: none; box-shadow: var(--sombra);
  padding: 46px 24px; text-align: center;
}
small, .chico-gris { color: var(--ios-label2); font-size: 13px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 10px 18px; border-radius: 11px;
  font-size: 16px; font-weight: 600; letter-spacing: -.02em;
  background: var(--ios-relleno-fuerte); color: var(--primario); white-space: nowrap;
}
.btn.primario { background: var(--primario); color: #fff; }
.btn.gris { background: var(--ios-relleno-fuerte); color: var(--primario); }
.btn.rojo { background: rgba(255,59,48,.12); color: var(--ios-rojo); }
.btn.verde { background: var(--ios-verde); color: #fff; }
.btn.chico { min-height: 32px; padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .35; cursor: default; }

/* ---------- Control segmentado ---------- */
.tabs, .segmentado { display: inline-flex; background: var(--ios-relleno-fuerte); border-radius: 9px; padding: 2px; gap: 2px; }
.tabs button, .segmentado button {
  padding: 6px 16px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--ios-label);
  background: transparent; transition: background .2s ease, box-shadow .2s ease;
}
.tabs button.activa, .segmentado button.activa { background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.tabs button:active { opacity: 1; transform: scale(.96); }

/* ---------- Píldoras ---------- */
.filtros { display: flex; gap: 7px; flex-wrap: wrap; }
.filtros button {
  border: none; background: var(--ios-relleno-fuerte); color: var(--ios-label);
  border-radius: 16px; padding: 6px 13px; font-size: 14px; font-weight: 500;
}
.filtros button.activa { background: var(--primario); color: #fff; font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--ios-card); border: none;
  box-shadow: var(--sombra); border-radius: 16px; padding: 7px 13px;
  font-size: 14px; font-weight: 500; color: var(--ios-label2);
}
.chip b { color: var(--ios-label); font-weight: 600; }
.pill { display: inline-block; background: rgba(52,199,89,.15); color: var(--verde); border-radius: 16px; padding: 4px 11px; font-size: 13px; font-weight: 600; }

/* ---------- Formularios ---------- */
.campo { margin-bottom: 14px; }
.campo label, label.titulo { display: block; font-size: 13px; font-weight: 500; color: var(--ios-label2); margin: 0 0 6px 2px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time],
input[type=number], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 10px 13px; border-radius: 10px;
  background: var(--ios-card); border: .5px solid var(--ios-separador); font-size: 16px; color: var(--ios-label);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--primario); box-shadow: 0 0 0 3px rgba(94,92,230,.14); }
input::placeholder, textarea::placeholder { color: var(--ios-label3); }
input:disabled, select:disabled, textarea:disabled { background: var(--ios-relleno); color: var(--ios-label2); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='16' viewBox='0 0 13 16'%3E%3Cpath d='M3.2 6.6 6.5 3.3l3.3 3.3M3.2 9.4l3.3 3.3 3.3-3.3' stroke='%238E8E93' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
select.auto, input.auto { width: auto; }

input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; min-width: 22px; padding: 0;
  border: 1.5px solid var(--ios-separador-opaco); border-radius: 50%; background: #fff;
  position: relative; vertical-align: -5px; cursor: pointer; transition: background .18s ease, border-color .18s ease;
}
input[type=checkbox]:checked { background: var(--primario); border-color: var(--primario); }
input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(43deg);
}
input[type=checkbox]:active { transform: scale(.88); }

input[type=file] {
  width: 100%; border: 1.5px dashed var(--ios-separador-opaco); background: var(--ios-card);
  padding: 18px; border-radius: var(--radio); font-size: 15px; color: var(--ios-label2); text-align: center; cursor: pointer;
}
input[type=file]::file-selector-button {
  border: none; background: var(--primario); color: #fff; border-radius: 9px;
  padding: 8px 15px; font-size: 14px; font-weight: 600; margin-right: 12px; cursor: pointer;
}

.opciones { display: flex; gap: 8px; }
.opciones button {
  flex: 1; border: .5px solid var(--ios-separador); background: var(--ios-card);
  border-radius: 10px; padding: 11px; font-size: 15px; font-weight: 500; color: var(--ios-label);
}
.opciones button.activa { background: var(--primario); border-color: var(--primario); color: #fff; font-weight: 600; }

.error { color: var(--ios-rojo); font-size: 14px; font-weight: 500; min-height: 18px; margin-top: 6px; }
.msg { min-height: 18px; margin-top: 8px; font-size: 14px; font-weight: 500; white-space: pre-line; }
.msg.error { color: var(--ios-rojo); }
.msg.ok { color: var(--verde); }
.acciones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Tablas ---------- */
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radio); }
table { width: 100%; border-collapse: collapse; background: var(--ios-card); border-radius: var(--radio); overflow: hidden; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 14px; font-size: 15px; vertical-align: middle; }
th {
  font-size: 12px; font-weight: 600; color: var(--ios-label2); text-transform: uppercase; letter-spacing: .04em;
  background: var(--ios-card); border-bottom: .5px solid var(--ios-separador);
}
td { border-bottom: .5px solid var(--ios-separador); }
tbody tr:last-child td { border-bottom: none; }
td input, td select { min-height: 34px; padding: 6px 9px; font-size: 15px; }

/* ---------- Estados ---------- */
.estado { display: inline-block; border-radius: 16px; padding: 3px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.estado.pendiente, .estado.solicitada { background: rgba(255,149,0,.16); color: var(--naranja); }
.estado.en_proceso { background: rgba(0,122,255,.14); color: var(--ios-azul); }
.estado.aprobada, .estado.aprobado { background: rgba(52,199,89,.16); color: var(--verde); }
.estado.rechazada, .estado.rechazado { background: rgba(255,59,48,.13); color: var(--ios-rojo); }
.estado.finalizado { background: var(--ios-relleno-fuerte); color: var(--ios-label2); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}

/* ===================================================================
   Hojas y alertas
   =================================================================== */
.modal-fondo { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.4); }
.modal-fondo.abierto { display: flex; }
.modal {
  background: var(--ios-card); border-radius: 14px; padding: 20px;
  width: min(540px, 100%); max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-shadow: var(--sombra-alta);
}
.modal h2 { margin: 0 0 3px; font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.modal .sub { color: var(--ios-label2); font-size: 14px; margin-bottom: 18px; }

@media (max-width: 899px) {
  .modal-fondo { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0;
    padding: 20px 18px calc(22px + var(--abajo));
  }
  .modal:not(.dialogo)::before {
    content: ""; display: block; width: 36px; height: 5px; margin: -6px auto 16px;
    border-radius: 3px; background: var(--ios-label3);
  }
  .acciones { flex-direction: column-reverse; }
  .acciones .btn { width: 100%; min-height: 48px; font-size: 17px; }
}

/* Alerta del sistema */
.modal.dialogo {
  width: 272px; max-width: 100%; padding: 0; border-radius: 14px; text-align: center; overflow: hidden;
  background: rgba(250,250,250,.94); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.dialogo .cuerpo-alerta { padding: 19px 16px 16px; }
.dialogo h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.dialogo .texto { font-size: 13px; line-height: 1.38; color: var(--ios-label); white-space: pre-line; }
.dialogo .campo { margin: 14px 0 0; }
.dialogo .campo input { min-height: 34px; font-size: 14px; border-radius: 6px; }
.dialogo .acciones { display: flex; flex-direction: row; margin: 0; gap: 0; border-top: .5px solid var(--ios-separador); }
.dialogo .acciones .btn {
  flex: 1; width: auto; min-height: 44px; border-radius: 0; background: transparent;
  font-size: 17px; font-weight: 400; color: var(--ios-azul); padding: 0;
}
.dialogo .acciones .btn + .btn { border-left: .5px solid var(--ios-separador); font-weight: 600; }
.dialogo .acciones .btn.rojo { color: var(--ios-rojo); background: transparent; }
.dialogo .acciones .btn:active { background: rgba(0,0,0,.06); opacity: 1; }

/* ---------- Avisos flotantes ---------- */
.avisos {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--alto-tab) + var(--abajo) + 22px);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(390px, calc(100vw - 32px)); pointer-events: none;
}
.aviso-flotante {
  pointer-events: auto; display: flex; gap: 9px; align-items: center; max-width: 100%;
  background: rgba(40,40,44,.92); color: #fff; border-radius: 20px; padding: 11px 17px;
  font-size: 15px; font-weight: 500; letter-spacing: -.01em; box-shadow: var(--sombra-alta);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.aviso-flotante .ico { font-size: 15px; line-height: 1; }
.aviso-flotante.ok { background: rgba(28,135,62,.94); }
.aviso-flotante.error { background: rgba(200,40,34,.94); }
@media (min-width: 900px) { .avisos { bottom: 28px; } }

.esqueleto { background: var(--ios-relleno-fuerte); border-radius: var(--radio); }

/* ---------- Listas ---------- */
.lista-linda { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 7px; }
.lista-linda li { position: relative; padding-left: 19px; line-height: 1.42; }
.lista-linda li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--primario); opacity: .6; }
.lista-linda.numerada { counter-reset: n; }
.lista-linda.numerada li { padding-left: 29px; }
.lista-linda.numerada li::before {
  counter-increment: n; content: counter(n); left: 0; top: .08em; width: 21px; height: 21px; border-radius: 50%;
  background: var(--primario); color: #fff; font-size: 11px; font-weight: 700; opacity: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Arrastre ---------- */
.fantasma {
  position: fixed; top: -1000px; left: -1000px; pointer-events: none; z-index: 999;
  width: 258px; background: var(--ios-card); border-radius: 12px; padding: 11px 13px;
  box-shadow: var(--sombra-alta); transform: rotate(3deg) scale(1.04);
}
.hueco { border: 2px dashed rgba(94,92,230,.4); border-radius: 11px; background: rgba(94,92,230,.05); }
body.arrastrando * { cursor: grabbing !important; }

/* ===================================================================
   Movimiento
   =================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @keyframes ios-aparecer { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
  .card, .modulo, .ticket, .pub, .kpi, .res, .dia, .columna, .persona, .evento, .nov, .periodo {
    animation: ios-aparecer .34s cubic-bezier(.32,.72,0,1) both;
  }
  .modulo:nth-child(2), .kpi:nth-child(2) { animation-delay: .03s; }
  .modulo:nth-child(3), .kpi:nth-child(3) { animation-delay: .06s; }
  .modulo:nth-child(4), .kpi:nth-child(4) { animation-delay: .09s; }
  .modulo:nth-child(5) { animation-delay: .12s; }
  .modulo:nth-child(6) { animation-delay: .15s; }
  .modulo:nth-child(7) { animation-delay: .18s; }
  .modulo:nth-child(n+8) { animation-delay: .21s; }

  @keyframes ios-hoja { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes ios-alerta { from { opacity: 0; transform: scale(1.14); } to { opacity: 1; transform: none; } }
  @keyframes ios-velo { from { opacity: 0; } to { opacity: 1; } }
  .modal-fondo.abierto { animation: ios-velo .22s ease both; }
  .modal { animation: ios-alerta .28s cubic-bezier(.32,.72,0,1) both; }
  .modal.dialogo { animation: ios-alerta .25s cubic-bezier(.3,1.4,.5,1) both; }
  @media (max-width: 899px) { .modal:not(.dialogo) { animation: ios-hoja .4s cubic-bezier(.32,.72,0,1) both; } }

  @keyframes ios-aviso { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
  @keyframes ios-aviso-out { to { opacity: 0; transform: translateY(8px) scale(.94); } }
  .aviso-flotante { animation: ios-aviso .32s cubic-bezier(.3,1.35,.5,1) both; }
  .aviso-flotante.yendose { animation: ios-aviso-out .2s ease forwards; }

  @keyframes ios-pop { from { opacity: 0; transform: translate(-50%,-50%) scale(.5); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
  .puesto { animation: ios-pop .38s cubic-bezier(.3,1.35,.5,1) both; transition: transform .16s ease; }
  .puesto:nth-child(2n) { animation-delay: .03s; }
  .puesto:nth-child(3n) { animation-delay: .06s; }
  .puesto:active { transform: translate(-50%,-50%) scale(.88); opacity: 1; }

  @keyframes ios-respirar { 0%,100% { box-shadow: 0 0 0 0 rgba(0,122,255,.38); } 70% { box-shadow: 0 0 0 9px rgba(0,122,255,0); } }
  .puesto.tuyo { animation: ios-pop .38s cubic-bezier(.3,1.35,.5,1) both, ios-respirar 2.4s ease-out 1s infinite; }

  @keyframes ios-llamar { 0%,100% { box-shadow: 0 0 0 0 rgba(52,199,89,.42); } 70% { box-shadow: 0 0 0 10px rgba(52,199,89,0); } }
  .res .llegue, .hero .btn.verde { animation: ios-llamar 2.2s ease-out infinite; }

  @keyframes ios-crecer-alto { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  .cols .b { transform-origin: bottom; animation: ios-crecer-alto .6s cubic-bezier(.32,.72,0,1) both; }
  .cols .col:nth-child(2n) .b { animation-delay: .03s; }
  .cols .col:nth-child(3n) .b { animation-delay: .06s; }
  @keyframes ios-crecer-ancho { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .fila .pista i, .opcion .barra { transform-origin: left; animation: ios-crecer-ancho .65s cubic-bezier(.32,.72,0,1) both; }
  .filas .fila:nth-child(2) .pista i { animation-delay: .05s; }
  .filas .fila:nth-child(3) .pista i { animation-delay: .1s; }
  .filas .fila:nth-child(4) .pista i { animation-delay: .15s; }
  .filas .fila:nth-child(n+5) .pista i { animation-delay: .2s; }

  @keyframes ios-brillo { to { background-position: -200% 0; } }
  .esqueleto { background: linear-gradient(100deg, #E5E5EA 30%, #F2F2F7 50%, #E5E5EA 70%); background-size: 200% 100%; animation: ios-brillo 1.4s linear infinite; }

  .msg-c { animation: ios-aparecer .3s cubic-bezier(.32,.72,0,1) both; }
  @keyframes ios-puntos { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
  .pensando .burbuja::after { content: " •••"; letter-spacing: 1px; animation: ios-puntos 1.2s ease-in-out infinite; }
}

/* ---------- Hoja "Más" del tab bar ---------- */
.lista-secciones { background: var(--ios-relleno); border-radius: var(--radio); overflow: hidden; }
.lista-secciones a {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px; color: var(--ios-label); font-size: 17px;
  border-bottom: .5px solid var(--ios-separador);
}
.lista-secciones a:last-child { border-bottom: none; }
.lista-secciones a .ico { font-size: 21px; width: 26px; text-align: center; }
.lista-secciones a .nom { flex: 1; font-weight: 500; }
.lista-secciones a .flecha { color: var(--ios-label3); font-size: 20px; font-weight: 600; }
.lista-secciones a.activa { color: var(--primario); }
.lista-secciones a:active { background: var(--ios-relleno-fuerte); opacity: 1; }

/* ---------- Íconos de trazo ---------- */
.ico svg { width: 1em; height: 1em; display: block; }
.tab-bar a .ico, .bottom-nav a .ico { font-size: 25px; filter: none; opacity: .92; }
.tab-bar a .ico svg { stroke-width: 1.6; }
.tab-bar a.activa .ico svg { stroke-width: 2.1; }
.topbar .marca .ico { font-size: 22px; color: var(--primario); }
.lista-secciones a .ico { font-size: 21px; color: var(--primario); display: flex; justify-content: center; }
.lista-secciones a .flecha { font-size: 17px; display: flex; }
.lista-secciones a .flecha svg { stroke-width: 2.2; }
.modulo .ico { font-size: 24px; color: var(--primario); }
.modulo .ico svg { stroke-width: 1.7; }

/* ---------- Campanita y panel de avisos ---------- */
.topbar .campana { position: relative; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primario); flex-shrink: 0; margin-left: 6px; }
.topbar .campana .ico { font-size: 23px; display: flex; }
.topbar .campana .globo {
  position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--ios-rojo); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(249,249,249,.95);
}
.topbar .campana .globo[hidden] { display: none; }
.avisos-panel { width: min(430px, 100%); }
.avisos-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.avisos-cab h2 { margin: 0; }
.lista-avisos { max-height: 60vh; overflow-y: auto; margin: 0 -4px; }
.aviso-item { display: flex; gap: 11px; padding: 11px 6px; border-bottom: .5px solid var(--ios-separador); color: var(--ios-label); border-radius: 8px; }
.aviso-item:last-child { border-bottom: none; }
.aviso-item .punto { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: transparent; }
.aviso-item.nuevo .punto { background: var(--ios-azul); }
.aviso-item .cuerpo { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aviso-item b { font-size: 15px; font-weight: 600; }
.aviso-item span:not(.punto):not(.cuerpo) { font-size: 14px; color: var(--ios-label2); }
.aviso-item small { font-size: 12px; color: var(--ios-label3); margin-top: 2px; }
.aviso-item:active { background: var(--ios-relleno); opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes timbre { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } }
  .topbar .campana .globo:not([hidden]) + * , .topbar .campana:has(.globo:not([hidden])) .ico { animation: timbre .9s ease 1; transform-origin: 50% 10%; }
}
