/* El panel de los calculadores con la cara del ERP (Generalist, 27/11; Leo: "Tiene que usar la misma paleta de colores
   que el ERP. Se tiene que sentir como si fuese el ERP", y responsive porque Ido entra desde el iPhone).
   Los tokens son los del ERP (main_software/ui/src/index.css) y la empresa se elige con data-empresa en <html>.
   En el telefono (<= 860 px) el menu pasa a una tira de secciones que se desliza, como en Forge. */

:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #fafbf9;
  --ink: #1c241f;
  --ink-2: #3b4540;
  --muted: #68736c;
  --line: #e2e6e1;
  --line-strong: #c9d1c9;
  --accent: #152a54;
  --accent-ink: #0d1c3a;
  --accent-soft: #e8edf6;
  --marca-b: #c8102e;
  --danger: #c8102e;
  --danger-soft: #fbe7ea;
  --ok: #1a7a52;
  --ok-soft: #e7f4ee;
  --hold: #935b06;
  --hold-soft: #faf1de;
  --orden: #2b4d8f;   /* las flechas de orden: el azul de la puerta del ERP, que se lee mas que el navy */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 36, 31, .06), 0 4px 14px rgba(28, 36, 31, .05);
  --shadow-lift: 0 4px 10px rgba(28, 36, 31, .10), 0 10px 28px rgba(28, 36, 31, .10);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --top: 60px;
  --side: 236px;
}
:root[data-empresa="flgreens"] {
  --accent: #4e7423;
  --accent-ink: #3a5719;
  --accent-soft: #eaf4dd;
  --marca-b: #273631;
  --orden: #4e7423;
}

