/* Cotizador Elphick — estilos */
:root {
  --verde: #4c8c2b;
  --verde-claro: #65b32e;
  --verde-suave: #eef6e8;
  --naranjo: #e0690f;
  --azul: #2fa9d6;
  --tinta: #1d2420;
  --texto: #2d3530;
  --gris: #6b736d;
  --linea: #e1e6e2;
  --fondo: #f4f6f4;
  --blanco: #fff;
  --rojo: #c0392b;
  --menu: #17201a;
  --menu-texto: #c9d3cb;
  --radio: 8px;
  --sombra: 0 1px 2px rgba(20, 30, 20, .06), 0 2px 8px rgba(20, 30, 20, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; color: var(--texto); background: var(--fondo); line-height: 1.45;
}
a { color: var(--verde); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; color: var(--tinta); font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--tinta); font-weight: 650; }

/* ---------- estructura */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.menu {
  background: var(--menu); color: var(--menu-texto); padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.menu .marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 650; }
.menu .marca img { width: 34px; height: 34px; }
.menu .marca small { display: block; color: var(--menu-texto); font-weight: 400; font-size: 12px; }
.menu nav a, .menu nav span.prox {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--menu-texto);
  font-size: 13.5px; margin-bottom: 1px; white-space: nowrap;
}
.menu nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.menu nav a.activo { background: var(--verde); color: #fff; }
.menu nav span.prox { opacity: .45; cursor: default; }
.menu nav span.prox em { margin-left: auto; font-style: normal; font-size: 10px; border: 1px solid; border-radius: 10px; padding: 0 5px; }
.menu .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7d8a80; margin: 16px 10px 6px; }
.menu svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu .pie { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12.5px; }
.menu .pie a { color: var(--menu-texto); }
.contenido { padding: 24px 28px 48px; min-width: 0; }
.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cabecera .sub { color: var(--gris); margin-top: 2px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.boton-menu { display: none; }

/* ---------- tarjetas */
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px 20px; }
.tarjeta + .tarjeta { margin-top: 16px; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cifra { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px 18px; box-shadow: var(--sombra); display: block; color: inherit; }
.cifra:hover { text-decoration: none; border-color: var(--verde-claro); }
.cifra .n { font-size: 26px; font-weight: 650; color: var(--tinta); }
.cifra .e { color: var(--gris); font-size: 13px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dos > .tarjeta { margin-top: 0 !important; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: 8px 0; border-bottom: 1px solid var(--linea); display: flex; justify-content: space-between; gap: 10px; }
.lista-simple li:last-child { border-bottom: 0; }
.muted { color: var(--gris); }
.aviso { background: #fff8ec; border: 1px solid #f3d3a6; color: #6b4a14; border-radius: var(--radio); padding: 12px 14px; margin-bottom: 16px; }
.aviso.info { background: #eef7fc; border-color: #bfe1f1; color: #1e4a5e; }
.hoja-ruta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.hoja-ruta div { border: 1px dashed var(--linea); border-radius: 6px; padding: 10px 12px; }
.hoja-ruta div.hecho { border-style: solid; border-color: #bcdcaa; background: var(--verde-suave); }
.hoja-ruta b { display: block; margin-bottom: 2px; }

/* ---------- botones */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linea); background: var(--blanco);
  color: var(--texto); padding: 7px 13px; border-radius: 6px; font: inherit; font-weight: 550; cursor: pointer;
  line-height: 1.2; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #c5ccc6; background: #fafbfa; }
.btn.primario { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.primario:hover { background: #417a24; }
.btn.peligro { color: var(--rojo); border-color: #ecc5c0; }
.btn.peligro.lleno { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.btn.chico { padding: 4px 9px; font-size: 12.5px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- mensajes */
.mensajes { margin-bottom: 16px; }
.mensaje { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; border: 1px solid; }
.mensaje.success { background: var(--verde-suave); border-color: #bcdcaa; color: #2d5a17; }
.mensaje.error { background: #fbeeec; border-color: #efc4be; color: #8a2a1e; }
.mensaje.warning, .mensaje.info { background: #eef7fc; border-color: #bfe1f1; color: #1e4a5e; }

/* ---------- tablas */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filtros .campo { width: auto; min-width: 140px; }
.filtros .buscar { min-width: 260px; flex: 1; max-width: 420px; }
.tabla-env { overflow-x: auto; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla th { background: #f8faf8; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); font-weight: 600; position: sticky; top: 0; }
.tabla tbody tr:hover { background: #fafcf9; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla td.num, .tabla th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla .fuerte { font-weight: 550; color: var(--tinta); }
.tabla td.nombre { min-width: 220px; }
.tabla .chico { font-size: 12.5px; color: var(--gris); }
.tabla .nowrap { white-space: nowrap; }
.tabla td.acc { white-space: nowrap; text-align: right; width: 1%; }
.tabla a.fila { color: inherit; }
.vacio { padding: 40px; text-align: center; color: var(--gris); }
.paginacion { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--gris); flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 550; color: #fff; background: var(--gris); }
.badge.ok { background: #e3f1da; color: #2d5a17; }
.badge.off { background: #eceeec; color: var(--gris); }

/* ---------- formularios */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.form-grid .ancho { grid-column: 1 / -1; }
#fila-nombre, #fila-empresa_nombre { grid-column: span 2; }
@media (max-width: 700px) { #fila-nombre, #fila-empresa_nombre { grid-column: auto; } }
.fila-campo label { display: block; font-size: 12.5px; font-weight: 600; color: var(--tinta); margin-bottom: 4px; }
.fila-campo .ayuda { font-size: 12px; color: var(--gris); margin-top: 3px; }
.fila-campo .err { color: var(--rojo); font-size: 12.5px; margin-top: 3px; }
.fila-campo.con-error .campo { border-color: var(--rojo); }
.fila-campo.check-fila { display: flex; align-items: center; gap: 8px; padding-top: 18px; }
.fila-campo.check-fila label { margin: 0; font-weight: 500; }
.campo {
  width: 100%; border: 1px solid #cfd6d0; border-radius: 6px; padding: 7px 10px; font: inherit; background: #fff;
  color: var(--texto); min-height: 34px;
}
.campo:focus { outline: 2px solid rgba(101, 179, 46, .35); border-color: var(--verde-claro); }
textarea.campo { resize: vertical; }
input[type=color].campo { padding: 2px; height: 34px; }
input[type=file].campo { padding: 5px; }
.check { width: 16px; height: 16px; accent-color: var(--verde); }
.barra-guardar { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--fondo) 30%); }
.errores-form { background: #fbeeec; border: 1px solid #efc4be; color: #8a2a1e; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.formset td { padding: 6px 8px; }
.formset .campo { min-width: 90px; }
.calculo { background: var(--verde-suave); border: 1px solid #cfe6c0; border-radius: var(--radio); padding: 12px 16px; display: flex; gap: 28px; flex-wrap: wrap; margin-top: 14px; }
.calculo div span { display: block; font-size: 12px; color: var(--gris); }
.calculo div b { font-size: 18px; color: var(--tinta); font-variant-numeric: tabular-nums; }

/* ---------- acceso */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #f4f8f1, #e9f1e4); }
.acceso .caja { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 40, 20, .1); padding: 32px; }
.acceso .caja.ancha { max-width: 520px; }
.acceso img { display: block; width: 200px; margin: 0 auto 18px; }
.acceso h1 { text-align: center; font-size: 18px; margin-bottom: 18px; }
.acceso .fila-campo { margin-bottom: 12px; }
.acceso .btn { width: 100%; justify-content: center; padding: 10px; }

/* ---------- móvil */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .menu { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .menu.abierto { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .btn.boton-menu { display: inline-flex; }
  .contenido { padding: 16px; }
  .dos { grid-template-columns: 1fr; }
}
@media print {
  .menu, .acciones, .filtros, .paginacion, .barra-guardar { display: none !important; }
  .app { display: block; }
}
