/* ══════════════════════════════════════════════════════════════════════
   Licitaciones — lo propio de esta app, encima de la hoja del Hub.
   Mismos tokens, mismas tarjetas; solo se agregan las piezas que el Hub
   no tiene (veredicto, cuenta regresiva, hallazgos, plan).
   ══════════════════════════════════════════════════════════════════════ */

.nav-mark { display: flex; flex-direction: column; gap: 6px; }
.nav-app { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding-left: 1px; }
.nav-count {
  margin-left: auto; font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center;
}
.mobile-bar-t { font-size: 14px; font-weight: 600; }
@media (max-width: 900px) and (min-width: 641px) { .nav-app, .nav-count { display: none; } }

main:focus, main:focus-visible { outline: none; }
.empty .row { gap: 10px; }
.empty .row .btn { margin: 0; }
.muted { color: var(--muted); }
.sub { font-size: 12.5px; color: var(--muted); }
.mt { margin-top: 14px; }
.stack > * + * { margin-top: 14px; }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wrap-anywhere { overflow-wrap: anywhere; }

/* ── Métricas del resumen ────────────────────────────────────────────── */
a.metric, button.metric { display: block; text-align: left; text-decoration: none; color: inherit; width: 100%; border-radius: var(--r-card); }
a.metric:hover, button.metric:hover { background: var(--surface-2); }
.metric.warn b { color: var(--warn); }
.metric.ok b { color: var(--ok); }
.metric .tag { float: right; }

/* ── Cuenta regresiva ────────────────────────────────────────────────── */
.cd { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 7px 8px; border-radius: 9px; line-height: 1.1; flex: none; }
.cd b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cd small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cd.danger { background: var(--danger-bg); color: var(--danger); }
.cd.warn { background: var(--warn-bg); color: var(--warn); }
.cd.info { background: var(--info-bg); color: var(--info); }
.cd.idle { background: var(--idle-bg); color: var(--idle); }

/* ── Lista de filas (tarjetas internas) ──────────────────────────────── */
.rows > a, .rows > div.r, .rows > button.r {
  display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  text-decoration: none; color: inherit; width: 100%; text-align: left;
}
.rows > :last-child { border-bottom: none; }
.rows > a:hover, .rows > button.r:hover { background: var(--surface-2); }
.rows .t { flex: 1; min-width: 0; }
.rows .t b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .t span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.rows .end small { font-size: 12px; color: var(--muted); }