html, body { background: var(--bg); }
body.erp {
  margin: 0; font: 14.5px/1.5 var(--font); color: var(--ink);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
.erp a { color: var(--accent); }
.erp a:hover { color: var(--accent-ink); }

/* ---- la marca ----------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { flex: 0 0 auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-1 { font-weight: 800; font-size: 15px; letter-spacing: -.01em; color: var(--accent); }
.brand-2 { font-weight: 800; font-size: 9.5px; letter-spacing: .04em; color: var(--marca-b); }
.brand-img img { display: block; width: auto; }

/* ---- la barra de arriba ------------------------------------------------- */
.erp-top {
  position: sticky; top: 0; z-index: 1030; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.erp-brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.erp-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 9px;
}
.erp-spacer { flex: 1; }
.erp-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.erp-user b { color: var(--ink); font-weight: 600; }
.erp-out {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 12px; cursor: pointer;
}
.erp-out:hover { background: var(--bg); }

/* ---- la cascara: menu y contenido --------------------------------------- */
.erp-shell { display: flex; min-height: calc(100vh - var(--top)); }
.erp-side {
  flex: 0 0 var(--side); position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line); padding: 10px 10px 20px;
}
.erp-side .sec-titulo {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 14px 12px 6px;
}
.erp-side a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
}
.erp-side a i { width: 18px; text-align: center; font-size: 16px; color: var(--muted); }
.erp-side a:hover { background: var(--bg); color: var(--ink); }
.erp-side a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.erp-side a.on i { color: var(--accent); }
.erp-side a.on::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent);
}
.erp-main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.erp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 18px; }
.erp-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.erp-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Bootstrap con la cara del ERP --------------------------------------- */
.erp .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.erp .card-header {
  background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 600; padding: 12px 16px;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.erp .table { margin-bottom: 0; color: var(--ink); --bs-table-bg: transparent; }
.erp .table > thead th, .erp .table-light th {
  background: var(--surface-2) !important; color: var(--muted); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.erp .table td { vertical-align: middle; border-color: var(--line); }
.erp .table-hover > tbody > tr:hover > * { background: #f7f8f6; --bs-table-accent-bg: transparent; }
.erp .btn { border-radius: 10px; font-weight: 600; }
.erp .btn-green, .erp .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.erp .btn-green:hover, .erp .btn-primary:hover, .erp .btn-green:focus, .erp .btn-primary:focus {
  background: var(--accent-ink); border-color: var(--accent-ink); color: #fff;
}
.erp .btn-outline-primary { color: var(--accent); border-color: var(--accent); }
.erp .btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.erp .btn-outline-secondary { color: var(--ink-2); border-color: var(--line-strong); }
.erp .btn-outline-secondary:hover { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.erp .form-control, .erp .form-select { border-radius: 10px; border-color: var(--line-strong); color: var(--ink); }
.erp .form-control:focus, .erp .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.erp .form-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.erp .alert { border-radius: 10px; border-width: 1px; }
.erp .badge { border-radius: 999px; font-weight: 600; padding: .4em .72em; letter-spacing: .01em; }
.erp .modal-content { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.erp .text-muted { color: var(--muted) !important; }

/* ---- el dashboard -------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi-nombre { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi-numero { margin-top: 4px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--accent-ink); }
.estados { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.estado {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: 13px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.estado b { color: var(--ink); font-weight: 700; }

/* una quote como tarjeta (las listas en el telefono) */
.lista-movil { display: none; }
.q-tarjeta { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.q-tarjeta:last-child { border-bottom: none; }
.q-tarjeta:active { background: var(--bg); }
.q-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.q-numero { font-weight: 700; color: var(--accent); }
.erp .quote-note-indicator {
  display: inline-grid; place-items: center; width: 19px; height: 19px; margin-inline-start: 5px;
  border: 1px solid #e8d5ae; border-radius: 50%; color: #935b06; background: #faf1de;
  font-size: 12px; font-weight: 800; line-height: 1; text-decoration: none; vertical-align: middle;
}
.erp a.quote-note-indicator:hover, .erp a.quote-note-indicator:focus-visible {
  border-color: #935b06; color: #935b06;
}
.q-total { font-weight: 700; color: var(--ink); white-space: nowrap; }
.q-cliente { margin-top: 2px; font-weight: 600; color: var(--ink); }
.q-detalle { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---- filtros: buscador, chips y fechas ----------------------------------- */
.filtros { margin-bottom: 12px; }
.buscador { position: relative; margin-bottom: 10px; }
.buscador > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.buscador input {
  width: 100%; box-sizing: border-box; font: inherit; padding: 10px 40px 10px 38px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.buscador input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.buscador-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); padding: 4px 6px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; font: inherit; font-size: 13.5px; line-height: 1.2;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; cursor: pointer;
}
.erp a.chip { color: var(--ink-2); }
.chip:hover { background: var(--bg); color: var(--ink); }
.chip b { font-weight: 700; color: var(--muted); }
.chip.on, .erp a.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.chip.on b { color: var(--accent-ink); }
.chips-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.fechas { display: none; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fechas.abierto { display: flex; }
.fechas label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.resultado { margin: 0 2px 10px; font-size: 13px; color: var(--muted); }
.acciones-fila { white-space: nowrap; }
.acciones-fila .btn, .acciones-fila form { margin-left: 2px; }
.sin-resultados[hidden] { display: none !important; }

/* la paginacion */
.paginas { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; border-radius: 0 0 var(--radius) var(--radius) !important; }
.paginas-texto { font-size: 13px; color: var(--muted); }
.erp .pagination { gap: 4px; }
.erp .page-link { border: 1px solid var(--line); border-radius: 8px !important; color: var(--ink-2); min-width: 34px; text-align: center; }
.erp .page-link:hover { background: var(--bg); color: var(--ink); }
.erp .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.erp .page-item.disabled .page-link { color: var(--line-strong); background: var(--surface); }

/* ---- la ficha de la quote ------------------------------------------------- */
.ficha-cliente { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.ficha-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.ficha-meta i { margin-right: 6px; }
.ficha-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ficha-estado { display: flex; align-items: center; gap: 8px; margin: 0; }
.ficha-estado label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ficha-estado select { width: auto; }
.ficha-total { text-align: right; }
.ficha-total span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ficha-total b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-ink); }
.resumen > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--ink-2); }
.resumen > div > span:first-child { color: var(--muted); }
.resumen .resumen-total { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 800; color: var(--accent-ink); }
.resumen .resumen-total > span:first-child { color: var(--ink); }
.nota { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.aviso-ok { font-size: 13px; font-weight: 600; color: var(--ok); }
.descuento-final { padding: 10px 12px; background: var(--ok-soft); border: 1px solid #c6e6d6; border-radius: 10px; color: var(--ok); }
.descuento-precio { font-size: 18px; font-weight: 800; }
.erp .table-responsive { border-radius: 0 0 var(--radius) var(--radius); }

/* ---- agents --------------------------------------------------------------- */
.agente[hidden] { display: none !important; }
tr.apagado td, .agente-tarjeta.apagado { color: var(--muted); }
tr.apagado td:first-child { color: var(--muted); font-weight: 600; }
.agente-tarjeta { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.agente-tarjeta:last-child { border-bottom: none; }
.agente-nombre { font-weight: 700; color: var(--ink); }
.agente-tarjeta.apagado .agente-nombre { color: var(--muted); }
.agente-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.agente-botones { display: inline-flex; gap: 6px; }
.erp code { color: var(--accent-ink); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* ---- etiquetas suaves, como las del ERP (en vez de los colores de Bootstrap) ---- */
.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; font-size: 12px; font-weight: 600; line-height: 1.5;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
}
td > .tag + .tag { margin-left: 4px; }
.tag-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag-accent { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.tag-hold { color: var(--hold); background: var(--hold-soft); border-color: transparent; }

/* ---- el catalogo: productos, garage y roofing ----------------------------- */
.prod-foto { width: 50px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.prod-tarjeta { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.prod-tarjeta:last-child { border-bottom: none; }
.prod-foto-m {
  flex: 0 0 64px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px;
}
.prod-foto-m img { width: 100%; height: 100%; object-fit: cover; }
.prod-cuerpo { flex: 1; min-width: 0; }
.erp a.prod-nombre { font-weight: 700; color: var(--ink); text-decoration: none; }
.prod-tarjeta.apagado .prod-nombre, .erp .prod-tarjeta.apagado a.prod-nombre { color: var(--muted); }
.prod-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tarjeta-botones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.precio-tarjeta { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.precio-tarjeta:last-child { border-bottom: none; }
.precio-nombre { font-weight: 700; color: var(--ink); }
.precio-unidad { font-size: 13px; color: var(--muted); white-space: nowrap; }
.precio-monto { font-size: 17px; font-weight: 800; color: var(--accent-ink); }
.precio-tarjeta.apagado .precio-nombre, .precio-tarjeta.apagado .precio-monto { color: var(--muted); }
.precio-form { display: flex; gap: 8px; margin: 8px 0 0; }
.precio-form .input-group { flex: 1; min-width: 0; }
.precio-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.precio-inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.precio-inline .input-group { width: 150px; flex: 0 0 auto; }
.estado-inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.erp .input-group-text { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.erp .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.erp .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* una tabla mas ancha que la pantalla se desliza adentro de su tarjeta: la pagina nunca se corre de costado
   (tambien en las pantallas que todavia no tienen su version de telefono) */
.erp-main .card-body.p-0, .erp-main .table-responsive, .erp-main .tabla-escritorio { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- el panel de los agentes --------------------------------------------- */
.q-enlace { display: block; color: inherit; text-decoration: none; }
.erp a.q-enlace, .erp a.q-enlace:hover { color: inherit; }
.q-detalle-pie { align-items: center; margin-top: 8px; }
.estado-quote { display: inline-block; margin: 0; }
.estado-quote select { width: auto; min-width: 116px; padding-top: 4px; padding-bottom: 4px; font-weight: 600; }
.estado-quote .estado-sent { color: var(--accent); }
.estado-quote .estado-accepted { color: var(--ok); }
.estado-quote .estado-rejected { color: var(--danger); }
.ficha-etiqueta { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
/* la calculadora (New Quote y Edit): sus estilos propios (verdes de FL Green fijos) pasan a la paleta del ERP. Van con .erp
   adelante para ganarle al <style> de la vista, que se imprime despues */
.erp .item-row { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.erp .item-row.custom-size { border-color: var(--hold); background: var(--hold-soft); }
.erp .item-badge { background: var(--accent-soft); color: var(--accent-ink); }
.erp .product-preview { background: var(--surface-2); border: 1px solid var(--line); }
.erp .product-preview .product-img { border-color: var(--line); }
.erp .product-preview h6 { color: var(--accent-ink); }
.erp .product-preview p { color: var(--muted); }
.erp .type-window { background: var(--accent-soft); color: var(--accent-ink); }
.erp .type-door { background: var(--hold-soft); color: var(--hold); }
.erp .addons-wrapper { background: var(--surface-2); border-color: var(--line); }
.erp .addons-wrapper > label.form-label { color: var(--muted); }
.erp .addon-row:hover { background: var(--bg); }
.erp .addon-row input[type="checkbox"] { accent-color: var(--accent); }
.erp .addon-row label { color: var(--ink-2); }
.erp .addon-price-tag { color: var(--accent); }
.erp .manual-price-box { background: var(--hold-soft); border-color: var(--hold); }
.erp .price-display { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.erp .price-label { color: var(--muted); }
.erp .price-value { color: var(--ink); }
.erp-agente .price-value.text-success, .erp-agente #summaryTotal, .erp-agente [id^="garage-total-"] { color: var(--accent-ink) !important; }
.erp #customerDropdown .list-group-item:hover { background: var(--accent-soft); border-left-color: var(--accent); }
.erp #customerDropdown .list-group-item.new-customer { color: var(--accent); }
.erp-agente .card.sticky-top { top: calc(var(--top) + 16px) !important; }
/* el alta y la edicion de un producto (su grilla de dos columnas, la foto a la derecha): la foto pegada no se esconde abajo de la barra */
.erp .page-layout > div[style*="sticky"] { top: calc(var(--top) + 16px) !important; }

/* ---- el orden por columnas (30/11): cada titulo que ordena muestra su flechita; el que ordena hoy, en color ---- */
.erp .table > thead th.ordenable { padding: 0; }
.erp th.ordenable a { display: flex; align-items: center; gap: 5px; padding: .5rem .5rem; color: inherit; text-decoration: none; white-space: nowrap; }
.erp .table-sm th.ordenable a { padding: .25rem .25rem; }
.erp th.ordenable.text-end a { justify-content: flex-end; }
.erp th.ordenable a i { font-size: 12px; color: var(--orden); opacity: 1; }   /* visibles, en color (Leo, 30/11: "Visibles, no gris clarito") */
.erp th.ordenable a:hover { color: var(--ink); }
.erp th.ordenable a:hover i { color: var(--accent); }
.erp th.ordenable.on a { color: var(--accent); }
.erp th.ordenable.on a i { color: var(--orden); opacity: 1; }
.resultado-orden { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.orden-movil { display: none; align-items: center; gap: 6px; margin: 0; }
.orden-movil label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.orden-movil select { width: auto; font-weight: 600; padding-top: 4px; padding-bottom: 4px; }

/* ---- la puerta (el login), la del ERP ------------------------------------ */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.gate-brand {
  position: relative; overflow: hidden; background: #0b1730;
  display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(32px, 6vw, 88px);
}
.gate-art { position: absolute; inset: -8% -12%; width: 124%; height: 116%; }
.drift { transform-origin: 300px 300px; }
.drift-1 { animation: drift1 26s ease-in-out infinite alternate; }
.drift-2 { animation: drift2 32s ease-in-out infinite alternate; }
.drift-3 { animation: drift3 22s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(26px, -18px, 0) rotate(2.5deg); } }
@keyframes drift2 { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-34px, 14px, 0) rotate(-2deg); } }
@keyframes drift3 { from { transform: translate3d(0, 0, 0); opacity: .75; } to { transform: translate3d(18px, 26px, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drift { animation: none; } }
.gate-brand-body { position: relative; }
.gate-brand .brand-1 { color: #fff; font-size: 26px; }
.gate-brand .brand-2 { color: #ff6b83; font-size: 15px; }
.gate-brand .brand { gap: 14px; }
.gate-tag { margin: 22px 0 0; font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: #fff; }
.gate-desc { margin: 12px 0 0; max-width: 34ch; font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .62); }
.gate-foot {
  position: absolute; left: clamp(32px, 6vw, 88px); bottom: 26px; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, .34);
}
:root[data-empresa="flgreens"] .gate-brand { background: #eaf4dd; }
:root[data-empresa="flgreens"] .gate-art { opacity: .6; }
:root[data-empresa="flgreens"] .gate-tag { color: #273631; }
:root[data-empresa="flgreens"] .gate-desc { color: #3a5719; }
:root[data-empresa="flgreens"] .gate-foot { color: rgba(39, 54, 49, .5); }
.gate-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.gate-box { width: 100%; max-width: 348px; }
.gate-box h1 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.gate-sub { margin: 5px 0 26px; color: var(--muted); font-size: 13.5px; }
.field { display: block; margin-bottom: 15px; }
.field span { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 11px 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; transition: border-color .12s, box-shadow .12s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-remember { display: flex; align-items: center; gap: 9px; margin: 4px 0 20px; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; }
.gate-remember input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.gate-err {
  margin-bottom: 14px; padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--danger);
  background: var(--danger-soft); border: 1px solid #f0c2ca; border-radius: 9px;
}
.gate-go {
  width: 100%; font: inherit; font-size: 16px; font-weight: 700; color: #fff; background: var(--accent); border: 1px solid var(--accent);
  border-radius: 10px; padding: 13px; cursor: pointer; transition: background .12s, transform .12s, box-shadow .12s;
}
.gate-go:hover:not(:disabled) { background: var(--accent-ink); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.gate-go:disabled { opacity: .7; cursor: default; }

/* ---- el telefono --------------------------------------------------------- */
@media (max-width: 860px) {
  :root { --top: 56px; }
  .erp-top { padding: 0 14px; gap: 10px; }
  .erp-user .erp-nombre, .erp-tag { display: none; }
  .erp-out span { display: none; }
  .erp-shell { display: block; }
  .erp-side {
    position: sticky; top: var(--top); z-index: 1020; height: auto; display: flex; gap: 6px; overflow-x: auto;
    padding: 8px 14px; border-right: none; border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .erp-side::-webkit-scrollbar { display: none; }
  .erp-side .sec-titulo { display: none; }
  /* los agentes tienen tres secciones: entran siempre las tres, sin deslizar (Leo, 30/11) */
  .erp-agente .erp-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .erp-agente .erp-side a { justify-content: center; gap: 6px; padding: 7px 4px; min-width: 0; font-size: 14px; }
  .erp-side a { flex: 0 0 auto; padding: 7px 13px; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; }
  .erp-side a.on { border-color: transparent; }
  .erp-side a.on::before { display: none; }
  .erp-main { padding: 16px 14px 36px; overflow-x: hidden; }
  .erp-head { margin-bottom: 14px; }
  .erp-head h1 { font-size: 19px; }
  .erp input, .erp select, .erp textarea { font-size: 16px; }   /* con menos, el iPhone hace zoom al tocar */
  .kpis { gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi-nombre { font-size: 10.5px; }
  .kpi-numero { font-size: 22px; }
  .erp .page-layout { grid-template-columns: minmax(0, 1fr); }   /* el producto: la foto abajo, no a la derecha */
  .erp .page-layout > div[style*="sticky"] { position: static !important; }
  .tabla-escritorio { display: none; }
  .orden-movil { display: inline-flex; }
  .lista-movil { display: block; }

  .gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .gate-brand { padding: 26px 24px 30px; }
  .gate-tag { font-size: 22px; margin-top: 16px; }
  .gate-brand .brand-1 { font-size: 21px; }
  .gate-brand .brand-2 { font-size: 12px; }
  .gate-desc, .gate-foot { display: none; }
  .gate-form { align-items: flex-start; padding: 28px 22px 36px; }
}

/* el telefono angosto: en los agentes, el icono arriba del nombre para que las tres secciones sigan entrando */
@media (max-width: 380px) {
  .erp-agente .erp-side a { flex-direction: column; gap: 1px; padding: 5px 2px; font-size: 12px; line-height: 1.2; border-radius: 12px; }
}
