/* Brando — app.css (panel del cliente). Todo sale de los tokens y componentes de brand.css
   (--b-*, .b-btn, .b-list, .b-sheet, .b-badge…). Aquí solo va la composición del panel:
   estilo Configuración/Apple Card — secciones con título, grupos de filas y tarjetas de alerta. */

/* ---------- Cabecera: material translúcido + cuenta ---------- */
.a-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--b-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: .5px solid var(--b-line);
  padding-top: env(safe-area-inset-top, 0px);
}
.a-top__in { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-4); min-height: 56px; }
.a-top .b-logo svg { height: 26px; }
.a-top__link {
  display: inline-flex; align-items: center; min-height: var(--b-tap); padding-inline: var(--b-space-2);
  font-size: var(--b-t-callout); color: var(--b-ink-2); text-decoration: none;
}
.a-top__link:hover { color: var(--b-ink); }

.a-cuenta { position: relative; }
.a-cuenta__btn {
  display: grid; place-items: center; width: var(--b-tap); height: var(--b-tap); margin-right: -6px;
  padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.a-cuenta__ini {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--b-tint); color: var(--b-on-tint);
  font: 600 var(--b-t-callout)/1 var(--b-font-body);
  transition: background-color var(--b-dur) var(--b-ease);
}
.a-cuenta__btn:hover .a-cuenta__ini, .a-cuenta__btn[aria-expanded="true"] .a-cuenta__ini { background: var(--b-tint-hover); }
.a-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; max-width: calc(100vw - 32px);
  background: var(--b-surface); border: .5px solid var(--b-line-strong); border-radius: var(--b-r-md);
  box-shadow: var(--b-e2); padding: 6px; display: flex; flex-direction: column;
  animation: a-pop var(--b-dur-in) var(--b-spring);
}
.a-menu__head { display: flex; flex-direction: column; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: .5px solid var(--b-line-strong); min-width: 0; }
.a-menu__nombre { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); }
.a-menu__email { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); overflow-wrap: anywhere; }
.a-menu__item {
  display: flex; align-items: center; min-height: var(--b-tap); padding: 0 12px; border: 0; border-radius: var(--b-r-sm);
  background: transparent; color: var(--b-ink); font: 400 var(--b-t-body)/1.2 var(--b-font-body); text-align: left; text-decoration: none; cursor: pointer;
}
.a-menu__item:hover, .a-menu__item:focus-visible { background: var(--b-surface-2); text-decoration: none; }
.a-menu__item--danger { color: var(--b-alto); }
@keyframes a-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- Pie ---------- */
.a-foot { border-top: .5px solid var(--b-line); padding-block: var(--b-space-5) calc(var(--b-space-5) + env(safe-area-inset-bottom, 0px)); font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.a-foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--b-space-2) var(--b-space-5); }
.a-foot__nav { display: flex; flex-wrap: wrap; gap: 0 var(--b-space-4); }
.a-foot__nav a { display: inline-flex; align-items: center; min-height: var(--b-tap); color: var(--b-ink-2); }

/* ---------- Estructura ---------- */
.a-main { min-height: calc(100dvh - 180px); }
.a-wrap { padding-block: var(--b-space-5) var(--b-space-8); }
@media (min-width: 768px) { .a-wrap { padding-block: var(--b-space-6) var(--b-space-9); } }
.a-muted { color: var(--b-ink-2); }
.a-btn-txt { display: inline-flex; align-items: center; gap: var(--b-space-2); }
.a-marca-txt { font-family: var(--b-font-mono); font-weight: 600; letter-spacing: .01em; text-transform: uppercase; overflow-wrap: anywhere; }

.a-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--b-space-3); min-height: 50dvh; }
.a-loading .b-spinner { width: 28px; height: 28px; border-width: 3px; color: var(--b-ink-3); }

/* ---------- Ingreso ---------- */
.a-login { display: grid; place-items: center; min-height: 60dvh; }
.a-login__card {
  width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: var(--b-space-4);
  background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg); padding: var(--b-card-pad);
}
.a-login__lead { font-size: var(--b-t-body); line-height: var(--b-lh-body); color: var(--b-ink-2); }
.a-login__form { display: flex; flex-direction: column; gap: var(--b-field-gap); margin-top: var(--b-space-2); }
.a-login__ok { display: flex; flex-direction: column; gap: var(--b-space-3); align-items: flex-start; }
.a-okmark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--b-bajo-bg); color: var(--b-bajo); }
.a-okmark svg { width: 26px; height: 26px; }
.a-login__foot { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); border-top: .5px solid var(--b-line-strong); padding-top: var(--b-space-4); margin-top: var(--b-space-2); }

