/* Agenda del equipo (2026-11-26). Tokens del tema PHN (tema/tokens.css); sin colores sueltos salvo los tonos
   por tipo, que salen de los mismos pares fondo/texto del tablero (ok, info, team, warn, neutro). */

.ag { display: grid; gap: var(--phn-space-5, 24px); }
.ag-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ag-cab h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.02em; }
.ag-cab p { margin: 0; color: var(--phn-text-2); max-width: 60ch; }

/* ------------------------------------------------------------------ tonos por tipo */
.ag-tono--acento { --t-bg: var(--phn-accent-soft); --t-fg: var(--phn-accent-text); --t-solid: var(--phn-accent); }
.ag-tono--info   { --t-bg: var(--phn-info-bg); --t-fg: var(--phn-info-fg); --t-solid: var(--phn-info-fg); }
.ag-tono--team   { --t-bg: var(--phn-team-bg); --t-fg: var(--phn-team-fg); --t-solid: var(--phn-team-fg); }
.ag-tono--warn   { --t-bg: var(--phn-warn-bg); --t-fg: var(--phn-warn-fg); --t-solid: var(--phn-warn-fg); }
.ag-tono--ok     { --t-bg: var(--phn-ok-bg); --t-fg: var(--phn-ok-fg); --t-solid: var(--phn-ok-fg); }
.ag-tono--neutro { --t-bg: var(--phn-neutral-bg); --t-fg: var(--phn-neutral-fg); --t-solid: var(--phn-text-2); }

