/* Base heredada del prototipo v1, incorporada aquí para evitar un @import
   adicional en el arranque. */

:root {
  --ink: #183036;
  --muted: #6d7d80;
  --line: #dce5e4;
  --canvas: #f4f7f6;
  --card: #ffffff;
  --brand: #17434a;
  --brand-2: #236771;
  --accent: #df9d3f;
  --accent-soft: #fff3df;
  --system: #edf5f6;
  --success: #39745a;
  --danger: #b84d52;
  --radius: 16px;
  --shadow: 0 16px 45px rgba(21, 53, 59, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { display: block; margin-bottom: 5px; color: var(--brand-2); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow.light { color: #bcd5d8; }
.brand-mark { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 22px; background: var(--accent); color: var(--brand); font-size: 2.7rem; font-weight: 900; }
.brand-mark.small { width: 41px; height: 41px; border-radius: 12px; font-size: 1.35rem; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: var(--brand); }
.login-brand { display: flex; align-items: center; justify-content: center; flex-direction: column; color: white; background: radial-gradient(circle at 25% 30%, #2c727b, var(--brand) 55%); }
.login-brand p { letter-spacing: .42em; font-weight: 800; }
.login-card { width: min(450px, calc(100% - 48px)); align-self: center; justify-self: center; padding: 44px; border-radius: 24px; background: white; box-shadow: var(--shadow); }
.login-card h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.045em; }
label { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; color: #425a5f; font-size: .82rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); outline: none; transition: .2s; }
input, select { min-height: 43px; padding: 9px 12px; }
textarea { resize: vertical; padding: 12px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(35, 103, 113, .12); }
.demo-note { margin: 18px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; text-align: center; }
.button { min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; }
.button.primary { background: var(--brand); color: white; }
.button.secondary { background: var(--accent-soft); color: #855315; border-color: #efd3a7; }
.button.ghost { background: white; color: var(--brand); border-color: var(--line); }
.button.full { width: 100%; margin-top: 25px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; background: var(--brand); color: white; z-index: 30; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: .92rem; letter-spacing: .1em; }
.sidebar-brand span { margin-top: 3px; color: #bcd1d4; font-size: .72rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px; border: 0; border-radius: 10px; background: transparent; color: #c9dcde; font-weight: 700; text-align: left; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: white; }
.nav-item span { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; }
#roleBadge { display: block; margin: 12px; color: #9fc0c4; font-size: .72rem; }
.main-content { min-width: 0; }
.topbar { min-height: 94px; display: flex; align-items: center; gap: 20px; padding: 18px clamp(20px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.status { padding: 5px 9px; border-radius: 99px; font-size: .7rem; font-weight: 850; }
.status.draft { background: var(--accent-soft); color: #855315; }
.top-actions { display: flex; gap: 8px; margin-left: auto; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.menu-button { display: none; }
.notice { margin: 22px clamp(20px, 4vw, 54px) 0; padding: 13px 16px; border: 1px solid #efd3a7; border-radius: 11px; background: var(--accent-soft); color: #78501b; font-size: .82rem; }
.page { padding: 30px clamp(20px, 4vw, 54px) 60px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading > div { display: flex; align-items: center; gap: 11px; }
.section-heading h2 { margin: 0; font-size: 1.22rem; }
.step-number { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--brand); color: white; font-size: .72rem; font-weight: 900; }
.autosave { color: var(--success); font-size: .75rem; font-weight: 750; }
.next-section { margin-top: 34px; }
.grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 5px 18px rgba(21,53,59,.035); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-heading h2, .card-heading h3 { margin: 0; }
.card-heading h3 { font-size: 1rem; }
.tag, .source-label, .internal-label { display: inline-flex; align-items: center; border-radius: 99px; font-size: .66rem; font-weight: 850; }
.tag { padding: 5px 8px; background: #edf1f1; color: var(--muted); }
.source-label { padding: 5px 8px; background: var(--system); color: var(--brand-2); }
.internal-label { padding: 3px 7px; background: #f5e9ea; color: #91424a; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.wide { grid-column: 1 / -1; }
.client-summary { min-height: 112px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 17px; padding: 15px; border-radius: 12px; background: var(--system); }
.client-summary div { min-width: 0; }
.client-summary span, .client-summary strong { display: block; overflow-wrap: anywhere; }
.client-summary span { margin-bottom: 3px; color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.client-summary strong { font-size: .82rem; }
.sectors { display: flex; flex-direction: column; gap: 14px; }
.sector-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.sector-header { min-height: 68px; display: grid; grid-template-columns: 38px 1fr auto 38px; align-items: center; gap: 10px; padding: 11px 16px; background: #fafdfe; border-bottom: 1px solid var(--line); }
.collapse-button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--system); color: var(--brand); font-size: 1.25rem; }
.sector-title { display: flex; align-items: center; gap: 9px; }
.sector-index { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; background: var(--brand); color: white; font-size: .68rem; font-weight: 900; }
.sector-name { min-height: 36px; padding: 4px 8px; border-color: transparent; background: transparent; font-weight: 850; }
.sector-name:hover, .sector-name:focus { border-color: var(--line); background: white; }
.sector-subtotal { min-width: 125px; text-align: right; }
.sector-subtotal span, .sector-subtotal strong { display: block; }
.sector-subtotal span { color: var(--muted); font-size: .65rem; font-weight: 750; text-transform: uppercase; }
.sector-subtotal strong { margin-top: 3px; }
.sector-content { padding: 0 16px 16px; }
.sector-card.collapsed .sector-content { display: none; }
.sector-card.collapsed .sector-header { border-bottom: 0; }
.items-table-wrap { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.items-table th { padding: 13px 8px 9px; color: var(--muted); font-size: .65rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.items-table td { padding: 9px 8px; border-top: 1px solid #edf1f1; vertical-align: middle; }
.items-table td:first-child { min-width: 235px; }
.items-table input, .items-table select { min-height: 38px; }
.system-field { background: var(--system); color: var(--brand); font-weight: 750; }
.item-code { display: block; min-height: 13px; margin: 4px 2px 0; color: var(--muted); font-size: .66rem; }
.item-actions { white-space: nowrap; }
.item-actions .icon-button { width: 32px; height: 32px; margin-left: 3px; }
.add-item-button { margin-top: 12px; padding: 9px 12px; border: 1px dashed #aebfc1; border-radius: 9px; background: white; color: var(--brand-2); font-weight: 800; }
.summary-layout { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); margin-top: 20px; }
.observations-card label:first-of-type { margin-top: 16px; }
.totals-card { padding: 25px; border-radius: var(--radius); background: var(--brand); color: white; box-shadow: var(--shadow); }
.totals-card h3 { margin: 0 0 21px; font-size: 1.3rem; }
.totals-card dl { margin: 0; }
.totals-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.totals-card dt { color: #c5dadd; }
.totals-card dd { margin: 0; font-weight: 850; }
.totals-card .grand-total { margin-top: 7px; padding-top: 17px; border: 0; font-size: 1.12rem; }
.totals-card .grand-total dt { color: white; }
.totals-card p { margin: 19px 0 0; color: #a9c6ca; font-size: .7rem; line-height: 1.5; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(12,33,37,.56); backdrop-filter: blur(5px); z-index: 100; }
.modal-card { width: min(570px, 100%); padding: 26px; border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.share-options { display: grid; gap: 10px; margin-top: 20px; }
.share-option { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); text-align: left; }
.share-option:hover { border-color: var(--brand-2); background: var(--system); }
.share-option span { color: var(--muted); font-size: .75rem; }
.client-view .internal-column, .client-view .internal-row, .client-view .internal-label, .client-view #internalNotes, .client-view label:has(#internalNotes), .client-view .admin-only { display: none !important; }
.client-view .prototype-notice { display: none; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 260px; transition: .25s; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-grid; }
  .two-columns, .summary-layout { grid-template-columns: 1fr; }
  .topbar { padding-inline: 20px; }
  .notice { margin-inline: 20px; }
  .page { padding-inline: 20px; }
}
@media (max-width: 680px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card { padding: 30px 24px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .top-actions { width: 100%; order: 4; }
  .top-actions .button { flex: 1; padding-inline: 8px; font-size: .75rem; }
  .notice { font-size: .75rem; }
  .section-heading { align-items: flex-start; }
  .section-heading .autosave { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .client-summary { grid-template-columns: 1fr; }
  .sector-header { grid-template-columns: 34px minmax(0,1fr) 38px; }
  .sector-subtotal { grid-column: 2; min-width: 0; text-align: left; }
  .sector-header > .delete-sector { grid-column: 3; grid-row: 1; }
  .items-table { min-width: 0; }
  .items-table thead { display: none; }
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; }
  .items-table tr { margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
  .items-table td { display: grid; grid-template-columns: 105px 1fr; gap: 9px; align-items: center; padding: 7px 0; border: 0; }
  .items-table td::before { content: attr(data-label); color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
  .items-table td:first-child { min-width: 0; }
  .items-table .item-actions { display: flex; justify-content: flex-end; }
  .items-table .item-actions::before { display: none; }
  .summary-layout { margin-top: 14px; }
  .share-option { align-items: flex-start; flex-direction: column; }
}
@media print {
  :root { background: white; }
  .sidebar, .top-actions, .menu-button, .notice, #addSectorButton, .add-item-button, .item-actions, .delete-sector, .collapse-button, .autosave, .internal-column, .internal-row, label:has(#internalNotes), .modal { display: none !important; }
  .app-shell { display: block; }
  .topbar { position: static; padding: 0 0 20px; border: 0; }
  .page { padding: 0; }
  .card, .sector-card, .totals-card { break-inside: avoid; box-shadow: none; }
  .sector-content { display: block !important; }
  .items-table { min-width: 0; }
  .totals-card { background: white; color: var(--ink); border: 1px solid var(--line); }
  .totals-card dt, .totals-card p, .eyebrow.light { color: var(--muted); }
}

/* --- Capa v2 ------------------------------------------------------------ */

:root {
  --ink: #252b33;
  --muted: #68717c;
  --line: #e0e3e8;
  --canvas: #f6f7f9;
  --brand: #c52a20;
  --brand-2: #ef3528;
  --accent: #f79177;
  --accent-soft: #fff0ec;
  --system: #f1f3f7;
  --success: #327257;
  --danger: #b7272d;
  --input: #1e57c8;
  --input-soft: #eef4ff;
  --linked: #147a4b;
  --linked-soft: #ecf8f1;
  --calculated: #202d30;
  --navy: #242b77;
  --olive: #9b9257;
  --brand-dark: #191d25;
  --brand-red-dark: #a9231b;
  --brand-coral: #f79177;
  --shadow: 0 16px 45px rgba(36,43,119,.08);
}

body { background: radial-gradient(circle at 88% 0, rgba(247,145,119,.09), transparent 30%), var(--canvas); }
.login-screen { background: var(--brand-dark); }
.login-brand { position: relative; overflow: hidden; background: linear-gradient(145deg, #242b77 0%, #171b24 68%); }
.login-brand::before { content: ""; position: absolute; width: 540px; height: 540px; left: -160px; top: -185px; border: 90px solid rgba(239,53,40,.24); border-radius: 50%; }
.login-brand::after { content: ""; position: absolute; width: 230px; height: 230px; right: -75px; bottom: -80px; border-radius: 50%; background: linear-gradient(145deg, rgba(239,53,40,.78), rgba(247,145,119,.44)); filter: blur(1px); }
.login-brand-content { position: relative; z-index: 1; width: min(460px,72%); }
.login-brand p { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.75); font-size: .79rem; font-weight: 700; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.brand-mark { width: 100%; height: auto; padding: 0; border-radius: 0; background: transparent; }
.brand-mark img { display: block; width: 100%; height: auto; }
.brand-mark.small { width: 170px; height: auto; border-radius: 0; }
.login-card { border-top: 5px solid var(--brand-2); box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.login-card h1 { color: var(--navy); }
.sidebar { background: linear-gradient(180deg, #242b77 0%, #191d25 100%); }
.sidebar-brand { flex-direction: column; align-items: flex-start; gap: 12px; }
.sidebar-brand span { color: rgba(255,255,255,.68); letter-spacing: .06em; text-transform: uppercase; }
.nav-item { color: rgba(255,255,255,.72); }
.nav-item:hover { background: rgba(255,255,255,.1); }
.nav-item.active { background: var(--brand-2); color: white; box-shadow: 0 7px 20px rgba(239,53,40,.26); }
#roleBadge { color: rgba(255,255,255,.6); }
.button { transition: background-color .2s, border-color .2s, color .2s, transform .2s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--brand); color: white; box-shadow: 0 7px 18px rgba(197,42,32,.18); }
.button.primary:hover { background: var(--brand-red-dark); }
.button.ghost { color: var(--navy); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(239,53,40,.12); }
.eyebrow { color: var(--brand-2); }
.eyebrow.light { color: rgba(255,255,255,.7); }
.notice { border-color: #f5c3b7; background: var(--accent-soft); color: #7e2e26; }
.status.draft { background: var(--accent-soft); color: #922c23; }
.step-number, .sector-index { background: var(--brand); }
.ante-card { border-top-color: var(--brand-2); }
.required-tag { background: var(--accent-soft); color: #922c23; }
.source-label { background: #eff0fa; color: var(--navy); }
.totals-card { background: linear-gradient(145deg, var(--navy), #171b24); }
.totals-card dt, .labor-total dt { color: rgba(255,255,255,.7); }
.totals-card p { color: rgba(255,255,255,.64); }
.measure-results .highlight-result { background: var(--navy); }
.measure-results .highlight-result span { color: rgba(255,255,255,.7); }
.labor-card-header { border-left: 5px solid var(--brand-2); }
.budget-tab.active { background: var(--navy); box-shadow: 0 7px 18px rgba(36,43,119,.16); }
.budget-tab.active::after { content: ""; position: absolute; height: 3px; left: 22%; right: 22%; bottom: 0; border-radius: 99px; background: var(--brand-coral); }
.budget-tab { position: relative; }

.main-content { padding-bottom: 60px; }
.budget-tabs { position: sticky; top: 94px; z-index: 19; display: flex; gap: 6px; margin: 22px clamp(20px,4vw,54px) 0; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); box-shadow: 0 8px 28px rgba(21,53,59,.06); }
.budget-tab { flex: 1; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 850; }
.budget-tab span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: #edf1f1; font-size: .66rem; }
.budget-tab.active { background: var(--navy); color: white; }
.budget-tab.active span { background: rgba(255,255,255,.16); }
.tab-page { display: none; padding: 30px clamp(20px,4vw,54px) 0; }
.tab-page.active { display: block; }
.sequence-field { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--system); }
.sequence-field strong { font-size: .94rem; letter-spacing: .03em; }
.sequence-field span { color: var(--linked); font-size: .62rem; font-weight: 800; text-align: right; }
.ante-card { margin-top: 18px; border-top: 4px solid var(--accent); }
.required-tag { padding: 5px 9px; border-radius: 99px; background: var(--accent-soft); color: #855315; font-size: .68rem; font-weight: 850; }
.ante-grid { display: grid; grid-template-columns: 1fr 1fr .68fr; gap: 16px; margin-top: 19px; }
.measure-block { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.measure-block h4 { margin: 0 0 13px; font-size: .8rem; }
.inline-fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.inline-fields label { margin-top: 0; font-size: .67rem; }
.measure-results { display: grid; gap: 9px; }
.measure-results > div, .measure-results > label { min-height: 60px; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-radius: 11px; background: var(--system); }
.measure-results span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.measure-results label input { width: 92px; }
.measure-results .highlight-result { background: var(--brand); color: white; }
.measure-results .highlight-result span { color: #bed4d7; }
.ante-details { margin-top: 4px; grid-template-columns: repeat(5,1fr); }
.ante-details label { grid-column: auto; }
.input-field { border-color: #b9cbee; background: var(--input-soft); color: var(--input); font-weight: 800; }
.linked-field { border-color: #b8dcc8; background: var(--linked-soft); color: var(--linked); font-weight: 800; }
.calculated-field { border-color: #d9e1e2; background: #f4f6f6; color: var(--calculated); font-weight: 850; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.legend span { padding: 5px 8px; border-radius: 99px; font-size: .64rem; font-weight: 850; }
.legend-input { background: var(--input-soft); color: var(--input); }
.legend-linked { background: var(--linked-soft); color: var(--linked); }
.legend-calc { background: #edf0f0; color: var(--calculated); }
.sector-header { grid-template-columns: 38px minmax(0,1fr) auto; }
.sector-title h3 { margin: 0; font-size: .9rem; }
.sector-title small { display: block; margin-top: 3px; color: var(--muted); }
.items-table th { white-space: nowrap; }
.items-table .item-description { min-width: 235px; }
.items-table .unit-cell { min-width: 90px; }
.items-table .number-cell { min-width: 105px; }
.items-table .wide-number { min-width: 130px; }
.items-table input, .items-table select { font-size: .76rem; }
.item-description small { display: block; margin: 4px 2px 0; color: var(--muted); font-size: .63rem; }
.linked-sector-message { margin: 13px 0 0; padding: 13px; border-radius: 10px; background: var(--linked-soft); color: var(--linked); font-size: .76rem; font-weight: 750; }
.service-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; background: white; }
.service-row span { color: var(--muted); font-size: .76rem; }
.service-row strong { color: var(--linked); }
.observations-card { margin-top: 20px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.labor-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.labor-card { padding: 0; overflow: hidden; }
.labor-card-header { padding: 13px 17px; background: var(--navy); color: white; }
.labor-card-header h3 { margin: 0; font-size: .86rem; }
.labor-card-header > div span { display: block; margin-top: 4px; color: rgba(255,255,255,.68); font-size: .66rem; }
.labor-card-header > strong { font-size: .88rem; text-align: right; }
.labor-fields { padding: 8px 17px 17px; }
.labor-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(130px,.42fr); align-items: center; gap: 15px; padding: 8px 0; border-bottom: 1px solid #edf1f1; }
.labor-row:last-child { border-bottom: 0; }
.labor-row label { margin: 0; color: var(--ink); font-weight: 680; }
.labor-row input { min-height: 38px; text-align: right; }
.labor-row .output { min-height: 38px; display: flex; align-items: center; justify-content: flex-end; padding: 8px 12px; border-radius: 9px; background: #f4f6f6; font-weight: 850; text-align: right; }
.labor-row .output.linked { background: var(--linked-soft); color: var(--linked); }
.labor-total { width: min(520px,100%); margin: 18px 0 0 auto; }
.labor-total dl div { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.labor-total dt { color: #c5dadd; }
.labor-total dd { margin: 0; font-weight: 850; }
.service-transfer-card, .displacement-card { grid-column: 1 / -1; }
.service-transfer-card .labor-card-header, .displacement-card .labor-card-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.service-transfer-card .labor-card-header { background: linear-gradient(105deg, var(--navy), #343d91); }
.service-cost-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--line); }
.service-cost-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 11px 15px; background: white; }
.service-cost-summary span { color: var(--muted); font-size: .72rem; }
.service-cost-summary strong { color: var(--calculated); font-size: .75rem; text-align: right; }
.displacement-card { border-bottom: 4px solid var(--brand-2); }
.displacement-card .labor-card-header { padding: 17px 19px; background: linear-gradient(105deg, var(--navy), #1c225f); }
.displacement-body { padding: 0 19px 19px; }
.displacement-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.subsection-heading > div { display: flex; align-items: center; gap: 10px; }
.subsection-heading h4 { margin: 0; color: var(--ink); font-size: .82rem; }
.subsection-heading p { margin: 3px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.subsection-number { display: grid; flex: 0 0 27px; height: 27px; place-items: center; border-radius: 7px; background: #eff0fa; color: var(--navy); font-size: .63rem; font-weight: 900; }
.displacement-grid, .cost-result-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.labor-output-box, .cost-result-grid > div { min-height: 70px; display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fa; }
.labor-output-box span, .cost-result-grid span { color: var(--muted); font-size: .66rem; font-weight: 750; }
.labor-output-box strong, .cost-result-grid strong { margin-top: 4px; color: var(--calculated); font-size: .9rem; }
.labor-output-box.emphasis { border-color: #cfd2ec; background: #f0f1fb; }
.labor-output-box.emphasis strong { color: var(--navy); }
.displacement-input-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.displacement-input-grid.single-field { grid-template-columns: minmax(220px,1fr) 2fr; }
.displacement-input-grid label { margin: 0; color: var(--ink); font-size: .7rem; }
.displacement-input-grid input { min-height: 39px; text-align: right; }
.cost-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 12px; }
.cost-result-grid > div { min-height: 76px; border-color: #dce8e1; background: #f4f9f6; }
.cost-result-grid strong { color: var(--linked); }
.cost-result-grid small { margin-top: 5px; color: var(--muted); font-size: .61rem; }
.dynamic-list { display: grid; gap: 8px; margin-top: 12px; }
.dynamic-cost-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(130px,.32fr) 36px; align-items: center; gap: 8px; }
.dynamic-cost-row input { min-height: 38px; }
.dynamic-cost-row input:nth-child(2) { text-align: right; }
.empty-dynamic-list { margin: 0; padding: 11px 13px; border-radius: 9px; background: #f7f8fa; color: var(--muted); font-size: .68rem; }
.add-line-button { margin-top: 10px; padding: 8px 11px; border: 1px dashed #a9b2be; border-radius: 8px; background: white; color: var(--navy); font-size: .69rem; font-weight: 850; }
.add-line-button:hover { border-color: var(--brand-2); color: var(--brand); }
.travel-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 13px; }
.travel-option { min-height: 82px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
.travel-option:hover { border-color: #c4c9df; }
.travel-option.selected { border-color: var(--navy); background: #f0f1fb; box-shadow: 0 0 0 2px rgba(36,43,119,.08); }
.travel-option input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--navy); }
.travel-option span strong, .travel-option span small { display: block; }
.travel-option span strong { color: var(--ink); font-size: .74rem; }
.travel-option span small { margin-top: 3px; color: var(--muted); font-size: .62rem; line-height: 1.35; }
.travel-option b { color: var(--navy); font-size: .76rem; text-align: right; }
.displacement-total { margin: 18px -19px -19px; padding: 6px 19px 12px; background: #f5f6f8; }
.displacement-total > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #e2e4e8; }
.displacement-total span { color: var(--muted); font-size: .7rem; }
.displacement-total strong { color: var(--calculated); font-size: .76rem; }
.displacement-total .grand { margin-top: 4px; padding-top: 13px; border: 0; }
.displacement-total .grand span, .displacement-total .grand strong { color: var(--navy); font-size: .86rem; font-weight: 900; }
.results-layout { grid-template-columns: minmax(0,1fr) 300px; align-items: start; }
.results-main { display: flex; min-width: 0; flex-direction: column; gap: 16px; }
.result-card { padding: 0; overflow: hidden; }
.result-card-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.result-card-header > div { display: flex; align-items: center; gap: 11px; }
.result-card-header h3 { margin: 0; color: var(--ink); font-size: .94rem; line-height: 1.25; }
.result-card-header p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.result-card-index { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--navy); color: white; font-size: .65rem; font-weight: 900; }
.editable-tag, .calculated-tag { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; font-size: .63rem; font-weight: 850; }
.editable-tag { background: var(--input-soft); color: var(--input); }
.calculated-tag { background: #edf0f2; color: var(--calculated); }
.result-column-head { display: grid; grid-template-columns: minmax(0,1fr) 170px 150px; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #f5f6f8; color: var(--muted); font-size: .61rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.result-column-head span:not(:first-child) { text-align: right; }
.result-rows { padding: 0 18px; }
.result-rows > label, .result-rows > div { min-height: 54px; display: grid; grid-template-columns: minmax(0,1fr) 170px 150px; align-items: center; gap: 12px; margin: 0; border-bottom: 1px solid #eceef1; }
.result-rows > :last-child { border-bottom: 0; }
.result-rows span { color: var(--ink); font-size: .76rem; font-weight: 680; line-height: 1.35; }
.result-rows input { justify-self: stretch; min-height: 38px; padding: 8px 11px; border: 1px solid #b9cbee; border-radius: 9px; background: var(--input-soft); color: var(--input); font-size: .8rem; font-weight: 850; text-align: right; }
.result-rows strong { color: var(--calculated); font-size: .79rem; font-weight: 850; text-align: right; }
.result-rows .result-percent { color: var(--navy); }
.result-rows .empty-result { color: #a8afb7; font-weight: 650; }
.editable-row { margin-inline: -18px !important; padding-inline: 18px; background: linear-gradient(90deg, rgba(238,244,255,.76), transparent 62%); }
.editable-row::before { content: ""; position: absolute; width: 3px; height: 24px; left: 0; border-radius: 0 4px 4px 0; background: var(--input); }
.editable-row { position: relative; }
.calculated-row { background: white; }
.result-total { min-height: 66px; display: grid; grid-template-columns: minmax(0,1fr) 170px 150px; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid #d8dbe1; background: #f0f1fb; }
.result-total span { color: var(--navy); font-size: .77rem; font-weight: 900; text-transform: uppercase; }
.result-total strong { color: var(--navy); font-size: .92rem; font-weight: 900; text-align: right; }
.final-profit { margin-inline: -18px; padding-inline: 18px; border-bottom: 0 !important; background: #eef6f1; }
.final-profit span, .final-profit strong { color: #215f46; font-weight: 900; }
.final-result-card { border-bottom: 4px solid var(--brand-2); }
.discount-rows { padding-block: 4px; }
.results-sidebar { display: flex; flex-direction: column; gap: 15px; }
.parameter-card { border-top: 4px solid var(--input); }
.parameter-card label { color: var(--ink); font-size: .76rem; }
.parameter-card input { font-size: .86rem; font-weight: 850; text-align: right; }
.helper { color: var(--muted); font-size: .7rem; line-height: 1.55; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .74rem; }
.check:last-child { border: 0; }
.check::before { content: "✓"; display: grid; flex: 0 0 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--linked-soft); color: var(--linked); font-weight: 900; }
.check.fail::before { content: "!"; background: #fdeced; color: var(--danger); }
.share-options { margin-top: 20px; }
.pricing-knowledge-note { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 12px 15px; border: 1px solid #cfd2ec; border-radius: 11px; background: #f0f1fb; color: var(--navy); font-size: .75rem; }
.pricing-knowledge-note span { color: #555d7a; }
.pricing-model-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; align-items: start; gap: 18px; }
.pricing-model-main, .pricing-model-sidebar { display: flex; min-width: 0; flex-direction: column; gap: 16px; }
.pricing-model-card { padding: 0; overflow: hidden; }
.pricing-model-card-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.pricing-model-card-header > div { display: flex; align-items: center; gap: 11px; }
.pricing-model-card-header h3 { margin: 0; color: var(--ink); font-size: .94rem; }
.pricing-model-card-header p { margin: 4px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.4; }
.pricing-model-index { display: grid; flex: 0 0 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--navy); color: white; font-size: .65rem; font-weight: 900; }
.linked-tag { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: var(--linked-soft); color: var(--linked); font-size: .63rem; font-weight: 850; }
.pricing-cost-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); }
.pricing-cost-group { min-width: 0; background: white; }
.pricing-cost-group-title { padding: 13px 16px; border-bottom: 1px solid var(--line); background: #f5f6f8; }
.pricing-cost-group-title h4 { margin: 0; color: var(--ink); font-size: .78rem; }
.pricing-cost-group-title p { margin: 3px 0 0; color: var(--muted); font-size: .63rem; }
.pricing-cost-rows { padding: 4px 16px; }
.pricing-cost-row { min-height: 46px; display: grid; grid-template-columns: minmax(0,1fr) minmax(125px,.42fr); align-items: center; gap: 12px; border-bottom: 1px solid #eceef1; }
.pricing-cost-row:last-child { border-bottom: 0; }
.pricing-cost-row span { color: var(--ink); font-size: .71rem; line-height: 1.3; }
.pricing-cost-row strong { color: var(--linked); font-size: .74rem; text-align: right; }
.pricing-cost-row.editable { margin-inline: -16px; padding-inline: 16px; border-left: 3px solid var(--input); background: linear-gradient(90deg, var(--input-soft), transparent 72%); }
.pricing-cost-row input { min-height: 36px; padding-block: 6px; font-size: .76rem; text-align: right; }
.pricing-cost-total { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 53px; padding: 12px 16px; border-top: 1px solid #d7dae0; background: #f0f1fb; }
.pricing-cost-total span, .pricing-cost-total strong { color: var(--navy); font-size: .78rem; font-weight: 900; }
.assumption-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; background: var(--line); }
.assumption-grid label { min-width: 0; min-height: 124px; justify-content: flex-end; margin: 0; padding: 14px; background: white; }
.assumption-grid label > span { color: var(--ink); font-size: .71rem; line-height: 1.3; }
.assumption-grid label > small { min-height: 25px; color: var(--muted); font-size: .6rem; line-height: 1.3; }
.percentage-input { position: relative; }
.percentage-input input { min-height: 38px; padding-right: 29px; text-align: right; }
.percentage-input b { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: var(--input); font-size: .72rem; pointer-events: none; }
.assumption-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; padding-top: 1px; background: var(--line); }
.assumption-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 11px 14px; background: #f7f8fa; }
.assumption-totals span { color: var(--muted); font-size: .65rem; line-height: 1.3; }
.assumption-totals strong { color: var(--calculated); font-size: .78rem; }
.assumption-totals .denominator { background: #f4f9f6; }
.assumption-totals .denominator strong { color: var(--linked); }
.pricing-formula-box { padding: 18px; }
.formula-readable { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 10px; background: #f5f6f8; }
.formula-readable span { color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.formula-readable code { color: var(--navy); font-family: inherit; font-size: .72rem; font-weight: 800; text-align: right; }
.formula-substitution { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 10px 12px; color: var(--muted); font-size: .72rem; }
.formula-substitution b { color: var(--brand-2); font-size: 1rem; }
.pricing-sale-total { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 16px; padding: 17px 18px; border-radius: 12px; background: linear-gradient(110deg,var(--navy),#343d91); color: white; }
.pricing-sale-total span { font-size: .74rem; font-weight: 850; text-transform: uppercase; }
.pricing-sale-total strong { font-size: 1.35rem; text-align: right; }
.pricing-sale-total small { grid-column: 2; color: rgba(255,255,255,.7); font-size: .72rem; text-align: right; }
.pricing-margin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.pricing-margin-grid > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 14px; padding: 14px 18px; background: #fbfcfe; }
.pricing-margin-grid span { grid-column: 1 / -1; color: var(--muted); font-size: .67rem; }
.pricing-margin-grid strong { color: var(--calculated); font-size: .8rem; }
.pricing-margin-grid b { color: var(--navy); font-size: .8rem; text-align: right; }
.pricing-proof-card { border-top: 4px solid var(--navy); }
.pricing-proof-card h3, .pricing-audit-card h3 { margin: 0; font-size: .9rem; }
.proof-rows { margin-top: 14px; }
.proof-rows > div, .proof-rate { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.proof-rows span, .proof-rate span { color: var(--muted); font-size: .69rem; }
.proof-rows strong, .proof-rate strong { color: var(--calculated); font-size: .73rem; text-align: right; }
.proof-rows .profit { margin-top: 3px; padding: 11px 9px; border: 0; border-radius: 8px; background: #eef6f1; }
.proof-rows .profit span, .proof-rows .profit strong { color: #215f46; font-weight: 900; }
.proof-rate { padding-top: 13px; border: 0; }
.proof-rate strong { color: var(--linked); font-size: .9rem; }
.pricing-audit-card { border-top: 4px solid var(--brand-2); }
.pricing-audit-card #pricingChecks { margin-top: 12px; }
.pricing-sale-card { border-bottom: 4px solid var(--brand-2); }
.search-combobox { position: relative; }
.search-results { position: absolute; z-index: 60; top: calc(100% + 5px); left: 0; right: 0; max-height: 310px; overflow: auto; padding: 5px; border: 1px solid #cfd4dc; border-radius: 11px; background: white; box-shadow: 0 18px 45px rgba(25,29,37,.16); }
.search-results button { width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 10px 11px; border: 0; border-radius: 8px; background: white; color: var(--ink); text-align: left; }
.search-results button:hover { background: var(--input-soft); }
.search-results button strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.search-results button span { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { margin: 0; padding: 12px; color: var(--muted); font-size: .7rem; }
.product-combobox { min-width: 290px; }
.product-results { min-width: 480px; }
.data-page { padding: 36px clamp(20px,4vw,54px); }
.data-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.data-page-heading h1 { margin: 4px 0; color: var(--navy); }
.data-page-heading p { margin: 0; color: var(--muted); }
.data-page-heading > strong { padding: 9px 12px; border-radius: 9px; background: var(--navy); color: white; }
.data-search { margin-top: 7px; }
.data-table-wrap { max-height: calc(100vh - 300px); overflow: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 11px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 11px; background: var(--navy); color: white; text-align: left; }
.data-table td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:nth-child(even) td { background: #fafbfc; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 3px; color: var(--muted); }
.money-cell { font-weight: 850; text-align: right; white-space: nowrap; }
.data-limit-note { color: var(--muted); font-size: .67rem; }
.fixed-cost-add { margin: 6px 16px 12px; }
.fixed-extra-row { grid-template-columns: minmax(130px,1fr) minmax(110px,.42fr) 34px; padding-block: 5px; }
.fixed-extra-row input { min-width: 0; }
.proposal-editor { padding: 28px clamp(16px,3vw,40px); }
.proposal-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.proposal-toolbar h1 { margin: 4px 0; color: var(--navy); }
.proposal-toolbar p { margin: 0; color: var(--muted); }
.proposal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.upload-button { position: relative; cursor: pointer; }
.upload-button input, .proposal-section-controls input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.proposal-layout { display: grid; grid-template-columns: 245px minmax(0,850px); justify-content: center; align-items: start; gap: 22px; }
.proposal-help { position: sticky; top: 20px; }
.proposal-help h3 { margin-top: 0; color: var(--navy); }
.proposal-help p { color: var(--muted); font-size: .7rem; line-height: 1.55; }
.proposal-stat { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: .75rem; }
.proposal-paper { min-width: 0; background: #dfe2e7; padding: 22px; border-radius: 14px; }
.proposal-document { overflow: hidden; min-height: 1100px; background: white; box-shadow: 0 15px 40px rgba(25,29,37,.13); }
.proposal-document-header { min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 28px; background: #101821; color: white; }
.proposal-document-header img { width: 190px; }
.proposal-document-header span { font-size: .62rem; letter-spacing: .04em; }
.proposal-cover, .proposal-section { padding: 28px 38px; border-bottom: 1px solid #edf0f2; }
.proposal-cover > span { color: var(--brand-2); font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.proposal-cover h2 { margin: 16px 0 8px; padding: 14px 17px; background: #1b2636; color: white; font-size: 1.75rem; }
.proposal-cover input, .proposal-cover textarea, .proposal-section-title, .proposal-section-text, .proposal-image-caption { width: 100%; border: 1px dashed #b9c0ca; border-radius: 5px; background: #fffdf6; color: var(--ink); }
.proposal-cover input { margin-top: 8px; color: var(--brand-2); font-weight: 900; }
.proposal-cover textarea, .proposal-section-text { resize: vertical; line-height: 1.55; }
.proposal-section { position: relative; break-inside: avoid; }
.proposal-section-title { padding: 7px 0; border-width: 0 0 2px; border-color: var(--brand-2); border-radius: 0; background: white; color: #171c32; font-size: 1rem; font-weight: 900; }
.proposal-section-text { margin-top: 12px; }
.proposal-section-controls { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; opacity: .58; }
.proposal-section:hover .proposal-section-controls { opacity: 1; }
.proposal-section-controls button, .proposal-section-controls label, .remove-proposal-image { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); font-size: .6rem; cursor: pointer; }
.proposal-info-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: .7rem; }
.proposal-info-table th, .proposal-info-table td { padding: 9px 10px; border: 1px solid #d7d9dd; text-align: left; }
.proposal-info-table th { width: 38%; background: #f3f3f4; color: #25283a; }
.proposal-images { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.proposal-images figure { margin: 0; padding: 8px; border: 1px dashed #b8bec7; border-radius: 9px; background: #fafafa; }
.proposal-images img { width: 100%; max-height: 340px; object-fit: contain; border-radius: 6px; }
.proposal-image-caption { margin-top: 6px; font-size: .67rem; }
.remove-proposal-image { margin-top: 6px; color: var(--danger); }
.proposal-investment { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-top: 18px; padding: 22px; background: #1b1c34; color: white; }
.proposal-investment span, .proposal-investment small { font-size: .65rem; }
.proposal-investment strong { color: #ff6429; font-size: 2rem; }
.proposal-document-footer { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; padding: 16px 28px; background: #101821; color: white; text-align: center; }
.proposal-document-footer strong, .proposal-document-footer span { display: block; font-size: .61rem; }
.proposal-document-footer strong { margin-bottom: 4px; color: #ff6429; }
.nav-separator { height: 1px; margin: 8px 12px; background: rgba(255,255,255,.14); }
.quotes-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.quotes-toolbar label { flex: 1; margin: 0; }
.quotes-toolbar .button { flex: 0 0 auto; }
.quote-list { display: grid; gap: 11px; }
.quote-list-card { display: grid; grid-template-columns: minmax(240px,1.15fr) minmax(360px,1fr) auto; align-items: center; gap: 20px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 7px 22px rgba(36,43,119,.045); }
.quote-list-card.current { border-color: #abb2e1; box-shadow: 0 0 0 2px rgba(36,43,119,.07); }
.quote-number-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.quote-number-line > strong { color: var(--navy); font-size: .87rem; }
.quote-status, .current-tag { padding: 4px 7px; border-radius: 99px; font-size: .57rem; font-weight: 900; }
.current-tag { background: #edf0fb; color: var(--navy); }
.quote-list-main h3 { margin: 8px 0 3px; color: var(--ink); font-size: .82rem; }
.quote-list-main p { margin: 0; color: var(--muted); font-size: .68rem; }
.quote-list-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.quote-list-meta > div { min-width: 0; padding-left: 10px; border-left: 1px solid var(--line); }
.quote-list-meta span, .quote-list-meta strong { display: block; }
.quote-list-meta span { color: var(--muted); font-size: .57rem; text-transform: uppercase; }
.quote-list-meta strong { overflow: hidden; margin-top: 4px; color: var(--ink); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.quote-list-actions { display: flex; gap: 7px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 50px 20px; border: 1px dashed #c8cdd5; border-radius: 13px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--navy); }
.status-borrador { background: #edf0f2; color: #5a626c; }
.status-en-revision { background: #fff3db; color: #8c5d08; }
.status-listo-para-enviar { background: #e8f0ff; color: #2454ad; }
.status-enviado { background: #eeeafe; color: #5d3ca6; }
.status-aprobado { background: #e7f7ee; color: #197248; }
.status-rechazado { background: #fdebec; color: #a72a32; }
.pipeline-summary { display: grid; grid-template-columns: repeat(6,minmax(120px,1fr)); gap: 8px; margin-bottom: 14px; }
.pipeline-summary > div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.pipeline-summary span, .pipeline-summary strong, .pipeline-summary small { display: block; }
.pipeline-summary span { color: var(--muted); font-size: .59rem; }
.pipeline-summary strong { margin: 4px 0; color: var(--navy); font-size: 1rem; }
.pipeline-summary small { overflow: hidden; color: var(--ink); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.kanban-board { display: grid; grid-template-columns: repeat(6,minmax(250px,1fr)); align-items: start; gap: 11px; overflow-x: auto; padding-bottom: 18px; }
.kanban-column { min-height: 460px; border: 1px solid var(--line); border-radius: 13px; background: #eef0f3; transition: border-color .18s,background .18s; }
.kanban-column.drag-over { border-color: var(--brand-2); background: #fff0ec; }
.kanban-column > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px; border-bottom: 1px solid #d8dce2; }
.kanban-column > header > div { display: flex; align-items: center; gap: 7px; }
.kanban-column h2 { margin: 0; color: var(--ink); font-size: .73rem; }
.kanban-column > header > strong { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: white; color: var(--navy); font-size: .63rem; }
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-dot.status-borrador { background: #77808a; }
.kanban-dot.status-en-revision { background: #d99a25; }
.kanban-dot.status-listo-para-enviar { background: #3975d5; }
.kanban-dot.status-enviado { background: #7651c8; }
.kanban-dot.status-aprobado { background: #24945f; }
.kanban-dot.status-rechazado { background: #cc3f47; }
.kanban-cards { display: grid; gap: 9px; padding: 9px; }
.kanban-card { padding: 12px; border: 1px solid #dadddf; border-radius: 10px; background: white; box-shadow: 0 5px 15px rgba(25,29,37,.055); cursor: grab; }
.kanban-card.dragging { opacity: .5; }
.kanban-card-number, .kanban-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.kanban-card-number strong { color: var(--navy); font-size: .7rem; }
.kanban-card-number button, .kanban-card-foot button { border: 0; background: transparent; color: var(--navy); font-size: .66rem; font-weight: 850; }
.kanban-card h3 { margin: 10px 0 4px; color: var(--ink); font-size: .72rem; line-height: 1.35; }
.kanban-card p { min-height: 28px; margin: 0; color: var(--muted); font-size: .61rem; line-height: 1.4; }
.kanban-card-value { margin: 10px 0; padding: 8px; border-radius: 7px; background: #f2f3f8; color: var(--navy); font-size: .72rem; font-weight: 900; }
.kanban-card-foot { padding-top: 8px; border-top: 1px solid var(--line); }
.kanban-card-foot span { color: var(--muted); font-size: .58rem; }
.kanban-card label { margin-top: 9px; color: var(--muted); font-size: .56rem; }
.kanban-card select { min-height: 32px; margin-top: 4px; padding: 5px 7px; font-size: .62rem; }
.kanban-empty { padding: 25px 12px; border: 1px dashed #c8cdd4; border-radius: 9px; color: #8b929b; font-size: .62rem; text-align: center; }

@media (max-width: 1120px) {
  .ante-grid { grid-template-columns: 1fr 1fr; }
  .measure-results { grid-column: 1 / -1; grid-template-columns: repeat(3,1fr); }
  .ante-details { grid-template-columns: repeat(3,1fr); }
  .results-layout { grid-template-columns: 1fr; }
  .pricing-model-layout { grid-template-columns: 1fr; }
  .pricing-model-sidebar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .assumption-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .quote-list-card { grid-template-columns: 1fr; }
  .quote-list-meta { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .quote-list-actions { justify-content: flex-end; }
  .pipeline-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .budget-tabs { top: 94px; }
  .labor-layout { grid-template-columns: 1fr; }
  .service-cost-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pricing-cost-columns { grid-template-columns: 1fr; }
  .proposal-layout { grid-template-columns: 1fr; }
  .proposal-help { position: static; }
}
@media (max-width: 680px) {
  .budget-tabs { top: 144px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-inline: 12px; overflow: visible; }
  .budget-tab { width: 100%; padding: 0 9px; font-size: .68rem; line-height: 1.15; }
  .tab-page { padding-inline: 14px; }
  .ante-grid, .ante-details { grid-template-columns: 1fr; }
  .measure-results { grid-column: auto; grid-template-columns: 1fr; }
  .inline-fields { grid-template-columns: 1fr; }
  .result-card-header { align-items: flex-start; }
  .result-card-header > .editable-tag, .result-card-header > .calculated-tag { display: none; }
  .result-column-head { display: none; }
  .result-rows { padding-inline: 14px; }
  .result-rows > label, .result-rows > div { grid-template-columns: 1fr 1fr; gap: 7px 10px; padding-block: 11px; }
  .result-rows span { grid-column: 1 / -1; }
  .editable-row { margin-inline: -14px !important; padding-inline: 14px; }
  .final-profit { margin-inline: -14px; padding-inline: 14px; }
  .result-total { grid-template-columns: 1fr 1fr; gap: 7px 10px; }
  .result-total span { grid-column: 1 / -1; }
  .labor-row { grid-template-columns: 1fr; gap: 5px; }
  .service-cost-summary, .displacement-grid, .cost-result-grid, .displacement-input-grid, .travel-options { grid-template-columns: 1fr; }
  .displacement-input-grid.single-field { grid-template-columns: 1fr; }
  .dynamic-cost-row { grid-template-columns: minmax(0,1fr) 105px 36px; }
  .service-transfer-card .labor-card-header, .displacement-card .labor-card-header { align-items: flex-start; }
  .service-transfer-card .labor-card-header > strong, .displacement-card .labor-card-header > strong { max-width: 120px; }
  .section-heading { flex-direction: column; }
  .legend { align-self: flex-start; }
  .pricing-knowledge-note { align-items: flex-start; flex-direction: column; }
  .pricing-model-sidebar, .assumption-grid, .assumption-totals, .pricing-margin-grid { grid-template-columns: 1fr; }
  .pricing-model-card-header { align-items: flex-start; }
  .pricing-model-card-header > .linked-tag, .pricing-model-card-header > .editable-tag, .pricing-model-card-header > .calculated-tag { display: none; }
  .formula-readable { align-items: flex-start; flex-direction: column; }
  .formula-readable code { text-align: left; }
  .formula-substitution { align-items: flex-start; flex-direction: column; }
  .pricing-sale-total { grid-template-columns: 1fr; }
  .pricing-sale-total strong, .pricing-sale-total small { grid-column: 1; text-align: left; }
  .pricing-cost-row input, .percentage-input input { min-height: 42px; }
  .product-results { min-width: 0; }
  .data-page-heading, .proposal-toolbar { align-items: flex-start; flex-direction: column; }
  .proposal-actions { justify-content: flex-start; }
  .proposal-paper { padding: 0; }
  .proposal-cover, .proposal-section { padding: 22px 18px; }
  .proposal-document-header { align-items: flex-start; flex-direction: column; }
  .proposal-images, .proposal-document-footer { grid-template-columns: 1fr; }
  .quotes-toolbar { align-items: stretch; flex-direction: column; }
  .quote-list-meta { grid-template-columns: 1fr; }
  .quote-list-actions { justify-content: stretch; }
  .quote-list-actions .button { flex: 1; }
  .pipeline-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media print {
  body { background: white; }
  .sidebar, .topbar, .budget-tabs, .notice, .data-page, .proposal-toolbar, .proposal-help, .proposal-section-controls, .remove-proposal-image { display: none !important; }
  .app-shell, .main-content, .proposal-editor, .proposal-layout, .proposal-paper { display: block !important; width: 100%; margin: 0; padding: 0; background: white; }
  .tab-page { display: none !important; }
  .proposal-document { box-shadow: none; }
  .proposal-cover input, .proposal-cover textarea, .proposal-section-title, .proposal-section-text, .proposal-image-caption { border-color: transparent; background: white; box-shadow: none; resize: none; }
  .proposal-section { break-inside: avoid; }
}

/* --- Sesión, compras en curso y usuarios ---------------------------------- */

.login-error {
  margin: 0;
  padding: .65rem .85rem;
  border-radius: .5rem;
  background: #fdecec;
  color: #a12020;
  font-size: .85rem;
  border: 1px solid #f3c9c9;
}

.autosave[data-tone="ok"] { color: #1c7a4a; }
.autosave[data-tone="error"] { color: #a12020; font-weight: 600; }

.pending-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: end;
}

.pending-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; }
.pending-form label.wide { grid-column: 1 / -1; }
.pending-form label small { font-weight: 400; opacity: .7; }
.pending-form button { align-self: end; }

.pending-preview {
  margin: 1rem 0 0;
  padding: .7rem .9rem;
  border-radius: .5rem;
  background: #f4f5fb;
  font-size: .85rem;
}

.pending-form-card { margin-bottom: 1.5rem; }

/* La compra en curso aparece destacada en el buscador del presupuesto. */
.search-results .pending-option strong::before {
  content: "EC";
  display: inline-block;
  margin-right: .45rem;
  padding: .05rem .35rem;
  border-radius: .25rem;
  background: #242b77;
  color: #fff;
  font-size: .66rem;
  letter-spacing: .04em;
  vertical-align: middle;
}

.inactive-row { opacity: .55; }

.items-table .kcal { text-align: right; }

@media (max-width: 700px) {
  .pending-form { grid-template-columns: 1fr; }
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.import-stats div {
  padding: .9rem 1rem;
  border-radius: .6rem;
  background: #fff;
  border: 1px solid #e4e6f0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.import-stats span { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; opacity: .65; }
.import-stats strong { font-size: 1.25rem; }

.button.ghost.danger { color: #a12020; border-color: #f0cccc; }
.button.ghost.danger:hover { background: #fdecec; }

/* --- Presupuesto finalizado ---------------------------------------------- */

.locked-notice {
  border-left: 4px solid #b8860b;
  background: #fff8e6;
  color: #6b5108;
}

.locked-notice .locked-notice-extra {
  display: block;
  margin-top: .35rem;
  font-size: .85em;
  opacity: .85;
}

.finalized-tag {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: .3rem;
  background: #6b5108;
  color: #fff;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.finalized-dot { color: #b8860b; font-size: .7rem; margin-left: .3rem; }

/* Señal visual de solo lectura, además de los campos deshabilitados. */
.quote-locked .tab-page input:disabled,
.quote-locked .tab-page textarea:disabled,
.quote-locked .tab-page select:disabled,
.quote-locked .proposal-editor input:disabled,
.quote-locked .proposal-editor textarea:disabled {
  background: #f5f5f7;
  color: #5b6377;
  cursor: not-allowed;
}

.quote-locked .add-item-button,
.quote-locked .item-actions,
.quote-locked .upload-button {
  opacity: .4;
  pointer-events: none;
}