/* ---------- Panel ---------- */
.a-app { display: flex; flex-direction: column; gap: var(--b-space-5); }
.a-hero { display: flex; flex-direction: column; gap: var(--b-space-1); }
.a-hero__sub { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); }

.a-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--b-space-6); align-items: start; }
.a-side { display: flex; flex-direction: column; gap: var(--b-space-6); min-width: 0; }
@media (min-width: 1024px) {
  .a-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: var(--b-space-7); }
  .a-side { position: sticky; top: calc(56px + var(--b-space-5) + env(safe-area-inset-top, 0px)); }
}

.a-sec { display: flex; flex-direction: column; gap: var(--b-space-3); min-width: 0; }
.a-sec__head { display: flex; align-items: center; gap: var(--b-space-2); min-height: var(--b-tap); }
.a-h2 { font-size: var(--b-t-title3); line-height: var(--b-lh-title3); }
@media (min-width: 768px) { .a-alertas .a-h2 { font-size: var(--b-t-title2); line-height: var(--b-lh-title2); } }
.a-sec__meta { margin-left: auto; font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); white-space: nowrap; }
.a-sec__meta:empty { display: none; }
.a-sec__meta + .a-editbtn { margin-left: 0; }
.a-editbtn { margin-right: -12px; }
/* En iPhone angosto la negativa de -12px saca "Listo" del borde: sin ella basta. */
@media (max-width: 400px) { .a-editbtn { margin-right: 0; } }
.a-iconbtn {
  display: grid; place-items: center; width: var(--b-tap); height: var(--b-tap); margin-left: -6px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--b-link); cursor: pointer;
}
.a-iconbtn svg { width: 22px; height: 22px; }
.a-iconbtn:hover { background: var(--b-tint); }

/* ---------- Grupos de filas (sobre .b-list) ---------- */
.a-rows { list-style: none; margin: 0; padding: 0; }
.a-group .a-rows > li + li::before,
.a-group .a-rows:not(:empty) ~ .b-list__row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--b-line-strong);
}
.a-rows.is-editando > li + li::before { left: 60px; }
.a-row {
  width: 100%; min-height: 56px; margin: 0; border: 0; background: transparent; color: var(--b-ink);
  font: inherit; text-align: left; -webkit-tap-highlight-color: transparent;
}
button.a-row { cursor: pointer; transition: background-color var(--b-dur) var(--b-ease); }
button.a-row:hover { background: var(--b-surface-2); }
button.a-row:active { background: color-mix(in srgb, var(--b-ink) 8%, var(--b-surface)); }
.a-row__main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.a-row__title { font-size: var(--b-t-body); line-height: var(--b-lh-headline); }
.a-row__title.a-marca-txt { font-size: var(--b-t-callout); }
.a-row__sub { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.a-row__value { display: inline-flex; align-items: center; gap: var(--b-space-2); flex: none; font-size: var(--b-t-callout); color: var(--b-ink-2); text-align: right; }
.a-row__accessory { display: inline-flex; align-items: center; gap: 2px; flex: none; font-size: var(--b-t-callout); color: var(--b-ink-2); }
.a-row__accessory svg { width: 18px; height: 18px; color: var(--b-ink-3); margin-right: -4px; }
.a-row--add { color: var(--b-link); font-weight: 500; }
.a-row__addicon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--b-tint); color: var(--b-on-tint); flex: none; }
.a-row__addicon svg { width: 18px; height: 18px; }
.a-row--action { color: var(--b-link); font-weight: 600; }
.a-row--empty { color: var(--b-ink-2); font-size: var(--b-t-callout); }
.a-row__del {
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; flex: none; margin-right: 4px;
  padding: 0; border: 0; border-radius: 50%; background: var(--b-alto); color: #fff; cursor: pointer;
  animation: a-in var(--b-dur-out) var(--b-spring);
}
.a-row__del::after { content: ""; position: absolute; inset: -8px; }
.a-row__del svg { width: 18px; height: 18px; }
.a-group__foot { padding-inline: var(--b-space-4); font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.a-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--b-ink-3); }
.a-dot--bajo { background: var(--b-bajo); }
.a-dot--medio { background: var(--b-medio); }
.a-dot--alto { background: var(--b-alto); }
@keyframes a-in { from { opacity: 0; transform: scale(.6); } }

