/* ObraPanel — estilo: hoja técnica. Papel cálido, tinta azul marino, acento verde-azulado. */
:root {
  --paper: #f5f4ef;
  --card: #ffffff;
  --ink: #13293d;
  --ink-2: #3c5163;
  --muted: #6b7a87;
  --line: #e2e0d8;
  --line-2: #eceae3;
  --accent: #0f8b8d;
  --accent-2: #0b6d6f;
  --accent-soft: #e3f2f1;
  --warn: #c9821b;
  --warn-soft: #fbf0dc;
  --danger: #c0392b;
  --danger-soft: #fbe7e4;
  --ok: #2e8b57;
  --side: #13293d;
  --side-ink: #c9d5df;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(19, 41, 61, .06), 0 4px 16px rgba(19, 41, 61, .05);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --c1: #0f8b8d; --c2: #e07a3f; --c3: #5b6cc2; --c4: #b58b2a; --c5: #8a5aa8; --c6: #9aa6b2;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 20px; } h3 { font-size: 15px; font-weight: 600; } h4 { font-size: 13px; font-weight: 600; }
p { margin: .4em 0; }
input, select, textarea, button { font: inherit; color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .r { text-align: right; }
.neg { color: var(--danger) !important; } .pos { color: var(--ok); }
.nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; }
.pad { padding: 14px 18px; } .pad-x { padding: 0 18px; } .pad-b { padding-bottom: 12px; }
.w-70 { width: 70px; } .w-80 { width: 80px; } .w-90 { width: 90px; } .w-100 { width: 100px; } .w-130 { width: 130px; } .w-150 { width: 150px; } .w-200 { width: 200px; }
.row { display: flex; align-items: center; } .gap { gap: 8px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 160px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.span2 { grid-column: 1 / -1; }
.print-only { display: none; }

/* Carga */
.loading { height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: ld 1s infinite linear; }
@keyframes ld { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Marco */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 40; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; padding: 6px 8px 16px; text-decoration: none !important; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.side-sec { text-transform: uppercase; font-size: 10.5px; letter-spacing: .09em; color: #7f93a5; padding: 14px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--side-ink); text-decoration: none !important; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.side-link i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.side-link small { margin-left: auto; font-size: 10px; opacity: .6; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.on { background: rgba(47, 180, 166, .16); color: #fff; box-shadow: inset 3px 0 0 #2fb4a6; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.main-wrap { flex: 1; margin-left: 232px; min-width: 0; }
.main { min-height: 100vh; }
.mobile-top { display: none; }
.side-scrim { display: none; }
.page { padding: 26px 32px 60px; max-width: 1400px; }
.page.narrow { max-width: 560px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* Cliente */
.client-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 28px; background: var(--side); }
.client-top .brand { padding: 0; }
.client-top nav { display: flex; gap: 18px; align-items: center; }
.client-top nav a, .client-top .link { color: var(--side-ink); }
.client-main .page { margin: 0 auto; max-width: 1100px; }
.preview-banner { background: var(--warn-soft); border: 1px solid #f0d9ab; padding: 8px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--ink); text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #cfccc1; background: #fbfaf7; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; } .btn.xs { padding: 2px 8px; font-size: 12px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); line-height: 1; text-decoration: none !important; display: inline-block; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent-2); }
.link + .link { margin-left: 12px; }
.dropdown { position: relative; }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 30; min-width: 240px; padding: 4px; }
.dropdown.open .dd-menu { display: block; }
.dd-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.dd-menu button:hover { background: var(--accent-soft); }

/* Tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card.pad { padding: 18px 20px; }
.card.pad h3 { margin: 6px 0 12px; }
.card.pad h3:not(:first-child) { margin-top: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section { margin-top: 16px; }
.stack > .card { margin-bottom: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.kpi.warn::before { background: var(--warn); }
.kpi small { display: block; color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 24px; margin: 2px 0; }
.kpi span { font-size: 12px; color: var(--muted); }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
.stat-row small { display: block; color: var(--muted); font-size: 12px; }
.stat-row b { font-size: 17px; }
.big { font-size: 30px; font-weight: 600; }

/* Tablas */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl.compact td, .tbl.compact th { padding: 6px 10px; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr.row-link { cursor: pointer; }
.tbl tr.row-link:hover td { background: #fbfaf7; }
.tbl tfoot td { border-top: 1px solid var(--line); background: #fbfaf7; }
.tbl .ch-row td { background: var(--accent-soft); border-bottom: 1px solid #cfe6e4; }
.tbl.budget td { padding: 3px 6px; }
.tbl.budget .ch-row td { padding: 8px 8px; }
.tbl.totals td { padding: 7px 14px; }
.tbl.totals .sub td { border-top: 1px solid var(--line); font-weight: 600; }
.tbl .grand td, .doc-totals .grand td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--ink); }

/* Celdas editables */
.cell { width: 100%; border: 1px solid transparent; background: transparent; padding: 5px 6px; border-radius: 6px; min-width: 0; }
.cell:hover { border-color: var(--line); background: #fff; }
.cell:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(15, 139, 141, .12); }
.cell.r { text-align: right; }
.cell-ro { display: block; text-align: right; padding: 5px 6px; color: var(--ink-2); }
.apu-link { display: inline-block; margin: 0 0 3px 7px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); font-size: 11px; }
select.cell { padding-right: 20px; }

/* Etiquetas */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.b-construccion, .b-bud-aprobado, .b-po-recibida, .b-p-aprobado { background: #dff1e6; color: #1f6b41; }
.b-diseno { background: #e6e9f8; color: #3d4b9a; }
.b-tramites, .b-p-presentado, .b-p-en_revision, .b-po-emitida, .b-bud-enviado { background: var(--warn-soft); color: #8a5a10; }
.b-finalizado { background: var(--accent-soft); color: var(--accent-2); }
.b-pausado, .b-cancelado, .b-p-rechazado, .b-po-anulada, .b-bud-rechazado { background: var(--danger-soft); color: #94291e; }
.b-p-con_observaciones { background: #fde5d4; color: #9a4612; }
.b-log { background: #e9eef3; color: var(--ink-2); }
.b-role-admin { background: var(--ink); color: #fff; } .b-role-cliente { background: var(--accent-soft); color: var(--accent-2); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: #fff; white-space: nowrap; }
.pill.teal { border-color: #bfe0dd; background: var(--accent-soft); color: var(--accent-2); }
.sel-status { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.sel-proc { border-radius: 999px; font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); background: #fff; }
.sel-proc.s-aprobado { background: #dff1e6; } .sel-proc.s-con_observaciones { background: #fde5d4; } .sel-proc.s-presentado, .sel-proc.s-en_revision { background: var(--warn-soft); } .sel-proc.s-rechazado { background: var(--danger-soft); }

/* Barras */
.bar { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.over span { background: var(--danger); }
.bar.thin { height: 4px; }
.pbar-big { margin: -6px 0 14px; } .pbar-big .bar { height: 4px; }
.dual { position: relative; height: 16px; }
.dual span { position: absolute; left: 0; border-radius: 3px; }
.dual .b { top: 0; height: 7px; background: #c8d3dc; }
.dual .s { top: 8px; height: 7px; background: var(--accent); }
.dual .s.over { background: var(--danger); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.lg.b { background: #c8d3dc; } .lg.s { background: var(--accent); } .lg.o { background: var(--danger); } .lg.in { background: var(--ink); }
.stackbar { display: flex; height: 12px; margin: 14px 18px 4px; border-radius: 4px; overflow: hidden; }
.c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); } .c4 { background: var(--c4); } .c5 { background: var(--c5); } .c6 { background: var(--c6); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list li.col { flex-direction: column; align-items: stretch; gap: 3px; }
.list.compact li { padding: 6px 18px; font-size: 13px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin: 0; padding: 14px 18px; }
.dl dt { color: var(--muted); font-size: 12.5px; } .dl dd { margin: 0; }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 18px 6px; margin: 0; }
.empty { text-align: center; padding: 40px 20px; }
.empty-ico { font-size: 28px; color: #c7c4b8; }
.empty h4 { font-size: 15px; margin: 6px 0 4px; }
.empty p { color: var(--muted); max-width: 440px; margin: 0 auto 14px; }

/* Barra de herramientas */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.seg { display: inline-flex; background: #ebe9e2; border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 500; }
.seg small { color: var(--muted); margin-left: 3px; }

/* Tarjetas de proyecto */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.pcard:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(19, 41, 61, .09); }
.pcard-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pcard h3 { font-size: 16px; margin-bottom: 2px; }
.pcard-bar { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.pcard-bar .bar { flex: 1; }
.pcard-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }

/* Pestañas */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a i { font-style: normal; font-size: 11px; background: var(--line-2); border-radius: 999px; padding: 0 6px; margin-left: 6px; color: var(--muted); }

/* Gantt */
.gantt { padding: 10px 18px 16px; overflow-x: auto; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 230px 1fr; gap: 12px; align-items: center; min-width: 640px; }
.gantt-head .g-track { position: relative; height: 22px; border-bottom: 1px solid var(--line); }
.gantt-head .g-track span { position: absolute; top: 2px; font-size: 11px; color: var(--muted); transform: translateX(-2px); border-left: 1px solid var(--line); padding-left: 4px; }
.gantt-row { padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.g-name { display: flex; flex-direction: column; font-size: 13px; }
.g-track { position: relative; height: 22px; }
.g-bar { position: absolute; top: 3px; height: 16px; background: #c8d3dc; border-radius: 4px; overflow: hidden; }
.g-bar span { display: block; height: 100%; background: var(--accent); }
.g-bar em { position: absolute; right: 4px; top: 0; font-size: 10px; font-style: normal; line-height: 16px; color: var(--ink); }
.g-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--danger); opacity: .6; z-index: 1; }

/* Presupuesto */
.sum-bar { display: flex; flex-wrap: wrap; gap: 0; background: var(--ink); color: #fff; border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; position: sticky; top: 0; z-index: 20; }
.sum-bar > div { padding: 12px 18px; border-right: 1px solid rgba(255, 255, 255, .1); flex: 1; min-width: 150px; }
.sum-bar small { display: block; font-size: 11px; color: #9fb3c4; text-transform: uppercase; letter-spacing: .05em; }
.sum-bar b { font-size: 17px; }
.sum-bar .hl { background: var(--accent); }
.sum-bar .hl small { color: #d9f1ef; }
.budget-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.help p { margin: 6px 0; }

/* Documentos y chat */
.dropzone { margin: 14px 18px; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; transition: .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; padding: 3px 0; }
.chat { max-height: 480px; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 75%; align-self: flex-start; }
.msg.me { align-self: flex-end; text-align: right; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg-body { display: inline-block; text-align: left; background: #f0efe9; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; }
.msg.me .msg-body { background: var(--accent); color: #fff; }
.msg.client:not(.me) .msg-body { background: var(--warn-soft); }
.chat-form { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.chat-form textarea { flex: 1; resize: vertical; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }

/* Bitácora */
.timeline-log { padding: 8px 18px 18px; }
.log { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); break-inside: avoid; }
.log:last-child { border-bottom: 0; }
.log-date { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 0; height: fit-content; background: #fbfaf7; }
.log-date b { display: block; font-size: 22px; line-height: 1.1; }
.log-date span { font-size: 11px; color: var(--muted); }
.log-body p { margin: 6px 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 8px; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; background: var(--line-2); }
.log-actions { margin-top: 6px; }
.timeline { list-style: none; padding: 0 0 0 14px; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 6px 0 10px 12px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: #ebe9e2; border-radius: 10px; padding: 10px; min-height: 120px; }
.kcol h4 { margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.kcol h4 small { color: var(--muted); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.kcard:hover { border-color: var(--accent); }
.kcard.late { border-left: 3px solid var(--danger); }
.kcard b { display: block; margin: 2px 0; font-size: 13px; }

/* Gráfico de columnas */
.colchart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 18px; }
.colgrp { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.cols span { width: 40%; max-width: 22px; border-radius: 3px 3px 0 0; min-height: 1px; }
.cols .in { background: var(--ink); } .cols .s { background: var(--accent); }
.colgrp small { margin-top: 6px; color: var(--muted); font-size: 11px; }

/* Documento imprimible */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 40px; box-shadow: var(--shadow); max-width: 900px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--ink); padding-bottom: 14px; margin-bottom: 16px; }
.doc-head h3 { color: var(--accent-2); letter-spacing: .08em; }
.doc-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.doc-meta small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.doc-tbl td, .doc-tbl th { padding: 6px 8px; font-size: 13px; }
.doc-totals { margin: 16px 0 0 auto; min-width: 300px; border-collapse: collapse; }
.doc-totals td { padding: 6px 10px; }
.doc-notes { margin-top: 22px; font-size: 13px; }
.doc-sign { display: flex; justify-content: space-around; gap: 40px; margin-top: 60px; font-size: 13px; text-align: center; }
.doc-sign span { display: block; width: 220px; border-top: 1px solid var(--ink); margin-bottom: 6px; }

/* Selector de insumos */
.pick-list { max-height: 420px; overflow-y: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; text-align: left; cursor: pointer; }
.pick-row:hover { background: var(--accent-soft); }
.pick-row small { display: block; color: var(--muted); font-size: 11.5px; }
.scroll-box { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }

/* Formularios y modales */
.op-shade { position: fixed; inset: 0; background: rgba(19, 41, 61, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.op-dialog { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.op-dialog.wide { max-width: 760px; }
.op-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.op-dialog-body { padding: 16px 18px 18px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 11.5px; }
.field input, .field select, .field textarea, .op-dialog input[type=search], .op-dialog select { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 139, 141, .12); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Avisos */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; max-width: 380px; }
.toast.t-error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* Acceso */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #dfeceb, transparent), var(--paper); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.auth-brand small { display: block; color: var(--muted); }

/* Responsive */
@media (max-width: 1100px) {
  .budget-layout { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  body.side-open .side { transform: none; }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .main-wrap { margin-left: 0; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; }
  .mobile-top .icon-btn { color: #fff; font-size: 20px; }
  .page { padding: 18px 14px 50px; }
  .grid2, .form-grid, .form-grid.g3, .doc-meta { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .dl { grid-template-columns: 1fr; } .dl dt { margin-top: 6px; }
  .sum-bar { position: static; }
  .doc { padding: 20px; }
  .client-top { padding: 12px 14px; }
  .msg { max-width: 90%; }
}

/* Impresión */
@media print {
  @page { size: letter; margin: 14mm; }
  body { background: #fff; font-size: 11.5px; }
  .side, .mobile-top, .no-print, .tabs, .crumbs, .page-head, .sum-bar, .toolbar, .preview-banner, .budget-layout aside, .client-top, #toasts { display: none !important; }
  .print-only { display: block; }
  .main-wrap { margin: 0; }
  .page { padding: 0; max-width: none; }
  .card, .doc { box-shadow: none; border: 0; padding: 0; }
  .budget-layout { display: block; }
  .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ch-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cell { border: 0 !important; padding: 0; }
  a { color: inherit; }
  .photos { grid-template-columns: repeat(4, 1fr); }
}

/* Ajustes del editor de presupuesto */
.tbl.budget { min-width: 820px; }
.tbl.budget tr:not(.ch-row) td:nth-child(2) { min-width: 280px; }
@media (max-width: 1560px) { .budget-layout { grid-template-columns: 1fr; } .budget-layout aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; } .budget-layout aside > .card { margin: 0; } }

/* ================= FASE 1 ================= */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid3 > .card { margin-bottom: 0; }
.kpis.k3 { grid-template-columns: repeat(3, 1fr); } .kpis.k4 { grid-template-columns: repeat(4, 1fr); } .kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.small-b { font-size: 14px !important; }
.warn-text { color: var(--warn); }
.dim { opacity: .55; }
.clickable { cursor: pointer; border: 0; font: inherit; }
.bar.amber span { background: var(--warn); }
.cap { text-transform: capitalize; }
.field-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.inline input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.subnav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card.flat { background: transparent; border: 0; box-shadow: none; }
.link-row { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.link-row:hover { color: var(--accent-2); text-decoration: underline; }
.att { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 5px; background: #f0efe9; color: var(--ink-2); white-space: nowrap; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.mini-row + .bar { margin: 2px 0 6px; }

/* Resumen del proyecto */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.summary-grid > .card { margin-bottom: 0; }
.summary-grid .span-2 { grid-column: span 2; }
.summary-grid .span-all { grid-column: 1 / -1; }
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); }
.kpi-strip > div { padding: 14px 18px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.kpi-strip > div:last-child { border-right: 0; }
.kpi-strip small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-strip b { font-size: 20px; }
.hero { height: 220px; border-radius: var(--radius); background-size: cover; background-position: center; position: relative; margin-bottom: -60px; overflow: hidden; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(19,41,61,0) 40%, rgba(245,244,239,1) 100%); }
.hero + .page-head { position: relative; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 14px 18px; }
.gallery figure { margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gallery figure.cover { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; min-height: 110px; max-height: 340px; object-fit: cover; display: block; }
.gallery figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; }
.gallery.portal { padding: 0 0 16px; }
.gallery-empty { padding: 26px; text-align: center; }
.note-form { display: flex; gap: 10px; padding: 12px 18px; align-items: flex-start; }
.note-form textarea { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
li.pinned { background: #fffbef; }
.check.done span { text-decoration: line-through; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #dde7ef; color: var(--ink); font-size: 11px; font-weight: 600; flex: none; }
.avatar.empty { background: #eee; color: #aaa; }
.avatar.lg { width: 42px; height: 42px; font-size: 14px; background: var(--accent-soft); color: var(--accent-2); }
.stars { color: #e3a008; letter-spacing: 1px; font-size: 13px; }
.stars i { color: #ddd9cc; font-style: normal; }

/* Prioridades */
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #b8c3cc; flex: none; }
.prio.p-media { background: #6b9ad1; } .prio.p-alta { background: var(--warn); } .prio.p-urgente { background: var(--danger); }
.prio-pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #eef1f4; color: var(--ink-2); }
.prio-pill.p-alta { background: var(--warn-soft); color: #8a5a10; } .prio-pill.p-urgente { background: var(--danger-soft); color: #94291e; } .prio-pill.p-media { background: #e6eef8; color: #3d5f8c; }

/* Tareas */
.task-group { padding-bottom: 6px; }
.task-row { display: grid; grid-template-columns: 22px 12px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line-2); }
.task-row:hover { background: #fbfaf7; }
.task-row.done .task-title b { text-decoration: line-through; color: var(--muted); }
.task-check { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.task-title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; min-width: 0; font: inherit; color: var(--ink); }
.task-title b { font-weight: 500; }
.task-title small { color: var(--muted); font-size: 12px; }
.kanban.board { grid-template-columns: repeat(4, minmax(230px, 1fr)); }
.kcol.over { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.kcard.dragging { opacity: .4; }
.kcard[draggable] { cursor: grab; }

/* Gantt extendido */
.gantt-group { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 0 4px; min-width: 640px; }
.gantt-row.tall { padding: 9px 0; }
.g-bar.late { box-shadow: inset 0 0 0 2px var(--danger); }
.g-bar.t-completada span, .g-bar.t-completada { background: #9fd3b4; }
.g-bar.t-en_progreso { background: #9cc4ea; } .g-bar.t-en_revision { background: #f2d38f; }
.g-bar.seg { border-radius: 3px; }
.g-bar.ghost { background: repeating-linear-gradient(45deg, #e3e8ec, #e3e8ec 6px, #f1f3f5 6px, #f1f3f5 12px); }
.g-none { position: absolute; top: 3px; left: 4px; }
.lg.today { background: var(--danger); width: 2px; }
.badge.s-a_tiempo, .badge.s-completo, .badge.s-finalizado { background: #dff1e6; color: #1f6b41; }
.badge.s-atrasado { background: var(--danger-soft); color: #94291e; }
.badge.s-por_iniciar { background: #e6e9f8; color: #3d4b9a; }
.badge.s-sin_cronograma, .badge.s-pausado { background: var(--line-2); color: var(--muted); }

/* Calendario */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-h { padding: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--line); background: #fbfaf7; }
.cal-d { min-height: 104px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d:hover { background: #fbfaf7; }
.cal-d.out { background: #faf9f5; color: #b2b6ba; }
.cal-d.today .cal-n { background: var(--accent); color: #fff; }
.cal-n { align-self: flex-end; font-size: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal-i { display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: #e6eef8; color: #24466e; font-family: inherit; }
.cal-i.done { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.k-event { background: #e3f2f1 !important; color: #0b5d5f !important; }
.k-task { background: #e6eef8 !important; color: #24466e !important; }
.k-reminder { background: #fff3d6 !important; color: #7a5410 !important; }
.k-payment { background: #e5f3ea !important; color: #1f6b41 !important; }
.k-procedure { background: #efe8f7 !important; color: #5a3d86 !important; }
.k-delivery { background: #fde9df !important; color: #9a4612 !important; }
.dot.k-event, .dot.k-task, .dot.k-reminder, .dot.k-payment, .dot.k-procedure, .dot.k-delivery { width: 9px; height: 9px; display: inline-block; border-radius: 50%; margin-right: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; cursor: pointer; }
.chip input { accent-color: currentColor; }

/* Flujo de caja */
.tbl.cf td, .tbl.cf th { padding: 6px 10px; white-space: nowrap; font-size: 13px; }
.tbl.cf th.mcol, .tbl.cf td:nth-child(n) { }
.tbl.cf .sec td { background: #fbfaf7; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tbl.cf .tot td { font-weight: 600; border-top: 1px solid var(--line); }
.tbl.cf .grand td { font-weight: 700; border-top: 2px solid var(--ink); background: var(--accent-soft); }
.tbl.cf td:first-child, .tbl.cf th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 220px; }
.tbl.cf .sec td:first-child { background: #fbfaf7; } .tbl.cf .grand td:first-child { background: var(--accent-soft); }
tr.dim td { opacity: .55; }

/* Cotizaciones */
.badge.q-borrador { background: var(--line-2); } .badge.q-enviada { background: #e6eef8; color: #24466e; } .badge.q-respondida { background: var(--warn-soft); color: #8a5a10; }
.badge.q-adjudicada { background: #dff1e6; color: #1f6b41; } .badge.q-cancelada { background: var(--danger-soft); color: #94291e; }
.tbl.cmp th.sup { min-width: 190px; vertical-align: top; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); background: #fbfaf7; }
.tbl.cmp th.sup.best { background: #e5f3ea; } .tbl.cmp th.sup.won { background: #d4eddc; box-shadow: inset 0 3px 0 var(--ok); }
.tbl.cmp td.price.best { background: #eef8f1; }
.tbl.cmp tfoot td { background: #fbfaf7; }
.doc-tbl td.blank { border-bottom: 1px solid #bbb; min-width: 110px; }
.sup-card h3 { font-size: 15px; }
.sup-card .pill { align-self: flex-start; margin: 8px 0 6px; }
.sup-card { display: flex; flex-direction: column; gap: 4px; }
ul.changes { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
ul.changes s { color: var(--muted); }

@media (max-width: 1200px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid .span-2 { grid-column: 1 / -1; }
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .cal-layout { grid-template-columns: 1fr; }
  .kpis.k5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .grid3, .summary-grid { grid-template-columns: 1fr; }
  .kpi-strip, .kpis.k3, .kpis.k4, .kpis.k5 { grid-template-columns: 1fr 1fr; }
  .gallery figure.cover { grid-column: span 2; grid-row: auto; }
  .cal-d { min-height: 64px; }
  .cal-i { font-size: 0; height: 6px; padding: 0; }
  .cal-i b { display: none; }
  .task-row { grid-template-columns: 22px 10px 1fr auto; }
  .task-row .avatar { display: none; }
  .hero { height: 140px; }
}
/* Ajustes de revisión */
.cap { text-transform: none; }
.cap::first-letter { text-transform: uppercase; }
h3.cap { display: inline-block; }
.dot.k-event { background: #0f8b8d !important; } .dot.k-task { background: #3d6fb0 !important; } .dot.k-reminder { background: #d39a22 !important; }
.dot.k-payment { background: #2e8b57 !important; } .dot.k-procedure { background: #7b55b0 !important; } .dot.k-delivery { background: #d26a2e !important; }
.tbl.cmp td:first-child { min-width: 260px; }
.tabs a { padding: 9px 11px; }

/* ================= Fase 1.1: ofertas, notificaciones, archivos, reportes ================= */
.scroll-x { overflow-x: auto; }
.form-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.w-40 { width: 40px; } .w-110 { width: 110px; }
.hide { display: none !important; }
.ok-txt { color: var(--ok); font-weight: 600; } .warn-txt { color: var(--danger); font-weight: 600; }
.b-of-borrador { background: var(--line-2); } .b-of-enviada { background: #e6ecfa; color: #34489a; }
.b-of-aceptada { background: #e2f3e8; color: #23704a; } .b-of-rechazada { background: var(--danger-soft); color: var(--danger); } .b-of-vencida { background: var(--warn-soft); color: #8a5a10; }

/* Marca, logo y campana */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.brand-row .brand { min-width: 0; overflow: hidden; }
.brand-row .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-img { max-height: 30px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; flex: none; }
.brand-img.sm { max-height: 26px; margin-right: 8px; vertical-align: middle; }
.auth-brand .brand-img { max-height: 46px; max-width: 160px; }
.bell { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; text-decoration: none !important; font-size: 16px; filter: grayscale(1) brightness(1.6); flex: none; }
.bell:hover, .bell.on { background: rgba(255, 255, 255, .08); }
.bell i { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #e0533d; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; filter: none; }
.client-top .bell { filter: none; width: 30px; height: 30px; }
.mobile-top .bell { margin-left: auto; }
.logo-prev { max-height: 56px; max-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.doc-brand { display: flex; gap: 14px; align-items: center; }
.doc-brand img { max-height: 64px; max-width: 170px; object-fit: contain; }

/* Notificaciones */
.notes { list-style: none; margin: 0; padding: 0; }
.note { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); padding-right: 10px; }
.note a { flex: 1; display: flex; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.note a > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.note small { color: var(--muted); }
.note.unread { background: #f3faf9; }
.note.unread b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.note-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); display: inline-grid; place-items: center; flex: none; }

/* Editor de ofertas */
.oe { overflow: visible; }
.oe-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--side); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.oe-head h3 { margin: 0; font-size: 15px; color: #fff; }
.oe-head small { color: #8fd3cf; font-size: 12px; }
.oe-head-x { margin-left: auto; }
.oe-ico { width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, .1); display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.oe-sub { margin: 18px 0 8px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.oe-row { display: grid; gap: 8px; align-items: center; margin-bottom: 6px; }
.oe-row.m { grid-template-columns: 1fr 100px 130px 32px; }
.oe-row.s { grid-template-columns: 1.3fr 150px 1.6fr 32px; }
.oe-row.l { grid-template-columns: 1fr 110px 150px 130px 32px; }
.oe-row input, .oe-tbl input:not([type=checkbox]), .oe-ch-head input, .oe input[data-k]:not([type=checkbox]):not([type=radio]), .oe select[data-k] { width: 100%; }
.oe .check input { width: auto; flex: none; }
.oe-extra .check { align-items: flex-start; gap: 10px; }
.pct-in { position: relative; display: flex; align-items: center; }
.pct-in input { padding-right: 30px; text-align: right; }
.pct-in i { position: absolute; right: 9px; font-style: normal; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.oe-tbl tr.off td { color: #a7b0b8; }
.oe-tbl tr.off input { opacity: .6; }
.oe-ch { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.oe-ch-head { display: grid; grid-template-columns: 1fr auto 32px; gap: 10px; align-items: center; margin-bottom: 8px; }
.oe-ch-name { font-weight: 600; }
.oe-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--side); color: #fff; padding: 12px 16px; border-radius: 8px; margin-top: 12px; font-weight: 600; }
.oe-total .num { color: #5fe0d9; font-size: 16px; }
.oe-total small { color: #9fb3c3; font-weight: 400; }
.oe-total.alt { background: #24405a; }
.oe-sum { width: 100%; margin-top: 10px; color: var(--ink-2); }
.oe-sum td { padding: 3px 0; }
.oe-cat { border-top: 1px solid var(--line-2); padding: 8px 0; }
.oe-cat-h { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.oe-extra { display: flex; align-items: center; gap: 12px; justify-content: space-between; border: 1px solid var(--line-2); background: #fafaf7; border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.oe-extra.on { border-color: var(--accent); background: var(--accent-soft); }
.oe-extra .check > span { display: flex; flex-direction: column; }
.oe-extra .field { width: 170px; margin: 0; }
.oe-grand { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: linear-gradient(120deg, var(--side), #1d4e6b); color: #fff; }
.oe-grand small { display: block; color: #9fd8d4; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.oe-grand b { font-size: 24px; font-family: var(--mono); color: #5fe0d9; }
.oe-bar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(19, 41, 61, .08); padding: 10px 16px; margin-top: 10px; }
.oe-bar b { font-family: var(--mono); }
.oe-accept { padding-top: 0; }
.doc-h { margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--accent); color: var(--ink); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.doc-h5 { margin: 14px 0 6px; font-size: 12.5px; color: var(--ink-2); }
.doc-totals.wide { min-width: 420px; }
.offer-doc .doc-meta .small, .rep-doc .doc-meta .small { color: var(--muted); }

/* Reporte de avance */
.rep-opts .checklist { margin: 10px 0; }
.rep-note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 14px; margin-bottom: 10px; }
.rep-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rep-kpis small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.rep-kpis b { font-size: 18px; }
.rep-log { border-left: 3px solid var(--line); padding: 4px 12px; margin-bottom: 10px; break-inside: avoid; }
.rep-log p { margin: 4px 0; }
.rep-log-h { font-size: 12.5px; color: var(--ink-2); }
.rep-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rep-photos figure { margin: 0; break-inside: avoid; }
.rep-photos img { width: 100%; height: 170px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.rep-photos figcaption { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Imágenes a PDF */
.drop { display: block; border: 2px dashed var(--line); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; margin: 8px 0; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.pdf-list { list-style: decimal; padding-left: 22px; margin: 10px 0; max-height: 380px; overflow: auto; }
.pdf-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.pdf-list img { width: 52px; height: 40px; object-fit: cover; border-radius: 4px; }
.pdf-list span { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-page { height: 96vh; display: flex; flex-direction: column; page-break-after: always; break-after: page; }
.pdf-page:last-child { page-break-after: auto; break-after: auto; }
.pdf-page img { flex: 1; min-height: 0; width: 100%; }
.pdf-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.pdf-cap { font-size: 11px; color: #555; text-align: center; margin-top: 4px; }

@media (max-width: 900px) {
  .form-grid.g4 { grid-template-columns: 1fr 1fr; }
  .oe-row.m { grid-template-columns: 1fr 90px 32px; }
  .oe-row.m > span.num { display: none; }
  .oe-row.s, .oe-row.l { grid-template-columns: 1fr 1fr; }
  .oe-row.s > input:first-child, .oe-row.l > input:first-child { grid-column: 1 / -1; }
  .oe-extra { flex-wrap: wrap; }
  .oe-grand b { font-size: 19px; }
  .rep-kpis { grid-template-columns: 1fr 1fr; }
  .rep-photos { grid-template-columns: 1fr 1fr; }
  .doc { overflow-x: auto; }
  .doc-totals.wide { min-width: 0; width: 100%; }
}
@media (max-width: 560px) { .form-grid.g4 { grid-template-columns: 1fr; } }
@media print {
  .oe-bar, .oe-accept, .rep-opts { display: none !important; }
  .doc-h { break-after: avoid; }
  .doc-tbl tr, .doc-totals tr { break-inside: avoid; }
  .doc-brand img { max-height: 54px; }
  .pdf-pages { display: block; }
}

/* Documentos imprimibles en pantallas angostas: la tabla se desplaza dentro del documento, no la página */
@media screen and (max-width: 860px) {
  .doc { padding: 16px; overflow-x: auto; max-width: 100%; }
  .doc-head { flex-direction: column; }
  .doc-totals { min-width: 0; width: 100%; }
  .doc-sign { flex-direction: column; align-items: center; gap: 30px; }
  .doc-sign span { width: 200px; }
}
