/* ============================================================
   Portal de Agricultores — Agrotop
   Sistema de diseño compartido, tomado de DESIGN-SYSTEM-AGROTOP.md
   (extraído de la propuesta de rediseño del AppHub, Aenimas/ux-hub).
   ============================================================ */

@font-face {
  font-family: "Montserrat";
  src: url("Montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============ TOKENS ============ */
:root {
  --accent: #FC2D45;
  --accent-soft: #FC2D451a;
  --accent-text: #C4142F;
  --accent-ink: #ffffff;
  --green: #008040;
  --orange: #FF9F48;

  --paper: #CECECE;
  --surface: #FFFFFF;
  --surface-2: #CECECE;
  --card: #F0F0F0;
  --card-border: rgba(0, 0, 0, 0.10);
  --border: #CECECE;
  --ink: #221B1C;
  --ink-muted: #5C5555;
  --shadow: rgba(40, 24, 24, 0.10);
  --shadow-lift: rgba(40, 24, 24, 0.18);
  --ring: #FC2D45;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1440px;
}

/* Modo claro fijo a propósito: esta es una pieza de propuesta para mostrar
   al equipo de desarrollo, no una app con preferencia de tema del usuario. */

/* ============ BASE ============ */
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ============ SHELL BAR ============ */
.shell {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--border);
}
.shell-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.brand .brand-word { font-weight: 800; font-size: 15px; color: var(--ink); white-space: nowrap; }
.divider-v { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.shell-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.shell-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}
.shell-user .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}
.shell-user .name { font-weight: 600; }
.shell-user .name small { display: block; font-weight: 500; color: var(--ink-muted); font-size: 11.5px; }
.shell-user .logout { color: var(--ink-muted); text-decoration: underline; text-decoration-color: var(--border); cursor: pointer; background: none; border: none; padding: 13px 6px; margin: -13px -6px; font-size: 13px; flex-shrink: 0; }
.shell-user .logout:hover { color: var(--accent-text); text-decoration-color: var(--accent-text); }
.shell-user .logout-short { display: none; }
@media (max-width: 860px) {
  .shell-title, .divider-v, .shell-user .name { display: none; }
  .shell-inner { gap: 12px; padding: 12px 16px; }
}
/* Debajo de ~420px (celular angosto) no cabe "Portal Agricultores" +
   avatar + "Cerrar sesión" completo — se prioriza que el botón de salir
   quede siempre entero y tocable, en vez de cortado a la mitad. */
@media (max-width: 420px) {
  .brand .brand-word { display: none; }
  .shell-user .logout-full { display: none; }
  .shell-user .logout-short { display: inline; }
}

/* ============ PAGE / LAYOUT ============ */
.page { max-width: var(--maxw); margin: 0 auto; padding: 30px 28px 64px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; }
.page-head .sub { color: var(--ink-muted); font-size: 14px; margin-top: 6px; }
.breadcrumb { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.layout { display: flex; gap: 32px; align-items: flex-start; }
.sidebar { width: 228px; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 88px; gap: 4px; }
.main { flex: 1; min-width: 0; }

.chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.chip[aria-current="page"] { background: var(--accent-text); color: var(--accent-ink); border-color: var(--accent-text); }
.chip:hover:not([aria-current="page"]) { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 39; }
@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 280px; max-width: 85vw; height: 100%;
    z-index: 40; background: var(--paper); padding: 20px; overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow-lift);
    transform: translateX(-100%); transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .chip { border-color: var(--border); }
}

/* ============ TILES (grilla del hub) ============ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.tile {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 168px;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px var(--shadow-lift); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tile-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-text); }
.tile-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.tile p { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.tile-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent-text); }
.tile-foot svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; transition: transform 0.15s; }
.tile:hover .tile-foot svg, .tile:focus-visible .tile-foot svg { transform: translateX(3px); }
.tile-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; background: var(--orange); color: var(--ink); }

/* ============ SECTIONS ============ */
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); font-weight: 700; }
.section-head .line { flex: 1; height: 1px; background: var(--border); min-width: 24px; }

/* ============ CARD (contenedor genérico) ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }
.card-head .sub { font-size: 12.5px; color: var(--ink-muted); }

/* ============ BOTONES ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent-text); color: var(--accent-ink); }
.btn-primary:hover { background: #a10f27; }
.btn-outline { background: var(--surface); color: var(--accent-text); border-color: var(--accent-text); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--ink-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-muted); }
.btn-sm { min-height: 36px; padding: 7px 13px; font-size: 12.5px; }

/* ============ SELECT DE FILTRO (fuera de un <form>, ej. cabecera de tabla) ============ */
.select-filter {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 34px 0 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235C5555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 10px center;
  background-size: 16px;
  cursor: pointer;
}
.select-filter:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 1px; }