/* ---------- Avisos del panel: suscripción por vencer y factura ---------- */
.a-banner, .a-nudge {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--b-space-3) var(--b-space-4);
  padding: var(--b-space-4); border-radius: var(--b-r-lg); border: 1px solid var(--b-line); background: var(--b-surface);
}
.a-banner--medio { background: var(--b-medio-bg); border-color: var(--b-medio-line); }
.a-banner--alto { background: var(--b-alto-bg); border-color: var(--b-alto-line); }
.a-banner__icon, .a-nudge__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--b-surface); color: var(--b-ink-2); }
.a-banner--medio .a-banner__icon { color: var(--b-medio); }
.a-banner--alto .a-banner__icon { color: var(--b-alto); }
.a-banner__icon svg, .a-nudge__icon svg { width: 22px; height: 22px; }
.a-nudge__icon { background: var(--b-tint); color: var(--b-on-tint); }
.a-banner__txt, .a-nudge__txt { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.a-banner__t, .a-nudge__t { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); color: var(--b-ink); }
.a-banner__s, .a-nudge__s { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); }
.a-banner__cta { align-self: center; margin-left: auto; }
.a-nudge__acts { display: flex; flex-wrap: wrap; gap: var(--b-space-2); margin-top: var(--b-space-3); }
@media (max-width: 600px) { .a-banner__cta { width: 100%; margin-left: 0; } }
/* Fila compacta dentro de "Datos de tu factura": sin icono, un párrafo y las acciones. */
.a-nudge--compact { padding: 0 var(--b-space-4) var(--b-space-4); border: 0; background: none; margin-top: calc(-1 * var(--b-space-2)); }
.a-nudge--compact .a-nudge__acts { margin-top: var(--b-space-2); }

/* ---------- Alertas: una tarjeta por solicitud ---------- */
.a-alertas__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--b-card-gap); }
.a-alerta {
  display: flex; flex-direction: column; gap: var(--b-space-3);
  background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg);
  padding: var(--b-card-pad);
}
.a-alerta__top { display: flex; align-items: center; justify-content: space-between; gap: var(--b-space-3); }
.a-alerta__score { display: inline-flex; align-items: center; gap: var(--b-space-2); font-size: var(--b-t-footnote); line-height: 1; color: var(--b-ink-2); white-space: nowrap; }
.a-alerta__score b { color: var(--b-ink); font-weight: 600; font-size: var(--b-t-callout); }
.a-alerta__meter { width: 56px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--b-surface-2); }
.a-alerta__meter > span { display: block; height: 100%; border-radius: inherit; background: var(--b-ink-3); }
.a-alerta--alto .a-alerta__meter > span { background: var(--b-alto); }
.a-alerta--medio .a-alerta__meter > span { background: var(--b-medio); }
.a-alerta--bajo .a-alerta__meter > span { background: var(--b-bajo); }
.a-alerta__cand { font: 600 var(--b-t-title3)/var(--b-lh-title3) var(--b-font-mono); letter-spacing: 0; margin-top: var(--b-space-1); }
.a-alerta__cand .a-marca-txt { font-weight: 600; }
.a-alerta__vs { font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink-2); margin-top: -4px; }
.a-alerta__vs .a-marca-txt { color: var(--b-ink); font-size: .94em; }

/* Recuadro del plazo (punteado, como en la gaceta) */
.a-plazo {
  display: flex; align-items: flex-start; gap: var(--b-space-3);
  padding: var(--b-space-3) var(--b-space-4); border-radius: var(--b-r-md); border: 1px dashed var(--b-line-strong);
}
.a-plazo__icon { width: 22px; height: 22px; flex: none; color: var(--b-ink-2); margin-top: 1px; }
.a-plazo__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.a-plazo__t { font: 600 var(--b-t-headline)/var(--b-lh-headline) var(--b-font-body); color: var(--b-ink); }
.a-plazo__s { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.a-plazo--urgente { border-style: solid; border-color: var(--b-alto-line); background: var(--b-alto-bg); }
.a-plazo--urgente .a-plazo__icon, .a-plazo--urgente .a-plazo__t { color: var(--b-alto); }
.a-plazo--cerrado { border-style: solid; border-color: transparent; background: var(--b-surface-2); }
.a-plazo--cerrado .a-plazo__icon { color: var(--b-ink-3); }
.a-plazo--cerrado .a-plazo__t { color: var(--b-ink-2); }

.a-alerta__razon { display: flex; flex-direction: column; gap: 2px; font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink); max-width: 68ch; }
.a-alerta__razon-t { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); font-weight: 600; color: var(--b-ink-2); }
.a-alerta__meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--b-space-3) var(--b-space-4);
  margin: 0; padding-top: var(--b-space-3); border-top: .5px solid var(--b-line-strong);
}
.a-alerta__meta > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.a-alerta__meta dt { font-size: var(--b-t-footnote); line-height: var(--b-lh-footnote); color: var(--b-ink-2); }
.a-alerta__meta dd { margin: 0; font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink); overflow-wrap: anywhere; }
.a-alerta__meta dd .a-marca-txt { font-weight: 400; font-size: .94em; }

