/* ============================================================
   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; }

/* ============ CAMPANA DE NOTIFICACIONES ============ */
.notif-bell { position: relative; }
.notif-trigger {
  position: relative; width: 32px; height: 32px; border-radius: 50%; border: none;
  background: transparent; color: var(--ink-muted); display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0; padding: 0;
}
.notif-trigger:hover, .notif-trigger[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
.notif-trigger svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.notif-count {
  position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--accent-text); color: #fff; font-size: 9.5px; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
}
.notif-count[hidden] { display: none; }
.notif-panel {
  position: absolute; top: calc(100% + 12px); right: -6px; width: 300px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px var(--shadow-lift); z-index: 60; overflow: hidden; white-space: normal;
}
.notif-panel[hidden] { display: none; }
.notif-panel-head { padding: 12px 14px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); border-bottom: 1px solid var(--border); }
.notif-list { list-style: none; max-height: 320px; overflow-y: auto; }
.notif-item { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-item-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.notif-item-meta .badge { font-size: 11px; padding: 2px 8px; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--ink-muted); font-size: 12.5px; }
@media (max-width: 420px) {
  .notif-panel { position: fixed; top: 62px; right: 10px; left: 10px; width: auto; max-width: 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; }
/* Pie con la versión del despliegue (lo rellena assets/nav.js). margin-top:auto
   lo empuja al fondo cuando el sidebar tiene alto libre (p. ej. el cajón en celular). */
.sidebar-version { margin-top: auto; padding: 12px 8px 4px; font-size: 11px; color: var(--ink-muted); text-align: center; }
.sidebar-version:empty { display: none; }
.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); }
}

/* ============ BARRA INFERIOR (solo celular) ============ */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-muted); text-decoration: none;
  }
  .tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ============ 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); }

/* ============ TWISTIE (expandir/colapsar tarjeta en celular) ============ */
/* Oculto por defecto -- solo aparece dentro del media query de tabla-a-tarjeta
   de abajo (max-width: 860px), nunca en la tabla normal de escritorio. Tiene
   que quedar declarado ANTES de ese media query: misma especificidad, así
   que si quedara después le ganaría en la cascada y el twistie no aparecería
   nunca en celular (justo lo que pasó la primera vez). */
.twistie-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink-muted); cursor: pointer;
}
.twistie-btn:hover { color: var(--accent-text); border-color: var(--accent-text); }
.twistie-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
tr.expandida .twistie-btn svg { transform: rotate(180deg); }

/* ============ 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 tr de arriba ya trae su propio display:block, que le gana a
     la regla [hidden] del navegador -- mismo problema ya documentado para
     .visit-item/.photo-preview más abajo en este archivo. Sin esto, ocultar
     una fila desde JS (fila.hidden = true, filtro o paginación) no hacía
     nada visualmente en la vista de tarjetas. */
  table.data tr[hidden] { display: none; }
  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; }

  /* Twistie: los datos secundarios de cada tarjeta (todo lo que no sea
     Nro/Llegada/Cultivo/Estado) empiezan ocultos y se muestran al tocar el
     chevrón — la tarjeta arranca compacta, con lo justo para identificar la
     recepción de un vistazo. */
  .twistie-btn { display: inline-flex; }
  table.data td.fila-detalle { display: none; }
  table.data tr.expandida td.fila-detalle { display: block; }
  table.data td .row-actions { display: flex; align-items: center; gap: 10px; }
  table.data td .row-actions .btn { width: auto; flex: 1; margin-top: 0; }
}

/* ============ PAGINADOR (listas largas: Recepciones, Liquidaciones) ============ */
/* Se oculta solo (ver JS) cuando hay una sola página — no tiene sentido
   mostrar "Página 1 de 1" con los botones siempre deshabilitados. */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.pager-info { font-size: 12.5px; color: var(--ink-muted); font-weight: 600; }
.pager .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .btn:disabled:hover { color: var(--ink-muted); border-color: var(--border); }