/* ============ SELECT DE TEMPORADA (chips horizontales) ============ */
.season-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.season-tabs a, .season-tabs span {
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; color: var(--ink-muted); border: 1px solid var(--border);
  min-height: 32px; display: inline-flex; align-items: center;
}
.season-tabs a:hover { color: var(--accent-text); border-color: var(--accent-text); }
.season-tabs .active { background: var(--accent-text); color: var(--accent-ink); border-color: var(--accent-text); }

/* ============ TABLA ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
table.data td { padding: 10px 10px; border-bottom: 1px solid var(--border); color: var(--ink); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { padding: 12px 14px; font-weight: 700; background: var(--surface-2); }

/* En celular una tabla con muchas columnas obliga a hacer scroll horizontal
   y se pierde de vista a qué fila corresponde cada dato — difícil para
   alguien poco acostumbrado a esto. Bajo 640px cada fila se convierte en su
   propia tarjeta con pares etiqueta/valor apilados (misma técnica que ya usa
   el resto del sitio para listas — nada nuevo que aprender). Cada <td> debe
   traer `data-label="Nombre columna"` para que el pseudo-elemento lo muestre;
   sin ese atributo, la etiqueta simplemente no aparece (no rompe nada). */
@media (max-width: 860px) {
  .table-wrap { border: none; background: transparent; overflow: visible; }
  table.data { white-space: normal; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tfoot, table.data tr, table.data td { display: block; width: 100%; }
  table.data tbody tr, table.data tfoot tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    padding: 2px 14px;
  }
  table.data tbody tr:hover { background: var(--surface); }
  /* Etiqueta y valor en la misma línea, fluyendo como texto normal (sin
     flex) — así el navegador puede hacer wrap solo si el valor es largo
     ("Predio Los Álamos — Trigo"), y queda compacto en una sola línea
     cuando es corto (la mayoría de los casos: "NRO: 10482"). Un intento
     anterior con flex+justify-content se veía más prolijo pero un valor
     largo se salía de la tarjeta en vez de saltar de línea — texto plano
     con wrap normal no tiene ese problema. */
  table.data td {
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
    line-height: 1.5;
  }
  table.data td:empty { display: none; }
  table.data td:last-child { border-bottom: none; }
  table.data td[data-label]::before {
    content: attr(data-label) ":  ";
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-muted);
  }
  table.data td.num { text-align: left; }
  table.data td .btn { width: 100%; margin-top: 4px; }
  table.data tfoot tr { background: var(--surface-2); font-weight: 700; }
}