/* Plazo terminado: gris, sin rojo ni resaltador, al final */
.a-alerta.is-cerrada { background: transparent; }
.a-alerta.is-cerrada .a-alerta__cand, .a-alerta.is-cerrada .a-alerta__vs .a-marca-txt { color: var(--b-ink-2); }
.a-alerta.is-cerrada .a-alerta__meter > span { background: var(--b-ink-3); }
.a-alerta.is-cerrada .a-alerta__score b { color: var(--b-ink-2); }
.a-cerradas { display: flex; flex-direction: column; gap: var(--b-space-3); margin-top: var(--b-space-5); }
.a-group__label { font: 600 var(--b-t-footnote)/var(--b-lh-footnote) var(--b-font-body); color: var(--b-ink-2); padding-inline: var(--b-space-4); }

/* Estado vacío */
.a-empty { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-lg); }
.a-empty__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--b-bajo-bg); color: var(--b-bajo); margin-bottom: var(--b-space-2); }
.a-empty__icon svg { width: 26px; height: 26px; }
.a-empty__title { font: 600 var(--b-t-title3)/var(--b-lh-title3) var(--b-font-body); }
.a-empty__meta { font-size: var(--b-t-footnote) !important; color: var(--b-ink-2); }

/* ---------- Hojas ---------- */
.a-sheet-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.a-sheet-form > .b-sheet__body { flex: 1 1 auto; }
.a-alertsheet { width: min(420px, calc(100vw - 32px)); }
.a-alertsheet__body { text-align: center; gap: var(--b-space-3); padding-top: var(--b-space-5); }
.a-alertsheet__title { font: 600 var(--b-t-title3)/var(--b-lh-title3) var(--b-font-body); }
.a-alertsheet .b-sheet__foot { border-top: 0; padding-top: 0; }
@media (max-width: 600px) { .a-alertsheet { width: 100vw; } }
.a-input-marca { font-family: var(--b-font-mono); text-transform: uppercase; letter-spacing: .01em; }
.a-input-marca::placeholder { text-transform: uppercase; }

.a-guia { margin: 0; display: flex; flex-direction: column; gap: var(--b-space-3); }
.a-guia > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--b-space-3); align-items: baseline; }
.a-guia dd { margin: 0; font-size: var(--b-t-callout); line-height: var(--b-lh-callout); color: var(--b-ink); }

/* Control segmentado (Consumidor final / Con mis datos) */
.a-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; padding: 2px; border: 0; border-radius: var(--b-r-sm); background: var(--b-surface-2); min-width: 0; }
.a-seg__opt { position: relative; display: block; cursor: pointer; }
.a-seg__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.a-seg__opt span {
  display: grid; place-items: center; min-height: 40px; padding: 0 var(--b-space-2); border-radius: 8px; text-align: center;
  font: 500 var(--b-t-callout)/1.2 var(--b-font-body); color: var(--b-ink-2);
  transition: background-color var(--b-dur) var(--b-ease), box-shadow var(--b-dur) var(--b-ease);
}
.a-seg__opt input:checked + span { background: var(--b-surface); color: var(--b-ink); font-weight: 600; box-shadow: var(--b-e1); }
.a-seg__opt input:focus-visible + span { outline: 3px solid var(--b-focus); outline-offset: 1px; }
.a-seg + .b-hint { margin-top: calc(var(--b-space-3) - var(--b-field-gap)); }
.a-factura__campos { display: flex; flex-direction: column; gap: var(--b-field-gap); }

/* Combobox de clases (lista en el flujo: no tapa el botón de guardar) */
.a-combo { position: relative; }
.a-combo__list {
  margin: 6px 0 0; max-height: 240px; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px; list-style: none; background: var(--b-surface); border: 1px solid var(--b-line-strong); border-radius: var(--b-r-sm);
}
.a-combo__opt {
  display: flex; gap: var(--b-space-3); align-items: center; min-height: var(--b-tap); padding: 8px 12px; border-radius: var(--b-r-xs); cursor: pointer;
  font-size: var(--b-t-callout); line-height: var(--b-lh-callout);
}
.a-combo__opt b { font-family: var(--b-font-mono); font-weight: 600; color: var(--b-ink-2); flex: none; width: 1.8em; font-variant-numeric: tabular-nums; }
.a-combo__opt span { flex: 1; min-width: 0; }
.a-combo__opt:hover, .a-combo__opt.is-active { background: var(--b-surface-2); }
.a-combo__opt[aria-selected="true"] { color: var(--b-link); }
.a-combo__check { width: 18px; height: 18px; flex: none; color: var(--b-link); }
.a-combo__empty { padding: 12px; color: var(--b-ink-2); font-size: var(--b-t-callout); }
.a-chips { display: flex; flex-wrap: wrap; gap: var(--b-space-2); }
.a-chips:empty { display: none; }
.a-chips .b-chip b { font-family: var(--b-font-mono); font-weight: 600; }
