/* Argenbras Gestión — sistema visual (navy + dorado + crema, heredado de Gestión Piasstra). */

:root {
  --navy: #0b3444;       /* primario: header, botones, tabs, dark surfaces */
  --navy-dark: #07242f;  /* hover primario */
  --navy-soft: #1d5a70;  /* links / hover claro */
  --gold: #f4695a;       /* acento decorativo (líneas, sobre navy) */
  --gold-ink: #c94c3e;   /* dorado legible sobre fondo claro (eyebrows) */
  --cream: #f4ede1;
  --cream-soft: #f4f1ea; /* hover/tints suaves */
  --bg: #f2ede4;         /* fondo de la app (crema) */
  --ink: #1a2935;        /* texto principal */
  --muted: #5a6675;
  --muted2: #8a96a4;
  --line: #e3e9ef;
}

* { box-sizing: border-box; }
/* Tipografía Montserrat. Se carga vía Google Fonts en _layout.php. */
html, body { margin: 0; padding: 0; font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
/* Los controles de formulario no heredan la tipografía por default — forzarla. */
input, select, textarea, button { font-family: inherit; }

/* =================== HEADER (topbar navy) =================== */
/* El fondo navy va full-width; el contenido se centra a 1400px (alineado con .gst-main). */
.gst-header { background: var(--navy); border-bottom: 3px solid var(--gold); }
.gst-header .gst-wrap {
  max-width: 1400px; margin: 0 auto; padding: 11px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.gst-brand { display: flex; align-items: center; gap: 12px; }
.gst-logo { height: 40px; }
.gst-brand-text strong { display: block; font-size: 14px; color: #fff; letter-spacing: 0.5px; }
.gst-brand-text small { display: block; font-size: 11px; color: var(--gold); }
.gst-user-icons { display: flex; gap: 6px; }
.gst-icon-btn {
  display: inline-flex; align-items: center; padding: 6px 12px; background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 16px; text-decoration: none; font-size: 12px; font-weight: 600;
}
.gst-icon-btn:hover { background: rgba(255,255,255,0.12); }

/* Menú del usuario (ícono persona) — reemplaza el bloque viejo con
   nombre+fecha visible en el header. Click al ícono abre popover con
   nombre, fecha actual y link de logout. */
.gst-user-menu { position: relative; }
.gst-user-menu > summary { list-style: none; cursor: pointer; padding: 6px 10px; }
.gst-user-menu > summary::-webkit-details-marker { display: none; }
.gst-user-btn { display: inline-flex; align-items: center; gap: 0; }
.gst-user-pop {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
  z-index: 200; overflow: hidden;
}
.gst-user-pop-h {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--cream-soft);
}
.gst-user-pop-h strong { display: block; font-size: 13px; color: var(--ink); }
.gst-user-pop-h small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.gst-user-pop a {
  display: block; padding: 10px 14px; font-size: 13px;
  color: var(--ink); text-decoration: none;
}
.gst-user-pop a:hover { background: var(--cream-soft); color: var(--navy); }

/* =================== TOPNAV =================== */
.gst-topnav { background: #fff; border-bottom: 1px solid var(--line); }
.gst-topnav .gst-wrap-nav {
  max-width: 1400px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-wrap: wrap; gap: 2px; justify-content: center;
}
.gst-mod { position: relative; }
.gst-mod-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 18px; text-decoration: none; color: var(--muted); min-width: 80px;
  border-bottom: 3px solid transparent; transition: all 0.15s;
}
.gst-mod-icon { font-size: 22px; line-height: 1; }
.gst-mod-label { font-size: 11px; font-weight: 600; }
.gst-mod:hover .gst-mod-btn { background: #f7f9fb; color: var(--navy); }
.gst-mod.is-active .gst-mod-btn { color: var(--navy); border-bottom-color: var(--gold); background: var(--cream-soft); }

.gst-submenu {
  position: absolute; top: 100%; left: 0; min-width: 160px;
  background: #fff; border: 1px solid var(--line); border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); display: none; z-index: 100;
}
.gst-mod.has-sub:hover .gst-submenu { display: block; }
.gst-submenu a {
  display: block; padding: 9px 14px; text-decoration: none; color: var(--ink); font-size: 13px;
  border-bottom: 1px solid #f0f2f5;
}
.gst-submenu a:last-child { border-bottom: 0; }
.gst-submenu a:hover { background: var(--cream-soft); color: var(--navy); }

/* Sub-submenú (hover sobre un item del submenú con sub-items). */
.gst-submenu-item { position: relative; }
.gst-submenu-item > a { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; text-decoration: none; color: var(--ink); font-size: 13px; border-bottom: 1px solid #f0f2f5; }
.gst-submenu-item:last-child > a { border-bottom: 0; }
.gst-submenu-item > a:hover { background: var(--cream-soft); color: var(--navy); }
.gst-subsub-chev { font-size: 11px; color: var(--muted2); margin-left: 12px; }
.gst-submenu-item.has-subsub > a:hover .gst-subsub-chev { color: var(--gold-ink); }

.gst-subsubmenu {
  position: absolute; top: -1px; left: 100%; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 0 6px 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); display: none; z-index: 110;
}
.gst-submenu-item.has-subsub:hover .gst-subsubmenu { display: block; }
.gst-subsubmenu a { display: block; padding: 9px 14px; text-decoration: none; color: var(--ink); font-size: 13px; border-bottom: 1px solid #f0f2f5; }
.gst-subsubmenu a:last-child { border-bottom: 0; }
.gst-subsubmenu a:hover { background: var(--cream-soft); color: var(--navy); }

/* =================== MAIN =================== */
/* Contenido más angosto y centrado (estilo SaaS); el topbar/nav siguen full a 1400. */
.gst-main { max-width: 1160px; margin: 0 auto; padding: 24px 20px; }

/* =================== CARDS / SECTIONS =================== */
.gst-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 22px; margin-bottom: 16px;
}
.gst-card-h {
  background: #f7f9fb; margin: -18px -22px 14px; padding: 12px 22px;
  border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0;
  display: flex; justify-content: space-between; align-items: center;
}
.gst-card-h .gst-title { display: flex; align-items: center; gap: 10px; }
.gst-card-h .gst-title-icon {
  width: 38px; height: 38px; background: #fff; border: 1px solid var(--line);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.gst-card-h h2 { margin: 0; font-size: 16px; color: var(--navy); }
/* Solo links DIRECTOS — los <a> del menú desplegable (.gst-menu-pop a) NO
   deben heredar este círculo. Antes el selector descendente los pintaba
   como circulitos azules y rompía el menú. */
.gst-card-h .gst-actions > a:not(.gst-btn) { padding: 5px 10px; background: var(--navy); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
/* Botones con texto en la cabecera (Imprimir, PDF…): botón normal, no círculo (2026-09-16). */
.gst-card-h .gst-actions > a.gst-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* Eyebrow / encabezado de sección — dorado uppercase */
.gst-section-h {
  color: var(--gold-ink); font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; background: transparent; padding: 0; margin-bottom: 10px;
}

/* =================== KPIs =================== */
.gst-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.gst-kpi { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 13px 16px; border-top: 3px solid var(--gold); }
.gst-kpi .lbl { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.gst-kpi .val { font-size: 22px; font-weight: 700; color: var(--navy); margin-top: 2px; }
.gst-kpi .sub { font-size: 11px; color: var(--muted2); }

/* =================== TABLAS =================== */
.gst-table { width: 100%; border-collapse: collapse; }
.gst-table th { background: #f7f9fb; padding: 9px 10px; text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.4px; border-bottom: 1px solid var(--line); }
.gst-table td { padding: 9px 10px; border-bottom: 1px solid #f0f2f5; font-size: 13px; vertical-align: middle; }
.gst-table tr:hover { background: var(--cream-soft); }
.gst-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.gst-table a { color: var(--navy-soft); text-decoration: none; }
.gst-table a:hover { text-decoration: underline; }

/* =================== FORMS =================== */
.gst-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 720px) { .gst-grid { grid-template-columns: 1fr; } }
.gst-grid label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.gst-grid input, .gst-grid select, .gst-grid textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d6dde5; border-radius: 5px;
  font-size: 13.5px; box-sizing: border-box; font-family: inherit;
}
.gst-grid .full { grid-column: 1 / -1; }

/* =================== BOTONES =================== */
.gst-btn {
  display: inline-block; padding: 8px 16px; border-radius: 4px; border: 1px solid #d6dde5;
  background: #fff; color: var(--ink); text-decoration: none; font-size: 13px; cursor: pointer; font-family: inherit;
}
.gst-btn:hover { background: var(--cream-soft); border-color: var(--navy); }
.gst-btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.gst-btn-primary:hover { background: var(--navy-dark); }
.gst-btn-gold    { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
.gst-btn-gold:hover { background: var(--gold-ink); color: #fff; }
.gst-btn-danger  { background: #c93030; border-color: #c93030; color: #fff; }
.gst-btn-ghost   { background: transparent; }

/* =================== FILTROS =================== */
.gst-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; margin-bottom: 14px; }
.gst-filters label { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px; }
.gst-filters input, .gst-filters select { width: 100%; padding: 7px 9px; border: 1px solid #d6dde5; border-radius: 4px; font-size: 13px; box-sizing: border-box; }
.gst-filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

/* =================== ALERTS =================== */
.gst-empty { background: #fff; border: 1px dashed #d6dde5; border-radius: 8px; padding: 30px; text-align: center; color: var(--muted); }
.gst-empty strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }

.gst-flash { padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; font-size: 13px; }
.gst-flash-ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.gst-flash-err { background: #fef2f2; border: 1px solid #fecaca; color: #c93030; }

/* Alias usado por las páginas nuevas de /gestion/ (mismo estilo que flash). */
.gst-msg     { padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; font-size: 13px; }
.gst-msg-ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.gst-msg-err { background: #fef2f2; border: 1px solid #fecaca; color: #c93030; }

/* =================== FORM =================== */
.gst-form label { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted2); letter-spacing: 0.5px; margin-bottom: 4px; font-weight: 600; }
.gst-form input[type=text], .gst-form input[type=email], .gst-form input[type=password],
.gst-form input[type=number], .gst-form input[type=date], .gst-form input[type=search],
.gst-form select, .gst-form textarea {
  width: 100%; padding: 7px 10px; border: 1px solid #d6dde5; border-radius: 5px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.gst-form input:focus, .gst-form select:focus, .gst-form textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(18,48,74,0.15);
}
.gst-form h3 { font-size: 13px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }

/* =================== AUTOCOMPLETE (búsqueda en vivo) =================== */
.gst-ac { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; box-shadow: 0 6px 16px rgba(0,0,0,.12); max-height: 340px; overflow: auto; }
.gst-ac a { display: block; padding: 8px 11px; text-decoration: none; color: var(--ink); border-bottom: 1px solid #f0f2f5; font-size: 13px; }
.gst-ac a:last-child { border-bottom: 0; }
.gst-ac a:hover, .gst-ac a.sel { background: var(--cream-soft); }
.gst-ac .nm { font-weight: 600; }
.gst-ac .meta { color: var(--muted2); font-size: 11.5px; }
.gst-ac .empty { padding: 10px 12px; color: var(--muted2); font-size: 12.5px; }
.gst-ac-lead {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  background: #fffbeb; color: #b8730a; border: 1px solid #fde68a;
  border-radius: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
  vertical-align: middle;
}

/* Tabs Clientes / Leads / Todos en gestion/clientes/. */
.gst-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.gst-tab {
  padding: 9px 16px; text-decoration: none; color: var(--muted);
  font-size: 13px; font-weight: 600; border-bottom: 3px solid transparent;
  margin-bottom: -1px; transition: all 0.12s;
}
.gst-tab:hover { color: var(--navy); background: var(--cream-soft); }
.gst-tab.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.gst-tab small { color: var(--muted2); font-weight: 500; margin-left: 4px; }
.gst-tab.is-active small { color: var(--gold-ink); }

/* =================== TARJETA COLAPSABLE (ficha) =================== */
details.gst-fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #f7f9fb; margin: -18px -22px 0; padding: 12px 22px; border-radius: 8px 8px 0 0; border-bottom: 1px solid var(--line); }
details.gst-fold > summary::-webkit-details-marker { display: none; }
details.gst-fold[open] > summary { margin-bottom: 16px; }
details.gst-fold > summary:hover { background: #eef1f5; }
.gst-fold-chev { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--navy); background: #fff; border: 1px solid var(--gold); border-radius: 14px; padding: 4px 12px; white-space: nowrap; }
.gst-fold-chev .lbl-open { display: none; }
details.gst-fold[open] .gst-fold-chev .lbl-closed { display: none; }
details.gst-fold[open] .gst-fold-chev .lbl-open { display: inline; }

/* =================== MENÚ "+" (crear documento) =================== */
.gst-menu { position: relative; display: inline-block; }
.gst-menu > summary { list-style: none; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.gst-menu > summary::-webkit-details-marker { display: none; }
.gst-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.14); z-index: 60; overflow: hidden; }
.gst-menu-pop a { display: block; padding: 9px 14px; text-decoration: none; color: var(--ink); font-size: 13px; border-bottom: 1px solid #f0f2f5; }
.gst-menu-pop a:last-child { border-bottom: 0; }
.gst-menu-pop a:hover { background: var(--cream-soft); color: var(--navy); }

/* =================== HOME DASHBOARD (filtros + 3 tarjetas Wallet) =================== */
/* Filtros temporales */
.gst-home-filtros {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 20px;
}
.gst-home-filtros-row { margin-bottom: 12px; }
.gst-home-filtros-row:last-of-type { margin-bottom: 0; }
.gst-home-filtros-lbl {
  font-size: 10.5px; font-weight: 700; color: var(--gold-ink);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px;
}
.gst-home-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gst-home-chips::-webkit-scrollbar { display: none; }
.gst-home-chip {
  flex-shrink: 0; padding: 7px 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 18px; cursor: pointer; font-family: inherit; font-size: 13px;
  color: var(--ink); font-weight: 500; min-width: 44px; text-align: center;
  text-decoration: none; transition: all 0.12s; user-select: none;
}
.gst-home-chip:hover { background: var(--cream-soft); border-color: var(--gold); }
.gst-home-chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.gst-home-chip.is-special { border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.gst-home-chip.is-special.is-active { background: var(--gold); color: #fff; border-color: var(--gold); }
.gst-home-filtro-resumen {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--cream-soft);
  border-radius: 12px; font-size: 11.5px; color: var(--muted); margin-top: 10px;
}
.gst-home-filtro-resumen b { color: var(--navy); }

/* Tarjetas estilo Apple Wallet */
.gst-home-stack { display: grid; gap: 14px; margin-bottom: 20px; perspective: 1000px; }
.gst-home-card {
  border-radius: 18px; padding: 24px 26px; color: #fff;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1);
}
.gst-home-card:hover { transform: translateY(-4px); }
.gst-home-card.cobrar { background: linear-gradient(140deg, #11503a 0%, #1d8a4a 60%, #66c490 100%); }
.gst-home-card.pagar  { background: linear-gradient(140deg, #5e0f0f 0%, #b13030 60%, #f29c9c 100%); }
.gst-home-card.op     { background: linear-gradient(140deg, #0a1b2b 0%, #244c79 60%, #6ea8d8 100%); }
/* Reflejo de luz tipo tarjeta de crédito real */
.gst-home-card::before {
  content: ''; position: absolute; top: -20%; right: -10%; width: 60%; height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 65%);
  pointer-events: none;
}
.gst-home-card-h {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 1.5px; opacity: 0.85; font-weight: 700;
}
.gst-home-card-h .gst-home-ic { font-size: 24px; }
.gst-home-big { font-size: 36px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.gst-home-sub { font-size: 13.5px; opacity: 0.88; margin: 6px 0 16px; }
.gst-home-rows {
  display: flex; justify-content: space-between; gap: 14px;
  padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
}
.gst-home-rows > div { flex: 1; min-width: 0; }
.gst-home-rows .lbl {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.6px; opacity: 0.7; margin-bottom: 2px;
}
.gst-home-rows .val { font-weight: 700; font-size: 13.5px; word-break: break-word; }
.gst-home-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  padding: 9px 16px; background: rgba(255, 255, 255, 0.22); color: #fff;
  text-decoration: none; border-radius: 30px; font-size: 12.5px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.4); backdrop-filter: blur(8px);
}
.gst-home-cta:hover { background: rgba(255, 255, 255, 0.32); }

@media (min-width: 900px) {
  .gst-home-stack { grid-template-columns: 1fr 1fr; }
  .gst-home-card.op { grid-column: 1 / -1; }
}

/* Mobile (≤ 600px): tarjetas más compactas, rows en grilla 2x2, CTA full-width */
@media (max-width: 600px) {
  .gst-home-filtros { padding: 12px 12px; margin-bottom: 14px; border-radius: 9px; }
  .gst-home-filtros-row { margin-bottom: 10px; }
  .gst-home-filtros-lbl { font-size: 10px; margin-bottom: 6px; }
  .gst-home-chip { padding: 7px 12px; font-size: 13px; }
  .gst-home-filtro-resumen { font-size: 11px; padding: 4px 9px; }

  .gst-home-stack { gap: 12px; margin-bottom: 16px; }
  .gst-home-card { padding: 18px 18px; border-radius: 14px; }
  /* Sin hover lift en touch — el efecto solo aplica con cursor real. */
  .gst-home-card:hover { transform: none; }

  .gst-home-card-h { margin-bottom: 14px; font-size: 11px; }
  .gst-home-card-h .gst-home-ic { font-size: 22px; }

  .gst-home-big { font-size: 26px; letter-spacing: -0.5px; }
  .gst-home-sub { font-size: 12.5px; margin: 4px 0 12px; }

  /* Rows: 2 columnas, no flex en línea — más legible en pantallas chicas */
  .gst-home-rows {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    padding-top: 10px;
  }
  .gst-home-rows > div { min-width: 0; }
  .gst-home-rows .lbl { font-size: 9.5px; }
  .gst-home-rows .val { font-size: 13px; }

  /* CTA centrado y full-width para tap fácil */
  .gst-home-cta {
    display: flex; justify-content: center; margin-top: 14px;
    padding: 11px 16px; width: 100%; box-sizing: border-box;
  }
}

/* Mobile chico (≤ 380px): rows en una sola columna, números más chicos */
@media (max-width: 380px) {
  .gst-home-big { font-size: 22px; }
  .gst-home-rows { grid-template-columns: 1fr; gap: 8px; }
  .gst-home-card { padding: 16px 16px; }
}

/* =================== PILLS / BADGES =================== */
.gst-pill { display: inline-block; padding: 2px 8px; border-radius: 11px; font-size: 10.5px; font-weight: 600; }
.gst-pill-ok      { background: #f0fdf4; color: #15803d; }
.gst-pill-warn    { background: #fffbeb; color: #b8730a; }
.gst-pill-err     { background: #fef2f2; color: #c93030; }
.gst-pill-neutral { background: #f0f2f5; color: #5a6675; }

/* =================== BOTTOM NAV (mobile, estilo app) =================== */
/* Por default oculto en desktop, se muestra solo en mobile via media query. */
.gst-bottomnav { display: none; }

/* Sheet/drawer "Más" — un native <details> que cuando está open muestra un */
/* overlay con los items secundarios. En desktop también oculto (no se abre). */
.gst-more-sheet { display: none; }
.gst-more-sheet[open] { display: block; }
.gst-more-sheet > summary { list-style: none; }
.gst-more-sheet > summary::-webkit-details-marker { display: none; }

/* =================== MOBILE (≤ 768px) =================== */
@media (max-width: 768px) {
  /* iOS no zoomea al focus si el input tiene font-size ≥ 16px. */
  input, select, textarea { font-size: 16px !important; }

  /* ----- Topbar compacto ----- */
  .gst-header .gst-wrap { padding: 8px 12px; }
  .gst-logo { height: 28px; }
  .gst-brand-text strong { font-size: 12px; }
  .gst-brand-text small { font-size: 10px; }
  .gst-icon-btn { padding: 5px 9px; font-size: 11px; }

  /* ----- Topnav desktop oculto, bottom nav en su lugar ----- */
  .gst-topnav { display: none; }

  /* ----- Main: padding chico, deja espacio abajo para el bottom nav ----- */
  .gst-main { padding: 14px 12px 84px; max-width: 100%; }

  /* ----- Cards más compactas ----- */
  .gst-card { padding: 13px 14px; margin-bottom: 12px; border-radius: 7px; }
  .gst-card-h { margin: -13px -14px 12px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .gst-card-h h2 { font-size: 14px; }
  .gst-card-h .gst-title-icon { width: 32px; height: 32px; font-size: 16px; }

  /* En la ficha del cliente el h2 tiene texto y un subtítulo grande — recorte. */
  .gst-card-h h2 { line-height: 1.25; word-break: break-word; }

  /* ----- KPIs 2 columnas (1 si es muy chiquito) ----- */
  .gst-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
  .gst-kpi { padding: 10px 12px; }
  .gst-kpi .val { font-size: 18px; }

  /* ----- Tablas con scroll horizontal en su wrapper natural ----- */
  /* El usuario tiene que envolver la tabla en algo con overflow; por las dudas */
  /* hacemos que la tabla misma scroll-x dentro de la card. */
  .gst-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gst-table { font-size: 12.5px; min-width: 100%; }
  .gst-table th, .gst-table td { padding: 7px 8px; }
  .gst-table th { font-size: 9.5px; }

  /* ----- Forms full-width ----- */
  .gst-grid { grid-template-columns: 1fr; gap: 10px; }
  .gst-filters { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }

  /* ----- Botones con touch target ≥ 44px ----- */
  .gst-btn { padding: 10px 14px; min-height: 40px; line-height: 1.2; }

  /* ----- Tabs scroll horizontal sin scrollbar visible ----- */
  .gst-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; scrollbar-width: none; }
  .gst-tabs::-webkit-scrollbar { display: none; }

  /* ----- Folds: el "Ver datos ▾" y el saldo apilados en mobile ----- */
  details.gst-fold > summary { flex-wrap: wrap; gap: 8px; padding: 10px 14px; margin: -13px -14px 0; }
  details.gst-fold[open] > summary { margin-bottom: 12px; }

  /* ----- Acciones rápidas / menu "+" ----- */
  .gst-menu > summary { width: 34px; height: 34px; font-size: 18px; }
  .gst-menu-pop { right: 0; min-width: 220px; max-width: calc(100vw - 24px); }
  .gst-menu-pop a { padding: 12px 16px; font-size: 14px; }

  /* ----- BOTTOM NAV visible en mobile ----- */
  .gst-bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 100; padding-bottom: env(safe-area-inset-bottom);
  }
  .gst-bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 6px; text-decoration: none; color: var(--muted);
    border: 0; background: transparent; cursor: pointer; font-family: inherit;
    min-height: 56px; justify-content: center;
  }
  .gst-bn-item.is-active { color: var(--navy); }
  .gst-bn-item.is-active .gst-bn-icon { transform: scale(1.05); }
  .gst-bn-icon { font-size: 22px; line-height: 1; }
  .gst-bn-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }
  .gst-bn-item.is-active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 28px; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px;
  }

  /* "Más" sheet — overlay desde abajo con los items secundarios. */
  .gst-more-sheet[open] > summary {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
    display: block;
  }
  .gst-more-pop {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-radius: 14px 14px 0 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    z-index: 201; max-height: 70vh; overflow-y: auto;
    animation: gst-sheet-up 0.18s ease-out;
  }
  @keyframes gst-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .gst-more-pop-handle { width: 36px; height: 4px; background: #d6dde5; border-radius: 2px; margin: 0 auto 14px; }
  .gst-more-pop h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
  .gst-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .gst-more-grid a {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; text-decoration: none; color: var(--ink);
    background: #f7f9fb; border-radius: 8px; font-size: 12px; font-weight: 600;
  }
  .gst-more-grid a:active { background: var(--cream-soft); }
  .gst-more-grid .ic { font-size: 24px; line-height: 1; }
}

/* =================== MOBILE chico (≤ 380px) =================== */
@media (max-width: 380px) {
  .gst-kpis { grid-template-columns: 1fr; }
  .gst-filters { grid-template-columns: 1fr; }
  .gst-brand-text { display: none; }
  .gst-more-grid { grid-template-columns: 1fr 1fr; }
}

/* =================== Búsqueda global Cmd+K =================== */
.gst-search-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.gst-search-modal[hidden] { display: none; }
.gst-search-backdrop { position: absolute; inset: 0; background: rgba(10, 18, 26, 0.55); backdrop-filter: blur(2px); }
.gst-search-dialog { position: relative; width: min(640px, calc(100vw - 24px)); max-height: 80vh; display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); overflow: hidden; }
.gst-search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #e3e9ef; }
.gst-search-icon { font-size: 18px; opacity: 0.55; }
.gst-search-input { flex: 1; border: 0; outline: none; font-size: 15px; padding: 4px 0; color: #1a2935; background: transparent; font-family: inherit; }
.gst-search-input::placeholder { color: #8a96a4; }
.gst-search-esc { background: #f0f2f5; padding: 3px 7px; border-radius: 3px; font-size: 10.5px; color: #5a6675; font-family: ui-monospace, monospace; }
.gst-search-results { flex: 1; overflow-y: auto; padding: 8px 0; min-height: 100px; }
.gst-search-hint { padding: 18px 22px; color: #5a6675; font-size: 13.5px; text-align: center; }
.gst-search-group { margin-bottom: 6px; }
.gst-search-group-label { padding: 6px 18px; font-size: 11px; color: #5a6675; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; background: #f7f9fb; }
.gst-search-group-label small { color: #8a96a4; font-weight: 400; }
.gst-search-item { display: block; padding: 9px 18px; text-decoration: none; color: #1a2935; border-left: 3px solid transparent; cursor: pointer; }
.gst-search-item:hover, .gst-search-item.is-active { background: #eaf3fb; border-left-color: #2563eb; }
.gst-search-item-title { font-size: 13.5px; font-weight: 600; }
.gst-search-item-sub { font-size: 12px; color: #5a6675; margin-top: 2px; }
.gst-search-item-meta { font-size: 11px; color: #8a96a4; margin-top: 2px; font-variant-numeric: tabular-nums; }
.gst-search-footer { padding: 9px 18px; background: #f7f9fb; border-top: 1px solid #e3e9ef; font-size: 11px; color: #5a6675; text-align: center; }
.gst-search-footer kbd { background: #fff; border: 1px solid #d6dde5; padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 10.5px; }

/* Sin spinners en inputs numéricos (pedido de Seba 2026-09-08) — igual que en
   el CRM: las flechitas no sirven para cargar cantidades/precios y molestan. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Acciones rápidas en filas (cuenta corriente de la ficha, listado de presupuestos):
   iconos monocromáticos via SVG dentro de .gst-cc-acts. Vivían inline en
   clientes/ficha.php; al compartirse con presupuestos/index.php (2026-09-23) pasan
   acá. OJO: la especificidad es alta a propósito porque `.gst-menu > summary` tiene
   fondo navy global (usado en otros menús) y acá lo pisamos. */
.gst-cc-acts { display: flex; gap: 4px; align-items: center; }
.gst-cc-acts .gst-cc-icon,
.gst-cc-acts details.gst-menu > summary.gst-cc-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 50%;
  color: #8a96a4; cursor: pointer; text-decoration: none; line-height: 1;
  transition: color 120ms, background 120ms, border-color 120ms;
  font-size: 0; /* mata cualquier herencia de tamaño que afecte al SVG hijo */
}
.gst-cc-acts .gst-cc-icon svg { display: block; }
.gst-cc-acts .gst-cc-icon:hover,
.gst-cc-acts details.gst-menu > summary.gst-cc-icon:hover { background: #f0f2f5; border-color: #d6dde5; color: var(--navy); }
/* "Anular" mantiene hint rojo solo en hover — semántica destructiva. */
.gst-cc-acts .gst-cc-icon[title="Anular"]:hover { color: #c93030; border-color: #fecaca; background: #fef2f2; }
.gst-cc-acts details.gst-menu > summary.gst-cc-icon::-webkit-details-marker { display: none; }
.gst-cc-acts details.gst-menu[open] > summary.gst-cc-icon { background: #f0f2f5; border-color: #d6dde5; color: var(--navy); }

/* Código de artículo con link a su ficha (gestion_sku_link, 24/09/2026). */
a.gst-sku { color:inherit; text-decoration:none; border-bottom:1px dotted #9aa8b6; }
a.gst-sku:hover { color:#1f5fbf; border-bottom-color:#1f5fbf; }

/* Texto atenuado (heredado de las páginas del CRM) */
.gst-muted { color: var(--muted); }
