/* =====================================================================
   LGMU Proposal System — application styles
   ===================================================================== */
:root {
  --brand: #134C83;
  --brand-600: #0f3f6d;
  --brand-50: #eef4fa;
  --brand-100: #dbe7f3;
  --ink: #0f1b2b;
  --ink-2: #344256;
  --muted: #6b778a;
  --line: #e3e8ef;
  --line-2: #eef1f5;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #16794c; --ok-bg: #e7f5ee;
  --warn: #9a5b00; --warn-bg: #fdf3e2;
  --err: #b42318; --err-bg: #fdecea;
  --info: #175cd3; --info-bg: #eaf2ff;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; background: linear-gradient(to right, #0c2340 var(--side), var(--bg) var(--side)); }
.sidebar { background: #0c2340; color: #c9d6e6; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.brand-mark img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.brand-text strong { display: block; color: #fff; font-size: 14px; letter-spacing: .01em; }
.brand-text span { font-size: 11.5px; color: #8fa3bd; }
.nav { padding: 12px 10px; flex: 1; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f86a3; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: #c9d6e6; font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.sidebar .user { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12.5px; }
.sidebar .user strong { color: #fff; display: block; font-size: 13px; }
.sidebar .user form { margin-top: 8px; }
.sidebar .user button { background: none; border: 1px solid rgba(255,255,255,.18); color: #c9d6e6; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.sidebar .user button:hover { background: rgba(255,255,255,.08); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { width: 100%; padding-left: 34px; background: var(--bg); border-color: transparent; }
.topbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- Cards / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card + .card { margin-top: 18px; }
.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack > * + * { margin-top: 18px; }

/* ---------- KPI ---------- */
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 3px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.status-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.status-strip a { padding: 14px 16px; border-right: 1px solid var(--line-2); color: inherit; }
.status-strip a:last-child { border-right: 0; }
.status-strip a:hover { background: var(--brand-50); text-decoration: none; }
.status-strip .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-strip .l { font-size: 12px; color: var(--muted); }

.hero-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; background: linear-gradient(120deg, var(--brand) 0%, #1d63a6 100%); color: #fff; border-radius: var(--radius); margin-bottom: 18px; flex-wrap: wrap; }
.hero-cta h2 { color: #fff; font-size: 19px; }
.hero-cta p { margin: 4px 0 0; color: #d6e4f3; }
.hero-cta .btn { background: #fff; color: var(--brand); border-color: #fff; font-size: 15px; padding: 11px 20px; }
.hero-cta .btn:hover { background: #eef4fa; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 13.5px/1.2 var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; }
.btn:hover { background: #f8fafc; border-color: #cfd7e2; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #12603d; }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-bg); border-color: #f4c7c1; }
.btn-wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn-wa:hover { background: #188a45; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--line-2); color: var(--err); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
label .req { color: var(--err); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #d3dae4; border-radius: var(--radius-sm); font: 14px/1.4 var(--font); color: var(--ink); background: #fff; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19, 76, 131, .14); }
input[readonly] { background: var(--bg); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--err); box-shadow: 0 0 0 3px rgba(180, 35, 24, .1); }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--err); margin-top: 4px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.input-group { display: flex; }
.input-group > span { display: grid; place-items: center; padding: 0 10px; background: var(--bg); border: 1px solid #d3dae4; border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.input-group > input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group > input + span { border-left: 0; border-right: 1px solid #d3dae4; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group > input:has(+ span) { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 6px; }
.seg { display: inline-flex; border: 1px solid #d3dae4; border-radius: var(--radius-sm); overflow: hidden; }
.seg label { margin: 0; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); border-right: 1px solid #d3dae4; background: #fff; }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg input:checked + span { color: var(--brand); }
.seg label:has(input:checked) { background: var(--brand-50); color: var(--brand); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table .num { text-align: right; }
.table a.row-link { font-weight: 600; color: var(--ink); }
.table a.row-link:hover { color: var(--brand); }
.table .sub { font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: #b4bfcd; margin-bottom: 8px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line-2); align-items: center; }
.pager span { color: var(--muted); font-size: 12.5px; margin-right: auto; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-draft { background: #f1f3f6; color: #556172; }
.badge-generated { background: var(--brand-50); color: var(--brand); }
.badge-sent { background: #eaf2ff; color: #175cd3; }
.badge-viewed { background: #f0eafe; color: #6941c6; }
.badge-under_discussion { background: var(--warn-bg); color: var(--warn); }
.badge-revised { background: #f1f3f6; color: #556172; }
.badge-accepted { background: var(--ok-bg); color: var(--ok); }
.badge-converted { background: #dff3ea; color: #0e5a38; }
.badge-rejected { background: var(--err-bg); color: var(--err); }
.badge-expired { background: #f4f4f5; color: #71717a; }
.badge-active { background: var(--ok-bg); color: var(--ok); }
.badge-inactive { background: #f4f4f5; color: #71717a; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--line-2); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- Alerts / toasts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #c6e8d6; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #f6cbc5; }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: #f4dfb6; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #cddffc; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: #0f1b2b; color: #fff; padding: 11px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .18s ease-out; }
.toast.error { background: #7a1610; }
.toast.success { background: #0e5a38; }
.toast.warning { background: #7a4700; }
.toast button { background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; margin-left: auto; padding: 0 0 0 6px; font-size: 16px; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 27, 43, .45); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 16px; overflow-y: auto; }
.modal.open { display: flex; animation: fadeIn .14s ease-out; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); animation: popIn .16s ease-out; }
.modal-box.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fafbfc; border-radius: 0 0 12px 12px; }
.modal-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters .f { min-width: 150px; flex: 1; }
.filters .f.wide { flex: 2.4; min-width: 220px; }
.filters label { font-size: 11.5px; }
.filters .btns { display: flex; gap: 6px; }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-100); border: 2px solid var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.client::before { background: #e7f5ee; border-color: var(--ok); }
.timeline li.system::before { background: #f1f3f6; border-color: #9aa5b4; }
.timeline .when { font-size: 11.5px; color: var(--muted); }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* =====================================================================
   Proposal builder
   ===================================================================== */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stepper { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; margin-bottom: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.stepper button { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 0; background: none; border-radius: 7px; cursor: pointer; font: 600 13px var(--font); color: var(--muted); white-space: nowrap; min-width: max-content; }
.stepper button .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 11.5px; color: var(--ink-2); flex: none; }
.stepper button:hover { background: var(--bg); }
.stepper button.active { background: var(--brand-50); color: var(--brand); }
.stepper button.active .n { background: var(--brand); color: #fff; }
.stepper button.done .n { background: var(--ok); color: #fff; }
.stepper button.has-error .n { background: var(--err); color: #fff; }
.step { display: none; }
.step.active { display: block; animation: fadeIn .15s ease-out; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.save-state { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.saving .dot { background: #f5a524; }
.save-state.error .dot { background: var(--err); }

.client-results { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 8px; max-height: 320px; overflow-y: auto; }
.client-results button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; cursor: pointer; font: 13.5px var(--font); }
.client-results button:hover, .client-results button:focus { background: var(--brand-50); outline: none; }
.client-results button:last-child { border-bottom: 0; }
.client-results .sub { color: var(--muted); font-size: 12px; }
.client-card { border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.client-card h3 { font-size: 16px; }
.client-card .meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }

.item-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 14px; }
.item-card .item-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: #fafbfc; border-radius: var(--radius) var(--radius) 0 0; }
.item-card .item-head img { width: 64px; height: 40px; object-fit: cover; border-radius: 5px; background: var(--bg); }
.item-card .item-head .t { flex: 1; min-width: 0; }
.item-card .item-head .t strong { display: block; }
.item-card .item-body { padding: 14px; }
.item-card .line-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.model-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.model-picker button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 8px; cursor: pointer; font: 13px var(--font); transition: border-color .12s, box-shadow .12s; }
.model-picker button:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19, 76, 131, .1); }
.model-picker img { width: 100%; height: 82px; object-fit: cover; border-radius: 5px; background: var(--bg); display: block; margin-bottom: 6px; }
.model-picker strong { display: block; font-size: 13px; }
.model-picker span { color: var(--muted); font-size: 12px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 4px 4px; }
.spec-table td:last-child { width: 36px; }
.spec-table input { padding: 6px 9px; font-size: 13px; }
.charge-row { display: grid; grid-template-columns: 170px 1fr 150px 100px 36px; gap: 10px; align-items: center; margin-bottom: 8px; }

.summary { position: sticky; top: 80px; }
.summary .card-body { padding: 16px 18px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.sum-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.sum-row.muted span { color: var(--muted); font-weight: 500; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 16px; }
.sum-row.total span { font-weight: 750; }
.sum-section { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 14px 0 4px; }
.sum-section:first-child { margin-top: 0; }
.summary .rental-box { background: var(--brand-50); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.preview-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius); background: #e9edf2; }
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.issues li:last-child { border-bottom: 0; }
.issues li::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--err-bg); color: var(--err); font-weight: 800; font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.issues.ok li::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.ready { text-align: center; padding: 26px 10px; }
.ready h2 { font-size: 19px; margin-bottom: 6px; }

/* ---------- Proposal page ---------- */
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.doc-frame-wrap { background: #e9edf2; border-radius: var(--radius); padding: 0; overflow: hidden; border: 1px solid var(--line); }
.doc-frame-wrap iframe { width: 100%; height: 980px; border: 0; display: block; }
.link-box { display: flex; gap: 6px; }
.link-box input { font-family: var(--mono); font-size: 12px; }
.wa-preview { white-space: pre-wrap; background: #e7f8ee; border: 1px solid #c4ebd3; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: linear-gradient(150deg, #0c2340 0%, var(--brand) 100%); color: #dbe7f3; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { color: #fff; font-size: 30px; line-height: 1.2; max-width: 440px; }
.auth-side p { color: #b9cbe0; max-width: 440px; font-size: 15px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 22px; margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .builder { grid-template-columns: 1fr; }
  .summary { position: static; }
  .g-main-side { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 60; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,27,43,.35); z-index: 50; }
  .menu-toggle { display: inline-grid; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 0 14px; }
  .topbar .search { display: none; }
  .g-2, .g-3, .g-4, .row, .row-3, .row-4 { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charge-row { grid-template-columns: 1fr 1fr; }
  .charge-row .desc { grid-column: 1 / -1; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .stepper button .t { display: none; }
  .stepper button.active .t { display: inline; }
  .hide-sm { display: none; }
  .doc-frame-wrap iframe { height: 75vh; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
}
.menu-toggle svg { width: 22px; height: 22px; }
.empty svg { display: block; margin: 0 auto 8px; }
.spec-table td:first-child { width: 42%; }
