/* Excel Mercado Público · estilos de la aplicación (línea de diseño de mecot.cl: «Confianza clara»).
   Marino para estructura y texto, verde azulado solo para la acción. Tipografía: Plus Jakarta Sans (títulos) + Inter (texto). */
@font-face { font-family:"Plus Jakarta Sans"; src:url("../fonts/PlusJakartaSans-Variable.woff2") format("woff2"); font-weight:200 800; font-style:normal; font-display:swap; }
@font-face { font-family:"Inter"; src:url("../fonts/Inter-Variable.woff2") format("woff2"); font-weight:100 900; font-style:normal; font-display:swap; }

:root {
  /* marca */
  --navy-950:#071B3D; --navy-800:#0C2B5C; --navy-600:#123F85; --navy-50:#E8EEF8;
  --teal-700:#007A68; --teal-800:#006555; --teal-500:#00A98F; --teal-300:#2FD5B8; --teal-100:#C9EDE5; --teal-50:#E6F6F2;
  /* neutros y estados */
  --surface-alt:#F2F7F8; --text:#1D2433; --text-muted:#4A5468; --line:#DFE6EA; --field-border:#B9C4CF;
  --success:#067647; --warning:#B54708; --error:#B42318;
  /* nombres que ya usan las pantallas */
  --bg:var(--surface-alt); --card:#fff; --txt:var(--text); --muted:var(--text-muted);
  --accent:var(--teal-700); --ok:var(--success); --err:var(--error);
  /* forma */
  --radius-sm:8px; --radius-md:12px; --radius-lg:20px; --radius-xl:28px;
  --shadow-sm:0 1px 2px rgba(12,43,92,.06), 0 1px 1px rgba(12,43,92,.04);
  --shadow-md:0 8px 24px -8px rgba(12,43,92,.14);
  --shadow-lg:0 24px 48px -16px rgba(12,43,92,.24);
  --ring:0 0 0 3px #fff, 0 0 0 6px var(--teal-700);
  --font-display:"Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:"Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease:cubic-bezier(.2,.7,.2,1);
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:var(--font-body); font-size:1rem; line-height:1.55; color:var(--text); background:var(--bg);
  background-image:radial-gradient(60% 40% at 90% -5%, rgba(0,169,143,.10), transparent), radial-gradient(45% 35% at -5% 0%, rgba(12,43,92,.06), transparent);
  background-repeat:no-repeat; min-height:100vh; display:flex; flex-direction:column; }