/* ── Veredicto ───────────────────────────────────────────────────────── */
.verdict { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; overflow: hidden; }
.verdict-main { padding: 22px 22px 20px; border-right: 1px solid var(--line-soft); position: relative; }
.verdict-main::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--vc, var(--idle)); }
.verdict-main .k { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.verdict-main h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 8px; color: var(--vc, var(--ink)); }
.verdict-main p { color: var(--text-mid); font-size: 13.5px; }
.verdict-main .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.duo > div { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-field); padding: 10px 12px; }
.duo span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.duo b { display: block; font-size: 13.5px; margin: 2px 0 3px; }
.duo p { font-size: 12.5px !important; }
.verdict-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.verdict-facts > div { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); min-width: 0; }
.verdict-facts > div:nth-child(2n) { border-right: none; }
.verdict-facts > div.wide { grid-column: 1 / -1; border-right: none; }
.verdict-facts span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.verdict-facts b { display: block; font-size: 13.5px; font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.verdict-facts ul { margin: 4px 0 0 16px; font-size: 13px; }
.v-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ── Secciones del análisis ──────────────────────────────────────────── */
details.sec { border-bottom: 1px solid var(--line-soft); }
details.sec:last-child { border-bottom: none; }
details.sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary:hover { background: var(--surface-2); }
details.sec > summary .n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--text-mid); flex: none; }
details.sec > summary h3 { font-size: 14px; font-weight: 600; flex: 1; }
details.sec > summary .chev { width: 16px; height: 16px; transition: transform .15s; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; }
details.sec[open] > summary .chev { transform: rotate(90deg); }
.sec-body { padding: 0 18px 16px 54px; }
.sec-body > p.res { color: var(--text-mid); font-size: 13.5px; margin-bottom: 10px; }
.item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.item:first-of-type { border-top: none; }
.item .lv { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--idle); }
.item .lv.ok { background: var(--ok); } .item .lv.atencion { background: #D48A00; } .item .lv.bloqueante { background: var(--danger); } .item .lv.info { background: var(--info); }
.item .c { flex: 1; min-width: 0; }
.item .c b { font-weight: 600; font-size: 13.5px; }
.item .c p { font-size: 13px; color: var(--text-mid); margin-top: 2px; overflow-wrap: anywhere; }
.item .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.ref { font-size: 11.5px; color: var(--info); background: var(--info-bg); padding: 2px 7px; border-radius: 5px; }
.src { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--idle-bg); color: var(--idle); }
.src.int { background: var(--accent-soft); color: #C8003F; }
.item .acts { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.item:hover .acts, .item .acts:focus-within { opacity: 1; }
@media (hover: none) { .item .acts { opacity: 1; } }
.item-group { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #C8003F; margin: 14px 0 2px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 500; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
table.mini td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.mini td.r, table.mini th.r { text-align: right; }

/* ── Progreso / análisis en curso ────────────────────────────────────── */
.progress { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.progress.ink > i { background: var(--ink); }
.thinking { display: flex; align-items: center; gap: 14px; padding: 22px; }
.pulse { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; flex: none; animation: pulse 1.6s ease-in-out infinite; }
.pulse svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
@keyframes pulse { 50% { transform: scale(1.08); background: #FFD6E3; } }

/* ── Plan de trabajo ─────────────────────────────────────────────────── */
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: none; }
.task .tick { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #C5D0D5; flex: none; display: grid; place-items: center; margin-top: 1px; background: var(--surface); }
.task .tick svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; opacity: 0; }
.task.done .tick { background: var(--ok); border-color: var(--ok); }
.task.done .tick svg { opacity: 1; }
.task.na .tick { background: var(--idle-bg); border-style: dashed; }
.task .tick:hover { border-color: var(--ok); }
.task .c { flex: 1; min-width: 0; cursor: pointer; }
.task .c b { font-weight: 500; font-size: 13.5px; display: block; }
.task.done .c b, .task.na .c b { text-decoration: line-through; color: var(--muted); }
.task .c .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.task .when { font-size: 12.5px; white-space: nowrap; color: var(--text-mid); flex: none; text-align: right; }
.task .when.late { color: var(--danger); font-weight: 600; }
.pill { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--idle-bg); color: var(--idle); white-space: nowrap; }
.pill.crit { background: var(--danger-bg); color: var(--danger); }
.pill.not { background: var(--warn-bg); color: var(--warn); }
.pill.firma { background: var(--info-bg); color: var(--info); }

/* ── Economía ────────────────────────────────────────────────────────── */
.eco-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.ledger { padding: 6px 18px 14px; }
.ledger div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line-soft); }
.ledger div:last-child { border-bottom: none; }
.ledger span { color: var(--text-mid); }
.ledger b { font-variant-numeric: tabular-nums; font-weight: 500; }
.ledger div.total { border-top: 1px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 10px; }
.ledger div.total span, .ledger div.total b { color: var(--ink); font-weight: 700; font-size: 15px; }
.ledger div.note span, .ledger div.note b { color: var(--muted); font-size: 12.5px; }
.critr { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; font-size: 13px; }
.critr i { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; margin-top: 1px; }
.critr i.ok { background: var(--ok); } .critr i.no { background: var(--danger); } .critr i.na { background: var(--idle); }
.range { width: 100%; accent-color: var(--accent); }

/* ── Arrastre de archivos ────────────────────────────────────────────── */
.drop {
  border: 1.5px dashed #CBD6DB; border-radius: var(--r-card); padding: 26px 18px; text-align: center;
  background: var(--surface); transition: background .14s, border-color .14s; cursor: pointer; display: block;
}
.drop:hover { border-color: var(--ink); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.7; margin-bottom: 6px; }
.drop b { display: block; font-size: 14px; }
.drop span { font-size: 12.5px; color: var(--muted); }

/* ── Pipeline (barras por estado) ────────────────────────────────────── */
.pipe { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-soft); margin: 4px 0 12px; }
.pipe i { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; font-size: 12.5px; }
.legend div { display: flex; align-items: center; gap: 7px; color: var(--text-mid); }
.legend div b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }

pre.code { background: var(--ink-deep); color: #E2EFF4; border-radius: var(--r-field); padding: 14px; font-size: 12px; max-height: 300px; overflow: auto; white-space: pre-wrap; }
textarea.big { width: 100%; min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-field); outline: none; resize: vertical; }
textarea.big:focus { border-color: var(--accent); }

@media (max-width: 1180px) { .eco-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .verdict { grid-template-columns: 1fr; }
  .verdict-main { border-right: none; border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 640px) {
  .verdict-facts, .verdict-main .duo { grid-template-columns: 1fr; }
  .verdict-facts > div { border-right: none; }
  .sec-body { padding: 0 16px 14px 16px; }
  .rows > a, .rows > div.r, .rows > button.r { padding: 12px 14px; gap: 10px; }
  .task { padding: 12px 14px; }
  .task .when { font-size: 12px; }
  .grid.g3 { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
}
.bar-fill { display: block; }

/* ── Íconos sueltos dentro de filas (sin esto el SVG ocupa todo el ancho) ── */
.rows .r > svg, .row > svg, .file-row svg, .chat-empty svg, .hero-drop .ic svg {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; color: var(--muted);
}
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.file-row:last-child { border-bottom: none; }
.file-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.file-row .st.ok { color: var(--ok); } .file-row .st.bad { color: var(--danger); }

/* ── Zona grande para soltar las bases (Resumen y Licitaciones) ───────── */
.hero-drop {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 16px; cursor: pointer;
  border: 1.5px dashed #CBD6DB; border-radius: var(--r-card); background: var(--surface); transition: border-color .14s, background .14s;
}
.hero-drop:hover { border-color: var(--ink); }
.hero-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.hero-drop .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.hero-drop .ic svg { width: 22px; height: 22px; color: var(--accent); }
.hero-drop > div { flex: 1; min-width: 0; }
.hero-drop > div b { display: block; font-size: 15px; }
.hero-drop > div span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.hero-drop .btn { margin-left: auto; flex: none; }
.drop-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(251, 8, 88, .08); border: 3px dashed var(--accent);
  display: none; place-items: center; pointer-events: none; }
.drop-overlay.on { display: grid; }
.drop-overlay div { background: var(--surface); padding: 18px 26px; border-radius: 14px; box-shadow: var(--shadow-pop); font-weight: 600; font-size: 15px; }
details.manual > summary { cursor: pointer; list-style: none; padding: 14px 18px; font-size: 13.5px; font-weight: 500; color: var(--text-mid); }
details.manual > summary::-webkit-details-marker { display: none; }
details.manual > summary:hover { color: var(--ink); }
@media (max-width: 640px) { .hero-drop { flex-wrap: wrap; } .hero-drop .btn { margin-left: 0; width: 100%; justify-content: center; } }

/* ── Qué piden ──────────────────────────────────────────────────────── */
.req { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.req:first-child { border-top: none; }
.req-h { display: flex; gap: 12px; align-items: flex-start; }
.req-h .q { flex: none; min-width: 56px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; line-height: 1.15; }
.req-h .q b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.req-h .q small { font-size: 11px; color: var(--muted); }
.req-h .d { flex: 1; min-width: 0; }
.req-h .d b { font-size: 14px; font-weight: 600; }
.req ul.specs { margin: 8px 0 0 86px; font-size: 13px; color: var(--text-mid); padding-left: 16px; }
.req ul.specs li { margin: 2px 0; }
.req .meta { margin: 8px 0 0 68px; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .req ul.specs { margin-left: 0; } .req .meta { margin-left: 0; } }

/* ── Asistente ──────────────────────────────────────────────────────── */
.chat-wrap { display: flex; flex-direction: column; min-height: 520px; }
.chat-log { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; font-size: 14px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line-soft); padding: 12px 16px; border-radius: 14px 14px 14px 4px; overflow-wrap: anywhere; }
.msg.assistant p { margin: 0 0 8px; } .msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { margin: 4px 0 8px 20px; }
.msg.assistant h4 { font-size: 14px; margin: 10px 0 4px; }
.msg.assistant code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.msg.assistant a { color: var(--info); }
.msg.assistant .tbl { overflow-x: auto; margin: 6px 0 10px; }
.msg.assistant table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.msg.assistant th { background: var(--surface); font-weight: 600; }
.msg .src-list { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.msg .src-list a { background: var(--info-bg); color: var(--info); padding: 2px 8px; border-radius: 5px; text-decoration: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .cost { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.chat-empty { text-align: center; padding: 30px 20px 10px; color: var(--muted); font-size: 13.5px; }
.chat-sug { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 18px 16px; }
.chat-sug button { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 7px 12px; font-size: 13px; color: var(--text-mid); }
.chat-sug button:hover { border-color: var(--accent); color: var(--ink); }
.chat-box { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--r-card) var(--r-card); }
.chat-box textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-field); outline: none; font-size: 14px; }
.chat-box textarea:focus { border-color: var(--accent); }
.chat-opts { display: flex; align-items: center; gap: 14px; padding: 0 14px 10px; font-size: 12.5px; color: var(--muted); background: var(--surface); border-radius: 0 0 var(--r-card) var(--r-card); }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }

/* ── Auditoría: nada empuja el ancho de la página ─────────────────────── */
.grid > *, .eco-grid > *, .stack > *, .verdict > *, .form-grid > * { min-width: 0; }
.card-head > svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.page-actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .page-actions .btn.primary { flex-basis: 100%; order: -1; }
}

/* ── Ajustes de la auditoría de UI ─────────────────────────────────── */
.field label.check { display: flex; align-items: center; gap: 8px; margin-bottom: 0; color: var(--text); font-weight: 400; font-size: 13.5px; }
.check input { flex: none; margin: 0; }
.notice { flex-wrap: wrap; align-items: center; }
.notice .btn { white-space: nowrap; }
.card-head > div:first-child { min-width: 0; }
.form-grid.three .span2 { grid-column: span 2; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; flex: none; }
.msg.assistant table { overflow-wrap: normal; word-break: normal; }
.msg.assistant th { white-space: nowrap; }
.chat-opts { flex-wrap: wrap; row-gap: 4px; }
.chat-opts .check { white-space: nowrap; }
.req ul.specs { margin-left: 68px; }
.nuevo-cliente { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; grid-column: 1 / -1; }
.kpi-mini .metric b { font-size: 16px; }

/* Documentos como filas (sirve igual en compu y celular) */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: none; }
.doc-row .t { flex: 1 1 240px; min-width: 0; }
.doc-row .t b { display: block; font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.doc-row .t span { display: block; font-size: 12.5px; color: var(--muted); }
.doc-row select { padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--r-field); background: var(--surface); font-size: 13px; outline: none; }
.doc-row .acts { display: flex; gap: 6px; align-items: center; flex: none; }