/* ------------------------------------------------------------------ botones */
.ag-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 16px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.ag-btn:active { transform: scale(.97); }
.ag-btn:disabled { opacity: .55; cursor: progress; }
.ag-btn .icono { width: 20px; height: 20px; flex: none; }
.ag-btn--primario { background: var(--phn-accent); color: var(--phn-on-accent); }
.ag-btn--primario:hover { filter: brightness(.95); }
.ag-btn--suave { background: var(--phn-neutral-bg); color: var(--phn-text); }
.ag-btn--hecho { background: var(--phn-accent); color: var(--phn-on-accent); flex: 1 1 140px; min-height: 56px; font-size: 1.05rem; }
.ag-btn--audio {
  background: var(--phn-text); color: var(--phn-surface); flex: 1 1 160px; min-height: 56px; font-size: 1.05rem;
}
.ag-btn--audio small { opacity: .7; font-weight: 600; font-variant-numeric: tabular-nums; }
.ag-btn--audio.is-sonando { background: var(--phn-accent-text); }
.ag-btn--audio.is-sonando .icono { animation: ag-latido 1s ease-in-out infinite; }
.ag-btn--mic { background: var(--phn-danger-bg); color: var(--phn-danger-fg); width: 100%; min-height: 64px; font-size: 1.05rem; }
.ag-btn--grabando { background: var(--phn-danger-solid, #D92D20); color: #FFFFFF; width: 100%; min-height: 64px; font-size: 1.05rem; animation: ag-pulso 1.4s ease-in-out infinite; }
@keyframes ag-latido { 50% { transform: scale(1.25); } }
@keyframes ag-pulso { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--phn-danger-solid, #D92D20) 18%, transparent); } }

.ag-pildora {
  min-height: 38px; padding: 0 16px; border: 1px solid var(--phn-border); border-radius: 999px;
  background: var(--phn-surface); color: var(--phn-text); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.ag-pildora:hover { border-color: var(--phn-border-strong, var(--phn-text-2)); }
.ag-pildora.is-sel { background: var(--phn-accent); border-color: var(--phn-accent); color: var(--phn-on-accent); }
.ag-icono {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: var(--phn-neutral-bg); color: var(--phn-text); cursor: pointer;
}
.ag-icono .icono { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ avisos y bloque del teléfono */
.ag-aviso { margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--phn-ok-bg); color: var(--phn-ok-fg); font-weight: 600; }
.ag-aviso--error { background: var(--phn-danger-bg); color: var(--phn-danger-fg); }

.ag-tel {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--phn-radius-card, 22px);
  background: var(--phn-surface); box-shadow: var(--phn-shadow-card); flex-wrap: wrap;
}
.ag-tel__icono { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--phn-warn-bg); color: var(--phn-warn-fg); flex: none; }
.ag-tel--activo .ag-tel__icono { background: var(--phn-ok-bg); color: var(--phn-ok-fg); }
.ag-tel__texto { flex: 1 1 220px; display: grid; gap: 2px; }
.ag-tel__texto small { color: var(--phn-text-2); }

/* ------------------------------------------------------------------ bloques */
.ag-bloque { display: grid; gap: 14px; align-content: start; }
.ag-bloque__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ag-bloque__cab h2 { margin: 0; font-size: 1.15rem; }
.ag-num { min-width: 28px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--phn-neutral-bg); color: var(--phn-neutral-fg); font-weight: 700; font-size: .85rem; margin-right: auto; }
.ag-num--alerta { background: var(--phn-danger-solid, #D92D20); color: #FFFFFF; }
.ag-cols { display: grid; gap: var(--phn-space-5, 24px); }
@media (min-width: 1100px) { .ag-cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }

.ag-vacio {
  display: flex; align-items: center; gap: 12px; margin: 0; padding: 22px; border-radius: var(--phn-radius-card, 22px);
  background: var(--phn-surface); box-shadow: var(--phn-shadow-card); color: var(--phn-text-2);
}
.ag-vacio .icono { color: var(--phn-ok-fg); flex: none; }
.ag-vacio--sm { padding: 14px 16px; box-shadow: none; background: var(--phn-neutral-bg); }

/* ------------------------------------------------------------------ para ti */
.ag-pendientes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.ag-pend {
  position: relative; display: grid; gap: 12px; padding: 20px 20px 18px; border-radius: var(--phn-radius-card, 22px);
  background: var(--phn-surface); box-shadow: var(--phn-shadow-card); overflow: hidden;
  transition: opacity .25s ease, transform .25s ease;
}
.ag-pend::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--t-solid); }
.ag-pend.is-enfocado { outline: 3px solid var(--phn-accent); outline-offset: 2px; }
.ag-pend.is-saliendo { opacity: 0; transform: translateX(24px); }
.ag-pend__cab { display: flex; align-items: center; gap: 12px; }
.ag-pend__cab div { display: grid; }
.ag-pend__cab small { color: var(--phn-text-2); }
.ag-pend__titulo { margin: 0; font-size: 1.3rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.ag-pend__detalle { margin: 0; color: var(--phn-text-2); }
.ag-pend__acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-pend__rapidas { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-avatar {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--t-bg, var(--phn-accent-soft)); color: var(--t-fg, var(--phn-accent-text)); font-weight: 800;
}
.ag-avatar .icono { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ lo que pediste */
.ag-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ag-pedido { padding: 14px 16px; border-radius: 18px; background: var(--phn-surface); box-shadow: var(--phn-shadow-card); display: grid; gap: 8px; }
.ag-pedido__cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ag-pedido__cab small { color: var(--phn-text-2); white-space: nowrap; }
.ag-destinos { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-destino { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--phn-neutral-bg); color: var(--phn-neutral-fg); }
.ag-destino .icono { width: 14px; height: 14px; }
.ag-destino--visto { background: var(--phn-info-bg); color: var(--phn-info-fg); }
.ag-destino--hecho { background: var(--phn-ok-bg); color: var(--phn-ok-fg); }

/* ------------------------------------------------------------------ calendario */
.ag-cal { padding: 20px; border-radius: var(--phn-radius-card, 22px); background: var(--phn-surface); box-shadow: var(--phn-shadow-card); }
.ag-cal__cab h2::first-letter, .ag-dia__titulo::first-letter { text-transform: uppercase; }
.ag-cal__nav { display: flex; gap: 6px; align-items: center; }
.ag-mes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ag-mes__dn { text-align: center; font-size: .72rem; font-weight: 700; color: var(--phn-text-2); padding-bottom: 4px; letter-spacing: .06em; }
.ag-dia {
  display: grid; justify-items: center; align-content: center; gap: 4px; height: 52px;
  border: 0; border-radius: 12px; background: transparent; color: var(--phn-text); font: inherit; font-weight: 600; cursor: pointer;
}
.ag-dia:hover { background: var(--phn-neutral-bg); }
.ag-dia.is-fuera { color: var(--phn-text-2); opacity: .45; }
.ag-dia.is-hoy > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--phn-accent); }
.ag-dia.is-sel { background: var(--phn-accent); color: var(--phn-on-accent); }
.ag-dia.is-sel .ag-punto { background: var(--phn-on-accent); }
.ag-puntos { display: flex; gap: 3px; min-height: 6px; }
.ag-punto { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--t-solid); }
.ag-dia__titulo { margin: 8px 0 0; font-size: 1rem; }
.ag-leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--phn-text-2); }
.ag-leyenda span { display: inline-flex; align-items: center; gap: 6px; }