main { width:100%; max-width:1200px; margin:0 auto; padding:clamp(20px, 3vw, 36px) clamp(16px, 4vw, 32px) 48px; flex:1; }
img { max-width:100%; }
a { color:var(--teal-700); }
a:hover { color:var(--teal-800); }
:focus-visible { outline:none; box-shadow:var(--ring); border-radius:var(--radius-sm); }
.saltar { position:absolute; left:-9999px; top:8px; z-index:100; background:var(--navy-800); color:#fff; padding:10px 16px; border-radius:var(--radius-sm); text-decoration:none; }
.saltar:focus { left:8px; }
[hidden] { display:none !important; }  /* sin esto, a.btn y similares siguen visibles aunque estén ocultos */

/* ---- títulos ---- */
h1, h2, h3, h4 { font-family:var(--font-display); color:var(--navy-800); text-wrap:balance; }
h1 { margin:0; font-size:1.6rem; letter-spacing:-.02em; }
h2 { margin:0 0 4px; font-size:clamp(1.45rem, 1.2rem + 1vw, 1.9rem); font-weight:800; line-height:1.15; letter-spacing:-.02em; }
h2::after { content:""; display:block; width:48px; height:4px; border-radius:2px; background:linear-gradient(90deg, var(--teal-500), var(--teal-300)); margin-top:8px; }
h3 { margin:0 0 6px; font-size:1.2rem; font-weight:700; letter-spacing:-.01em; }
h4 { margin:0 0 6px; font-size:.95rem; }
p.sub { margin:10px 0 24px; color:var(--text-muted); max-width:78ch; text-wrap:pretty; }
.muted { color:var(--text-muted); }
.err { color:var(--error); }
code { background:var(--teal-50); border:1px solid var(--teal-100); border-radius:6px; padding:1px 6px; font-size:.88em; }

/* ---- barra superior (vidrio esmerilado) ---- */
nav.menu { position:sticky; top:0; z-index:40; background:rgba(255,255,255,.86); -webkit-backdrop-filter:saturate(160%) blur(12px); backdrop-filter:saturate(160%) blur(12px); border-bottom:1px solid var(--line); transition:box-shadow .15s; }
nav.menu.scrolled { box-shadow:var(--shadow-md); }
nav.menu .in { max-width:1200px; margin:0 auto; padding:0 clamp(16px, 4vw, 32px); display:flex; align-items:center; gap:8px; min-height:72px; }
nav.menu .marca img { height:44px; width:auto; display:block; margin:8px 20px 8px 0; }
@media (max-width:960px) { nav.menu .marca img { height:36px; } }
nav.menu .panel { display:flex; align-items:center; gap:4px; flex:1; flex-wrap:wrap; min-width:0; }
nav.menu a.item, nav.menu summary { display:block; padding:9px 14px; color:var(--navy-800); text-decoration:none; font-weight:500; cursor:pointer; list-style:none; border-radius:var(--radius-sm); transition:background .18s var(--ease), color .18s var(--ease); }
nav.menu a.item:hover, nav.menu summary:hover { background:var(--surface-alt); color:var(--navy-800); }
nav.menu .activo { background:var(--navy-800); color:#fff; }
nav.menu a.item.activo:hover, nav.menu summary.activo:hover { background:var(--navy-600); color:#fff; }
nav.menu details { position:relative; }
nav.menu summary::-webkit-details-marker { display:none; }
nav.menu summary::after { content:""; display:inline-block; width:7px; height:7px; margin-left:8px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:translateY(-3px) rotate(45deg); transition:transform .18s var(--ease); }
nav.menu details[open] > summary::after { transform:translateY(0) rotate(225deg); }
nav.menu .sub { position:absolute; z-index:50; top:calc(100% + 8px); left:0; min-width:260px; background:#fff; border:1px solid var(--line); border-radius:var(--radius-md); padding:8px; box-shadow:var(--shadow-lg); animation:aparece .18s var(--ease); }
nav.menu .sub a { display:flex; align-items:center; gap:10px; padding:10px 12px; min-height:44px; border-radius:var(--radius-sm); color:var(--text); text-decoration:none; font-size:.95rem; }
nav.menu .sub a:hover { background:var(--teal-50); color:var(--navy-800); }
/* usuario: fila propia bajo el menú (no compite con los menús ni los empuja) */
.barra-usuario .in { max-width:1200px; margin:0 auto; padding:10px clamp(16px, 4vw, 32px) 0; display:flex; justify-content:flex-end; align-items:center; gap:14px; font-size:.9rem; }
.barra-usuario a { color:var(--teal-700); font-weight:600; text-decoration:none; padding:6px 4px; }
.barra-usuario a:hover { text-decoration:underline; }
nav.menu .burger { display:none; margin-left:auto; background:transparent; color:var(--navy-800); border:1px solid var(--line); width:44px; height:44px; padding:0; border-radius:var(--radius-sm); font-size:1.4rem; line-height:1; box-shadow:none; }
@keyframes aparece { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

/* ---- tarjetas, avisos ---- */
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:clamp(16px, 2.5vw, 24px); margin-bottom:20px; box-shadow:var(--shadow-sm); }
.warn { background:#FFF7E8; border:1px solid #F5D9A8; border-left:4px solid var(--warning); padding:12px 16px; border-radius:var(--radius-md); margin-bottom:20px; color:#5C2E06; }
.flash { padding:12px 16px; border-radius:var(--radius-md); margin-bottom:16px; border:1px solid; border-left-width:4px; }
.flash.ok { background:var(--teal-50); border-color:var(--teal-100); border-left-color:var(--success); color:#05442A; }
.flash.error { background:#FEF3F2; border-color:#FDD3CF; border-left-color:var(--error); color:#7A1A12; }

/* ---- botones ---- */
button, a.boton, a.btn { font-family:var(--font-body); font-size:.95rem; font-weight:600; line-height:1.2; min-height:44px; padding:10px 20px; border-radius:var(--radius-md); border:0; cursor:pointer; text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--teal-700); color:#fff; transition:background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease); }
button:hover:not(:disabled), a.boton:hover, a.btn:hover { background:var(--teal-800); color:#fff; transform:translateY(-1px); box-shadow:var(--shadow-md); }
button:active:not(:disabled) { transform:none; }
button:disabled { opacity:.55; cursor:not-allowed; }
button.gris, a.boton.gris, a.btn.gris-btn { background:#fff; color:var(--navy-800); border:2px solid var(--navy-800); padding:8px 18px; }
button.gris:hover:not(:disabled), a.boton.gris:hover, a.btn.gris-btn:hover { background:var(--navy-800); color:#fff; }
button.rojo { background:var(--error); min-height:36px; padding:6px 14px; }
button.rojo:hover:not(:disabled) { background:#8E1B12; }
a.btn { background:var(--teal-700); }
/* botones dentro de tablas y grillas: más compactos */
button.x, .grilla button.x, td.x button { min-height:32px; padding:4px 8px; background:transparent; color:var(--text-muted); box-shadow:none; transform:none; font-weight:400; }
.grilla button.x:hover, button.x:hover:not(:disabled) { background:#FEF3F2; color:var(--error); box-shadow:none; transform:none; }

/* ---- formularios ---- */
select, textarea, input[type=text], input[type=search], input[type=number], input[type=date], input[type=time], input[type=password], input[type=email], input[type=datetime-local] { font-family:var(--font-body); font-size:.95rem; color:var(--text); }
select { padding:9px 12px; border:1px solid var(--field-border); border-radius:var(--radius-sm); background:#fff; margin-left:6px; min-height:40px; }
textarea { width:100%; margin-top:12px; padding:10px 12px; border:1px solid var(--field-border); border-radius:var(--radius-sm); background:#fff; }
input[type=checkbox], input[type=radio] { accent-color:var(--teal-700); width:1.05rem; height:1.05rem; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--teal-700) !important; box-shadow:0 0 0 3px rgba(0,122,104,.22); }
form.edicion label { display:block; font-weight:600; margin-top:16px; color:var(--navy-800); }
form.edicion input[type=text], form.edicion input[type=password], form.edicion input[type=number], form.edicion input[type=date], form.edicion input[type=datetime-local], form.edicion select, form.edicion textarea
  { width:100%; margin:4px 0 0; padding:11px 14px; min-height:46px; border:1px solid var(--field-border); border-radius:var(--radius-sm); background:#fff; }
form.edicion label:has(input[type=checkbox]) { display:flex; align-items:center; gap:10px; font-weight:500; }
form.edicion .ayuda { color:var(--text-muted); font-size:.85rem; margin:4px 0 0; }
form.edicion .fijo { background:var(--surface-alt); padding:10px 14px; border-radius:var(--radius-sm); margin-top:4px; }
.row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:16px; }
.barra { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:12px 0; }
.barra input[type=search] { flex:1; min-width:200px; min-height:44px; padding:10px 14px; border:1px solid var(--field-border); border-radius:var(--radius-sm); background:#fff; }
.pag { display:flex; gap:10px; align-items:center; margin-top:14px; flex-wrap:wrap; }

/* ---- Excel: nombre, datos, pestañas, grilla ---- */
.nombre-archivo { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0 0 14px; }
.nombre-archivo label { font-weight:600; color:var(--navy-800); }
.nombre-archivo #opCotizaciones, .nombre-archivo label[for=etapaCotizacion] { flex:1 1 100%; }   /* la lista de cotizaciones y el estado ocupan su propia línea */
.nombre-archivo select { flex:1; min-width:min(260px, 100%); max-width:520px; padding:11px 14px; border:1px solid var(--field-border); border-radius:var(--radius-sm); background:#fff; font:inherit; }
.nombre-archivo input { flex:1; min-width:min(260px, 100%); max-width:520px; padding:11px 14px; border:1px solid var(--field-border); border-radius:var(--radius-sm); background:#fff; }
details.datos-excel { border:1px solid var(--line); border-radius:var(--radius-md); padding:10px 14px; margin:0 0 16px; background:var(--surface-alt); }
details.datos-excel > summary { cursor:pointer; font-weight:600; color:var(--navy-800); }
.de-grupos { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap:12px; margin:12px 0; }
.de-grupos fieldset { border:1px solid var(--line); border-radius:var(--radius-md); padding:10px 14px 14px; display:grid; grid-template-columns:110px 1fr; gap:8px; align-items:center; margin:0; background:#fff; }
.de-grupos legend { font-weight:700; padding:0 6px; color:var(--teal-700); font-family:var(--font-display); }
.de-grupos label { font-size:.85rem; color:var(--text-muted); }
.de-grupos select, .de-grupos input { width:100%; padding:8px 10px; border:1px solid var(--field-border); border-radius:var(--radius-sm); font-size:.9rem; background:#fff; margin:0; }
.de-grupos .de-terminos { grid-column:1 / -1; grid-template-columns:30px 1fr; }
.de-grupos .de-linea { font-size:.9rem; padding:6px 0; color:var(--navy-900, #0C2B5C); }
.de-grupos .de-linea input.de-valor { width:auto; min-width:0; padding:4px 8px; margin:0 3px; text-align:center; border-color:var(--teal-500, #00A98F); background:var(--teal-50, #E6F7F4); }
.drop { border:2px dashed var(--field-border); border-radius:var(--radius-lg); padding:clamp(24px, 5vw, 44px); text-align:center; cursor:pointer; transition:.18s var(--ease); display:block; background:var(--surface-alt); }
.drop.over, .drop:hover { border-color:var(--teal-500); background:var(--teal-50); }
.drop strong { color:var(--teal-700); }
.tabs { display:flex; gap:6px; margin-bottom:16px; border-bottom:1px solid var(--line); overflow-x:auto; }
.tab { background:none; color:var(--text-muted); border-radius:var(--radius-sm) var(--radius-sm) 0 0; padding:11px 18px; border-bottom:3px solid transparent; white-space:nowrap; min-height:44px; box-shadow:none; font-weight:500; }
.tab:hover:not(:disabled) { background:var(--surface-alt); color:var(--navy-800); transform:none; box-shadow:none; }
.tab.activa { color:var(--navy-800); border-bottom-color:var(--teal-500); font-weight:700; }
.grilla { max-height:420px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius-md); background:#fff; }
.grilla table { border-collapse:separate; border-spacing:0; }
.grilla thead th { position:sticky; top:0; background:var(--surface-alt); z-index:1; }
.grilla td { padding:0; border-bottom:1px solid var(--line); border-right:1px solid var(--line); }
.grilla td.num { text-align:center; color:var(--text-muted); background:#FAFCFC; font-size:.8rem; }
.grilla input { width:100%; border:0; padding:9px 10px; font:inherit; font-size:.92rem; background:transparent; }
.grilla input:focus { outline:2px solid var(--teal-700); outline-offset:-2px; background:var(--teal-50); box-shadow:none; }
.grilla input.mala { background:#FEF3F2; }
/* Grilla de productos compartida (static/js/grilla.js): Cotizar, Generación, Ficha técnica y edición de cotizaciones */
.grilla.alta { max-height:60vh; }
.grilla.ancha table { min-width:1000px; }
.grilla td.n { text-align:center; color:var(--text-muted); background:#FAFCFC; font-size:.8rem; }
.grilla td.x { text-align:center; }
.grilla td.cifra input { text-align:right; }
.grilla tr.mal td { background:#FEF3F2; }
.grilla thead th { padding:8px 10px; font-size:.8rem; }
.bar { height:10px; background:var(--line); border-radius:999px; overflow:hidden; flex:1; min-width:160px; }
.bar > div { height:100%; width:0; background:linear-gradient(90deg, var(--teal-700), var(--teal-500)); transition:width .3s; }
.opciones { margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.opciones .tipos { display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center; margin:6px 0 12px; }
.opciones label.tipo { background:var(--teal-50); border:1px solid var(--teal-100); border-radius:999px; padding:7px 16px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; transition:.18s var(--ease); }
.opciones label.tipo:hover { border-color:var(--teal-500); }
.opciones label.tipo:has(input:checked) { background:var(--teal-700); border-color:var(--teal-700); color:#fff; }
.opciones label.respaldo, .opciones label.principal { display:block; margin:8px 0; }
.opciones details.extra { margin:8px 0; }
.opciones details.extra summary { cursor:pointer; color:var(--teal-700); font-weight:600; }
.opciones input[type=number] { padding:8px 10px; border:1px solid var(--field-border); border-radius:var(--radius-sm); min-height:38px; }
.empresa label { display:block; font-weight:600; margin-top:10px; color:var(--navy-800); }
.empresa input[type=text], .empresa input[type=password] { width:100%; margin-top:4px; padding:11px 14px; min-height:46px; border:1px solid var(--field-border); border-radius:var(--radius-sm); font-weight:400; }
.empresa .dos { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* selectores dentro de las grillas (sin margen ni borde propio) */
td select { margin:0; }
.grilla td select, .op-grilla td select, .fm-grilla td select { margin:0; min-height:0; border:0; border-radius:0; }

/* ---- tablas ---- */
.scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
table { width:100%; border-collapse:collapse; font-size:.92rem; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
th { font-family:var(--font-display); font-weight:700; color:var(--navy-800); background:var(--surface-alt); white-space:nowrap; font-size:.82rem; letter-spacing:.02em; }
tbody tr:hover td { background:rgba(230,246,242,.5); }
.grilla tbody tr:hover td { background:transparent; }
td.url { max-width:380px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
td img { width:56px; height:56px; object-fit:contain; background:#fff; border-radius:var(--radius-sm); }
td.acciones { white-space:nowrap; }
td.acciones a { margin-right:10px; color:var(--teal-700); text-decoration:none; font-weight:600; }
td.acciones a:hover { text-decoration:underline; }
td.celda { max-width:320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.card.scroll { padding:0; }
.card.scroll td.acciones { position:sticky; left:0; z-index:1; background:#fff; box-shadow:10px 0 10px -10px rgba(12,43,92,.18); }
.card.scroll tbody tr:hover td.acciones { background:var(--teal-50); }
.card.scroll table th:first-child, .card.scroll table td:first-child { padding-left:20px; }

/* ---- tarjetas de inicio de mantenedores ---- */
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap:16px; }
.grid a.tarjeta { display:block; background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px; text-decoration:none; color:var(--text); box-shadow:var(--shadow-sm); transition:transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease); }
.grid a.tarjeta:hover { border-color:var(--teal-500); transform:translateY(-3px); box-shadow:var(--shadow-md); }
.grid .n { font-family:var(--font-display); font-size:1.9rem; font-weight:800; color:var(--navy-800); line-height:1.1; margin:6px 0; }

/* ---- ventanas ---- */
.modal { position:fixed; inset:0; background:rgba(7,27,61,.55); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; z-index:60; padding:16px; }
.modal[hidden] { display:none; }
.modal-caja { background:#fff; border-radius:var(--radius-xl); width:min(680px, 100%); max-height:92vh; overflow:auto; padding:clamp(18px, 3vw, 28px); box-shadow:var(--shadow-lg); animation:aparece .2s var(--ease); }
.modal-cab { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.modal-cab h3 { margin:0; font-size:1.25rem; }
.modal-datos { margin:10px 0 6px; }
.spinner { width:22px; height:22px; border:3px solid var(--teal-100); border-top-color:var(--teal-700); border-radius:50%; animation:giro .8s linear infinite; flex:none; }
.spinner[hidden] { display:none; }
.spinner.chico { width:14px; height:14px; border-width:2px; display:inline-block; vertical-align:-2px; margin-right:6px; }
@keyframes giro { to { transform:rotate(360deg); } }
.actuales { min-height:8px; }
.actual { padding:6px 12px; background:var(--teal-50); border-radius:var(--radius-sm); margin-bottom:6px; font-size:.9rem; }
.log { max-height:230px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius-md); margin-top:10px; }
.log:empty { display:none; }
.linea { padding:7px 12px; border-bottom:1px solid var(--line); font-size:.88rem; }
.linea.bien { color:var(--success); } .linea.mal { color:var(--error); }

/* ---- arrastrar y soltar (tiendas, perfiles) ---- */
.dd { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:8px; }
.dd h4 { margin:0 0 6px; color:var(--text-muted); font-family:var(--font-body); font-weight:600; }
.zona { min-height:90px; padding:12px; border:2px dashed var(--field-border); border-radius:var(--radius-md); display:flex; flex-wrap:wrap; gap:8px; align-content:flex-start; transition:.18s var(--ease); background:#fff; }
.zona.sobre { border-color:var(--teal-500); background:var(--teal-50); }
.chip { background:var(--surface-alt); color:var(--navy-800); border:1px solid var(--line); border-radius:999px; padding:7px 14px; cursor:grab; user-select:none; font-size:.9rem; transition:.18s var(--ease); }
.chip:hover { border-color:var(--teal-500); }
.chip small { opacity:.7; margin-right:4px; }
.chip .flags { display:none; margin-left:10px; font-size:.78rem; }
.chip .flags label { display:inline; margin:0 0 0 6px; font-weight:400; cursor:pointer; }
.zona[data-zona="asig"] .chip .flags { display:inline; }
.chip.moviendo { opacity:.4; }
.zona[data-zona="asig"] .chip { background:var(--teal-50); color:var(--navy-800); border-color:var(--teal-100); }

/* ---- franja de sitios y pie (iguales a los de mecot.cl) ---- */
.franja { background:var(--navy-950); color:#9FB3D1; font-size:.8125rem; }
.franja .in { max-width:1200px; margin:0 auto; padding:0 clamp(16px, 4vw, 32px); display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:36px; }
.franja a { color:#B7C6DD; text-decoration:none; padding:8px 12px; border-radius:var(--radius-sm); font-weight:500; }
.franja a:hover { color:#fff; }
.franja a[aria-current="true"] { color:#fff; background:rgba(255,255,255,.12); }
.franja-sitios { display:flex; gap:4px; }
@media (max-width:640px) { .franja-lema { display:none; } .franja .in { justify-content:center; } }
.pie { background:var(--navy-950); color:var(--navy-50); margin-top:auto; padding:48px 0 0; }
.pie .in { max-width:1200px; margin:0 auto; padding:0 clamp(16px, 4vw, 32px); }
.pie a { color:var(--teal-300); text-underline-offset:.2em; }
.pie a:hover { color:#fff; }
.pie strong { color:#fff; font-family:var(--font-display); }
.pie p { color:var(--navy-50); margin:6px 0 0; font-size:.95rem; }
.pie-grid { display:grid; gap:32px; }
@media (min-width:768px) { .pie-grid { grid-template-columns:1.2fr 1fr 1fr; } }
.pie-logo img { height:44px; width:auto; margin-bottom:12px; }
.pie .copia { border-top:1px solid rgba(255,255,255,.14); margin-top:40px; padding-top:20px; padding-bottom:20px; font-size:.85rem; display:flex; flex-wrap:wrap; gap:8px 24px; justify-content:space-between; color:#9FB3D1; }

/* ---- movimiento reducido ---- */
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }

/* ---- pantallas angostas ---- */
@media (max-width:960px) {
  nav.menu .burger { display:inline-flex; align-items:center; justify-content:center; }
  nav.menu .panel { display:none; position:absolute; left:0; right:0; top:100%; flex-direction:column; align-items:stretch; flex-wrap:nowrap; gap:2px; background:#fff; border-bottom:1px solid var(--line); padding:8px clamp(16px, 4vw, 32px) 16px; box-shadow:var(--shadow-lg); max-height:calc(100vh - 108px); overflow:auto; }
  nav.menu.abierto .panel { display:flex; animation:aparece .2s var(--ease); }
  nav.menu a.item, nav.menu summary { min-height:48px; display:flex; align-items:center; }
  nav.menu summary { justify-content:space-between; }
  nav.menu .sub { position:static; box-shadow:none; border:0; border-left:3px solid var(--teal-100); border-radius:0; margin:0 0 6px 12px; padding:2px 0 2px 8px; min-width:0; animation:none; }
}
@media (max-width:720px) {
  .dd, .empresa .dos { grid-template-columns:1fr; }
  .de-grupos fieldset { grid-template-columns:1fr; }
  .de-grupos .de-terminos { grid-template-columns:30px 1fr; }
  .modal { padding:8px; align-items:flex-end; }
  .modal-caja { max-height:94vh; border-radius:var(--radius-xl) var(--radius-xl) 0 0; }
  .row > button, .row > a.btn { flex:1 1 auto; }
  td.url { max-width:220px; }
  table { font-size:.88rem; }
  th, td { padding:8px 10px; }
  .barra { flex-direction:column; align-items:stretch; }
  .barra input[type=search] { min-width:0; }
  .grilla { max-height:380px; }
}

/* Persona (responsable / quien cotizó): cada una con su color (enlace.colores) */
.persona { display:inline-block; padding:2px 10px; border-radius:999px; font-weight:700; font-size:.8rem; white-space:nowrap; border:1px solid transparent; }

/* ---- Componentes comunes (static/js/ui.js): lista con buscador, filtro de varios valores y filtro de fechas ---- */
.ui-filtro { display:flex; align-items:center; justify-content:space-between; gap:6px; width:100%; box-sizing:border-box; min-height:0; padding:4px 8px; font:inherit; font-size:.78rem; font-weight:400;
  color:var(--navy-800, #0C2B5C); background:#fff; border:1px solid var(--line); border-radius:6px; cursor:pointer; text-align:left; box-shadow:none; }
.ui-filtro:hover { border-color:var(--accent); background:#fff; }
.ui-filtro .ui-txt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ui-filtro .ui-txt.vacio { color:#6b7a90; }
.ui-filtro.con-filtro { border-color:var(--accent); background:var(--teal-50, #e6f4f1); font-weight:600; }
.ui-filtro.ui-abierto, .ui-filtro:focus, .ui-filtro:active { border-color:var(--accent); box-shadow:0 0 0 2px rgba(0,122,104,.18); background:#fff; color:var(--navy-800, #0C2B5C); }
.ui-filtro.con-filtro.ui-abierto, .ui-filtro.con-filtro:focus { background:var(--teal-50, #e6f4f1); }
.ui-panel { position:fixed; z-index:3000; display:flex; flex-direction:column; gap:6px; max-width:min(420px, calc(100vw - 16px)); padding:8px; background:#fff; color:var(--navy-800, #0C2B5C);
  border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 32px rgba(12,43,92,.22); font-size:.88rem; text-transform:none; font-weight:400; }
.ui-panel .ui-buscar { width:100%; box-sizing:border-box; padding:8px 10px; font:inherit; border:1px solid var(--line); border-radius:8px; }
.ui-panel .ui-opciones { overflow:auto; flex:1 1 auto; min-height:0; max-height:300px; }
.ui-panel .ui-opcion { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:8px; cursor:pointer; line-height:1.25; }
.ui-panel .ui-opcion span { flex:1 1 auto; }
.ui-panel .ui-opcion em { font-style:normal; font-size:.78rem; color:#6b7a90; }
.ui-panel .ui-opcion:hover, .ui-panel .ui-opcion.activa { background:var(--teal-50, #e6f4f1); }
.ui-panel .ui-opcion.sel { font-weight:700; }
.ui-panel .ui-opcion.off { opacity:.45; cursor:not-allowed; }
.ui-panel .ui-opcion input { width:auto; margin:0; }
.ui-panel .ui-grupo { padding:6px 10px 2px; font-size:.75rem; font-weight:700; text-transform:uppercase; color:#6b7a90; }
.ui-panel .ui-vacio { padding:10px; color:#6b7a90; text-align:center; }
.ui-panel .ui-acciones { display:flex; gap:6px; flex-wrap:wrap; }
.ui-panel .ui-acciones button { min-height:0; padding:4px 10px; font-size:.78rem; background:#fff; color:var(--navy-800, #0C2B5C); border:1px solid var(--line); border-radius:999px; box-shadow:none; cursor:pointer; }
.ui-panel .ui-acciones button:hover { border-color:var(--accent); }
.ui-panel.ui-rango label { display:flex; flex-direction:column; gap:3px; font-size:.8rem; font-weight:600; }
.ui-panel.ui-rango input { padding:7px 8px; font:inherit; border:1px solid var(--line); border-radius:8px; }
select[data-buscar], select { cursor:pointer; }

/* ---- ventanas con «Ver» (static/js/ui.js) ---- */
.modal-caja.ancha { width:min(1120px, 100%); }
.ui-visor { margin-top:14px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; }
.ui-visor .barra { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 12px; background:var(--surface-alt); }
.ui-visor .barra > span { display:flex; gap:8px; }
.ui-visor .barra a.boton, .ui-visor .barra button { min-height:0; padding:6px 14px; font-size:.85rem; }
.ui-visor iframe { display:block; width:100%; height:62vh; border:0; background:#fff; }
body.embed { background:#fff; }
body.embed main { padding:12px 16px; max-width:none; margin:0; }
body.embed .solo-pagina { display:none !important; }

/* Botones de acción de fila: solo icono, la leyenda aparece al pasar el cursor (ahorra espacio en las grillas) */
.ic { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; min-height:0; padding:0; margin:0 1px; border:1px solid transparent; border-radius:8px;
      background:none; box-shadow:none; color:var(--navy-800); font-size:.95rem; line-height:1; text-decoration:none; cursor:pointer; position:relative; vertical-align:middle; }
.ic:hover, .ic:focus-visible { background:var(--teal-50); border-color:var(--teal-100); text-decoration:none !important; }
.ic.rojo { color:var(--err); background:none; } .ic.rojo:hover { background:#fde8e8; border-color:#f4b6b6; }
.ic[data-tip]:hover::after, .ic[data-tip]:focus-visible::after { content:attr(data-tip); position:absolute; left:100%; top:50%; transform:translateY(-50%); margin-left:6px; z-index:60;
      background:var(--navy-800); color:#fff; font:600 .72rem/1.2 var(--font-body, inherit); padding:5px 8px; border-radius:6px; white-space:nowrap; pointer-events:none; box-shadow:var(--shadow-lg); }
td.acciones form { display:inline-flex; margin:0; align-items:center; }
td.acciones select.estado { width:auto; max-width:118px; padding:3px 4px; font-size:.72rem; margin-left:4px; }
/* listas de Mantenedores y similares: más compactas */
.card.scroll table { font-size:.8rem; }
.card.scroll th, .card.scroll td { padding:6px 8px; }
.card.scroll th { font-size:.72rem; }
.card.scroll table th:first-child, .card.scroll table td:first-child { padding-left:8px; }
td.celda { max-width:230px; }
.ui-leyenda { position:fixed; z-index:1000; max-width:min(480px, calc(100vw - 16px)); background:var(--navy-800); color:#fff; font:500 .8rem/1.35 var(--font-body, inherit); padding:7px 10px; border-radius:8px; box-shadow:var(--shadow-lg); pointer-events:none; overflow-wrap:anywhere; }
.barra-fichas { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:0 0 8px; }
.scroll-fichas { max-height:42vh; overflow:auto; border:1px solid var(--line); border-radius:10px; margin-bottom:10px; }
.scroll-fichas table { font-size:.82rem; } .scroll-fichas th, .scroll-fichas td { padding:5px 8px; } .scroll-fichas thead th { position:sticky; top:0; z-index:1; }
.scroll-fichas td.celda { max-width:340px; }
.scroll-fichas th:first-child { width:38px; } .scroll-fichas th:nth-child(2) { width:44px; }
.nombre-archivo .ok { color:var(--ok); font-weight:600; }
.repro-lista { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.repro-fila { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 10px; border-bottom:1px solid var(--line); font-size:.88rem; }
.repro-fila:last-child { border-bottom:0; }
.repro-formas { display:grid; gap:8px; margin:0 0 12px; }
.repro-formas button { display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; padding:10px 14px; }
.repro-formas button .muted { font-weight:400; font-size:.82rem; }

/* selección de celdas como en Excel (static/js/seleccion-rango.js) */
td.sel-rango { background:rgba(0,169,143,.20) !important; box-shadow:inset 0 0 0 1px var(--teal-700); }
td.sel-rango input, td.sel-rango select { background:transparent !important; }
tbody.seleccionando { user-select:none; -webkit-user-select:none; cursor:cell; }
tbody.seleccionando input, tbody.seleccionando select { cursor:cell; }
.form-modal label { display:block; font-weight:600; margin-top:12px; color:var(--navy-800); }
.form-modal input, .form-modal select { display:block; width:100%; margin-top:4px; font-weight:400; }
.repro-acc { display:flex; align-items:center; gap:2px; flex-shrink:0; }

/* comparar cotizaciones (⇄ Comparar): una columna por cotización, el mejor precio en verde */
.dif-sel { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; margin:0 0 12px; }
.dif-sel label { display:flex; align-items:center; gap:6px; font-weight:400; font-size:.88rem; }
.dif-tabla { width:100%; border-collapse:collapse; font-size:.85rem; }
.dif-tabla th, .dif-tabla td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.dif-tabla thead th { position:sticky; top:0; background:var(--surface-alt); z-index:1; }
.dif-tabla td.dif-prod { min-width:220px; max-width:360px; }
.dif-tabla td.dif-mejor { background:#E6F6F1; }
.dif-tabla td.dif-vacio { color:var(--text-muted); background:#FAFAFA; font-style:italic; }
.dif-pct { color:var(--err); font-size:.78rem; font-weight:600; }
.dif-tag { display:inline-block; padding:1px 8px; border-radius:999px; font-size:.72rem; font-weight:600; background:#CFEFE6; color:#00574A; white-space:nowrap; }
.dif-tabla tfoot td, .dif-total td { font-size:.92rem; border-top:2px solid var(--navy-800); background:var(--surface-alt); }
.dif-tabla tfoot td.dif-mejor { background:#E6F6F1; }

/* ---- barra de desplazamiento horizontal arriba de las grillas (se sincroniza con la de abajo) ---- */
.ui-scroll-arriba { overflow-x:auto; overflow-y:hidden; height:14px; margin:0; }
.ui-scroll-arriba[hidden] { display:none; }
.ui-scroll-arriba > div { height:1px; }

/* ---- fila de filtros por columna bajo el encabezado de las tablas ---- */
tr.ui-filtros th { background:var(--surface-alt); padding:4px; font-weight:400; border-bottom:1px solid var(--line); }
tr.ui-filtros input { width:100%; min-width:60px; box-sizing:border-box; padding:4px 6px; font:inherit; font-size:.78rem; border:1px solid var(--line); border-radius:6px; background:#fff; }

/* ---- «⚙ Columnas»: elegir qué columnas ver en cada grilla ---- */
.ui-cols-barra { display:flex; justify-content:flex-end; margin:4px 0 4px; }
.ui-cols-barra button { min-height:34px; padding:4px 12px; font-size:.82rem; }
.ui-cols-panel { padding:8px 10px; }
.ui-cols-panel { min-width:300px; }
.ui-cols-lista { flex:1 1 auto; min-height:0; max-height:min(70vh, 560px); overflow:auto; display:grid; grid-template-columns:1fr; gap:2px; }
.ui-cols-lista.dos { grid-template-columns:1fr 1fr; column-gap:10px; }
.ui-cols-lista label { display:flex; align-items:center; gap:8px; margin:0; padding:4px 6px; font-weight:400; font-size:.88rem; cursor:pointer; border-radius:6px; }
.ui-cols-lista label:hover { background:var(--teal-50); }
.ui-cols-lista input { width:auto; margin:0; flex:none; }
.ui-cols-pie { border-top:1px solid var(--line); margin-top:6px; padding-top:8px; }
.ui-cols-pie button { min-height:32px; padding:4px 10px; font-size:.8rem; }

/* bloques plegables de las pantallas con varias grillas (Caducadas, Oportunidades) */
details.cad-bloque { margin:14px 0; }
details.cad-bloque > summary { font-size:1.05rem; }
.chip-estado { display:inline-block; padding:2px 10px; border-radius:999px; font-size:.76rem; font-weight:700; background:var(--teal-50); color:var(--navy-800); border:1px solid var(--line); white-space:nowrap; }
.filtro-barra { min-width:230px; }
.filtro-barra .ui-filtro { width:100%; min-height:42px; }

/* Total y presupuesto opcional (static/js/presupuesto.js) */
.presu { display:inline-flex; align-items:center; gap:10px 16px; flex-wrap:wrap; }
.presu-caja { display:inline-flex; align-items:center; gap:8px; margin:0; font-weight:600; font-size:.85rem; }
.presu-caja input { width:150px; margin:0; }
.presu-aviso:empty { display:none; }
.presu-aviso { font-weight:700; font-size:.9rem; }
.presu-aviso.pasa { color:#b42318; background:#fee4e2; border-radius:8px; padding:4px 10px; }
.presu-aviso.ok { color:#007A68; }

/* Notas de la oportunidad elegida (al cotizar) */
.op-notas { flex:1 1 100%; width:100%; box-sizing:border-box; margin:8px 0; padding:10px 12px; background:#fffbe6; border:1px solid #f0e2a0; border-left:4px solid #e0b400; border-radius:8px; font-size:.88rem; }
.op-notas textarea { display:block; width:100%; box-sizing:border-box; margin:6px 0 4px; padding:8px 10px; font:inherit; font-size:.9rem; line-height:1.4; border:1px solid var(--field-border, #c9d2dd); border-radius:8px; background:#fff; resize:vertical; min-height:70px; max-height:260px; }
.op-notas .muted { font-size:.78rem; }

/* Cotizar: filas de resultados editables en la grilla */
td.url { overflow:visible; }
.cel-ed { width:100%; min-width:0; padding:5px 7px; font-size:13px; }
td.url .cel-ed { width:calc(100% - 22px); }
.cel-precio { white-space:nowrap; min-width:150px; }
.cel-precio input.cel-ed { width:82px; }
.cel-precio select.cel-ed { width:auto; }
.cel-img { min-width:190px; }
.cel-img img { height:34px; width:auto; vertical-align:middle; margin-right:6px; border-radius:4px; }
.cel-img input.cel-ed { width:120px; }
.cel-img:focus { outline:2px solid var(--verde, #00A98F); outline-offset:-2px; }
.cel-cant { width:64px; }
.cel-cant input.cel-ed { width:60px; text-align:right; }
.cel-prod { min-width:230px; }
.cel-prod textarea.cel-ed { resize:vertical; font-family:inherit; line-height:1.3; }