/* ============ 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; min-width: 0; }
.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 {
  width: 100%; 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); }

/* ============ 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; }

/* ============ DASHBOARD DE INICIO ============ */
.dash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.dash-kpi { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 3px var(--shadow); }
/* Clima (assets/clima.js) */
.clima-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 1px 3px var(--shadow); margin-bottom: 8px; }
.clima-tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.clima-tabla thead th { padding: 8px 6px; color: var(--ink-muted); font-weight: 700; text-align: center; border-bottom: 1px solid var(--card-border); }
.clima-tabla tbody tr + tr > * { border-top: 1px solid var(--card-border); }
.clima-tabla .clima-centro { text-align: left; padding: 7px 10px; min-width: 170px; position: sticky; left: 0; background: var(--card); }
.clima-nombre { font-weight: 700; }
.clima-aviso { font-size: 11px; white-space: normal; overflow-wrap: anywhere; color: var(--ink-muted); font-weight: 600; }
.clima-aviso.clima-lluvia { color: var(--accent-text); }
.clima-celda { text-align: center; padding: 7px 4px; }
.clima-temp { font-weight: 700; white-space: nowrap; }
.clima-dato { color: var(--ink-muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 560px) { .clima-tabla .clima-centro { min-width: 140px; padding: 6px 8px; } .clima-celda { padding: 6px 2px; } .clima-dato { font-size: 10px; } }
.dash-kpi-label {font-size: 12.5px; color: var(--ink-muted); font-weight: 600; }
.dash-kpi-valor { font-size: 26px; font-weight: 800; margin-top: 2px; }
.dash-kpi-cmp { font-size: 12.5px; margin-top: 2px; min-height: 19px; }
.dash-delta.bien { color: var(--green); font-weight: 700; }
.dash-delta.mal { color: var(--accent-text); font-weight: 700; }
.dash-delta.neutro { color: var(--ink-muted); font-weight: 600; }
.dash-sem { margin-top: 10px; }
.dash-sem-barra { position: relative; display: flex; height: 10px; margin: 6px 0; }
.dash-sem-barra span { display: block; height: 100%; }
.dash-sem-barra span:first-of-type { border-radius: 5px 0 0 5px; }
.dash-sem-barra span:last-of-type { border-radius: 0 5px 5px 0; }
.dash-sem-barra i { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--ink); border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.dash-sem-estado { font-size: 12.5px; margin-top: 6px; color: var(--ink-muted); }
.dash-mock { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); }
.dash-leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12.5px; color: var(--ink-muted); margin: 4px 0 16px; }
.dash-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.dash-leyenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ficha-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 8px 0; }
.ficha-res { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 3px var(--shadow); display: block; width: 100%; }
.ficha-res:hover, .ficha-res:focus-visible { border-color: var(--accent); }
.ficha-res-cab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-muted); }
.ficha-res-cab b { font-size: 16px; color: var(--ink); }
.ficha-fila { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.ficha-fila-n { display: flex; align-items: center; gap: 6px; }
.ficha-fila .ficha-punto { width: 9px; height: 9px; }
.ficha-fila .dash-sem { grid-column: 1 / -1; margin-top: 3px; }
.ficha-fila .dash-sem-barra { height: 5px; }
.ficha-fila .dash-sem-barra i { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 2px; }
.ficha-fila .dash-sem-estado { display: none; }
.ficha-res-ver { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--accent-text); }
.ficha-caja { border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--surface); margin-top: 14px; padding: 0 16px; }
.ficha-caja[open] { padding-bottom: 14px; }
.ficha-caja-titulo { cursor: pointer; font-size: 18px; font-weight: 800; color: var(--ink); min-height: 48px; display: flex; align-items: center; list-style: none; }
.ficha-caja-titulo::-webkit-details-marker { display: none; }
.ficha-caja-titulo::before { content: "▸"; display: inline-block; width: 1.2em; transition: transform .15s; }
.ficha-caja[open] > .ficha-caja-titulo::before { transform: rotate(90deg); }
.ficha-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 8px; }
@media (max-width: 640px) { .ficha-grid { grid-template-columns: 1fr; } }
.ficha-param-cab { display: flex; justify-content: space-between; align-items: center; }
.ficha-punto { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.ficha-valores { display: flex; gap: 22px; align-items: flex-end; margin-top: 2px; }
.ficha-prom { font-size: 18px; font-weight: 700; color: var(--ink-muted); }
.ficha-sub { font-size: 12px; color: var(--ink-muted); }
.ficha-proys { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ficha-proys .ficha-proy { margin-bottom: 0; }
.ficha-proy-cultivo { font-size: 12.5px; font-weight: 700; opacity: .9; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ficha-proy { background: var(--green); color: #fff; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.ficha-proy h3 { font-size: 15px; margin: 0; }
.ficha-proy-valor { font-size: 34px; font-weight: 800; margin: 4px 0; }
.ficha-proy p { margin: 0; font-size: 13.5px; }
.dash-privado { font-size: 12.5px; color: var(--ink-muted); }
.dash-section-title { font-size: 16px; margin: 28px 0 14px; }
@media (max-width: 640px) { .dash-kpis { grid-template-columns: 1fr; } }
.dash-camiones .dash-kpi { border-left: 6px solid var(--ink-muted); }
.dash-cam-porteria { border-left-color: var(--orange) !important; }
.dash-cam-planta { border-left-color: var(--accent-text) !important; }
.dash-cam-liberados { border-left-color: var(--green) !important; }
.dash-cultivo-titulo { font-size: 18px; margin: 22px 0 4px; }
.dash-cultivo-sub { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 12px; }
.dash-kpi-vars { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--card-border); font-size: 12.5px; }
.dash-kpi-vars li { display: flex; justify-content: space-between; gap: 10px; }
.dash-kpi-vars strong { white-space: nowrap; }
.dash-kpis-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .dash-kpis-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .dash-kpis-4 { grid-template-columns: 1fr; } }
.dash-camiones .dash-kpi-cmp { white-space: pre-line; }

/* Camiones: tarjetas compactas. En celular van las 3 en una sola fila. */
.dash-camiones-titulo { margin-top: 0; }
.dash-unidad { font-size: 15px; font-weight: 700; }
@media (max-width: 640px) {
  .dash-camiones { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dash-camiones .dash-kpi { padding: 10px 10px 10px 12px; border-left-width: 5px; }
  .dash-camiones .dash-kpi-label { font-size: 11.5px; min-height: 3em; }
  .dash-camiones .dash-kpi-valor { font-size: 24px; }
  .dash-camiones .dash-unidad { display: block; font-size: 11px; font-weight: 600; color: var(--ink-muted); margin-top: -2px; }
  .dash-camiones .dash-kpi-cmp { font-size: 11px; min-height: 0; }
}

/* ============ CUADERNO DEL AGRICULTOR ============
   Pensado para usarse con el pulgar en el campo: botones grandes (≥44px, la mayoría ≥56px),
   íconos con texto, pocas escrituras y un asistente por pasos. */
.cuad-cta { display: flex; width: 100%; min-height: 60px; font-size: 17px; border-radius: 14px; justify-content: center; gap: 10px; margin-bottom: 18px; }
.cuad-cta svg { width: 24px; height: 24px; }

/* Pestañas por tipo de actividad (ícono + nombre), con desplazamiento horizontal en el celular */
.cuad-cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cuad-cat {
  flex: 0 0 auto; scroll-snap-align: start; min-width: 88px; min-height: 80px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px; color: var(--ink-muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.cuad-cat svg, .cuad-tile svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cuad-cat svg { width: 28px; height: 28px; }
.cuad-cat:hover { color: var(--accent-text); border-color: var(--accent-text); }
.cuad-cat[aria-pressed="true"] { background: var(--accent-text); border-color: var(--accent-text); color: var(--accent-ink); }
.cuad-cat:focus-visible, .cuad-tile:focus-visible, .cuad-opcion:focus-visible, .cuad-chip:focus-visible, .cuad-seg button:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 2px; }

/* Selector de 2 o 3 opciones (todas / por hacer / hechas) */
.cuad-seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.cuad-seg button { min-height: 44px; padding: 0 16px; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-muted); cursor: pointer; }
.cuad-seg button[aria-pressed="true"] { background: var(--accent-text); color: var(--accent-ink); }
.cuad-filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

/* Asistente por pasos */
.cuad-steps { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 20px; }
.cuad-step { flex: 1; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-muted); }
.cuad-step .dot { width: 36px; height: 36px; margin: 0 auto 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); background: var(--surface); font-size: 14px; }
.cuad-step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.cuad-step.current .dot { border-color: var(--accent-text); color: var(--accent-text); }
.cuad-step.current { color: var(--ink); }
.cuad-pregunta { font-size: 21px; font-weight: 800; margin: 0 0 4px; line-height: 1.25; }
.cuad-ayuda { color: var(--ink-muted); font-size: 13.5px; margin: 0 0 16px; }
.cuad-bloque { margin-bottom: 22px; }
.cuad-bloque > label, .cuad-bloque > .cuad-titulo { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.cuad-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .cuad-tiles { grid-template-columns: repeat(2, 1fr); } }
.cuad-tile {
  min-height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.cuad-tile svg { width: 38px; height: 38px; color: var(--accent-text); }
.cuad-tile[aria-pressed="true"] { border-color: var(--accent-text); background: var(--accent-soft); }

.cuad-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cuad-chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.cuad-chip:hover { border-color: var(--accent-text); color: var(--accent-text); }

.cuad-opciones { display: grid; gap: 10px; }
.cuad-opcion {
  min-height: 58px; width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface);
  border: 2px solid var(--border); border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.cuad-opcion small { display: block; font-weight: 500; color: var(--ink-muted); font-size: 12.5px; }
.cuad-opcion[aria-pressed="true"] { border-color: var(--accent-text); background: var(--accent-soft); }
.cuad-opcion .marca { margin-left: auto; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--border); }
.cuad-opcion[aria-pressed="true"] .marca { background: var(--accent-text); border-color: var(--accent-text); box-shadow: inset 0 0 0 4px var(--accent-soft); }

.cuad-nav { display: flex; gap: 10px; margin-top: 24px; }
.cuad-nav .btn { flex: 1; min-height: 54px; font-size: 15px; }

.cuad-resumen > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cuad-resumen span { color: var(--ink-muted); }
.cuad-resumen strong { text-align: right; }
.cuad-resumen .btn { flex: 0 0 auto; }

/* Evita que una fila con desplazamiento horizontal (ej. las pestañas del Cuaderno) ensanche toda la página en el celular */
.layout > .main { width: 100%; max-width: 100%; }
.layout > .main, .main > .card { min-width: 0; }
.cuad-filtros .select-filter { max-width: 100%; }

/* Un elemento con el atributo hidden debe quedar oculto aunque su clase le ponga display (ej. .field) */
[hidden] { display: none !important; }

/* Resumen del asistente del Cuaderno en pantallas chicas: etiqueta arriba, valor y botón debajo */
@media (max-width: 640px) {
  .cuad-resumen > div { flex-wrap: wrap; }
  .cuad-resumen span { flex: 0 0 100%; font-size: 12px; }
  .cuad-resumen strong { flex: 1; text-align: left; }
}