.ag-linea { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-evento {
  display: grid; grid-template-columns: 72px 36px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px; border-radius: 16px; background: var(--t-bg);
}
.ag-evento.is-cancelado { opacity: .55; }
.ag-evento.is-cancelado strong { text-decoration: line-through; }
.ag-evento__hora { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--t-fg); padding-top: 8px; font-size: .9rem; }
.ag-evento__icono { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--phn-surface); color: var(--t-fg); }
.ag-evento__icono .icono { width: 18px; height: 18px; }
.ag-evento__cuerpo { display: grid; gap: 2px; min-width: 0; }
.ag-evento__cuerpo small { color: var(--phn-text-2); }
.ag-evento__cuerpo p { margin: 4px 0 0; color: var(--phn-text-2); font-size: .9rem; }
.ag-evento__acc { display: flex; gap: 6px; }
.ag-evento__acc .ag-icono { background: var(--phn-surface); }
@media (max-width: 520px) {
  .ag-evento { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .ag-evento__hora { grid-column: 1 / -1; padding: 0; }
}

/* ------------------------------------------------------------------ asistente */
.ag-dialogo {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0;
  border-radius: 26px; background: var(--phn-surface); color: var(--phn-text); box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}
.ag-dialogo::backdrop { background: rgba(20, 24, 20, .45); backdrop-filter: blur(3px); }
@media (max-width: 640px) {
  .ag-dialogo { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .ag-dialogo__caja { min-height: 100dvh; }
}
.ag-dialogo__caja { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 16px; padding: 20px 22px 22px; }
.ag-dialogo__cab { display: flex; align-items: center; gap: 12px; }
.ag-dialogo h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.ag-dialogo__cuerpo { display: grid; gap: 12px; align-content: start; overflow: auto; }
.ag-dialogo__nota { margin: 0; color: var(--phn-text-2); }
.ag-dialogo__pie { display: flex; justify-content: space-between; gap: 10px; }
.ag-dialogo__pie .ag-btn--primario { flex: 1; max-width: 280px; margin-left: auto; }
.ag-progreso { flex: 1; display: flex; gap: 6px; }
.ag-progreso i { flex: 1; height: 6px; border-radius: 999px; background: var(--phn-neutral-bg); }
.ag-progreso i.is-lleno { background: var(--phn-accent); }

.ag-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.ag-tipo {
  display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  padding: 14px; border: 2px solid transparent; border-radius: 18px; background: var(--t-bg); color: var(--phn-text); font: inherit; cursor: pointer;
}
.ag-tipo:hover, .ag-tipo.is-sel { border-color: var(--t-solid); }
.ag-tipo__icono { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--phn-surface); color: var(--t-fg); }
.ag-tipo small { color: var(--phn-text-2); line-height: 1.3; }

.ag-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ag-persona {
  display: grid; justify-items: center; gap: 8px; padding: 14px 8px; border: 2px solid var(--phn-border); border-radius: 18px;
  background: var(--phn-surface); color: var(--phn-text); font: inherit; font-weight: 700; cursor: pointer;
}
.ag-persona .ag-avatar { width: 52px; height: 52px; font-size: 1.2rem; }
.ag-persona.is-sel { border-color: var(--phn-accent); background: var(--phn-accent-soft); }
.ag-persona.is-sel .ag-avatar { background: var(--phn-accent); color: var(--phn-on-accent); }

.ag-campo {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: var(--phn-radius-field, 12px);
  background: var(--phn-neutral-bg); color: var(--phn-text); font: inherit; resize: vertical;
}
.ag-campo:focus { outline: 2px solid var(--phn-accent); outline-offset: 1px; }
.ag-campo--grande { font-size: 1.2rem; min-height: 60px; font-weight: 600; }
.ag-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ag-check input { width: 22px; height: 22px; accent-color: var(--phn-accent); }
.ag-grabado { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-resumen { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; background: var(--t-bg); }
.ag-resumen div { display: grid; gap: 4px; }
.ag-resumen strong { font-size: 1.25rem; }
.ag-resumen small { color: var(--phn-text-2); display: inline-flex; gap: 4px; align-items: center; }
.ag-resumen small .icono { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ resumen en Inicio */
.ag-inicio { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.ag-inicio > button {
  display: grid; gap: 4px; text-align: left; padding: 16px 18px; border: 0; border-radius: 20px; font: inherit; cursor: pointer;
  background: var(--t-bg, var(--phn-surface)); color: var(--phn-text); box-shadow: var(--phn-shadow-card);
}
.ag-inicio > button small { color: var(--phn-text-2); text-transform: capitalize; }
.ag-inicio__pend { grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; background: var(--phn-surface) !important; }
.ag-inicio__pend span:last-child { display: grid; gap: 2px; min-width: 0; }
.ag-inicio__pend small { text-transform: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-inicio__num { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--phn-ok-bg); color: var(--phn-ok-fg); font-size: 1.3rem; font-weight: 800; }
.ag-inicio__pend.is-alerta .ag-inicio__num { background: var(--phn-danger-solid, #D92D20); color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .ag-btn, .ag-pend { transition: none; }
  .ag-btn--grabando, .ag-btn--audio.is-sonando .icono { animation: none; }
}