/* ============ BADGES DE ESTADO ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: #0080401a; color: var(--green); }
.badge-warn { background: #FF9F481a; color: #a3600c; }
.badge-pending { background: rgba(92,85,85,0.12); color: var(--ink-muted); }
.badge-alert { background: var(--accent-soft); color: var(--accent-text); }

/* ============ FORMULARIOS ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.field .hint { font-size: 11.5px; color: var(--ink-muted); }
.field input, .field select, .field textarea {
  min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 13.5px; color: var(--ink); background: var(--surface);
}
.field textarea { min-height: 96px; resize: vertical; padding-top: 10px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 1px; }
.field-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ============ FOTO ADJUNTA (Solicitar Visita) ============ */
.photo-upload-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.photo-upload-trigger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 84px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--ink-muted); font-size: 13px; font-weight: 700; cursor: pointer; background: var(--surface-2);
}
.photo-upload-trigger[hidden] { display: none; } /* [hidden] normal no le gana al display:flex de arriba */
.photo-upload-trigger:hover, .photo-upload-input:focus-visible + .photo-upload-trigger {
  border-color: var(--accent-text); color: var(--ink);
}
.photo-upload-trigger svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.photo-preview { position: relative; display: inline-block; }
.photo-preview[hidden] { display: none; }
.photo-preview img {
  max-width: 220px; max-height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: block; object-fit: cover;
}
.photo-remove {
  position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid var(--surface); font-size: 14px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.photo-error { font-size: 12px; color: var(--accent-text); margin-top: 4px; }

/* ============ AVISO DE NOTIFICACIÓN (Solicitar Visita) ============ */
.notify-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: #0080401a;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.5;
}
.notify-hint svg { width: 18px; height: 18px; stroke: var(--green); fill: none; stroke-width: 1.8; flex-shrink: 0; }
.notify-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: #0080401a; color: var(--green);
}
.notify-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============ TIMELINE (Torre de Control / Bitácora) ============ */
.steps { display: flex; align-items: center; gap: 0; margin: 6px 0 4px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-muted); border: 2px solid var(--border); font-size: 13px; font-weight: 800; z-index: 1; }
.step .label { font-size: 11.5px; font-weight: 700; color: var(--ink-muted); text-align: center; }
.step .time { font-size: 11px; color: var(--ink-muted); }
.step::after { content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.step:last-child::after { display: none; }
.step.done .dot { background: var(--green); color: #fff; border-color: var(--green); }
.step.done .label { color: var(--ink); }
.step.done::after { background: var(--green); }
.step.current .dot { background: var(--accent-text); color: #fff; border-color: var(--accent-text); }
.step.current .label { color: var(--ink); }
@media (max-width: 640px) { .steps { flex-direction: column; align-items: flex-start; gap: 18px; } .step { flex-direction: row; width: 100%; } .step::after { top: 0; left: 14px; width: 2px; height: 100%; } .step .label, .step .time { text-align: left; } }

.visit-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.visit-item[hidden] { display: none; } /* .visit-item ya trae display:flex propio, que sin esto le gana a la regla [hidden] del navegador */
.visit-item:last-child { border-bottom: none; }
.visit-item .visit-date { width: 78px; flex-shrink: 0; text-align: center; }
.visit-item .visit-date .d { font-size: 20px; font-weight: 800; line-height: 1; }
.visit-item .visit-date .m { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.visit-item .visit-body h4 { font-size: 14px; margin-bottom: 3px; }
.visit-item .visit-body .meta { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.visit-item .visit-body p { font-size: 13.5px; color: var(--ink); }

/* ============ NOTA DE TRANSPARENCIA IA ============ */
.ai-note {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 28px;
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
}
.ai-note.top { padding-top: 14px; }
.ai-note.bottom { padding-bottom: 24px; }

/* ============ MODAL (Detalle) ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(34, 27, 28, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-dialog {
  background: var(--surface); border-radius: var(--radius);
  max-width: 720px; width: 100%; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 20px 60px var(--shadow-lift);
  transform: translateY(10px); transition: transform 0.15s ease;
}
.modal-overlay.show .modal-dialog { transform: translateY(0); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h3 { font-size: 16px; }
.modal-head .sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; }
.modal-close {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.modal-close:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.modal-body { padding: 18px 20px; }
.modal-body table.data { font-size: 12.5px; }
.modal-body .table-wrap { margin-bottom: 14px; }
.modal-body h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); margin: 0 0 8px; }
.modal-foot-row { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 13.5px; border-top: 1px solid var(--border); }
.modal-foot-row.total { font-weight: 800; background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .modal-overlay, .modal-dialog { transition: none; } }

/* ============ LOGIN / RECUPERAR CLAVE ============ */
.auth-page {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  border-top: 4px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.22);
}
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }

.auth-panel-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; justify-content: center; }
.auth-panel-brand img { height: 30px; width: auto; }
.auth-panel-brand span { font-weight: 800; font-size: 15px; color: var(--ink); }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.auth-card .sub { font-size: 13px; color: var(--ink-muted); margin-bottom: 24px; line-height: 1.5; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card form[hidden] { display: none; }
.auth-card .btn { width: 100%; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; flex-wrap: wrap; gap: 8px; }
.auth-links a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-message {
  border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 18px;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.5;
}
.auth-message svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; }
.auth-message.error { background: var(--accent-soft); color: var(--accent-text); }
.auth-message.ok { background: #0080401a; color: var(--green); }
.auth-message[hidden] { display: none; }
.auth-footer-note { text-align: center; font-size: 12px; color: var(--ink-muted); margin-top: 22px; }
.auth-demo-hint { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--ink-muted); line-height: 1.6; }
.auth-demo-hint code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ============ EMPTY / NOTE ============ */
.empty { padding: 40px 0; text-align: center; color: var(--ink-muted); font-size: 14px; }
.pitch-note { margin-top: 40px; padding: 16px 18px; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--ink-muted); line-height: 1.6; }
.pitch-note strong { color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
