:root {
  --ink: #182230;
  --muted: #687486;
  --line: #dfe5eb;
  --soft: #f4f7f9;
  --navy: #0b2f4f;
  --blue: #1269a8;
  --orange: #f59a23;
  --green: #167554;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf2f5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.topbar { height: 72px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--orange); color: var(--navy); font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #b9cad8; }
.version { padding: 7px 11px; border: 1px solid #51718b; border-radius: 999px; font-size: 12px; }
.page-shell { max-width: 1240px; margin: 0 auto; padding: 34px 24px 60px; }
.hero { display: grid; grid-template-columns: 1.5fr 0.8fr; gap: 24px; align-items: stretch; margin-bottom: 24px; }
.hero > div { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 30px; }
.hero h1 { margin: 5px 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.06; letter-spacing: -0.04em; }
.lead { max-width: 740px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.eyebrow { margin: 0; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }
.hero-spec { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #0b2f4f, #164e78) !important; color: white; }
.hero-spec span { color: #b9d1e1; font-size: 13px; }
.hero-spec strong { margin: 10px 0 8px; font-size: 27px; }
.hero-spec small { color: #d3e2ec; line-height: 1.5; }
.summary-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin: 22px 0; }
.summary-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card strong { display: block; margin: 8px 0 6px; color: var(--navy); font-size: 29px; }
.total-card { border-color: #f0c27f; background: #fff9ef; }
.total-card strong { color: #9b5500; }
.notice { display: flex; align-items: flex-start; gap: 14px; margin: 20px 0; padding: 18px 20px; border-radius: 14px; }
.notice p { margin: 4px 0 0; }
.notice-ok { color: #0f5d42; background: #e8f6f0; border: 1px solid #b8e4d2; }
.notice-info { color: #225675; background: #e9f3f9; border: 1px solid #c4deed; }
.notice-error { color: #8a2c27; background: #fff0ee; border: 1px solid #efc1bd; }
.notice-saved { color: #5f4b05; background: #fff8dc; border: 1px solid #ead690; }
.notice-error ul { margin: 7px 0 0; }
.check { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.save-icon { color: #d69000; font-size: 22px; line-height: 1; }
.panel { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.panel-heading { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 5px 0 0; font-size: 22px; }
.panel-heading p.muted { margin: 8px 0 0; }
.panel-total { color: var(--navy); font-size: 22px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 13px 17px; color: #576577; background: var(--soft); font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 14px 17px; border-top: 1px solid #edf0f2; vertical-align: top; }
tbody tr:hover { background: #fbfcfd; }
.number { text-align: right; white-space: nowrap; }
.center { text-align: center; }
.muted { color: var(--muted); }
.price-editor { padding-bottom: 24px; }
.price-editor form { padding: 0 24px; }
fieldset { margin: 22px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 13px; color: var(--navy); font-weight: 800; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.price-grid label { display: block; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; }
.price-grid label > span { display: block; min-height: 38px; font-size: 13px; font-weight: 700; }
.input-wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px; margin-top: 7px; }
.input-wrap b { color: var(--green); }
.input-wrap input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #cbd4dc; border-radius: 7px; background: white; font: inherit; }
.input-wrap small { grid-column: 2; color: var(--muted); }
button { margin-top: 22px; padding: 12px 20px; border: 0; border-radius: 9px; color: white; background: var(--blue); font: inherit; font-weight: 800; cursor: pointer; }
button:hover { background: #0b568c; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.secondary-button { color: var(--navy); background: #e7edf2; }
.secondary-button:hover { background: #d7e1e9; }
footer { display: flex; gap: 12px; justify-content: center; margin-top: 28px; color: var(--muted); font-size: 13px; }

/* Piloto 07: editor visual directo */
.wide-shell { max-width: 1500px; }
.builder-hero { grid-template-columns: 1.6fr 0.7fr; }
.reference-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0; padding: 15px 18px; border: 1px solid #b8e4d2; border-radius: 14px; background: #e8f6f0; color: #0f5d42; }
.reference-strip > div { display: flex; align-items: center; gap: 12px; }
.reference-strip strong, .reference-strip small { display: block; }
.reference-strip small { margin-top: 3px; color: #477564; }
.text-button { margin: 0; padding: 8px 12px; color: #0f5d42; border: 1px solid #9bcfb9; background: transparent; white-space: nowrap; }
.text-button:hover { color: white; background: #167554; }
.builder-grid { display: grid; grid-template-columns: minmax(360px, 0.78fr) minmax(500px, 1.35fr); gap: 20px; align-items: start; }
.builder-grid .panel { margin-top: 0; }
.no-overflow { overflow: visible; }
.compact-heading { padding: 18px 20px; }
.compact-heading h2 { font-size: 20px; }
.controls-body { padding: 20px; }
.dimension-fieldset { margin: 0; }
.dimension-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.dimension-grid label { font-size: 12px; font-weight: 800; }
.dimension-grid label > span { display: block; margin-bottom: 6px; color: #536273; }
.unit-input { display: grid; grid-template-columns: 1fr auto; align-items: center; overflow: hidden; border: 1px solid #cbd4dc; border-radius: 8px; background: white; }
.unit-input input { width: 100%; min-width: 0; padding: 10px; border: 0; outline: 0; font: inherit; }
.unit-input b { padding: 0 9px; color: var(--muted); font-size: 11px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
button.small-button { margin: 0; padding: 9px 11px; font-size: 12px; }
.subtle-button { color: var(--navy); background: #e7edf2; }
.subtle-button:hover { background: #d6e1e9; }
.technical-details { margin: 0 0 18px; padding: 11px 12px; border: 1px solid #dce4ea; border-radius: 9px; background: #f8fafb; }
.technical-details summary { color: var(--navy); cursor: pointer; font-size: 12px; font-weight: 800; }
.technical-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.technical-grid .span-all { grid-column: 1 / -1; }
.section-block { padding-top: 18px; border-top: 1px solid var(--line); }
.section-block + .section-block { margin-top: 18px; }
.subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.subheading h3 { margin: 0; color: var(--navy); font-size: 15px; }
.subheading small { color: var(--muted); text-align: right; }
.section-tree { display: grid; gap: 5px; }
.tree-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.tree-button { width: 100%; margin: 0; padding: 9px 10px; border: 1px solid #d8e0e7; border-radius: 8px; color: var(--ink); background: #f8fafb; text-align: left; font-size: 12px; font-weight: 700; }
.tree-button:hover { color: var(--navy); background: #edf3f7; }
.tree-button.active { border-color: #f0a443; background: #fff7e9; box-shadow: inset 3px 0 0 var(--orange); }
.tree-button small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; }
.selected-editor-block { min-height: 220px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-grid .span-2 { grid-column: 1 / -1; }
.editor-field { display: block; font-size: 12px; font-weight: 800; }
.editor-field > span { display: block; margin-bottom: 5px; color: #536273; }
.editor-field input, .editor-field select { width: 100%; padding: 9px 10px; border: 1px solid #cbd4dc; border-radius: 7px; background: white; font: inherit; }
.readout-box { min-height: 39px; padding: 10px; border: 1px solid #dce4ea; border-radius: 7px; background: #f3f6f8; color: var(--navy); font-weight: 800; }
.editor-help { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.editor-warning { padding: 11px 12px; color: #755506; border: 1px solid #ead690; border-radius: 8px; background: #fff8dc; font-size: 12px; line-height: 1.45; }
.editor-warning strong { display: block; margin-bottom: 3px; }
.section-width-help { margin: -2px 0 3px; color: #486476; font-size: 11px; line-height: 1.45; }
.editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.editor-actions button { margin: 0; padding: 10px; font-size: 12px; }
.editor-actions .span-2 { grid-column: 1 / -1; }
.danger-button { color: #8a2c27; background: #fff0ee; border: 1px solid #efc1bd; }
.danger-button:hover { color: white; background: #a83b34; }
.child-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.child-links button { margin: 0; padding: 9px; color: var(--navy); background: #eaf1f6; font-size: 12px; }
.drawer-list { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.drawer-row { display: grid; grid-template-columns: auto 1fr 1fr 1fr; gap: 8px; align-items: end; }
.drawer-row strong { align-self: center; color: var(--navy); font-size: 12px; }
.toggle-line { display: flex; align-items: center; gap: 8px; padding-top: 6px; font-size: 12px; font-weight: 700; }
.toggle-line input { width: auto; }
.full-button { width: 100%; margin-top: 18px; }
.status-chip { padding: 6px 9px; border-radius: 999px; color: #34596f; background: #e8f1f6; font-size: 11px; font-weight: 800; }
.status-chip.ok { color: #0f5d42; background: #dff2e9; }
.status-chip.error { color: #8a2c27; background: #fee8e5; }
.visual-panel { position: sticky; top: 16px; }
.svg-stage { min-height: 520px; padding: 20px; display: grid; place-items: center; background: radial-gradient(circle at 50% 20%, #ffffff, #f1f5f8 68%); }
#cabinet-svg { width: 100%; height: 500px; overflow: visible; }
#cabinet-svg text { pointer-events: none; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.svg-cover { fill: #174f78; stroke: #0b2f4f; stroke-width: 1.5; }
.svg-side, .svg-floor { fill: #d9e2e8; stroke: #7f909d; stroke-width: 1.2; }
.svg-zocal { fill: #c7d1d8; stroke: #738491; stroke-width: 1.2; }
.svg-foot { fill: #263747; }
.svg-division { fill: #f5a027; stroke: #b66a08; stroke-width: 1.2; }
.svg-door { fill: rgba(224, 235, 242, 0.92); stroke: #315d78; stroke-width: 1.4; cursor: pointer; }
.svg-drawer { fill: rgba(255, 248, 232, 0.95); stroke: #9d650d; stroke-width: 1.4; cursor: pointer; }
.svg-front:hover { filter: brightness(0.96); stroke-width: 2.4; }
.svg-shelf { stroke: #62859b; stroke-width: 2; stroke-dasharray: 7 5; pointer-events: none; }
.svg-section-hit { fill: transparent; stroke: transparent; cursor: pointer; }
.svg-section-selected { fill: rgba(245, 154, 35, 0.09); stroke: #f59a23; stroke-width: 3; stroke-dasharray: 9 5; pointer-events: none; }
.svg-front-selected { stroke: #d84a22; stroke-width: 4; filter: drop-shadow(0 0 3px rgba(216, 74, 34, 0.4)); }
.svg-label { fill: #29495d; font-size: 14px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.svg-measure { fill: #5e7180; font-size: 12px; font-weight: 700; }
.visual-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.visual-legend span { display: flex; align-items: center; gap: 6px; }
.visual-legend i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.legend-division { background: #f5a027; }
.legend-door { background: #dbe8ef; border: 1px solid #315d78; }
.legend-drawer { background: #fff1d8; border: 1px solid #9d650d; }
.legend-selected { border: 2px dashed #f59a23; }
.selection-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px; min-height: 58px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fbfcfd; font-size: 12px; }
.selection-detail strong { color: var(--navy); }
.selection-detail span { color: var(--muted); }
.detail-pill { padding: 5px 8px; border-radius: 999px; background: #edf3f7; color: #35566b !important; }
.calculation-messages:empty { display: none; }
.message-card { margin: 12px 0; padding: 14px 17px; border-radius: 12px; font-size: 13px; }
.message-card strong { display: block; margin-bottom: 5px; }
.message-card ul { margin: 0; padding-left: 20px; }
.message-card.error { color: #8a2c27; border: 1px solid #efc1bd; background: #fff0ee; }
.message-card.warning { color: #755506; border: 1px solid #ead690; background: #fff8dc; }
.message-card.success { color: #0f5d42; border: 1px solid #b8e4d2; background: #e8f6f0; }
.tall-table { max-height: 600px; overflow: auto; }
.tall-table thead { position: sticky; top: 0; z-index: 1; }
.price-editor .panel-heading { cursor: default; }

.compact-topbar { height: 56px; padding: 0 max(24px, calc((100vw - 1500px) / 2 + 24px)); }
.compact-topbar .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.compact-topbar .brand small { font-size: 11px; }
.wide-shell { padding-top: 16px; }
.workspace-bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto minmax(420px, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #d6e0e7; border-radius: 13px; background: rgba(255, 255, 255, 0.97); box-shadow: 0 5px 18px rgba(20, 50, 73, 0.08); backdrop-filter: blur(8px); }
.workspace-identity { min-width: 170px; }
.workspace-identity span, .workspace-identity strong { display: block; }
.workspace-identity span { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.workspace-identity strong { color: var(--navy); font-size: 17px; white-space: nowrap; }
.compact-dimensions { display: grid; grid-template-columns: repeat(4, minmax(88px, 1fr)); gap: 7px; }
.compact-dimensions label > span { display: block; margin: 0 0 3px 2px; color: #637182; font-size: 10px; font-weight: 800; }
.compact-dimensions .unit-input input { padding: 7px 8px; font-size: 12px; }
.compact-dimensions .unit-input b { padding: 0 6px; font-size: 9px; }
.workspace-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.toolbar-button, .examples-menu summary { margin: 0; padding: 8px 10px; border: 1px solid #d9e2e8; border-radius: 8px; color: var(--navy); background: #f5f8fa; font-size: 11px; font-weight: 800; cursor: pointer; list-style: none; }
.toolbar-button:hover, .examples-menu summary:hover { color: white; background: var(--blue); }
.toolbar-button:disabled { opacity: .42; cursor: not-allowed; }
.toolbar-button:disabled:hover { color: var(--navy); background: #f5f8fa; }
.examples-menu { position: relative; }
.examples-menu summary::-webkit-details-marker { display: none; }
.examples-popover { position: absolute; right: 0; top: calc(100% + 7px); z-index: 30; width: 190px; padding: 7px; border: 1px solid #d8e1e8; border-radius: 10px; background: white; box-shadow: 0 12px 30px rgba(17, 43, 63, .18); }
.examples-popover button { width: 100%; margin: 0; padding: 9px 10px; color: var(--navy); background: white; text-align: left; font-size: 11px; }
.examples-popover button:hover { background: #eaf2f7; }
.reference-chip { padding: 7px 9px; border-radius: 999px; color: #116145; background: #e4f5ed; font-size: 10px; font-weight: 800; white-space: nowrap; }
.visual-first-grid { grid-template-columns: minmax(620px, 1fr) minmax(330px, 380px); gap: 16px; }
.visual-first-grid .visual-panel { position: relative; top: auto; }
.inspector-panel { position: sticky; top: 82px; align-self: start; }
.inspector-body { padding: 16px; }
.visual-tip { color: var(--muted); font-size: 11px; text-align: right; }
.visual-first-grid .svg-stage { min-height: 610px; padding: 14px; }
.visual-first-grid #cabinet-svg { height: 590px; }
.context-summary { margin-bottom: 13px; padding: 11px 12px; border-radius: 9px; background: #edf4f8; }
.context-summary strong, .context-summary span { display: block; }
.context-summary strong { color: var(--navy); font-size: 13px; }
.context-summary span { margin-top: 3px; color: #607282; font-size: 11px; line-height: 1.4; }
.content-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.content-choices button { margin: 0; padding: 8px 4px; border: 1px solid #d6e0e7; color: #40596a; background: #f7f9fa; font-size: 10px; }
.content-choices button:hover { color: var(--navy); background: #eaf1f5; }
.content-choices button.active { color: white; border-color: #d9820d; background: #e78b12; box-shadow: 0 2px 7px rgba(219, 125, 8, .22); }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; margin-top: 11px; }
.quick-actions button { margin: 0; padding: 8px 7px; color: var(--navy); background: #e9f1f6; font-size: 10px; }
.quick-actions button:hover { color: white; background: var(--blue); }
.three-actions { grid-template-columns: repeat(3, 1fr); }
.context-advanced, .content-settings, .advanced-settings, .advanced-group { border: 1px solid #dbe3e9; border-radius: 9px; background: #f8fafb; }
.context-advanced, .content-settings { margin-top: 11px; padding: 9px 10px; }
.context-advanced summary, .content-settings summary, .advanced-settings > summary, .advanced-group > summary { color: var(--navy); cursor: pointer; font-size: 11px; font-weight: 800; }
.context-advanced .editor-field { margin-top: 9px; }
.content-settings .drawer-list { margin-top: 9px; padding: 0; border: 0; background: transparent; }
.inspector-panel .drawer-row { grid-template-columns: 1fr 1fr; }
.inspector-panel .drawer-row strong { grid-column: 1 / -1; padding-top: 3px; }
.inspector-panel .drawer-row .editor-field:last-child { grid-column: 1 / -1; }
.advanced-settings { margin-top: 16px; padding: 11px; }
.advanced-settings[open] > summary { margin-bottom: 10px; }
.advanced-group { margin-top: 8px; padding: 9px; background: white; }
.advanced-group[open] > summary { margin-bottom: 9px; }
.advanced-group .section-tree { margin-top: 9px; }
.advanced-settings .full-button { margin-top: 10px; }
.selected-editor-block { min-height: 0; }
.summary-grid { gap: 10px; margin: 16px 0; }
.summary-card { padding: 14px 16px; }
.summary-card strong { margin: 5px 0 3px; font-size: 22px; }
.summary-card small { font-size: 10px; }
.svg-division-hit { fill: transparent; stroke: transparent; pointer-events: all; cursor: ew-resize; touch-action: none; }
.svg-division-hit[data-division-orientation="horizontal"] { cursor: ns-resize; }
.svg-division-hit:hover, .svg-division-hit.active { fill: rgba(245, 154, 35, .16); stroke: rgba(182, 106, 8, .65); stroke-width: 2; }
.svg-division-grip { stroke: #9a5a07; stroke-width: 3; stroke-dasharray: 7 6; pointer-events: none; opacity: .42; }
.svg-division-grip.active { stroke: #d84a22; stroke-width: 4; opacity: 1; }
.svg-division-measure { pointer-events: none; }
.svg-division-measure rect { fill: #fff7e9; stroke: #e28a15; stroke-width: 1.5; }
.svg-division-measure text { fill: #7a4805; font-size: 11px; font-weight: 900; text-anchor: middle; dominant-baseline: middle; }
.svg-inline-editor-object { overflow: visible; }
.svg-inline-editor { height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px; border: 1.5px solid #e28a15; border-radius: 9px; background: rgba(255, 255, 255, .96); box-shadow: 0 5px 14px rgba(28, 54, 72, .18); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.svg-inline-editor label > span { display: block; margin: 0 0 2px 2px; color: #4f6170; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.svg-inline-editor label > div { display: grid; grid-template-columns: 1fr auto; align-items: center; overflow: hidden; border: 1px solid #cbd7df; border-radius: 6px; background: white; }
.svg-inline-editor input { min-width: 0; width: 100%; height: 29px; padding: 4px 5px; border: 0; outline: 0; color: var(--navy); background: transparent; font-size: 11px; font-weight: 900; }
.svg-inline-editor b { padding-right: 5px; color: #71818e; font-size: 8px; }
.is-dragging-division { cursor: grabbing; user-select: none; }
.is-dragging-division * { cursor: grabbing !important; }

@media (max-width: 1100px) {
  .workspace-bar { position: static; grid-template-columns: auto 1fr; }
  .workspace-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .visual-first-grid { grid-template-columns: 1fr; }
  .visual-first-grid .visual-panel { order: 1; }
  .inspector-panel { position: static; order: 2; }
}

@media (max-width: 850px) {
  .hero, .summary-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-bar { grid-template-columns: 1fr; }
  .workspace-actions { grid-column: auto; }
  .compact-dimensions { grid-template-columns: repeat(4, 1fr); }
  .workspace-actions { justify-content: flex-start; }
  .builder-grid { grid-template-columns: 1fr; }
  .visual-first-grid .visual-panel { order: 1; }
  .inspector-panel { position: static; order: 2; }
  .visual-panel { position: static; }
  .svg-stage { min-height: 420px; }
  #cabinet-svg { height: 400px; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 18px; }
  .page-shell { padding: 20px 12px 45px; }
  .hero > div, .panel-heading { padding: 20px; }
  .price-grid { grid-template-columns: 1fr; }
  .price-editor form { padding: 0 16px; }
  footer { flex-direction: column; align-items: center; }
  .reference-strip { align-items: stretch; flex-direction: column; }
  .dimension-grid { grid-template-columns: 1fr; }
  .compact-dimensions { grid-template-columns: 1fr 1fr; }
  .workspace-actions .toolbar-button span, .reference-chip { display: none; }
  .visual-tip { display: none; }
  .editor-grid, .editor-actions { grid-template-columns: 1fr; }
  .editor-grid .span-2 { grid-column: auto; }
  .drawer-row { grid-template-columns: 1fr; }
  .svg-stage { min-height: 330px; padding: 10px; }
  #cabinet-svg { height: 320px; }
  .visual-first-grid .svg-stage { min-height: 350px; }
  .visual-first-grid #cabinet-svg { height: 340px; }
  .content-choices { grid-template-columns: 1fr 1fr; }
}

/* Piloto 08: usuarios, permisos y navegación por áreas */
.app-topbar { min-height: 62px; height: auto; display: grid; grid-template-columns: auto minmax(260px, 1fr) auto; gap: 24px; padding-top: 7px; padding-bottom: 7px; }
.app-brand { color: white; text-decoration: none; }
.app-brand:hover strong { color: #dceaf3; }
.app-tabs { display: flex; align-items: center; justify-content: center; gap: 5px; }
.app-tab { padding: 8px 14px; border-radius: 8px; color: #c6d8e5; text-decoration: none; font-size: 13px; font-weight: 800; }
.app-tab:hover { color: white; background: rgba(255, 255, 255, .1); }
.app-tab.active { color: var(--navy); background: white; box-shadow: 0 3px 10px rgba(0, 0, 0, .16); }
.account-area { display: flex; align-items: center; justify-content: flex-end; gap: 9px; color: white; }
.account-name { min-width: 92px; text-align: right; }
.account-name strong, .account-name small { display: block; }
.account-name strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.account-name small { margin-top: 2px; color: #b9cad8; font-size: 10px; }
.logout-form { margin: 0; }
.logout-button { margin: 0; padding: 7px 10px; border: 1px solid #55758e; color: white; background: transparent; font-size: 11px; }
.logout-button:hover { background: #164e78; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 15px; }
.flash-stack .notice { margin: 0; }
.notice-success { color: #0f5d42; background: #e8f6f0; border: 1px solid #b8e4d2; }
.notice-warning { color: #755506; background: #fff8dc; border: 1px solid #ead690; }

.management-shell { max-width: 1340px; }
.narrow-management-shell { max-width: 880px; }
.management-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .45fr); gap: 22px; align-items: stretch; margin-bottom: 20px; }
.management-heading > div { padding: 23px 26px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.management-heading h1 { margin: 7px 0 8px; color: var(--navy); font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.management-heading p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.55; }
.reference-cost-card { display: flex; flex-direction: column; justify-content: center; color: white; background: linear-gradient(135deg, #0b2f4f, #164e78) !important; }
.reference-cost-card span, .reference-cost-card small { color: #c4d7e4; font-size: 12px; }
.reference-cost-card strong { margin: 8px 0 5px; font-size: 28px; }
.standalone-price-editor { margin-top: 0; }
.standalone-price-editor form { padding-bottom: 24px; }
.sticky-form-actions { position: sticky; bottom: 12px; z-index: 5; margin-top: 24px; padding: 12px; border: 1px solid #d4e0e7; border-radius: 11px; background: rgba(255, 255, 255, .96); box-shadow: 0 7px 22px rgba(18, 48, 70, .14); backdrop-filter: blur(8px); }

.users-heading { grid-template-columns: minmax(0, 1fr) minmax(310px, .55fr); }
.role-summary { display: grid; align-content: center; gap: 10px; }
.role-summary span { padding: 10px 12px; border-radius: 9px; color: #486274; background: #edf4f8; font-size: 12px; line-height: 1.4; }
.role-summary b { display: block; color: var(--navy); }
.user-management-grid { display: grid; grid-template-columns: minmax(330px, .7fr) minmax(600px, 1.3fr); gap: 18px; align-items: start; }
.user-management-grid .panel { margin-top: 0; }
.management-form { padding: 20px 22px 24px; }
.user-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.user-form-grid label > span:first-child, .auth-form label > span:first-child { display: block; margin-bottom: 5px; color: #536273; font-size: 12px; font-weight: 800; }
.user-form-grid input:not([type="checkbox"]), .user-form-grid select, .auth-form input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #c7d2da; border-radius: 8px; background: white; font: inherit; }
.user-form-grid input:focus, .user-form-grid select:focus, .auth-form input:focus { outline: 3px solid rgba(18, 105, 168, .14); border-color: var(--blue); }
.checkbox-field { align-self: end; }
.checkbox-line { min-height: 42px; display: flex !important; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid #c7d2da; border-radius: 8px; color: var(--ink) !important; background: white; font-size: 13px !important; font-weight: 700 !important; }
.checkbox-line input { width: 18px; height: 18px; }
.form-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.errorlist { margin: 5px 0 0; padding: 0; color: #9b312b; font-size: 11px; list-style: none; }
.form-error { padding: 11px 13px; border: 1px solid #efc1bd; border-radius: 8px; color: #8a2c27; background: #fff0ee; font-size: 12px; }
.users-table td:first-child strong, .users-table td:first-child small { display: block; }
.users-table td:first-child small { margin-top: 3px; color: var(--muted); }
.role-badge, .status-badge { display: inline-block; padding: 5px 8px; border-radius: 999px; color: #435c6d; background: #e9f0f4; font-size: 10px; font-weight: 900; white-space: nowrap; }
.role-badge.admin { color: #754500; background: #fff0d2; }
.status-badge { color: #7b3430; background: #fee9e7; }
.status-badge.active { color: #126044; background: #dff3e9; }
.table-action { display: inline-block; padding: 7px 9px; border-radius: 7px; color: var(--blue); background: #eaf2f7; text-decoration: none; font-size: 11px; font-weight: 900; }
.table-action:hover { color: white; background: var(--blue); }
.quote-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.inline-delete-form { display: inline-flex; margin: 0; }
.table-action.danger-action { margin: 0; border: 0; color: #8a2c27; background: #fff0ee; cursor: pointer; }
.table-action.danger-action:hover { color: white; background: #a83b34; }
.edit-user-panel { margin-top: 14px; }
.back-link { display: inline-block; margin: 3px 0 5px; color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 800; }
.button-link { display: inline-flex; align-items: center; margin-top: 22px; padding: 12px 20px; border-radius: 9px; color: var(--navy); text-decoration: none; font-weight: 800; }
.access-denied-card { padding: 48px; text-align: center; }
.access-denied-card h1 { margin: 9px 0 10px; color: var(--navy); font-size: 34px; }
.access-denied-card p:not(.eyebrow) { max-width: 600px; margin: 0 auto; color: var(--muted); line-height: 1.6; }
.access-denied-card .button-link { color: white; background: var(--blue); }
.access-denied-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: #8a2c27; background: #fee8e5; font-size: 25px; font-weight: 900; }

.auth-page { min-height: 100vh; background: linear-gradient(135deg, #e9f0f4, #f8fafb 52%, #e5edf2); }
.auth-layout { width: min(940px, calc(100% - 32px)); min-height: 560px; display: grid; grid-template-columns: 1fr 1fr; margin: max(40px, 7vh) auto; overflow: hidden; border: 1px solid #d4dee5; border-radius: 22px; background: white; box-shadow: 0 24px 70px rgba(13, 45, 68, .18); }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 42px; color: white; background: linear-gradient(145deg, #0b2f4f, #174f78); }
.auth-brand { color: white; }
.auth-brand small { color: #c3d6e2; }
.auth-intro h1 { max-width: 390px; margin: 9px 0 14px; font-size: 39px; line-height: 1.06; letter-spacing: -.045em; }
.auth-intro p:not(.eyebrow) { max-width: 400px; color: #c8d9e4; line-height: 1.6; }
.auth-intro > small { color: #a9c0cf; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 50px; }
.auth-card h2 { margin: 6px 0 8px; color: var(--navy); font-size: 29px; }
.auth-form { display: grid; gap: 15px; margin-top: 25px; }
.auth-submit { width: 100%; margin: 5px 0 0; }
.auth-links { margin-top: 2px; text-align: center; }
.auth-links-left { margin-top: 24px; text-align: left; }
.auth-links a { color: var(--blue); font-weight: 750; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .button-link { display: inline-flex; justify-content: center; padding: 11px 18px; border-radius: 8px; color: white; background: var(--blue); text-decoration: none; }
.auth-links .button-link:hover { text-decoration: none; filter: brightness(.96); }
.auth-form .errorlist { margin: 6px 0 0; padding: 0; color: #a83232; font-size: 12px; list-style: none; }
.setup-layout { width: min(1080px, calc(100% - 32px)); }
.setup-card { padding: 38px 46px; }
.setup-form { grid-template-columns: 1fr 1fr; gap: 11px; }
.setup-form .form-error, .setup-form .auth-submit { grid-column: 1 / -1; }

@media (max-width: 1120px) {
  .app-topbar { grid-template-columns: auto 1fr; gap: 6px 16px; }
  .app-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .account-area { grid-column: 2; grid-row: 1; }
  .user-management-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-topbar { padding: 8px 14px; }
  .app-brand small, .account-name { display: none; }
  .app-tabs { overflow-x: auto; }
  .app-tab { padding: 7px 11px; }
  .management-heading, .users-heading { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; margin: 16px auto; }
  .auth-intro { min-height: 270px; padding: 30px; }
  .auth-intro h1 { font-size: 32px; }
  .auth-card { padding: 32px 28px; }
  .setup-form { grid-template-columns: 1fr; }
  .setup-form .form-error, .setup-form .auth-submit { grid-column: auto; }
}

@media (max-width: 560px) {
  .app-topbar .version { display: none; }
  .user-form-grid { grid-template-columns: 1fr; }
  .management-heading > div { padding: 19px; }
  .management-form { padding: 17px; }
  .auth-layout { width: calc(100% - 18px); }
  .auth-intro { min-height: 235px; padding: 24px; }
  .auth-card { padding: 28px 22px; }
}

/* Piloto 09: clientes, cotizaciones, versiones y permisos explícitos */
.quote-from-builder { margin: 0; padding: 8px 12px; border-color: #ecad3e; color: #5b3800; background: #ffc45d; font-size: 11px; }
.quote-from-builder:hover { border-color: #ffcc74; background: #ffd384; }
.prepared-team-action { display: grid; gap: 4px; margin: 18px 22px 0; padding: 14px; border: 1px solid #c9dae6; border-radius: 11px; background: #edf5fa; }
.prepared-team-action strong { color: var(--navy); font-size: 13px; }
.prepared-team-action span { color: var(--muted); font-size: 11px; }
.prepared-team-action button { width: 100%; margin: 8px 0 0; }
.password-pending { display: block; margin-top: 5px; color: #9a5d00; font-size: 10px; font-weight: 800; }
.module-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; padding: 22px 25px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.module-heading h1, .quote-detail-heading h1 { margin: 5px 0 7px; color: var(--navy); font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.module-heading p:not(.eyebrow), .quote-detail-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.compact-module-heading { min-height: 118px; }
.primary-button { color: white; background: var(--blue); }
.primary-button:hover { color: white; background: #0b5d98; }
.module-panel { margin-top: 0; }
.filter-bar { display: flex; align-items: center; gap: 9px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.filter-bar input, .filter-bar select { min-width: 250px; padding: 9px 11px; border: 1px solid #c6d2da; border-radius: 8px; background: white; font: inherit; }
.filter-bar button { margin: 0; padding: 9px 15px; }
.filter-bar a { color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.business-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.business-form-grid label > span:first-child, .quote-line-grid label > span:first-child { display: block; margin-bottom: 5px; color: #536273; font-size: 11px; font-weight: 850; }
.business-form-grid input:not([type="checkbox"]), .business-form-grid select, .business-form-grid textarea, .quote-line-grid input, .quote-line-grid select, .quote-line-grid textarea, .state-form select { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #c7d2da; border-radius: 8px; background: white; font: inherit; }
.business-form-grid textarea, .quote-line-grid textarea { resize: vertical; }
.business-form-grid input:focus, .business-form-grid select:focus, .business-form-grid textarea:focus, .quote-line-grid input:focus, .quote-line-grid select:focus, .quote-line-grid textarea:focus { outline: 3px solid rgba(18, 105, 168, .14); border-color: var(--blue); }
.span-all { grid-column: 1 / -1; }
.empty-cell { padding: 35px !important; color: var(--muted); text-align: center; }
.quote-list-table td:nth-child(2) strong, .quote-list-table td:nth-child(2) small, .quote-items-table td:first-child strong, .quote-items-table td:first-child small { display: block; }
.quote-list-table small, .quote-items-table small { margin-top: 3px; color: var(--muted); }
.quote-status { display: inline-block; padding: 6px 9px; border-radius: 999px; color: #435d6e; background: #e7eff4; font-size: 10px; font-weight: 900; white-space: nowrap; }
.status-enviada { color: #0c527d; background: #dceefa; }
.status-aceptada { color: #106044; background: #dff3e9; }
.status-rechazada, .status-anulada { color: #843630; background: #fde8e5; }
.status-vencida { color: #765200; background: #fff0c8; }
.quote-editor-shell { padding-bottom: 110px; }
.quote-editor-shell form { margin: 0; }
.quote-header-form, .quote-lines-panel { margin-top: 13px; }
.quote-business-grid { grid-template-columns: repeat(4, 1fr); }
.quote-business-grid label:first-child, .quote-business-grid label:nth-child(5), .quote-business-grid .span-all { grid-column: span 2; }
.quote-lines { display: grid; gap: 11px; padding: 16px; }
.builder-price-notice { margin: 12px 16px 0; padding: 12px 14px; }
.builder-price-notice p { font-size: 11px; }
.quote-line { border: 1px solid #d5e0e7; border-radius: 12px; background: #f8fafb; transition: opacity .15s ease; }
.quote-line.pending-delete { display: none; }
.quote-line-heading { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid #dce5ea; color: var(--navy); background: #edf3f6; border-radius: 12px 12px 0 0; }
.quote-line-heading button { margin: 0; padding: 5px 8px; border-color: #e5b8b4; color: #8c332d; background: #fff; font-size: 10px; }
.quote-line-grid { display: grid; grid-template-columns: .75fr repeat(4, 1fr); gap: 10px; align-items: end; padding: 12px; }
.quote-line-grid .product-field { grid-column: 2 / -1; }
.quote-line-grid .description-field { grid-column: 1 / -1; }
.line-total { min-height: 62px; display: flex; flex-direction: column; justify-content: center; padding: 8px 10px; border-radius: 8px; color: white; background: var(--navy); text-align: right; }
.line-total span { color: #bdd1de; font-size: 10px; }
.line-total strong { margin-top: 4px; font-size: 15px; }
.delete-control { display: none; }
.compact-button { margin: 0; padding: 8px 11px; }
.quote-submit-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-end; gap: 28px; padding: 12px max(24px, calc((100vw - 1340px) / 2)); border-top: 1px solid #c7d7e1; background: rgba(239, 245, 248, .97); box-shadow: 0 -8px 25px rgba(12, 42, 62, .12); backdrop-filter: blur(8px); }
.quote-submit-bar > div { display: grid; text-align: right; }
.quote-submit-bar span, .quote-submit-bar small { color: var(--muted); font-size: 10px; }
.quote-submit-bar strong { color: var(--navy); font-size: 23px; }
.quote-submit-bar button { margin: 0; }
.quote-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 10px 0 15px; padding: 23px 25px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.quote-detail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.quote-detail-actions .button-link { margin: 0; }
.quote-detail-actions .inline-delete-form { margin: 0; }
.quote-delete-button { margin: 0; padding: 12px 16px; border-radius: 9px; font: inherit; font-weight: 800; cursor: pointer; }
.quote-version-notice { margin: 8px 0 14px; }
.quote-version-tabs { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 13px; padding: 4px; }
.quote-version-tabs a { min-width: 78px; padding: 8px 12px; border: 1px solid #cedae2; border-radius: 9px; color: var(--navy); background: white; text-decoration: none; font-size: 12px; font-weight: 900; }
.quote-version-tabs a.active { border-color: var(--blue); color: white; background: var(--blue); }
.quote-version-tabs small { display: block; margin-top: 3px; color: inherit; opacity: .72; font-size: 9px; }
.quote-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 14px; }
.quote-metrics article { display: grid; gap: 5px; min-height: 98px; align-content: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.quote-metrics span, .quote-metrics small { color: var(--muted); font-size: 11px; }
.quote-metrics strong { color: var(--navy); font-size: 22px; }
.quote-metrics .cost-metric { border-color: #ebc379; background: #fff9ee; }
.compact-state-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 18px 20px; }
.compact-state-panel h2 { margin: 4px 0 0; }
.state-form { display: flex; gap: 8px; }
.state-form button { margin: 0; }

.print-quote-body { min-height: 100vh; margin: 0; padding: 28px; background: #dfe7ec; }
.quote-paper { width: min(210mm, 100%); min-height: 270mm; margin: 0 auto; padding: 18mm 16mm; color: #172c3b; background: white; box-shadow: 0 8px 32px rgba(12, 36, 54, .2); }
.quote-paper-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 14px; border-bottom: 3px solid var(--navy); }
.quote-paper-header > div:last-child { display: grid; gap: 4px; text-align: right; }
.quote-paper-header > div:last-child strong { color: var(--navy); font-size: 25px; }
.quote-paper-header > div:last-child span { color: var(--muted); font-size: 11px; }
.quote-paper-client { display: grid; grid-template-columns: 1.2fr 1.1fr .9fr; gap: 20px; margin: 20px 0; padding: 14px; background: #eff4f7; }
.quote-paper-client > div { display: grid; align-content: start; gap: 3px; font-size: 11px; }
.quote-paper-client small { color: var(--blue); font-weight: 900; }
.quote-paper h1 { margin: 18px 0; color: var(--navy); font-size: 20px; }
.quote-paper-table { width: 100%; border-collapse: collapse; }
.quote-paper-table th { padding: 9px; color: white; background: var(--navy); text-align: left; font-size: 10px; }
.quote-paper-table td { padding: 11px 9px; border-bottom: 1px solid #dce4e9; vertical-align: top; font-size: 11px; }
.quote-paper-table p { margin: 4px 0 0; color: var(--muted); line-height: 1.4; }
.quote-paper-bottom { display: grid; grid-template-columns: 1fr 270px; gap: 28px; margin-top: 25px; }
.quote-paper-bottom p { margin: 0 0 8px; font-size: 11px; }
.quote-paper-bottom dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; margin: 0; font-size: 12px; }
.quote-paper-bottom dt, .quote-paper-bottom dd { margin: 0; }
.quote-paper-bottom dd { text-align: right; font-weight: 800; }
.quote-paper-bottom .grand-total { padding-top: 9px; border-top: 2px solid var(--navy); color: var(--navy); font-size: 15px; font-weight: 900; }
.quote-paper footer { margin-top: 35px; padding-top: 10px; border-top: 1px solid #dce4e9; color: var(--muted); font-size: 9px; text-align: center; }
.print-action { position: fixed; right: 22px; bottom: 22px; margin: 0; box-shadow: 0 8px 22px rgba(0, 0, 0, .2); }

@media (max-width: 1120px) {
  .quote-business-grid { grid-template-columns: 1fr 1fr; }
  .quote-line-grid { grid-template-columns: repeat(4, 1fr); }
  .quote-line-grid .product-field { grid-column: span 3; }
  .quote-line-grid .description-field { grid-column: span 4; }
  .quote-metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .module-heading, .quote-detail-heading, .compact-state-panel { align-items: flex-start; flex-direction: column; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar input, .filter-bar select { min-width: 0; width: 100%; }
  .business-form-grid, .quote-business-grid { grid-template-columns: 1fr; }
  .business-form-grid .span-all, .quote-business-grid label:first-child, .quote-business-grid label:nth-child(5), .quote-business-grid .span-all { grid-column: auto; }
  .quote-line-grid { grid-template-columns: 1fr 1fr; }
  .quote-line-grid .product-field { grid-column: auto; }
  .quote-line-grid .description-field { grid-column: span 2; }
  .quote-submit-bar { justify-content: space-between; padding: 10px 14px; }
  .quote-metrics { grid-template-columns: 1fr; }
  .quote-paper-bottom, .quote-paper-client { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 0; }
  .print-quote-body { padding: 0; background: white; }
  .quote-paper { width: 100%; min-height: 0; padding: 14mm; box-shadow: none; }
  .print-action { display: none; }
}

/* Importación de clientes Laudus */
.module-actions { display: flex; align-items: center; gap: 8px; }
.module-actions .button-link { margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination a { padding: 7px 10px; border-radius: 7px; color: var(--blue); background: #eaf2f7; text-decoration: none; font-weight: 900; }
.client-import-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 15px; margin-bottom: 15px; }
.client-import-grid .panel { margin-top: 0; }
.import-upload-form > label > span { display: block; margin-bottom: 7px; color: #536273; font-size: 12px; font-weight: 850; }
.import-upload-form input[type="file"] { width: 100%; padding: 14px; border: 1px dashed #9bb8cb; border-radius: 10px; background: #f4f8fa; }
.import-rules-panel ul { display: grid; gap: 9px; margin: 0; padding: 18px 24px 22px 42px; color: #486274; font-size: 12px; line-height: 1.5; }
.import-preview-panel { margin-top: 0; }
.import-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.import-kpis article { min-height: 84px; display: grid; align-content: center; gap: 5px; padding: 12px; border: 1px solid #d9e4ea; border-radius: 10px; background: #f8fafb; }
.import-kpis span { color: var(--muted); font-size: 10px; }
.import-kpis strong { color: var(--navy); font-size: 23px; }
.import-preview-panel > .notice { margin: 12px 17px 0; }
.import-detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(270px, .75fr); gap: 16px; padding: 17px; }
.import-detail-grid h3 { margin: 0 0 10px; color: var(--navy); font-size: 14px; }
.selected-data { padding: 15px; border-radius: 11px; background: #edf4f8; }
.selected-data ul { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; margin: 0 0 18px; padding-left: 18px; color: #486274; font-size: 11px; }
.selected-data p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.confirm-import-form { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 17px 17px; padding: 15px; border: 1px solid #e4bc70; border-radius: 11px; background: #fff8e9; }
.confirm-import-form > div { display: grid; gap: 4px; }
.confirm-import-form strong { color: #654100; font-size: 13px; }
.confirm-import-form span { color: #84662c; font-size: 11px; }
.confirm-import-form button { margin: 0; }
.import-history { margin-top: 15px; }

@media (max-width: 1120px) {
  .import-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .module-actions { width: 100%; flex-wrap: wrap; }
  .client-import-grid, .import-detail-grid { grid-template-columns: 1fr; }
  .import-kpis { grid-template-columns: 1fr 1fr; }
  .confirm-import-form { align-items: stretch; flex-direction: column; }
}

/* Cotización guiada, catálogo, imágenes y alertas comerciales */
.notification-link { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: white; text-decoration: none; }
.notification-link:hover, .notification-link.has-unread { background: rgba(255,255,255,.13); }
.notification-link b { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--navy); border-radius: 999px; color: #4b2b00; background: #ffbd49; font-size: 9px; }
.quote-client-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.quote-client-grid label > span:first-child, .client-picker > label span, .dialog-form-grid label > span:first-child { display: block; margin-bottom: 5px; color: #536273; font-size: 11px; font-weight: 850; }
.quote-client-grid input:not([type="checkbox"]), .quote-client-grid select, .quote-client-grid textarea, .dialog-form-grid input:not([type="checkbox"]) { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #c7d2da; border-radius: 8px; background: white; font: inherit; }
.quote-client-grid input:focus, .quote-client-grid select:focus, .quote-client-grid textarea:focus, .dialog-form-grid input:focus { outline: 3px solid rgba(18,105,168,.14); border-color: var(--blue); }
.quote-client-grid .span-two { grid-column: span 2; }
.search-picker-control { position: relative; }
.search-picker-control input { padding-right: 38px !important; }
.icon-clear { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; color: #647584; background: transparent; font-size: 22px; }
.client-picker, .catalog-search-block { position: relative; }
.search-results { position: absolute; z-index: 45; top: calc(100% + 4px); right: 0; left: 0; max-height: 300px; overflow: auto; border: 1px solid #b9ccd8; border-radius: 10px; background: white; box-shadow: 0 15px 36px rgba(13,45,68,.2); }
.search-result-item { width: 100%; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid #e2e9ed; border-radius: 0; color: var(--ink); background: white; text-align: left; }
.search-result-item:hover { background: #edf5fa; }
.search-result-item img { width: 44px; height: 44px; flex: 0 0 auto; object-fit: contain; border: 1px solid #dce6ec; border-radius: 7px; background: white; }
.search-result-item > span { min-width: 0; display: grid; gap: 3px; }
.search-result-item strong { overflow: hidden; color: var(--navy); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-item small { color: var(--muted); font-size: 10px; }
.search-empty { margin: 0; padding: 15px; color: var(--muted); font-size: 11px; }
.selected-client-card { margin-top: 7px; padding: 10px 12px; border: 1px solid #bcd6c9; border-radius: 9px; background: #eff9f4; }
.selected-client-card > div { display: grid; gap: 2px; }
.selected-client-card strong { color: #114f3a; font-size: 12px; }
.selected-client-card span, .selected-client-card small, .field-help { color: var(--muted); font-size: 10px; }
.field-help { margin: 6px 0 0; line-height: 1.45; }
.dispatch-picker { position: relative; }
.inline-link { width: auto; margin: 6px 0 0; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 850; }
.inline-link:hover { color: #084c7d; background: transparent; }
.inline-link:disabled { color: #9cacb8; cursor: not-allowed; }

.quote-line-fields { padding: 13px; }
.quote-line-main { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(280px,1.3fr); gap: 10px; }
.quote-line-main label > span, .quote-line-commercial label > span { display: block; margin-bottom: 5px; color: #536273; font-size: 11px; font-weight: 850; }
.quote-line-main input, .quote-line-main select, .quote-line-main textarea, .quote-line-commercial input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #c7d2da; border-radius: 8px; background: white; font: inherit; }
.quote-line-main input:focus, .quote-line-main select:focus, .quote-line-main textarea:focus, .quote-line-commercial input:focus { outline: 3px solid rgba(18,105,168,.14); border-color: var(--blue); }
.quote-line-main .description-field { grid-column: 1 / -1; }
.quote-line-main textarea { resize: vertical; }
.catalog-search-block { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid #bcd3e2; border-radius: 9px; background: #eef6fb; }
.catalog-search-block[hidden] { display: none; }
.catalog-search-block label { min-width: 0; }
.catalog-search-block .catalog-selection { padding: 10px 0; color: #31566f; font-size: 10px; }
.catalog-search-block .search-results { top: calc(100% + 4px); }
.quote-line-commercial { display: grid; grid-template-columns: .65fr repeat(4, minmax(125px,1fr)) minmax(130px,.85fr); gap: 9px; align-items: end; margin-top: 10px; }
.quote-line-commercial label[hidden] { display: none; }
.quote-line-commercial input[readonly], .quote-line-main input[readonly] { color: #37566b; background: #edf2f5; }
.price-source { min-height: 14px; display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.quote-line-media { display: grid; grid-template-columns: 155px 1fr; gap: 13px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid #dce5ea; }
.line-image-preview { height: 105px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #aebfca; border-radius: 9px; color: #7e909d; background: white; font-size: 10px; }
.line-image-preview img { width: 100%; height: 100%; object-fit: contain; }
.line-image-controls { display: grid; justify-items: start; gap: 5px; }
.line-image-controls strong { color: var(--navy); font-size: 12px; }
.line-image-controls small { color: var(--muted); font-size: 10px; }
.image-upload-button { display: inline-flex; margin-top: 3px; padding: 7px 10px; border: 1px solid #b7ccda; border-radius: 7px; color: var(--blue); background: #edf5fa; cursor: pointer; font-size: 10px; font-weight: 850; }
.image-upload-button input { display: none; }

.decision-dialog, .form-dialog { width: min(640px, calc(100% - 28px)); padding: 28px; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 25px 80px rgba(8,32,49,.35); }
.decision-dialog::backdrop, .form-dialog::backdrop { background: rgba(4,27,44,.68); backdrop-filter: blur(3px); }
.decision-dialog { text-align: center; }
.decision-dialog .dialog-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: #6a3c00; background: #ffd47f; font-size: 34px; font-weight: 900; }
.decision-dialog h2, .form-dialog h2 { margin: 5px 0 9px; color: var(--navy); font-size: 25px; }
.decision-dialog > p:not(.eyebrow) { max-width: 520px; margin: 0 auto; color: #526a7a; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.decision-dialog .dialog-actions { justify-content: center; }
.dialog-actions button { margin: 0; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dialog-close { width: 34px; height: 34px; margin: 0; padding: 0; border: 0; color: #607585; background: #e9f0f4; font-size: 21px; }
.dialog-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 16px; }
.catalog-total { color: var(--blue); font-size: 18px; }
.catalog-sync-panel { margin-bottom: 15px; }
.notification-list { display: grid; gap: 10px; padding: 15px; }
.notification-card { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid #d8e2e8; border-radius: 11px; background: #f9fbfc; }
.notification-card.unread { border-color: #e6b860; background: #fff9ec; }
.notification-state { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: #9cacb7; }
.notification-card.unread .notification-state { background: #e39411; box-shadow: 0 0 0 4px #ffe7b8; }
.notification-content { display: grid; gap: 4px; }
.notification-content strong { color: var(--navy); font-size: 13px; }
.notification-content p { margin: 0; color: #526a7a; font-size: 11px; line-height: 1.5; }
.notification-content small { color: var(--muted); font-size: 9px; }
.notification-actions { display: flex; gap: 6px; }
.notification-actions .button-link, .notification-actions button { margin: 0; padding: 7px 9px; font-size: 10px; }

@media (max-width: 1120px) {
  .quote-client-grid { grid-template-columns: 1fr 1fr; }
  .quote-line-commercial { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .quote-client-grid, .quote-line-main, .dialog-form-grid { grid-template-columns: 1fr; }
  .quote-client-grid .span-two, .quote-line-main .description-field, .dialog-form-grid .span-all { grid-column: auto; }
  .catalog-search-block { grid-template-columns: 1fr; }
  .quote-line-commercial { grid-template-columns: 1fr 1fr; }
  .quote-line-media { grid-template-columns: 105px 1fr; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
  .notification-card { grid-template-columns: 12px 1fr; }
  .notification-actions { grid-column: 2; }
}

.billing-copy-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 12px; border: 1px solid #c9dae5; border-radius: 10px; background: #f0f6f9; }
.billing-copy-row button { margin: 0; }
.billing-copy-row small { color: var(--muted); font-size: 10px; }
.client-address-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #d9e3e9; }
.subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.subsection-heading h3 { margin: 4px 0; color: var(--navy); font-size: 18px; }
.subsection-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.subsection-heading button { margin: 0; }
.client-address-list { display: grid; gap: 11px; }
.client-address-card { border: 1px solid #d4e0e7; border-radius: 11px; background: #f8fafb; }
.client-address-card.pending-delete { display: none; }
.client-address-heading { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid #dce5ea; color: var(--navy); background: #edf3f6; border-radius: 11px 11px 0 0; }
.client-address-heading button { margin: 0; padding: 5px 8px; border-color: #e5b8b4; color: #8c332d; background: white; font-size: 10px; }
.address-form-grid { padding: 12px; }
.cabinet-view-toolbar { display: flex; gap: 5px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid #dbe5eb; background: #f6f9fb; scrollbar-width: thin; }
.cabinet-view-toolbar button { flex: 0 0 auto; margin: 0; padding: 6px 9px; border: 1px solid #c6d5df; border-radius: 7px; color: #36566c; background: white; font-size: 9px; }
.cabinet-view-toolbar button:hover, .cabinet-view-toolbar button.active { border-color: var(--blue); color: white; background: var(--blue); }
.quote-image-choice { display: grid; grid-template-columns: minmax(240px, 1fr) 1.2fr; gap: 12px; align-items: end; padding: 10px 13px; border-top: 1px solid #dbe5eb; background: #f7fafb; }
.quote-image-choice label span { display: block; margin-bottom: 4px; color: #536273; font-size: 9px; font-weight: 850; }
.quote-image-choice select { width: 100%; padding: 7px 9px; border: 1px solid #c6d4dd; border-radius: 7px; background: white; font: inherit; font-size: 10px; }
.quote-image-choice small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.svg-cover-core { fill: #d8e4eb; stroke: #6b8799; stroke-width: 1.5; }
.svg-cover-durolac { fill: #f1ead9; stroke: #8b876f; stroke-width: 1; }
.svg-door-profile { fill: #d9ebf6; stroke: #2d6588; stroke-width: 1.5; }
.svg-front-profile { fill: #fff2d8; stroke: #bd7812; stroke-width: 1.5; }
.svg-lock-profile { fill: #687784; stroke: #394b57; stroke-width: 1; }
.svg-side-plan { fill: #d8e4eb; stroke: #6b8799; stroke-width: 1.5; }
.svg-zocal-plan { fill: #eef8d8; stroke: #88a600; stroke-width: 1.5; }
.svg-plan-label { fill: #4e6810; font-size: 11px; font-weight: 700; }
.svg-side-alt { fill: #d8e4eb; stroke: #6b8799; stroke-width: 2; }
.svg-technical-line, .svg-front-edge, .svg-perspective-floor { fill: none; stroke: #63849a; stroke-width: 2; }
.svg-zocal-alt { fill: #c9d6de; stroke: #7891a1; stroke-width: 1.5; }
.svg-back-panel { fill: #eeeae0; stroke: #8a887f; stroke-width: 1.5; }
.svg-underside { fill: #dbe6ec; stroke: #55758a; stroke-width: 2; }
.svg-technical-strip { fill: #c9d6de; stroke: #7891a1; stroke-width: 1.5; }
.svg-foot-plan { fill: #233b4a; }
.svg-perspective-top { fill: #ecf3f7; stroke: #426a83; stroke-width: 2; }
.svg-perspective-side { fill: #c8d9e4; stroke: #426a83; stroke-width: 2; }
.svg-perspective-front { fill: #f8fbfc; stroke: #426a83; stroke-width: 2; }
.svg-view-caption { fill: #31566f; font-size: 16px; font-weight: 750; }
@media (max-width: 760px) {
  .billing-copy-row, .subsection-heading { align-items: stretch; flex-direction: column; }
  .quote-image-choice { grid-template-columns: 1fr; }
}

/* Cotización comercial inspirada en el formato Dasec vigente */
.dasec-reference-quote { width: min(216mm, 100%); min-height: 279mm; padding: 10mm 11mm 9mm; color: #23282c; font-family: Arial, Helvetica, sans-serif; }
.reference-quote-header { display: flex; align-items: center; justify-content: space-between; gap: 9mm; padding: 0 1mm 3mm; border: 0; }
.reference-brand { display: flex; align-items: center; gap: 6mm; }
.reference-logo { position: relative; display: grid; grid-template-columns: 7mm auto; align-items: center; min-width: 58mm; }
.reference-logo i { grid-row: 1 / span 2; align-self: stretch; display: flex; align-items: center; justify-content: center; color: #121212; font-size: 7pt; font-style: normal; font-weight: 800; letter-spacing: .06em; writing-mode: vertical-rl; transform: rotate(180deg); }
.reference-logo strong { color: #030303; font-size: 30pt; font-weight: 500; letter-spacing: .14em; line-height: 1; }
.reference-logo strong b { color: #e31e24; font-weight: 650; }
.reference-logo > span { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm; padding: 1.3mm .5mm 0; }
.reference-logo em { height: 5mm; background: #24398d; }
.reference-logo em:nth-child(2) { background: #007239; }.reference-logo em:nth-child(3) { background: #df2029; }.reference-logo em:nth-child(4) { background: #f5ad2f; }
.company-copy { display: grid; min-width: 54mm; font-size: 6.6pt; line-height: 1.2; }
.company-copy strong { font-size: 6.7pt; }
.quote-number-box { min-width: 58mm; display: grid; gap: 1.5mm; padding: 3mm 5mm; border: 1px solid #333; text-align: center; }
.quote-number-box span, .quote-number-box strong { font-size: 9pt; font-weight: 500; }.quote-number-box b { color: #ed1c24; font-size: 13pt; font-weight: 500; }.quote-number-box small { color: #666; font-size: 6pt; }
.reference-client-box { display: grid; grid-template-columns: .95fr .95fr 1.1fr; gap: 4mm; padding: 2.4mm 1mm; border: 1px solid #333; }
.reference-client-box dl { display: grid; grid-template-columns: 23mm 1fr; align-content: start; gap: .8mm 1.5mm; margin: 0; font-size: 6.6pt; line-height: 1.25; }
.reference-client-box dt, .reference-client-box dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }.reference-client-box dt { font-weight: 700; }.reference-client-box dt::after { content: " :"; }.reference-client-box dd { color: #42484c; }
.reference-slogan { display: flex; align-items: center; justify-content: space-between; min-height: 10mm; padding: 1mm 6mm; color: #777; }
.reference-slogan > span { font-size: 14pt; font-weight: 300; letter-spacing: .03em; }.reference-slogan > div { display: flex; align-items: center; gap: 2.5mm; }.service-badges b { padding: 1mm 1.4mm; border: 1px solid #8d969c; color: #5d686f; font-size: 5.5pt; letter-spacing: .04em; }.service-badges strong { color: #68727a; font-size: 11pt; }
.reference-subject { margin: 0 0 2mm !important; padding: 1.5mm 2mm; border-left: 3px solid #233e70; color: #233e70 !important; font-size: 9pt !important; }
.reference-products-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.reference-products-table thead { display: table-header-group; }
.reference-products-table th { padding: 2mm 1.8mm; color: white; background: #233e70; font-size: 8pt; font-weight: 500; text-align: left; }
.reference-products-table th.number { text-align: center; }.reference-products-table .image-column { width: 48mm; text-align: center; }.reference-products-table .quantity-column { width: 13mm; }.reference-products-table .price-column { width: 20mm; }.reference-products-table .discount-column { width: 17mm; }.reference-products-table .total-column { width: 22mm; }
.reference-products-table tbody tr { break-inside: avoid; page-break-inside: avoid; }
.reference-products-table td { height: auto; padding: 1.8mm 1.5mm; border-bottom: 1px solid #888; vertical-align: top; font-size: 6.5pt; line-height: 1.22; }
.reference-products-table td.number { padding-top: 1.8mm; vertical-align: middle; text-align: center; white-space: nowrap; }
.reference-product-image { text-align: center; vertical-align: middle !important; }.reference-product-image img { width: 43mm; height: 24mm; object-fit: contain; }.reference-product-image span { display: inline-grid; place-items: center; width: 40mm; height: 21mm; color: #aaa; border: 1px dashed #bbb; font-size: 6pt; }
.reference-product-copy { min-width: 0; }.product-copy-layout { min-height: 25mm; display: grid; grid-template-columns: 7mm minmax(0,1fr); gap: 1mm; align-content: start; }.reference-product-copy .line-index { text-align: center; }.product-copy-layout > div { min-width: 0; overflow-wrap: anywhere; }.reference-product-copy strong { font-size: 6.8pt; text-transform: uppercase; }.reference-product-copy p { margin: .8mm 0 0; color: #30363a; font-size: 6.4pt; line-height: 1.28; overflow-wrap: anywhere; }
.reference-summary { display: grid; grid-template-columns: 1fr 39mm; gap: 4mm; align-items: center; margin-top: 7mm; padding: 1.5mm 2mm; border: 1px solid #333; break-inside: avoid; page-break-inside: avoid; }
.summary-gallery { display: flex; align-items: center; gap: 4mm; min-height: 17mm; color: #576b79; }.summary-gallery > div:last-child { display: grid; margin-left: auto; text-align: center; }.summary-gallery strong { color: #050505; font-size: 22pt; letter-spacing: .08em; line-height: 1; }.summary-gallery small { color: #333; font-size: 5pt; letter-spacing: .23em; }.summary-gallery b { margin-top: 1mm; color: #111; font-size: 9pt; }.summary-products { display: flex; gap: 1.4mm; }.summary-products span { padding: 2mm 1.7mm; border: 1px solid #718797; color: #4d687a; background: #f2f6f8; font-size: 5.2pt; font-weight: 800; }
.reference-summary dl { display: grid; grid-template-columns: 1fr auto; gap: .7mm 2mm; margin: 0; font-size: 6.8pt; }.reference-summary dt,.reference-summary dd { margin: 0; }.reference-summary dd { text-align: right; }.reference-summary .grand-total { font-weight: 800; }
.reference-quote-footer { display: grid; grid-template-columns: .85fr 1.2fr 1fr; margin-top: 2.5mm; padding: 0; border: 0; color: #686f73; font-size: 6.4pt; line-height: 1.4; text-align: left; break-inside: avoid; page-break-inside: avoid; }
.reference-quote-footer > div { min-height: 22mm; padding: 1.5mm 2mm; border-left: 1px solid #444; }.reference-quote-footer > div:last-child { color: #303438; font-size: 6.7pt; }
.reference-notes { margin-top: 2mm; padding: 2mm; border-top: 1px solid #999; color: #555; font-size: 6.4pt; break-inside: avoid; }
.history-product-image { width: 92px; text-align: center; }.history-product-image img { width: 82px; height: 64px; object-fit: contain; border: 1px solid #dbe4e9; border-radius: 7px; background: white; }

@media print {
  @page { size: Letter; margin: 0; }
  .dasec-reference-quote { width: 216mm; min-height: 279mm; padding: 10mm 11mm 9mm; }
}

/* Piloto 18: margen en constructor, biblioteca, correlativos y orden de líneas */
.commercial-summary-card { gap: 8px; }
.commercial-summary-card label { margin: 0; }
.margin-control { display: flex; align-items: center; gap: 8px; }
.margin-control input { width: 110px; font-size: 1.1rem; font-weight: 700; }
.margin-control b { color: var(--muted, #607080); }
.builder-context-notice { margin-bottom: 18px; }
.quote-line-actions, .line-order-actions { display: flex; align-items: center; gap: 8px; }
.line-order-actions button { min-width: 36px; padding: 8px 10px; }
.line-order-actions .remove-quote-line { min-width: auto; }
.quote-save-error { margin-bottom: 14px; }
.builder-action-dialog { width: min(760px, calc(100vw - 32px)); }
.builder-name-field { display: grid; gap: 7px; margin: 16px 0; }
.builder-action-options { display: grid; gap: 10px; }
.builder-option { display: grid; gap: 4px; width: 100%; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid #ccd7e2; background: #fff; color: #17324a; }
.builder-option:hover { border-color: #2776b5; background: #f5faff; }
.builder-option strong { font-size: 1rem; }
.builder-option span { font-size: .88rem; color: #617385; font-weight: 400; }
.builder-option.primary-option { border-color: #1f74b7; background: #eef7ff; }
.existing-quote-picker { margin-top: 16px; padding-top: 16px; border-top: 1px solid #d9e1e8; }
.existing-quote-picker label { display: grid; gap: 7px; }
.existing-quote-picker .search-results { position: static; display: grid; margin-top: 10px; max-height: 260px; overflow: auto; }
.furniture-library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.furniture-card { overflow: hidden; padding: 0; }
.furniture-card-image { min-height: 220px; display: grid; place-items: center; background: #f4f7fa; border-bottom: 1px solid #e1e7ed; }
.furniture-card-image img { width: 100%; height: 240px; object-fit: contain; }
.furniture-card-image span { color: #8794a0; }
.furniture-card-body { display: grid; gap: 12px; padding: 20px; }
.compact-data-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.compact-data-list div { display: grid; gap: 2px; }
.compact-data-list dt { color: #71808e; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.compact-data-list dd { margin: 0; font-weight: 700; }
.narrow-management-shell { max-width: 980px; }
.sequence-current { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px; border-bottom: 1px solid #e1e7ed; }
.sequence-current div { display: grid; gap: 6px; }
.sequence-current span { color: #6f7e8a; }
.sequence-current strong { font-size: 2rem; color: #123d61; }
.sequence-form { padding: 20px; }
@media (max-width: 760px) {
  .quote-line-actions { align-items: stretch; flex-direction: column; }
  .line-order-actions { flex-wrap: wrap; }
  .sequence-current { grid-template-columns: 1fr; }
  .compact-data-list { grid-template-columns: 1fr; }
}

/* Piloto 19: permisos, biblioteca segura y documentos multipágina */
.permission-group { margin: 0 0 18px; padding: 18px; border: 1px solid #d8e2e9; border-radius: 14px; background: #fbfdfe; }
.permission-group legend { padding: 0 8px; color: #123d61; font-weight: 850; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 18px; }
.permission-grid label { min-width: 0; }
.wide-user-management { grid-template-columns: minmax(480px, .95fr) minmax(620px, 1.25fr); }
.furniture-filter-bar select { min-width: 150px; }
.furniture-management { margin-top: 4px; padding-top: 10px; border-top: 1px solid #dce5eb; }
.furniture-management summary { cursor: pointer; color: #174f79; font-weight: 800; }
.furniture-management form { margin-top: 9px; }
.inline-management-form { display: flex; gap: 8px; }
.inline-management-form input { flex: 1; min-width: 0; }
.archived-card { opacity: .84; }
.builder-save-confirmation .dialog-actions { margin-top: 12px; }
.commercial-only-summary { grid-template-columns: minmax(280px, 440px); justify-content: center; }
.quote-line.requires-approval { border-color: #d49b36; box-shadow: 0 0 0 2px rgba(212,155,54,.12); }
.approval-banner { margin: 14px 0; }
.approval-decision-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; }
.approval-form { display: flex; align-items: center; gap: 10px; }
.approval-form input { min-width: 280px; }
.quote-save-error ul { margin: 8px 0 0; padding-left: 20px; }

.quote-document { display: grid; gap: 18px; }
.quote-page { position: relative; width: min(216mm, 100%); min-height: 279mm; margin: 0 auto; padding: 9mm 11mm 10mm; color: #23282c; background: #fff; box-shadow: 0 8px 32px rgba(12,36,54,.2); overflow: hidden; box-sizing: border-box; }
.official-dasec-logo { display: block; width: 56mm; height: 17mm; object-fit: contain; object-position: left center; }
.official-dasec-logo.compact-logo { width: 37mm; height: 11mm; }
.continuation-header { display: flex; align-items: center; justify-content: space-between; gap: 10mm; margin-bottom: 4mm; padding-bottom: 2mm; border-bottom: 1.2mm solid #233e70; }
.continuation-header > div { display: flex; align-items: center; gap: 5mm; color: #4f5c65; font-size: 8pt; }
.continuation-header > strong { color: #233e70; font-size: 9pt; }
.page-counter { position: absolute; right: 11mm; bottom: 4mm; color: #707b83; font-size: 6.5pt; }
.summary-continuation-title { margin: 18mm 0 6mm; color: #233e70; font-size: 16pt; font-weight: 800; text-align: center; }
.final-page-spacer { min-height: 3mm; }
.quote-page .reference-summary { margin-top: 4mm; }
.quote-page .reference-quote-footer { margin-top: 2mm; }

@media (max-width: 980px) {
  .wide-user-management { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .approval-decision-panel, .approval-form { align-items: stretch; flex-direction: column; }
  .approval-form input { min-width: 0; width: 100%; }
}

@media print {
  @page { size: Letter portrait; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; background: white !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .print-quote-body { margin: 0; padding: 0 !important; background: white; }
  .quote-document { display: block; }
  .quote-page { width: 216mm; height: 279mm; min-height: 279mm; margin: 0; padding: 9mm 11mm 10mm; box-shadow: none; break-after: page; page-break-after: always; }
  .quote-page:last-child { break-after: auto; page-break-after: auto; }
  .reference-products-table tbody tr, .reference-summary, .reference-quote-footer, .reference-notes { break-inside: avoid !important; page-break-inside: avoid !important; }
  .reference-products-table th { color: white !important; background: #233e70 !important; }
  .print-action { display: none !important; }
}
.role-default-action { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #d5e2ea; border-radius: 10px; background: #f7fafc; }
.role-default-action small { color: var(--muted); }
@media (max-width: 720px) { .role-default-action { align-items: stretch; flex-direction: column; } }

/* Piloto 19.3: precio visible, medidas enteras, promociones web y cajones editables */
.builder-price-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 0;
  padding: 18px 22px;
  border: 1px solid #d7e2e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 48, 72, .06);
}
.builder-price-main { display: grid; gap: 4px; }
.builder-price-main > span, .builder-margin-top > span { color: #657584; font-size: .86rem; }
.builder-price-main > strong { color: #123d61; font-size: 2rem; line-height: 1.05; }
.builder-price-main > small, .builder-margin-top > small { color: #71808c; }
.builder-margin-top { display: grid; gap: 6px; min-width: 220px; }
.builder-margin-top > strong { color: #123d61; font-size: 1.35rem; }
.drawer-height-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d5e1e8;
  border-radius: 11px;
  background: #f7fafc;
}
.drawer-height-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.drawer-height-heading small { color: #6b7d8b; }
.drawer-height-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.web-promotion-field .readout-box { color: #12643a; background: #eaf7ef; border-color: #b9dec7; font-weight: 800; }
.description-counter { float: right; color: #547084; font-weight: 800; }
.reference-product-copy p { max-height: 17mm; overflow: hidden; }

@media (max-width: 760px) {
  .builder-price-strip { align-items: stretch; flex-direction: column; }
  .drawer-height-list { grid-template-columns: 1fr; }
}

/* Piloto 19.3: paginación Carta calibrada para hasta seis productos estándar */
.reference-products-table td {
  padding-top: 1.15mm;
  padding-bottom: 1.15mm;
}
.reference-product-image img {
  width: 40mm;
  height: 20mm;
}
.reference-product-image span {
  width: 38mm;
  height: 18mm;
}
.product-copy-layout {
  min-height: 21mm;
}
.reference-product-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  max-height: 19.5mm;
}
