/* Cotizaciones OVCORP — estilos propios (sin librerías externas) */
:root {
  --ink: #2b2f36;
  --ink-2: #3a3f47;
  --ink-3: #565b64;
  --gold: #b8923a;
  --gold-d: #96751f;
  --gold-l: #f3ead2;
  --paper: #f6f4ef;
  --card: #ffffff;
  --line: #e3e0d8;
  --muted: #6d7179;
  --green: #2f7d5b;
  --green-l: #dcefe4;
  --amber: #b07a0c;
  --amber-l: #f8ecc8;
  --red: #b4432f;
  --red-l: #f6d9d2;
  --blue: #3b5f8a;
  --blue-l: #dfe8f3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 47, 54, .06), 0 2px 8px rgba(43, 47, 54, .05);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--gold-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
h1 { font-family: var(--serif); font-size: 1.65rem; letter-spacing: .1px; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.right, .num { text-align: right; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.mt { margin-top: 1.2rem; }
.mb { margin-bottom: 1.2rem; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- estructura */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--ink); color: #d8d9dc; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 14px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.brand b { display: block; font-family: var(--serif); font-size: 1.02rem; letter-spacing: .3px; line-height: 1.15; }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 12px; }
.brand img.logo { width: 150px; height: auto; background: none; border-radius: 0; padding: 0; filter: brightness(0) invert(1); }
.brand img.mark { width: 34px; height: 34px; background: none; padding: 0; filter: brightness(0) invert(1); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .bell { position: relative; color: #fff; font-size: 1.15rem; padding: 6px 8px; }
.count[hidden] { display: none; }
.topbar .bell .count { position: absolute; top: -4px; right: -4px; background: var(--gold); color: #1e2126; border-radius: 999px; font-size: .68rem; font-weight: 700; padding: 0 6px; }
/* ---------------------------------------------------------------- cronograma (Gantt) */
.pwwrap { position: relative; display: block; }
.pwwrap input { padding-right: 46px; }
.pwtoggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.pwtoggle:hover, .pwtoggle:focus-visible { color: var(--ink); background: rgba(0, 0, 0, .05); outline: none; }
.notif-list { padding: 6px; }
.notif { margin: 0; }
.notif button { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 12px; cursor: pointer; font: inherit; color: inherit; }
.notif button:hover { background: var(--gold-l); }
.notif .dot { flex: 0 0 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: transparent; }
.notif.unread .dot { background: var(--gold); }
.notif .txt { flex: 1; min-width: 0; }
.notif .txt b { display: block; font-weight: 500; }
.notif.unread .txt b { font-weight: 700; }
.notif .txt small { display: block; color: var(--muted); margin-top: 2px; }
.notif + .notif { border-top: 1px solid var(--line); }
.brand span { display: block; font-size: .72rem; color: #a9acb2; letter-spacing: .6px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav h4 { margin: 16px 10px 4px; font-size: .68rem; letter-spacing: 1px; text-transform: uppercase; color: #8b8f97; font-weight: 600; }
.nav a { display: flex; align-items: center; justify-content: space-between; color: #d8d9dc; padding: 8px 10px; border-radius: 8px; font-size: .93rem; }
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav a.active { background: rgba(184, 146, 58, .2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav .count { background: var(--gold); color: #1e2126; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 8px; }
.sidebar .me { margin-top: auto; padding: 14px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
.sidebar .me b { display: block; color: #fff; font-weight: 600; }
.sidebar .me .role { color: #a9acb2; font-size: .75rem; }
.sidebar .me .links { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.sidebar .me a, .linkbtn { color: #d8d9dc; font-size: .82rem; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.sidebar .me a:hover, .linkbtn:hover { color: #fff; text-decoration: underline; }
.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1500px; }
.topbar { display: none; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.public { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.public .box { width: 100%; max-width: 410px; }
.public .logo { display: block; margin: 0 auto 22px; width: 190px; max-width: 70%; }

/* ---------------------------------------------------------------- componentes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card > h2, .card .cardhead h2 { margin-bottom: 12px; }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cardhead h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .92rem; font-weight: 600; padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #faf8f3; text-decoration: none; border-color: #cfcabd; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-d); border-color: var(--gold-d); }
.btn-danger { color: var(--red); border-color: #e4b9b0; background: #fff; }
.btn-danger:hover { background: var(--red-l); }
.btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ok:hover { background: #256649; border-color: #256649; }
.btn-sm { padding: 4px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

.flashes { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: .93rem; }
.flash-success { background: var(--green-l); border-color: #b9dbc8; color: #1f5a41; }
.flash-danger { background: var(--red-l); border-color: #ebbcb1; color: #8a2f1f; }
.flash-warning { background: var(--amber-l); border-color: #ead9a0; color: #7a5407; }
.flash-info { background: var(--blue-l); border-color: #c1d1e6; color: #2d4a6d; }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; letter-spacing: .2px; white-space: nowrap; }
.badge-pendiente { background: var(--amber-l); color: #7a5407; }
.badge-aprobado { background: var(--green-l); color: #1f5a41; }
.badge-rechazado { background: var(--red-l); color: #8a2f1f; }
.badge-neutral { background: #ecebe6; color: var(--ink-3); }
.badge-gold { background: var(--gold-l); color: #7a5c14; }
.badge-blue { background: var(--blue-l); color: #2d4a6d; }
.light { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.light i { width: 11px; height: 11px; border-radius: 50%; background: #b9bcc2; box-shadow: 0 0 0 3px rgba(0, 0, 0, .05); }
.light-verde i { background: var(--green); }
.light-ambar i { background: #e0a21b; }
.light-rojo i { background: var(--red); }
.light-verde { color: #1f5a41; } .light-ambar { color: #8a5f06; } .light-rojo { color: #8a2f1f; } .light-sin_datos { color: var(--muted); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: .76rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.3rem; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi.tone-green { border-top: 3px solid var(--green); } .kpi.tone-amber { border-top: 3px solid #e0a21b; }
.kpi.tone-red { border-top: 3px solid var(--red); } .kpi.tone-gold { border-top: 3px solid var(--gold); } .kpi.tone-ink { border-top: 3px solid var(--ink); }
.neg { color: var(--red); } .pos { color: var(--green); }
.sectiontitle { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin: 22px 0 8px; }

/* tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; padding: 10px 12px; background: #faf8f3; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num, .table td.num { text-align: right; }
.table td { padding: 10px 12px; border-bottom: 1px solid #efece5; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf8; }
.table tfoot td { font-weight: 700; background: #faf8f3; border-top: 1px solid var(--line); }
.table .title { font-weight: 600; color: var(--ink); }
.table td.projcell { min-width: 280px; }
.table .title a { color: var(--ink); }
.table .title a:hover { color: var(--gold-d); }
.table .sub { color: var(--muted); font-size: .8rem; }
tr.rejected td { opacity: .65; }
.clip { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: .8rem; }
.clip svg { width: 14px; height: 14px; }
.clip.missing { color: #c58a12; white-space: nowrap; }
.acta-ok { color: var(--green); font-weight: 600; font-size: .8rem; }

/* barras */
.bar { position: relative; height: 8px; background: #ebe8df; border-radius: 999px; overflow: hidden; min-width: 48px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.bar.gold > span { background: var(--gold); }
.bar.ok > span { background: var(--green); }
.bar.warn > span { background: #e0a21b; }
.bar.bad > span { background: var(--red); }
.barrow { display: flex; align-items: center; gap: 8px; }
.barrow .bar { flex: 1; }
.barrow small { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--ink-3); }

/* alertas */

/* pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--ink-3); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--gold); }
.tabs .count { background: var(--amber-l); color: #7a5407; border-radius: 999px; font-size: .72rem; padding: 0 7px; font-weight: 700; }

/* formularios */
.form { display: grid; gap: 14px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field label, .lbl-t { font-size: .82rem; font-weight: 600; color: var(--ink-3); }
.field .hint { font-size: .78rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid #d3cfc3; border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; }
textarea { min-height: 78px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(184, 146, 58, .45); border-color: var(--gold); }
input[type=file] { font: inherit; font-size: .88rem; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; font-weight: 500; color: var(--ink); }
.check input { margin-top: 3px; accent-color: var(--gold-d); }
.moneyin { position: relative; }
.moneyin::before { content: "S/"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.moneyin input { padding-left: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 130px; }
.filters .field.grow { flex: 1; min-width: 190px; }
.formactions { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.errors { background: var(--red-l); border: 1px solid #ebbcb1; color: #8a2f1f; border-radius: 8px; padding: 10px 14px; }
.errors ul { margin: 4px 0 0; padding-left: 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; margin: 0; }
legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: var(--muted); padding: 0 6px; }

dl.dl { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
dl.dl dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
dl.dl dd { margin: 0; overflow-wrap: anywhere; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { width: 100%; height: auto; display: block; }
.share { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #ebe8df; margin-top: 4px; }
.share span { display: block; height: 100%; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; font-size: .92rem; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; }
.pager a, .pager span { padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: .85rem; color: var(--ink); }
.pager span.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { padding-left: 14px; border-left: 3px solid var(--gold-l); font-size: .87rem; }
.timeline .when { color: var(--muted); font-size: .76rem; }
.pwbox { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: 1px; background: var(--gold-l); border: 1px dashed var(--gold); border-radius: 10px; padding: 14px 18px; text-align: center; user-select: all; }
.note { background: var(--blue-l); border: 1px solid #c1d1e6; color: #2d4a6d; border-radius: 8px; padding: 10px 14px; font-size: .9rem; }
.note.warn { background: var(--amber-l); border-color: #ead9a0; color: #7a5407; }
.decision { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 14px 16px; background: #fffdf7; }

/* ---------------------------------------------------------------- adaptable */
@media (max-width: 1100px) {
  .grid.wide, .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 22px 20px 50px; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: #fff; padding: 10px 14px; position: sticky; top: 0; z-index: 30; }
  .topbar .brand { border: 0; margin: 0; padding: 0; }
  .topbar button { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
  .sidebar { display: none; position: fixed; inset: 52px 0 0 0; width: auto; height: auto; z-index: 25; }
  body.menu-open .sidebar { display: flex; }
  .sidebar .brand { display: none; }
  .main { padding: 18px 14px 50px; }
  h1 { font-size: 1.4rem; }
  dl.dl { grid-template-columns: 1fr; gap: 2px 0; }
  dl.dl dd { margin-bottom: 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-sm { display: none; }
  .table td.projcell { min-width: 0; }
  .kpi .value { font-size: 1.02rem; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
}
@media print {
  .sidebar, .topbar, .actions, .tabs, .filters, .formactions { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .card, .kpi, .table-wrap { box-shadow: none; }
}

/* ================================================================ Cotizaciones OVCORP: componentes propios */
.badge-borrador { background: #ecebe6; color: var(--ink-3); }
.badge-generada { background: var(--blue-l); color: #2d4a6d; }
.badge-enviada { background: var(--gold-l); color: #7a5c14; }
.badge-procedente { background: var(--green-l); color: #1f5a41; }
.badge-improcedente { background: var(--red-l); color: #8a2f1f; }
.kpi { display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: #cfcabd; background: #fffdf7; }
details > summary { cursor: pointer; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--gold-d); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
.radios { display: flex; gap: 18px; padding-top: 6px; }
.result-ok { border-left: 4px solid var(--green); background: #f6fbf8; }
.result-bad { border-left: 4px solid var(--red); background: #fdf7f5; }
.imgprev { background: #f3f1ea; border: 1px dashed var(--line); border-radius: 8px; padding: 8px; display: flex; align-items: center; justify-content: center; min-height: 64px; }
.imgprev img { max-height: 72px; max-width: 100%; object-fit: contain; }

/* pasos del flujo */
.steps { list-style: none; display: flex; gap: 0; margin: 0 0 20px; padding: 0; }
.steps li { flex: 1; position: relative; text-align: center; padding-top: 4px; min-width: 0; }
.steps li::before { content: ""; position: absolute; top: 18px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.current::before { background: var(--gold); }
.steps .dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--muted); }
.steps li.done .dot { background: var(--gold); border-color: var(--gold); color: #fff; }
.steps li.current .dot { border-color: var(--gold); color: var(--gold-d); box-shadow: 0 0 0 4px var(--gold-l); }
.steps li.ok .dot { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 0 4px var(--green-l); }
.steps li.bad .dot { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 0 4px var(--red-l); }
.steps b { display: block; font-size: .85rem; margin-top: 6px; }
.steps small { display: block; font-size: .74rem; color: var(--muted); min-height: 1em; }

/* editores en tabla */
.grid-edit { width: 100%; border-collapse: collapse; font-size: .88rem; }
.grid-edit th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 8px 6px; background: #faf8f3; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.grid-edit td { padding: 3px 4px; border-bottom: 1px solid #efece5; vertical-align: top; }
.grid-edit input[type=text], .grid-edit select, .grid-edit textarea { padding: 6px 7px; font-size: .86rem; border-color: transparent; background: transparent; border-radius: 6px; }
.grid-edit input:hover, .grid-edit select:hover, .grid-edit textarea:hover { border-color: #d3cfc3; background: #fff; }
.grid-edit input:focus, .grid-edit select:focus, .grid-edit textarea:focus { background: #fff; }
.grid-edit textarea { min-height: 0; resize: none; line-height: 1.3; overflow: hidden; }
.grid-edit .c-num input, .grid-edit .calc { text-align: right; font-variant-numeric: tabular-nums; }
.grid-edit .calc { padding: 8px 8px 0; white-space: nowrap; color: var(--ink-2); }
.grid-edit .subtotal { font-weight: 600; }
.grid-edit .c-act { white-space: nowrap; text-align: right; }
.grid-edit .item-row.is-title td { background: var(--gold-l); }
.grid-edit .item-row.is-title .c-num input { visibility: hidden; }
.grid-edit .item-row.is-title input[name=it_code], .grid-edit .item-row.is-title textarea { font-weight: 700; }
.grid-edit .item-row.is-title .c-unit select { font-size: .75rem; color: var(--muted); }
.grid-edit .item-row.is-zero { color: var(--muted); }
.grid-edit .item-row.has-error td { background: var(--red-l); }
.icon { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: .8rem; color: var(--ink-3); line-height: 1; padding: 0; }
.icon:hover { background: var(--gold-l); border-color: var(--gold); }
.icon.danger:hover { background: var(--red-l); border-color: #e4b9b0; color: var(--red); }
.budget-wrap { max-height: 68vh; overflow: auto; }
.budget-table { min-width: 1280px; }
.cond-table td.c-sec select { font-size: .82rem; }
.cond-table textarea { min-height: 54px; overflow: auto; }
.cond-table td { border-bottom: 1px solid var(--line); }
.cond-help { margin: 2px 6px 0; font-size: .72rem; }
.cond-view { padding-left: 18px; font-size: .88rem; }
.cond-view li { margin-bottom: 6px; }

/* totales del presupuesto */
.sumbox { display: grid; gap: 0; margin: 14px 0 0 auto; max-width: 440px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.sumbox > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 14px; border-bottom: 1px solid #efece5; font-size: .9rem; }
.sumbox > div:last-child { border-bottom: 0; }
.sumbox b { font-variant-numeric: tabular-nums; }
.sumbox .total { background: var(--gold-l); font-size: 1rem; }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px -4px -8px; padding: 12px 16px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -4px 18px rgba(43, 47, 54, .1); backdrop-filter: blur(6px); }
.savebar-total { font-size: .95rem; color: var(--ink-3); }
.savebar-total b { font-size: 1.25rem; color: var(--ink); margin-left: 6px; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* vista del presupuesto en el detalle */
.budget-view td { font-size: .85rem; padding: 6px 10px; }
.budget-view .t-title td { font-weight: 700; background: #faf8f3; }
.budget-view .t-title.lv1 td { background: var(--ink); color: #fff; }
.budget-view .t-title.lv2 td { background: var(--gold-l); }
.budget-view .t-zero td { color: #a3a8b0; }

/* análisis de gastos generales */
.gg-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.gg-params .field label { font-size: .75rem; }
.gg-sec { margin-bottom: 18px; }
.gg-sec h3 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px 8px 0 0; font-size: .88rem; }
.gg-sec h3 .gg-group { font-weight: 500; font-size: .74rem; color: var(--gold-l); text-transform: uppercase; letter-spacing: .6px; }
.gg-sec .table-wrap { border-radius: 0 0 8px 8px; box-shadow: none; }
.gg-sec .gg-note { font-size: .78rem; color: var(--muted); padding: 6px 12px; background: #faf8f3; }
.gg-sec .gg-sub { text-align: right; padding: 8px 12px; font-weight: 700; background: #faf8f3; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.gg-sec .grid-edit th { top: 0; }
.gg-sec .qsrc { display: grid; gap: 2px; }
.gg-sec .qsrc select { font-size: .72rem; padding: 2px 4px; color: var(--muted); }
.gg-sec input[readonly] { color: var(--muted); }
.gg-sec .gg-add { margin: 8px 12px; }

@media (max-width: 860px) {
  .steps b { font-size: .74rem; }
  .steps small { display: none; }
  .savebar { margin-left: -14px; margin-right: -14px; border-radius: 0; }
}
