/* Sistema Ayni — línea gráfica del manual de marca:
   azul #021223 (elegancia, poder), naranja #FF5D27 (dinamismo),
   gris claro #E3E3E3 y gris #565656. Founders Grotesk → Hanken Grotesk como sustituta web. */

:root {
  --azul: #021223;
  --azul-2: #0b2238;
  --azul-3: #163452;
  --naranja: #ff5d27;
  --naranja-2: #e84a15;
  --naranja-suave: #fff0ea;
  --gris-claro: #e3e3e3;
  --gris: #565656;

  --fondo: #f3f3f1;
  --superficie: #ffffff;
  --superficie-2: #f8f8f7;
  --borde: #e3e3e3;
  --borde-fuerte: #cfcfcd;
  --texto: #021223;
  --texto-2: #565656;
  --texto-3: #8a8a88;

  --ok: #1d7a52;
  --ok-suave: #e5f3ec;
  --aviso: #a86a00;
  --aviso-suave: #fdf3dd;
  --peligro: #c2321b;
  --peligro-suave: #fbe8e4;
  --info: #23517e;
  --info-suave: #e6eef7;

  --radio: 10px;
  --radio-s: 6px;
  --sombra: 0 1px 2px rgba(2, 18, 35, .06), 0 1px 1px rgba(2, 18, 35, .04);
  --sombra-2: 0 12px 32px rgba(2, 18, 35, .18);
  --fuente: 'Hanken Grotesk', 'Founders Grotesk', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--fuente);
  font-size: 14px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--texto-2); }
.sutil { color: var(--texto-3); font-size: 12px; }
.fuerte { font-weight: 650; }
.nowrap { white-space: nowrap; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral {
  background: var(--azul);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px 16px;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; text-decoration: none; }
.marca svg { width: 34px; height: 31px; color: #fff; }
.marca-txt { line-height: 1.05; }
.marca-txt b { display: block; font-size: 17px; font-weight: 700; }
.marca-txt span { font-size: 15px; font-weight: 400; }
.marca-sub { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--naranja); margin-top: 6px; font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.4); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 8px;
  color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500;
  position: relative;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.activo { background: rgba(255,255,255,.1); color: #fff; }
.nav a.activo::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--naranja); }
.nav .cuenta { margin-left: auto; background: var(--naranja); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }

.lateral-pie { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; font-size: 11.5px; color: rgba(255,255,255,.45); }
.lateral-pie button { background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.lateral-pie button:hover { color: #fff; }
.lateral-pie .ico { width: 14px; height: 14px; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barra-sup {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px;
  background: rgba(243,243,241,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde);
}
.barra-sup .selector { display: flex; align-items: center; gap: 8px; }
.barra-sup .selector label { font-size: 12px; color: var(--texto-2); }
.barra-sup select { border: 1px solid var(--borde); background: var(--superficie); border-radius: 8px; padding: 6px 30px 6px 10px; font-weight: 600; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23565656' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; cursor: pointer; }
.espacio { flex: 1; }
.campana { position: relative; }
.campana .punto { position: absolute; top: -3px; right: -3px; background: var(--naranja); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--fondo); }
.quien { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 99px; border: 1px solid var(--borde); background: var(--superficie); cursor: pointer; }
.quien-txt { line-height: 1.15; text-align: left; }
.quien-txt b { display: block; font-size: 13px; }
.quien-txt span { font-size: 11px; color: var(--texto-2); }

.contenido { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.cabecera h1 { font-size: 26px; font-weight: 700; }
.cabecera p { color: var(--texto-2); margin-top: 4px; }
.cabecera .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.migas { font-size: 12.5px; color: var(--texto-2); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.migas a { text-decoration: none; }
.migas a:hover { color: var(--naranja); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--borde-fuerte);
  background: var(--superficie); color: var(--texto);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--superficie-2); border-color: var(--texto-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.btn.primario:hover { background: var(--naranja-2); border-color: var(--naranja-2); }
.btn.oscuro { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.oscuro:hover { background: var(--azul-3); }
.btn.peligro { color: var(--peligro); border-color: #e9b9b0; }
.btn.peligro:hover { background: var(--peligro-suave); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.chico { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.fantasma { border-color: transparent; background: transparent; }
.btn.fantasma:hover { background: rgba(2,18,35,.05); }
.btn .ico { width: 16px; height: 16px; }
.btn-ico { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--texto-2); }
.btn-ico:hover { background: rgba(2,18,35,.06); color: var(--texto); }
.btn-ico.borde { border-color: var(--borde); background: var(--superficie); }
.link { background: none; border: 0; padding: 0; color: var(--naranja-2); font-weight: 600; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Tarjetas ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--borde); }
.tarjeta-cab h2, .tarjeta-cab h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.tarjeta-cuerpo { padding: 16px 18px; }
.tarjeta-pie { padding: 12px 18px; border-top: 1px solid var(--borde); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.rejilla { display: grid; gap: 16px; }
.rejilla > * { min-width: 0; }
.r-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.r-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.r-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.pila { display: flex; flex-direction: column; gap: 16px; }

.kpi { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sombra); }
.kpi-et { font-size: 12px; color: var(--texto-2); font-weight: 500; }
.kpi-val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-nota { font-size: 12px; color: var(--texto-2); }
.kpi.t-peligro .kpi-val { color: var(--peligro); }
.kpi.t-ok .kpi-val { color: var(--ok); }
.kpi.t-acento { background: var(--azul); border-color: var(--azul); color: #fff; }
.kpi.t-acento .kpi-et, .kpi.t-acento .kpi-nota { color: rgba(255,255,255,.65); }

/* ---------- Insignias ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; line-height: 1.5; }
.badge .ico { width: 12px; height: 12px; }
.t-neutro.badge { background: #eeeeec; color: var(--gris); }
.t-ok.badge { background: var(--ok-suave); color: var(--ok); }
.t-aviso.badge { background: var(--aviso-suave); color: var(--aviso); }
.t-peligro.badge { background: var(--peligro-suave); color: var(--peligro); }
.t-info.badge { background: var(--info-suave); color: var(--info); }
.t-acento.badge { background: var(--naranja-suave); color: var(--naranja-2); }
.t-oscuro.badge { background: var(--azul); color: #fff; }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--azul-3); flex: none; letter-spacing: .02em; }
.avatar.chico { width: 24px; height: 24px; font-size: 9.5px; }
.av-logistica { background: #ff5d27; }
.av-residente { background: #23517e; }
.av-gerente_proyectos { background: #3f5f7c; }
.av-gerente_general { background: #021223; }
.av-compras { background: #1d7a52; }
.av-almacen { background: #8a5a14; }
.av-seguridad { background: #7a3b6a; }
.av-consulta { background: #8a8a88; }

.barra { height: 6px; background: #ececea; border-radius: 99px; overflow: hidden; }
.barra span { display: block; height: 100%; border-radius: 99px; background: var(--ok); transition: width .3s; }
.barra.t-aviso span { background: #e0a21a; }
.barra.t-peligro span { background: var(--peligro); }
.barra.t-acento span { background: var(--naranja); }
.barra-doble { position: relative; height: 8px; background: #ececea; border-radius: 99px; overflow: hidden; }
.barra-doble .ej { position: absolute; inset: 0 auto 0 0; background: var(--azul); }
.barra-doble .co { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, var(--naranja) 0 4px, #ff8a62 4px 8px); }
.barra-doble.excede { outline: 2px solid var(--peligro); outline-offset: 1px; }

/* ---------- Tablas ---------- */
.tabla-env { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--borde); background: var(--superficie-2); white-space: nowrap; }
.tabla td { padding: 10px 12px; border-bottom: 1px solid #efefed; vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr.click { cursor: pointer; }
.tabla tbody tr.click:hover td { background: #fafaf8; }
.tabla tfoot td { font-weight: 700; border-top: 1px solid var(--borde); background: var(--superficie-2); }
.tabla .cod { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11.5px; color: var(--texto-2); white-space: nowrap; }
.tabla tr.quitado td { color: var(--texto-3); }
.tabla tr.quitado td .desc { text-decoration: line-through; }
.tabla tr.rojo td { background: #fff6f4; }
.tabla tr.ambar td { background: #fffaf0; }

/* Hoja tipo Google Sheets */
.hoja { width: 100%; min-width: 1040px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.hoja th { position: sticky; top: 0; background: #f1f1ef; color: var(--texto-2); font-weight: 600; font-size: 11.5px; text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--borde-fuerte); border-right: 1px solid var(--borde); white-space: nowrap; }
.hoja th.idx, .hoja td.idx { width: 34px; text-align: center; color: var(--texto-3); background: #f6f6f4; font-size: 11px; }
.hoja td { border-bottom: 1px solid var(--borde); border-right: 1px solid #efefed; padding: 0; height: 38px; vertical-align: middle; background: #fff; }
.hoja td > .celda { padding: 0 8px; display: flex; align-items: center; gap: 6px; min-height: 37px; }
.hoja input, .hoja select { width: 100%; height: 37px; border: 0; background: transparent; padding: 0 8px; outline: none; }
.hoja input:focus, .hoja select:focus { box-shadow: inset 0 0 0 2px var(--naranja); background: #fffaf7; }
.hoja input.num { text-align: right; font-variant-numeric: tabular-nums; }
.hoja td.calc { background: #fafaf8; font-weight: 600; }
.hoja tr.quitado td { background: #f7f7f5; color: var(--texto-3); }
.hoja tr.quitado .desc { text-decoration: line-through; }
.hoja tfoot td { background: #f1f1ef; font-weight: 700; height: 40px; }
.hoja .agregar td { background: #fff; }
.hoja-env { overflow: auto; border: 1px solid var(--borde-fuerte); border-radius: 8px; }
.hoja .desc { font-weight: 550; }
.hoja .cod { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; color: var(--texto-3); }
.hoja .alerta-celda { color: var(--peligro); }

/* Combobox de ítems */
.combo { position: relative; }
.combo-lista { position: fixed; z-index: 80; width: min(600px, 80vw); max-height: 360px; overflow-y: auto; background: #fff; border: 1px solid var(--borde-fuerte); border-radius: 10px; box-shadow: var(--sombra-2); padding: 6px; }
.combo-op { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.combo-op:hover, .combo-op.activo { background: var(--naranja-suave); }
.combo-op b { font-weight: 600; }
.combo-op .precio { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.combo-op .meta { font-size: 11.5px; color: var(--texto-2); }
.combo-grupo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--texto-3); padding: 8px 10px 4px; }

/* ---------- Formularios ---------- */
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo > span { font-size: 12.5px; font-weight: 600; color: var(--texto-2); }
.campo input, .campo select, .campo textarea, .entrada {
  border: 1px solid var(--borde-fuerte); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none; width: 100%;
}
.campo textarea { resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { border-color: var(--naranja); box-shadow: 0 0 0 3px rgba(255,93,39,.15); }
.error { border-color: var(--peligro) !important; }
.form-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-rejilla .completo { grid-column: 1 / -1; }
.entrada.chica { padding: 5px 8px; height: 32px; }
.tabla input.entrada.chica.num { min-width: 76px; }
.buscador { position: relative; }
.buscador .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--texto-3); width: 16px; height: 16px; }
.buscador input { padding-left: 32px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtros select, .filtros input { height: 36px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--naranja); }

.segmentos { display: inline-flex; background: #eaeae7; border-radius: 9px; padding: 3px; gap: 2px; }
.segmentos button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--texto-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmentos button.on { background: #fff; color: var(--texto); box-shadow: var(--sombra); }
.segmentos .cuenta { font-size: 11px; background: var(--naranja); color: #fff; border-radius: 99px; padding: 0 6px; }

.pestanas { display: flex; gap: 2px; border-bottom: 1px solid var(--borde); margin-bottom: 16px; overflow-x: auto; }
.pestanas button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--texto-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pestanas button:hover { color: var(--texto); }
.pestanas button.on { color: var(--texto); border-bottom-color: var(--naranja); }
.pestanas .ico { width: 16px; height: 16px; }
.pestanas .badge { margin-left: 2px; }

/* ---------- Flujo / pasos ---------- */
.flujo { display: grid; grid-template-columns: repeat(8, minmax(92px, 1fr)); gap: 0; padding: 18px 18px 16px; overflow-x: auto; }
.paso { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 4px; }
.paso::before { content: ''; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--borde); z-index: 0; }
.paso:first-child::before { display: none; }
.paso.hecho::before, .paso.actual::before { background: var(--azul); }
.paso .bola { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--borde-fuerte); color: var(--texto-3); position: relative; z-index: 1; font-weight: 700; font-size: 12px; }
.paso .bola .ico { width: 16px; height: 16px; }
.paso.hecho .bola { background: var(--azul); border-color: var(--azul); color: #fff; }
.paso.actual .bola { border-color: var(--naranja); color: var(--naranja); box-shadow: 0 0 0 4px rgba(255,93,39,.15); }
.paso.observado .bola { border-color: var(--peligro); background: var(--peligro); color: #fff; }
.paso .p-tit { font-size: 12px; font-weight: 650; line-height: 1.2; }
.paso .p-sub { font-size: 11px; color: var(--texto-2); line-height: 1.25; }

/* Línea de tiempo */
.linea-tiempo { list-style: none; margin: 0; padding: 0; }
.linea-tiempo li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.linea-tiempo li::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--borde); }
.linea-tiempo li:last-child::before { display: none; }
.linea-tiempo .t-txt { font-size: 13px; }
.linea-tiempo .t-fecha { font-size: 11.5px; color: var(--texto-3); }

/* Comentarios */
.comentarios { display: flex; flex-direction: column; gap: 12px; }
.comentario { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.comentario .burbuja { background: var(--superficie-2); border: 1px solid var(--borde); border-radius: 0 10px 10px 10px; padding: 8px 11px; }
.comentario .burbuja.obs { background: var(--peligro-suave); border-color: #f0c8bf; }
.comentario .autor { font-size: 12px; font-weight: 650; display: flex; gap: 6px; align-items: baseline; }
.comentario .autor span { font-weight: 400; color: var(--texto-3); font-size: 11px; }
.comentario p { font-size: 13px; margin-top: 2px; }
.redactar { display: flex; gap: 8px; margin-top: 12px; }
.redactar textarea { flex: 1; border: 1px solid var(--borde-fuerte); border-radius: 8px; padding: 8px 10px; resize: none; height: 40px; outline: none; }
.redactar textarea:focus { border-color: var(--naranja); }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #efefed; }
.lista > li:last-child { border-bottom: 0; }
.lista a.fila { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 1; min-width: 0; }
.lista .principal-txt { flex: 1; min-width: 0; }
.lista .principal-txt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .principal-txt span { font-size: 12px; color: var(--texto-2); }
.alerta-fila { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; border-bottom: 1px solid #efefed; text-decoration: none; }
.alerta-fila:last-child { border-bottom: 0; }
.alerta-fila:hover { background: #fafaf8; }
.alerta-fila .ico { margin-top: 1px; }
.alerta-fila.t-peligro .ico { color: var(--peligro); }
.alerta-fila.t-aviso .ico { color: var(--aviso); }
.alerta-fila.t-info .ico, .alerta-fila.t-accion .ico { color: var(--info); }
.alerta-fila.no-leida { background: #fffaf7; }
.alerta-fila.no-leida b { font-weight: 650; }

.aviso-caja { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 9px; border: 1px solid; font-size: 13px; }
.aviso-caja .ico { margin-top: 1px; }
.aviso-caja.t-info { background: var(--info-suave); border-color: #c7d7ea; color: #183b5c; }
.aviso-caja.t-aviso { background: var(--aviso-suave); border-color: #f0dca8; color: #6e4500; }
.aviso-caja.t-peligro { background: var(--peligro-suave); border-color: #f0c8bf; color: #7d1e0e; }
.aviso-caja.t-ok { background: var(--ok-suave); border-color: #bfe0cf; color: #11573a; }
.aviso-caja.t-acento { background: var(--naranja-suave); border-color: #ffd0bd; color: #8a2c0b; }

.estrellas { display: inline-flex; gap: 1px; }
.estrella { background: none; border: 0; padding: 1px; cursor: pointer; color: #d4d4d1; display: inline-grid; }
.estrella:disabled { cursor: default; }
.estrella .ico { width: 15px; height: 15px; }
.estrella.on { color: var(--naranja); }
.estrella.on .ico { fill: var(--naranja); }

.vacio { padding: 36px 18px; text-align: center; color: var(--texto-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vacio .ico { width: 28px; height: 28px; }

/* Proveedores */
.prov { display: flex; flex-direction: column; }
.prov.negra { border-color: #f0c8bf; }
.prov-cab { display: flex; gap: 12px; padding: 16px 18px 12px; align-items: flex-start; }
.prov-logo { width: 42px; height: 42px; border-radius: 10px; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.prov.negra .prov-logo { background: var(--peligro); }
.prov-crit { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 0 18px 12px; font-size: 13px; align-items: center; }
.prov-com { padding: 10px 18px; border-top: 1px solid var(--borde); font-size: 12.5px; color: var(--texto-2); flex: 1; }

/* Partidas */
.partida-fila td:first-child { width: 80px; }
.cap-fila td { background: #f6f6f4; font-weight: 650; font-size: 12.5px; }
.leyenda { display: flex; gap: 14px; font-size: 12px; color: var(--texto-2); flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Chips de impacto */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--borde); border-radius: 9px; padding: 8px 10px; background: #fff; font-size: 12px; min-width: 200px; flex: 1; }
.chip b { display: block; font-size: 12.5px; }
.chip .barra { margin-top: 6px; }

/* Modal */
.modal-capa { position: fixed; inset: 0; z-index: 100; background: rgba(2,18,35,.45); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .15s; }
.modal-capa.abierto { opacity: 1; }
.modal { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--sombra-2); transform: translateY(8px); transition: transform .15s; }
.modal-capa.abierto .modal { transform: none; }
.modal.ancho { width: min(860px, 100%); }
.modal.medio { width: min(680px, 100%); }
.modal-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--borde); }
.modal-cab h3 { font-size: 17px; }
.modal-cuerpo { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-pie { padding: 14px 20px; border-top: 1px solid var(--borde); display: flex; justify-content: flex-end; gap: 8px; }
.texto { color: var(--texto-2); }

/* Subida de comprobantes */
.zona-subida { border: 2px dashed var(--borde-fuerte); border-radius: 12px; padding: 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; background: var(--superficie-2); transition: border-color .12s, background .12s; }
.zona-subida:hover, .zona-subida.encima { border-color: var(--naranja); background: var(--naranja-suave); }
.zona-subida .ico { width: 30px; height: 30px; color: var(--naranja); }
.lectura { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.lectura .vista { border-radius: 10px; border: 1px solid var(--borde); overflow: hidden; background: #f6f6f4; aspect-ratio: 3/4; display: grid; place-items: center; position: relative; }
.lectura .vista img { width: 100%; height: 100%; object-fit: cover; }
.escaneo { position: absolute; left: 0; right: 0; height: 3px; background: var(--naranja); box-shadow: 0 0 12px var(--naranja); animation: escanear 1.4s ease-in-out infinite; }
@keyframes escanear { 0% { top: 4%; } 50% { top: 94%; } 100% { top: 4%; } }
.ticket { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 9px; color: #555; padding: 14px; line-height: 1.5; width: 100%; height: 100%; background: #fff; }
.ia-tag { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--naranja-2); }
.ia-tag .ico { width: 14px; height: 14px; }

/* Asistente */
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 760px; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.msg.yo { align-self: flex-end; grid-template-columns: 1fr 30px; }
.msg .cuerpo { background: var(--superficie-2); border: 1px solid var(--borde); padding: 10px 14px; border-radius: 4px 12px 12px 12px; font-size: 13.5px; }
.msg.yo .cuerpo { background: var(--azul); color: #fff; border-color: var(--azul); border-radius: 12px 4px 12px 12px; }
.msg .cuerpo table { margin-top: 8px; font-size: 12.5px; }
.msg .cuerpo ul { margin: 6px 0 0; padding-left: 18px; }
.bot { width: 30px; height: 30px; border-radius: 50%; background: var(--naranja); color: #fff; display: grid; place-items: center; }
.bot svg { width: 16px; height: 15px; }
.sugerencias { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 12px; }
.sugerencias button { border: 1px solid var(--borde-fuerte); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.sugerencias button:hover { border-color: var(--naranja); color: var(--naranja-2); }
.chat-entrada { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--borde); }
.chat-entrada input { flex: 1; }

/* Avisos */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--azul); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--sombra-2); font-weight: 500; max-width: 420px; animation: entra .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.t-ok .ico { color: #6be0a7; }
.toast.t-peligro .ico, .toast.t-aviso .ico { color: var(--naranja); }
.toast.sale { opacity: 0; transform: translateY(6px); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

/* Menús desplegables */
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra-2); width: 360px; z-index: 60; overflow: hidden; }
.menu-pop header { padding: 12px 16px; border-bottom: 1px solid var(--borde); font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.menu-pop .cuerpo { max-height: 420px; overflow-y: auto; }
.menu-usuario button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 14px; border: 0; background: none; cursor: pointer; text-align: left; }
.menu-usuario button:hover { background: var(--superficie-2); }
.menu-usuario button.on { background: var(--naranja-suave); }
.menu-usuario b { display: block; font-size: 13px; }
.menu-usuario span { font-size: 11.5px; color: var(--texto-2); }
.relativo { position: relative; }

/* Bienvenida */
.hero { background: var(--azul); color: #fff; border-radius: 14px; padding: 22px 24px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 240px; background: url('../img/simbolo.svg') no-repeat center / contain; filter: invert(1); opacity: .06; }
.hero h1 { font-size: 24px; }
.hero p { color: rgba(255,255,255,.7); margin-top: 4px; }
.hero > div:last-child { flex-wrap: wrap; }
.hero .linea { width: 44px; height: 3px; background: var(--naranja); margin-bottom: 12px; }

.separador { height: 1px; background: var(--borde); margin: 4px 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.dl dt { color: var(--texto-2); }
.dl dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grande { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.solo-movil { display: none !important; }

@media print {
  .lateral, .barra-sup, .no-imprimir { display: none !important; }
  .app { display: block; }
  .contenido { padding: 0; }
  .tarjeta { box-shadow: none; }
}

@media (max-width: 1100px) {
  .r-main { grid-template-columns: 1fr; }
}
/* Pantallas de laptop: el menú lateral queda solo con íconos */
@media (max-width: 1180px) and (min-width: 801px) {
  .app { grid-template-columns: 68px 1fr; }
  .lateral { padding: 18px 10px 14px; align-items: center; }
  .marca { padding: 0 0 18px; }
  .marca-txt, .marca-sub, .nav-sec, .nav a > span:not(.cuenta), .sync span { display: none !important; }
  .nav { width: 100%; }
  .nav a { justify-content: center; padding: 10px 0; }
  .nav a.activo::before { left: -10px; }
  .nav .cuenta { position: absolute; top: 3px; right: 6px; font-size: 9.5px; padding: 0 5px; }
  .nav-sec + a, .nav a + .nav-sec { margin-top: 0; }
  .lateral-pie { display: flex; justify-content: center; width: 100%; }
  .contenido { padding: 22px 20px 60px; }
  .barra-sup { padding: 10px 20px; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; z-index: 90; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-abierto .lateral { transform: none; }
  .solo-movil { display: inline-grid !important; }
  .r-2, .r-3 { grid-template-columns: 1fr; }
  .r-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-val { font-size: 19px; }
  .barra-sup .sutil, .barra-sup .selector label { display: none; }
  .cabecera h1 { font-size: 22px; }
  .contenido { padding: 18px 16px 60px; }
  .barra-sup { padding: 10px 16px; }
  .quien-txt { display: none; }
  .lectura { grid-template-columns: 1fr; }
}

/* ---------- Hoja del requerimiento (formato Excel de obra) ---------- */
.hoja-barra { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.hoja-doc { background: #fff; border: 1px solid var(--borde-fuerte); border-radius: 10px; overflow: hidden; }
.doc-cab { display: grid; grid-template-columns: 200px 1fr 200px; align-items: center; padding: 12px 16px; border-bottom: 2px solid var(--azul); }
.doc-cab h2 { text-align: center; font-size: 17px; letter-spacing: .02em; }
.doc-cab .sutil { text-align: right; }
.doc-logo { display: flex; align-items: center; gap: 8px; line-height: 1.05; font-size: 12px; }
.doc-logo svg { width: 30px; height: 28px; color: var(--azul); }
.doc-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 16px; font-size: 12.5px; border-bottom: 1px solid var(--borde); flex-wrap: wrap; }
.doc-meta .amarillo { background: #fff34d; padding: 4px 14px; font-weight: 600; font-size: 12px; }
.doc-in { border: 1px solid transparent; background: transparent; padding: 2px 6px; border-radius: 4px; font-weight: 600; min-width: 260px; }
.doc-in:hover { border-color: var(--borde); }
.doc-in:focus { outline: none; border-color: var(--naranja); background: #fff; }
.amarillo .doc-in { min-width: 0; }

.xls-env { border: 0; border-radius: 0; max-height: 70vh; }
.xls { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.xls th, .xls td { border-right: 1px solid #e6e6e3; border-bottom: 1px solid #e6e6e3; height: 32px; padding: 0; vertical-align: middle; background: #fff; }
.xls thead th { position: sticky; top: 0; z-index: 3; background: #f1f1ef; color: var(--azul); font-size: 11px; font-weight: 700; text-align: center; padding: 0 8px; white-space: nowrap; }
.xls thead tr.grupos th { top: 0; height: 24px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); background: #e9e9e6; font-weight: 600; }
.xls thead tr:nth-child(2) th { top: 24px; }
.xls .fija { position: sticky; z-index: 2; }
.xls thead .fija { z-index: 4; }
.xls .f1 { left: 0; text-align: center; }
.xls .f2 { left: 52px; box-shadow: 2px 0 0 #d7d7d4; }
.xls td .celda { overflow: hidden; }
.xls td.obs .celda, .xls td.gerencia .celda, .xls td.respuesta .celda { padding: 4px 8px; line-height: 1.3; }
.xls .celda { padding: 0 8px; display: flex; align-items: center; gap: 6px; min-height: 31px; }
.xls td.num .celda { justify-content: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xls td.centro .celda { justify-content: center; }
.xls input, .xls select { width: 100%; height: 31px; border: 0; background: transparent; padding: 0 8px; outline: none; font-size: 12.5px; }
.xls input.num { text-align: right; font-variant-numeric: tabular-nums; }
.xls input:focus, .xls select:focus { box-shadow: inset 0 0 0 2px var(--naranja); background: #fffaf7; }
.xls td.f2 { position: sticky; }
.xls td.f2 input { padding-right: 58px; }
.cod-flot { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: var(--texto-3); pointer-events: none; }
.xls .idx-item { color: var(--texto-2); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.xls .calc { background: #fafaf8; font-weight: 600; }
.xls tr.seccion td { background: #fdf0d8; font-weight: 700; color: var(--azul); }
.xls tr.seccion .sub .celda { justify-content: flex-end; }
.xls td.estado { text-align: center; font-weight: 700; font-size: 11.5px; }
.xls td.estado.pagado, .xls td.estado.pagado select { background: #dfe9f7; color: #1c3f8f; }
.xls td.estado.pendiente, .xls td.estado.pendiente select { background: #fdf3c4; color: #6b5300; }
.xls td.estado .celda { justify-content: center; }
.xls td.estado select { font-weight: 700; text-align: center; }
.xls tr.obs-gerencia td:not(.estado) { background: #ffe2cc; }
.xls tr.obs-gerencia td.gerencia { background: #ffc79c; font-weight: 600; }
.xls tr.quitado td { color: var(--texto-3); background: #f7f7f5; }
.xls tr.quitado .desc { text-decoration: line-through; }
.xls .rojo-txt { color: var(--peligro); }
.xls td.obs .celda { color: #b3261e; font-weight: 600; }
.xls td.acc { min-width: 90px; }
.xls td.acc .btn, .xls td.acc .btn-ico { margin: 0 4px; }
.xls tr.agregar td { background: #fcfcfb; }
.xls tfoot td { background: #f6f6f4; font-weight: 700; height: 34px; font-size: 12px; }
.xls tfoot td.f2 { padding: 0 8px; }
.xls tfoot td.num { padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xls tfoot tr.total-final td { background: #fff34d; }
.xls tfoot tr.total-final td.num { background: #3e7be0; color: #fff; }
.xls .combo input { height: 31px; }
.xls td.dev-caja input, .xls td.dev-caja input::placeholder { color: var(--peligro); font-weight: 600; }
.xls input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--naranja); vertical-align: middle; }
.xls td.centro { text-align: center; }

/* ---------- Acceso (login, instalación, contraseña) ---------- */
.acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 46%) 1fr; }
.acceso-marca { background: var(--azul); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.acceso-marca::after { content: ''; position: absolute; right: -80px; bottom: -90px; width: 420px; height: 390px; background: url('../img/simbolo.svg') no-repeat center / contain; filter: invert(1); opacity: .06; }
.acceso-logo { display: flex; align-items: center; gap: 12px; font-size: 18px; line-height: 1.05; }
.acceso-logo svg { width: 46px; height: 42px; color: #fff; }
.acceso-marca h1 { font-size: 34px; line-height: 1.1; margin-top: 4px; }
.acceso-marca p { color: rgba(255,255,255,.7); margin-top: 12px; max-width: 420px; }
.acceso-marca .linea { width: 52px; height: 3px; background: var(--naranja); margin-bottom: 18px; }
.sutil-claro { font-size: 12px; color: rgba(255,255,255,.4); }
.acceso-form { display: grid; place-items: center; padding: 32px 20px; }
.acceso-form form { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.acceso-form h2 { font-size: 24px; }
.grande-btn { height: 44px; font-size: 15px; }
.cargando { min-height: 100vh; display: grid; place-items: center; text-align: center; color: var(--texto-2); gap: 12px; }
@media (max-width: 800px) {
  .acceso { grid-template-columns: 1fr; }
  .acceso-marca { padding: 24px; gap: 24px; }
  .acceso-marca h1 { font-size: 24px; }
}

/* Estado de sincronización */
.sync { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: rgba(255,255,255,.6); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #3ccf8e; flex: none; }
.sync span { display: none; }
.sync[data-sync="ok"] .s-ok, .sync[data-sync="guardando"] .s-guardando, .sync[data-sync="sin-conexion"] .s-sin { display: inline; }
.sync[data-sync="guardando"] i { background: #f5c242; animation: latido 1s infinite; }
.sync[data-sync="sin-conexion"] i { background: var(--naranja); }
@keyframes latido { 50% { opacity: .3; } }

/* ---------- Planilla tipo Google Sheets ---------- */
.planilla { background: #fff; border: 1px solid var(--borde-fuerte); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; outline: none; }
.planilla:focus-visible { box-shadow: 0 0 0 2px rgba(26,115,232,.25); }
.planilla.completa { position: fixed; inset: 0; z-index: 85; border-radius: 0; border: 0; }
.planilla.completa .pl-grilla { max-height: none; flex: 1; }
.pl-barra { display: flex; align-items: center; gap: 2px; padding: 6px 10px; background: #f6f8fc; border-bottom: 1px solid #e3e6ea; flex-wrap: wrap; }
.pl-btn { height: 30px; min-width: 30px; padding: 0 7px; border: 0; background: transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; color: #3c4043; font-size: 13px; font-weight: 600; position: relative; white-space: nowrap; }
.pl-btn:hover { background: #e8ebf0; }
.pl-btn .ico { width: 16px; height: 16px; }
.pl-btn.ancho { padding: 0 10px; font-weight: 600; }
.pl-btn.naranja { background: var(--naranja); color: #fff; }
.pl-btn.naranja:hover { background: var(--naranja-2); }
.pl-btn input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.pl-a { font-weight: 800; text-decoration: underline; text-decoration-color: var(--naranja); text-decoration-thickness: 3px; }
.pl-sep { width: 1px; height: 20px; background: #dadce0; margin: 0 5px; }
.pl-formula { display: flex; align-items: center; border-bottom: 1px solid #e3e6ea; height: 34px; }
.pl-ref { width: 92px; padding: 0 10px; font-size: 12.5px; color: #3c4043; border-right: 1px solid #e3e6ea; height: 100%; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.pl-fx { padding: 0 10px; color: #80868b; font-style: italic; font-family: Georgia, serif; border-right: 1px solid #e3e6ea; height: 100%; display: flex; align-items: center; }
.pl-formula input { flex: 1; height: 100%; border: 0; padding: 0 10px; outline: none; font-size: 13px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.pl-formula input:focus { box-shadow: inset 0 -2px 0 #1a73e8; }
.pl-doc { display: grid; grid-template-columns: 170px 1fr auto; gap: 16px; align-items: center; padding: 8px 14px; border-bottom: 2px solid var(--azul); }
.pl-doc .doc-logo { font-size: 11.5px; }
.pl-doc-centro { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12.5px; text-align: center; min-width: 0; }
.pl-doc-centro b { font-size: 15px; letter-spacing: .02em; }
.pl-doc .amarillo { background: #fff34d; padding: 4px 12px; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.pl-doc .doc-in { min-width: 0; width: 260px; }
.pl-doc .amarillo .doc-in { width: 200px; }

.pl-grilla { overflow: auto; max-height: 72vh; position: relative; background: #fff; }
.pl-tabla { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-family: Arial, 'Hanken Grotesk', sans-serif; color: #202124; }
.pl-tabla th, .pl-tabla td { border-right: 1px solid #e2e3e3; border-bottom: 1px solid #e2e3e3; height: 25px; padding: 0; }
.pl-tabla thead th { position: sticky; top: 0; z-index: 4; background: #f8f9fa; color: #5f6368; font-weight: 500; font-size: 11px; text-align: center; height: 22px; user-select: none; cursor: pointer; }
.pl-tabla thead th.marcada, .pl-tabla th.num-fila.marcada { background: #d3e3fd; color: #041e49; font-weight: 700; }
.pl-tabla thead th.esquina { left: 0; z-index: 6; cursor: default; }
.pl-tabla thead th.fija { z-index: 5; }
.pl-tabla .redim { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.pl-tabla .redim:hover { background: #1a73e8; opacity: .5; }
.pl-tabla th.num-fila { position: sticky; left: 0; z-index: 3; background: #f8f9fa; color: #5f6368; font-weight: 400; font-size: 11px; text-align: center; width: 44px; cursor: pointer; user-select: none; }
.pl-tabla td { background: #fff; cursor: cell; position: relative; }
.pl-tabla td > div { padding: 0 6px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-tabla td.fija { position: sticky; z-index: 2; }
.pl-tabla td[data-c="1"], .pl-tabla thead th[data-col="1"] { box-shadow: 2px 0 0 #c4c7c5; }
.pl-tabla td.der { text-align: right; font-variant-numeric: tabular-nums; }
.pl-tabla td.centro { text-align: center; }
.pl-tabla td.rojo { color: #c5221f; font-weight: 600; }
.pl-tabla td.error { color: #c5221f; font-weight: 700; }
.pl-tabla td.fx::after { content: ''; position: absolute; right: 0; top: 0; border-left: 6px solid transparent; border-top: 6px solid #1a73e8; }
.pl-tabla tr.titulos td { background: #eef1f6; font-weight: 700; text-align: center; color: var(--azul); font-size: 11.5px; }
.pl-tabla tr.seccion td { background: #fdf0d8; font-weight: 700; color: var(--azul); }
.pl-tabla tr.seccion td[data-c="1"] > div { overflow: visible; }
.pl-tabla tr.obs-gerencia td { background: #ffe2cc; }
.pl-tabla tr.obs-gerencia td[data-c="13"] { background: #ffc79c; font-weight: 600; }
.pl-tabla tr.quitado td { color: #9aa0a6; background: #f7f7f7; }
.pl-tabla tr.quitado td[data-c="1"] { text-decoration: line-through; }
.pl-tabla td.pagado { background: #dfe9f7 !important; color: #1c3f8f; font-weight: 700; }
.pl-tabla td.pendiente { background: #fdf3c4 !important; color: #6b5300; font-weight: 700; }
.pl-tabla tr.vacia td { background: #fff; }
.pl-tabla tr.pie td { background: #f6f6f4; font-weight: 700; }
.pl-tabla tr.monto td { background: #fff34d; }
.pl-tabla tr.monto td[data-c="7"] { background: #3e7be0; color: #fff; }
.pl-tabla td.en-rango { background-image: linear-gradient(rgba(26,115,232,.12), rgba(26,115,232,.12)); }
.pl-tabla td.activa { outline: 2px solid #1a73e8; outline-offset: -2px; z-index: 3; }
.pl-tabla td.editando > div { visibility: hidden; }
.pl-edit { position: absolute; inset: -1px; min-width: 100%; width: max(100%, 260px); z-index: 7; border: 2px solid #1a73e8; box-shadow: 0 2px 6px rgba(0,0,0,.25); font: inherit; padding: 0 6px; outline: none; background: #fff; height: 27px; }
select.pl-edit { width: 100%; }
.pl-sugerencias { width: 460px; }
.pl-estado { display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px; border-top: 1px solid #e3e6ea; background: #f8f9fa; font-size: 11.5px; color: #5f6368; flex-wrap: wrap; }
.pl-menu { z-index: 120; }
.pl-captura { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; resize: none; }
.planilla:focus-within { box-shadow: 0 0 0 2px rgba(26,115,232,.18); }

/* Fechas y montos en compras */
.fechas-celda { min-width: 150px; }
.fechas-celda label { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 4px; font-size: 11px; color: var(--texto-2); }
.fechas-celda label + label { margin-top: 4px; }
.fechas-celda input { width: 132px; min-width: 0; }
.pie-montos { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.pie-montos b { margin-left: 4px; }
.tarjeta-cab h2, .tarjeta-cab h3 { min-width: 0; }
.tarjeta-cab > .sutil { white-space: nowrap; }
.recorte { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ojito para ver la contraseña y enlaces de acceso */
.clave-caja { position: relative; display: block; }
.clave-caja input { padding-right: 44px; }
.ver-clave { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; border: 0; background: transparent; border-radius: 6px; display: grid; place-items: center; color: var(--texto-2); cursor: pointer; }
.ver-clave:hover { background: rgba(2,18,35,.06); color: var(--texto); }
.ver-clave .ico { width: 18px; height: 18px; }
.acceso-pie { text-align: center; color: var(--texto-2); font-size: 13.5px; }

/* ---------- Pulido general de interfaz ---------- */
.rejilla { gap: 18px; }
.tarjeta-cab { padding: 16px 20px; min-height: 58px; }
.tarjeta-cuerpo { padding: 18px 20px; }
.tarjeta-pie { padding: 14px 20px; }
.kpi { padding: 16px 18px; gap: 6px; min-width: 0; }
.kpi-nota { overflow-wrap: anywhere; }
.lista > li { padding: 13px 20px; gap: 14px; }
.lista .principal-txt span { line-height: 1.45; }
.tabla th { padding: 11px 16px; }
.tabla td { padding: 12px 16px; line-height: 1.4; }
.tabla td .badge + .badge, .tabla td .badge + .sutil { margin-left: 6px; }
.tabla .sutil { line-height: 1.45; }
.cabecera { gap: 20px; margin-bottom: 22px; }
.cabecera .acciones { gap: 10px; }
.badge { padding: 3px 9px; }
.dos-lineas { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips-linea { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-linea .badge { margin: 0 !important; }
.apagada { opacity: .55; }

/* Desplegables: flecha propia con espacio, nunca cortada */
select.entrada, .campo select, .tabla select, .tabla-usuarios select, .modal select {
  appearance: none; -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23565656' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  padding-right: 34px !important; text-overflow: ellipsis; cursor: pointer;
}
.xls select, .pl-tabla select { background-position: right 6px center; padding-right: 24px !important; }

/* Usuarios */
.persona { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.persona-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.persona-txt .recorte { max-width: 260px; color: var(--texto-2); font-size: 12.5px; }
.tabla-usuarios select { min-width: 200px; width: auto; height: 36px; }
.tabla-usuarios td { vertical-align: middle; }
.tabla-usuarios td:nth-child(3) { max-width: 300px; }
.tabla-usuarios td:nth-child(4) { min-width: 200px; }
.tabla-usuarios .recorte { max-width: 230px; }
.acc-celda { width: 60px; text-align: right; }
.tabla-permisos th { text-align: center; white-space: normal; min-width: 96px; line-height: 1.3; vertical-align: bottom; }
.tabla-permisos th:first-child { text-align: left; min-width: 240px; }
.tabla-permisos td { text-align: center; }
.tabla-permisos td:first-child { text-align: left; }
.tabla-permisos .si { color: var(--ok); display: inline-grid; }
.checks-proyectos { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--borde-fuerte); border-radius: 99px; font-weight: 600; font-size: 13px; background: #fff; transition: all .12s; }
.check-chip span::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--borde-fuerte); background: #fff; flex: none; }
.check-chip input:checked + span { border-color: var(--naranja); background: var(--naranja-suave); color: var(--naranja-2); }
.check-chip input:checked + span::before { background: var(--naranja) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; border-color: var(--naranja); }
.check-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255,93,39,.2); }
.nuevo-proyecto-linea { display: flex; gap: 8px; margin-top: 12px; }
.nuevo-proyecto-linea input { flex: 1; min-width: 0; }

/* Menú de acciones */
.menu-acciones { z-index: 130; }
.menu-acciones .menu-usuario button { padding: 10px 14px; }
.menu-acciones .menu-usuario button .ico { width: 16px; height: 16px; color: var(--texto-2); }
.peligro-txt, .peligro-txt .ico { color: var(--peligro) !important; }
.tabla.compacta th { padding: 10px 10px; }
.tabla.compacta td { padding: 10px 10px; }
.tabla.compacta td:first-child, .tabla.compacta th:first-child { padding-left: 16px; }

.var { font-size: 11px; text-align: right; margin-top: 3px; font-weight: 600; }
.r-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); }
.tabla-permisos th { min-width: 76px; font-size: 10.5px; padding: 10px 8px; }
.tabla-permisos th:first-child { min-width: 200px; }
.tabla-permisos td { padding: 10px 8px; }
.tabla.compacta .cod { white-space: normal; }
.tabla.compacta td:first-child { min-width: 170px !important; }
.fechas-celda input { width: 124px; }

/* Carga masiva de ítems */
.pasos-carga { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pasos-carga > div { display: flex; gap: 12px; align-items: flex-start; background: var(--superficie-2); border: 1px solid var(--borde); border-radius: 10px; padding: 14px; }
.num-paso { width: 28px; height: 28px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.pasos-carga p { margin-top: 4px; }
.fila-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 800px) { .pasos-carga { grid-template-columns: 1fr; } }
/* Ajustes finos para pantallas de laptop */
@media (max-width: 1180px) {
  .recorte { max-width: 190px; }
  .tabla-usuarios select { min-width: 165px; }
  .persona { min-width: 190px; }
  .persona-txt .recorte, .tabla-usuarios .recorte { max-width: 180px; }
  .tabla-permisos th { min-width: 66px; padding: 9px 6px; }
  .tabla-permisos th:first-child { min-width: 170px; }
  .tabla-permisos td { padding: 9px 6px; }
  .fechas-celda label { grid-template-columns: 50px 1fr; }
  .fechas-celda input { width: 114px; }
  .tabla.compacta th, .tabla.compacta td { padding: 9px 8px; }
}
@media (max-width: 1180px) {
  .tabla.compacta input.entrada.chica.num { min-width: 60px; width: 72px; }
  .tabla.compacta td[style*="width:90px"], .tabla.compacta td[style*="width:100px"] { width: 80px !important; }
}