/* Lista de licitaciones en tarjetas (celular) */
.lic-cards { display: none; }
.lic-card { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.lic-card:last-child { border-bottom: none; }
.lic-card .t { flex: 1; min-width: 0; }
.lic-card .t b { display: block; font-weight: 600; font-size: 14px; line-height: 1.35; }
.lic-card .t .s { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lic-card .t .b { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lic-card .t .n { display: block; font-size: 12.5px; margin-top: 6px; color: var(--text-mid); }

/* Progreso de subida */
.file-row .bar { flex-basis: 100%; height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin: 2px 0 0 28px; }
.file-row .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.file-row { flex-wrap: wrap; }
.file-row.ok .bar i { background: var(--ok); }

@media (max-width: 640px) {
  .card-head { flex-wrap: wrap; }
  .card-head > div:first-child { flex: 1 1 200px; }
  .form-grid.three .span2 { grid-column: auto; }
  .nuevo-cliente { grid-template-columns: 1fr; }
  .grid.g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.g4 .metric { padding: 12px 13px; }
  .grid.g4 .metric b { font-size: 19px; margin-top: 4px; }
  .grid.g4 .metric small { font-size: 11.5px; }
  .kpi-mini .metric b { font-size: 14px !important; line-height: 1.3; }
  .kpi-mini .metric .cd { min-width: 46px; padding: 5px 6px; }
  .kpi-mini .metric .cd b { font-size: 16px; }
  .kpi-mini .metric { gap: 10px !important; }
  .lic-cards { display: block; }
  .lic-table { display: none; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .chip { flex: none; white-space: nowrap; }
  .toolbar .search { flex: 1 0 220px; max-width: none; }
  .req-h { flex-wrap: wrap; }
  .req-h > .btn { margin-left: 68px; }
  .req ul.specs { margin-left: 0; }
  .chat-opts .right { display: none; }
  .doc-row .acts { width: 100%; }
  .doc-row select { flex: 1; }
  .hero-drop { padding: 16px; gap: 12px; }
}
.filtros { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filtros .toolbar { margin-bottom: 0; }
@media (max-width: 640px) {
  .filtros { display: block; }
  .filtros .toolbar { margin-bottom: 8px; }
  .filtros .search { max-width: none; width: 100%; display: block; }
}
.lic-card .cd, .rows .cd { align-self: flex-start; }
.nav-user > .avatar { display: grid !important; place-items: center; }
@media (max-width: 640px) {
  .kpi-mini .metric:first-child { flex-direction: column; align-items: flex-start !important; }
  .msg { max-width: 100%; }
  .msg.user { max-width: 92%; }
  .rows .t b, .rows .t span { white-space: normal; }
  .cfg-grid > .stack:last-child { order: -1; }
  .req-h .d { flex: 1 1 calc(100% - 70px); }
}
.progress.indet i { width: 35%; animation: indet 1.6s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }

/* ── iPhone: nada fuera de la pantalla puede ensanchar la página ─────────
   Safari cuenta los elementos fijos movidos fuera de la vista (panel lateral
   cerrado, menú) y deja la página corrida de lado. Cerrados, no existen. */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { position: relative; overscroll-behavior-x: none; }
.app, .app-body, main { max-width: 100vw; overflow-x: clip; }
.panel { visibility: hidden; transition: transform .24s cubic-bezier(.3,.8,.3,1), visibility 0s linear .24s; }
.panel.open { visibility: visible; transition: transform .24s cubic-bezier(.3,.8,.3,1), visibility 0s; }
@media (max-width: 640px) {
  .nav { visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  .nav.open { visibility: visible; transition: transform .22s ease, visibility 0s; }
}
/* iPhone hace zoom al tocar un campo con letra menor a 16px y la página se
   queda agrandada y corrida. En pantallas táctiles los campos van a 16px. */
@media (max-width: 640px), (pointer: coarse) {
  input, select, textarea, .field input, .field select, .field textarea, .search, .chat-box textarea, .doc-row select, textarea.big { font-size: 16px !important; }
}
