/* MAXSILOS · Cotizaciones — estilos de la aplicación */
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url(/fonts/montserrat-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url(/fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url(/fonts/montserrat-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url(/fonts/montserrat-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-display: swap; src: url(/fonts/source-sans-3-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/source-sans-3-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-display: swap; src: url(/fonts/source-sans-3-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 700; font-display: swap; src: url(/fonts/source-sans-3-latin-700-normal.woff2) format('woff2'); }

:root {
  --blue: #003399; --blue-700: #00297a; --blue-900: #001a52; --blue-50: #eef2fb; --blue-100: #dde6f7; --blue-200: #c3d1ee;
  --red: #ff0000; --red-700: #c70018; --red-50: #fff0f1;
  --ink: #16213a; --ink-2: #34405c; --muted: #5d6a85; --faint: #8a95ad;
  --line: #dde3ef; --line-2: #eaeef6; --bg: #f1f4fa; --surface: #fff;
  --green: #0f7b45; --green-50: #e8f6ee; --amber: #b86e00; --amber-50: #fff4de; --star: #f2a900;
  --head: 'Montserrat', 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --shadow-1: 0 1px 2px rgba(10, 30, 80, .06), 0 1px 1px rgba(10, 30, 80, .04);
  --shadow-2: 0 2px 6px rgba(10, 30, 80, .07), 0 10px 28px rgba(10, 30, 80, .08);
  --shadow-3: 0 12px 40px rgba(6, 20, 60, .28);
  --side-w: 244px; --bar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--text); font-size: 15.5px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
#app { min-height: 100%; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; line-height: 1.2; color: var(--blue-900); }
p { margin: 0 0 .6em; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
::selection { background: #cfdcff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bold { font-weight: 700; } .head { font-family: var(--head); }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .stack { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; } .spacer { flex: 1; } .gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.right { text-align: right; } .center { text-align: center; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; } .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.span2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.hidden { display: none !important; }
.only-sm { display: none !important; }
svg.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
svg.ic.fill { fill: currentColor; stroke: none; }
.spin { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* ───── Estructura ───── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, #00226b 0%, #001a52 100%); color: #fff; display: flex; flex-direction: column; z-index: 40; }
.brand { padding: 18px 18px 14px; position: relative; }
.brand img { display: block; width: 100%; max-width: 168px; height: auto; border-radius: 3px; }
.brand-sub { margin-top: 9px; font-family: var(--head); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; color: rgba(255, 255, 255, .62); }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-title { font-family: var(--head); font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .45); padding: 14px 10px 5px; letter-spacing: .03em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r); color: rgba(255, 255, 255, .84); font-weight: 600; font-size: 14.5px; position: relative; text-decoration: none; transition: background .12s; }
.nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .15); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 3px 3px 0; background: var(--red); }
.nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; font-family: var(--head); }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.usercard { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--blue); display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 13px; flex: none; }
.usercard .nm { font-weight: 700; font-size: 14px; line-height: 1.15; } .usercard .rl { font-size: 12px; color: rgba(255, 255, 255, .6); }
.side-foot .btn { width: 100%; justify-content: flex-start; color: rgba(255, 255, 255, .85); }
.side-foot .btn:hover { background: rgba(255, 255, 255, .1); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 26px 32px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: 25px; font-weight: 800; position: relative; padding-bottom: 9px; }
.page-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 38px; height: 3px; background: var(--red); border-radius: 2px; }
.page-sub { color: var(--muted); margin-top: 6px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scrim { display: none; }
.bottomnav { display: none; }

/* ───── Tarjetas y contenedores ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 52px; }
.card-h h2, .card-h h3 { font-size: 15.5px; font-weight: 700; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.card.flat { box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.stat .lb { font-size: 13.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .vl { font-family: var(--head); font-weight: 800; font-size: 27px; color: var(--blue-900); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .sb { font-size: 13px; color: var(--muted); margin-top: 3px; }
.stat.accent { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-700) 100%); border-color: transparent; color: #fff; }
.stat.accent .lb, .stat.accent .sb { color: rgba(255, 255, 255, .78); } .stat.accent .vl { color: #fff; }
.stat.accent::after { content: ''; position: absolute; right: -34px; top: -10px; width: 74px; height: 140px; background: var(--red); opacity: .9; transform: skewX(-24deg); }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; border: 0; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .ic { width: 38px; height: 38px; color: var(--blue-200); margin-bottom: 8px; stroke-width: 1.5; }
.empty h3 { color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); background: var(--blue-50); color: var(--blue-900); font-size: 14.5px; border: 1px solid var(--blue-100); }
.notice.warn { background: var(--amber-50); border-color: #f2d9a2; color: #6d4300; } .notice.err { background: var(--red-50); border-color: #ffc9ce; color: #8a0013; } .notice.ok { background: var(--green-50); border-color: #bfe5cf; color: #0a5430; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--blue-50); color: var(--blue); white-space: nowrap; font-family: var(--head); }
.badge.green { background: var(--green-50); color: var(--green); } .badge.amber { background: var(--amber-50); color: var(--amber); } .badge.red { background: var(--red-50); color: var(--red-700); } .badge.gray { background: #eceff5; color: var(--muted); } .badge.solid { background: var(--blue); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.green { background: #1fa25f; } .dot.amber { background: #e7a100; } .dot.red { background: var(--red); } .dot.blue { background: var(--blue); }
.kbd { font-family: var(--head); font-size: 11.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: #fff; color: var(--ink-2); }

/* ───── Botones ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-family: var(--head); font-size: 13.5px; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; text-decoration: none; line-height: 1; }
.btn:hover { background: var(--blue-50); border-color: var(--blue-200); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(0, 30, 100, .25); }
.btn.primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn.danger { color: var(--red-700); border-color: #f3c1c7; background: #fff; } .btn.danger:hover { background: var(--red-50); border-color: #ee9aa4; }
.btn.danger.solid { background: var(--red-700); color: #fff; border-color: var(--red-700); } .btn.danger.solid:hover { background: #a8001a; }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: rgba(0, 51, 153, .08); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; } .btn.lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn.icon { width: 38px; padding: 0; } .btn.icon.sm { width: 32px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .ic { width: 1.25em; height: 1.25em; }
.star { background: none; border: 0; padding: 4px; border-radius: 6px; color: #b4bdd0; display: inline-grid; place-items: center; line-height: 1; }
.star:hover { color: var(--star); background: #fff6df; } .star.on { color: var(--star); } .star .ic { width: 20px; height: 20px; }
.star.on .ic { fill: var(--star); }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; cursor: pointer; } .link-btn:hover { text-decoration: underline; }

/* ───── Formularios ───── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 13.5px; font-weight: 700; color: var(--ink-2); font-family: var(--head); }
.help { font-size: 12.5px; color: var(--muted); } .err-text { font-size: 13px; color: var(--red-700); font-weight: 600; }
.input, .select, .textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #c9d2e4; border-radius: var(--r); background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.input:hover, .select:hover, .textarea:hover { border-color: #a9b6d2; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 51, 153, .16); }
.input[disabled], .select[disabled], .textarea[disabled], .input[readonly] { background: #f3f5fa; color: var(--muted); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d6a85' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
.input.sm, .select.sm { min-height: 32px; padding: 4px 9px; font-size: 14px; }
.input-icon { position: relative; } .input-icon > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 18px; height: 18px; }
.input-icon > .input { padding-left: 36px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; flex: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: #bcc6dc; position: relative; transition: background .15s; margin: 0; flex: none; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--blue); } .switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.seg { display: inline-flex; background: #e8edf7; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 7px; font-weight: 700; font-family: var(--head); font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--blue); } .seg button.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(10, 30, 80, .18); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--blue-200); background: var(--blue-50); } .chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip .n { opacity: .7; font-weight: 600; font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-family: var(--head); font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--blue); } .tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-icon { flex: 1 1 260px; max-width: 460px; }

/* ───── Tablas ───── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-family: var(--head); font-weight: 700; font-size: 12.5px; color: var(--muted); padding: 10px 14px; background: #f7f9fd; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #f8faff; }
.tbl tr.clickable { cursor: pointer; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td.act { text-align: right; white-space: nowrap; width: 1%; }
.tbl .title-cell { font-weight: 700; color: var(--blue-900); } .tbl .sub-cell { font-size: 13px; color: var(--muted); }

/* ───── Menús, ventanas y avisos ───── */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: 5px; z-index: 80; max-height: min(70vh, 520px); overflow: auto; }
.menu.left { right: auto; left: 0; } .menu.up { top: auto; bottom: calc(100% + 6px); }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 11px; border: 0; background: none; text-align: left; border-radius: 7px; font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.menu .mi:hover { background: var(--blue-50); } .menu .mi.danger { color: var(--red-700); } .menu .mi.danger:hover { background: var(--red-50); }
.menu .mi[disabled] { opacity: .45; pointer-events: none; } .menu .mi .ic { color: var(--muted); } .menu .mi.danger .ic { color: var(--red-700); }
.menu .msep { height: 1px; background: var(--line-2); margin: 4px 2px; } .menu .mhd { font-family: var(--head); font-size: 11.5px; font-weight: 700; color: var(--faint); padding: 7px 11px 3px; }
.overlay { position: fixed; inset: 0; background: rgba(6, 18, 52, .55); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .14s ease-out; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-3); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s ease-out; }
.modal.sm { max-width: 440px; } .modal.lg { max-width: 820px; } .modal.xl { max-width: 1060px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-h h2 { font-size: 17px; font-weight: 800; flex: 1; }
.modal-b { padding: 20px; overflow: auto; flex: 1 1 auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fafbfe; border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 101; box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.toasts { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--blue-900); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 14.5px; animation: pop .16s ease-out; }
.toast.ok { background: #0b5e36; } .toast.err { background: #a30016; } .toast.warn { background: #7a4b00; }
.toast .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; padding: 0 0 0 6px; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--muted); gap: 12px; }
.skeleton { background: linear-gradient(90deg, #e9edf6 25%, #f4f6fb 50%, #e9edf6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ───── Inicio de sesión ───── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-art { position: relative; overflow: hidden; background: var(--blue); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; }
.login-art::before { content: ''; position: absolute; top: -10%; bottom: -10%; right: -45%; width: 62%; background: var(--red); transform: skewX(-22deg); }
.login-art::after { content: ''; position: absolute; top: -10%; bottom: -10%; right: 22.5%; width: 14px; background: #fff; transform: skewX(-22deg); opacity: .96; }
.login-art > * { position: relative; z-index: 2; }
.login-art img { width: 250px; max-width: 70%; border-radius: 6px; background: #fff; padding: 9px; box-sizing: content-box; }
.login-art > div { max-width: min(470px, 62%); }
.login-art h1 { color: #fff; font-size: clamp(26px, 2.8vw, 40px); font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.login-art p { max-width: 26em; color: rgba(255, 255, 255, .86); font-size: 17px; margin-top: 14px; }
.login-art small { color: rgba(255, 255, 255, .78); max-width: 330px; display: block; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-box { width: 100%; max-width: 400px; }
.login-box h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-box .mobile-logo { display: none; }
.pw-wrap { position: relative; } .pw-wrap .btn { position: absolute; right: 3px; top: 3px; height: 34px; width: 34px; }
.otp { letter-spacing: .5em; text-align: center; font-family: var(--head); font-weight: 700; font-size: 22px; }

/* ───── Cotizaciones: lista ───── */
.q-num { font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--blue); white-space: nowrap; }
.status-sel { appearance: none; border: 0; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-family: var(--head); font-size: 12.5px; cursor: pointer; }
.qcards { display: none; }

/* ───── Gráficas ───── */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 36px; background: linear-gradient(180deg, var(--blue) 0%, #2a58c2 100%); border-radius: 5px 5px 0 0; min-height: 3px; transition: height .35s; }
.bars .b:last-child i { background: linear-gradient(180deg, var(--red) 0%, #ff5a5a 100%); }
.bars .b span { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-weight: 600; } .bars .b em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.hbar .tr { height: 9px; background: #e8edf7; border-radius: 999px; overflow: hidden; } .hbar .tr i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.stackbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #e8edf7; } .stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13.5px; } .legend span { display: inline-flex; align-items: center; gap: 6px; }
.list { display: flex; flex-direction: column; } .list > a, .list > .li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.list > a:hover { background: #f8faff; text-decoration: none; } .list > :last-child { border-bottom: 0; }

/* ───── Catálogo ───── */
.cat-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.cat-filter { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; padding: 8px; }
.cat-filter button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.cat-filter button:hover { background: var(--blue-50); } .cat-filter button.on { background: var(--blue); color: #fff; }
.cat-filter button .n { margin-left: auto; font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.cat-filter .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--blue-200); flex: none; }
.cname { font-weight: 700; color: var(--blue-900); line-height: 1.25; } .cdesc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 6px; background: #eef1f8; font-size: 12px; font-weight: 700; color: var(--ink-2); font-family: var(--head); white-space: nowrap; }

/* ───── Biblioteca ───── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; display: flex; flex-direction: column; transition: box-shadow .12s, border-color .12s; }
.tile:hover { box-shadow: var(--shadow-2); border-color: var(--blue-200); } .tile.sel { outline: 3px solid var(--blue); outline-offset: -1px; }
.tile .im { aspect-ratio: 4 / 3; background: #eef1f8 repeating-conic-gradient(#e6eaf3 0 25%, #f4f6fb 0 50%) 50% / 16px 16px; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.tile .im img { width: 100%; height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; user-select: none; }
.tile .meta { padding: 8px 10px 10px; font-size: 13px; } .tile .meta b { display: block; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tick { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.dropzone { border: 2px dashed var(--blue-200); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); background: #fafcff; transition: background .12s, border-color .12s; }
.dropzone.over { background: var(--blue-50); border-color: var(--blue); }

/* ───── Visor de páginas ───── */
.viewer { background: #dfe5f1; border-radius: var(--r-lg); padding: 18px 12px; min-height: 300px; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pg { background: #fff; box-shadow: 0 2px 10px rgba(10, 30, 80, .18), 0 0 0 1px rgba(10, 30, 80, .08); position: relative; max-width: 100%; }
.pg img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.pg .pn { position: absolute; right: 8px; bottom: 6px; font-size: 11px; font-family: var(--head); font-weight: 700; color: var(--faint); background: rgba(255, 255, 255, .85); padding: 1px 7px; border-radius: 999px; }
.pg .ph { aspect-ratio: 8.5 / 11; display: grid; place-items: center; color: var(--faint); }
.viewer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ───── Editor de cotizaciones ───── */
.ed { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: nowrap; z-index: 30; min-height: 56px; }
.ed-bar .num-tag { font-family: var(--head); font-weight: 800; color: var(--blue); font-size: 14px; white-space: nowrap; }
.ed-bar .title-in { border: 1px solid transparent; background: transparent; font-family: var(--head); font-weight: 700; font-size: 15.5px; padding: 6px 8px; border-radius: 8px; min-width: 120px; flex: 1 1 200px; max-width: 460px; text-overflow: ellipsis; }
.ed-bar .title-in:hover { background: #f3f6fc; } .ed-bar .title-in:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 51, 153, .14); }
.savestate { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.savestate.err { color: var(--red-700); } .savestate.ok .ic { color: var(--green); }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 372px; }
.ed-canvas { overflow-y: auto; padding: 18px 22px 28px; scroll-behavior: smooth; }
.ed-wrap { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.ed-side { border-left: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.ed-foot { background: #fff; border-top: 1px solid var(--line); padding: 9px 18px; display: flex; align-items: center; gap: 22px; z-index: 30; flex-wrap: wrap; }
.ed-foot .tot { display: flex; flex-direction: column; line-height: 1.15; } .ed-foot .tot span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ed-foot .tot b { font-family: var(--head); font-size: 15.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ed-foot .tot.big b { font-size: 22px; color: var(--blue); font-weight: 800; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.sec.dragover { outline: 3px dashed var(--blue); outline-offset: 2px; background: #f7faff; }
.sec-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, #fafbfe, #f4f7fc); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.sec-h .ttl { border: 1px solid transparent; background: transparent; font-family: var(--head); font-weight: 800; font-size: 15px; color: var(--blue-900); padding: 5px 8px; border-radius: 7px; flex: 1; min-width: 80px; }
.sec-h .ttl:hover { background: #fff; border-color: var(--line); } .sec-h .ttl:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 51, 153, .14); }
.sec-h .sub { font-family: var(--head); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--blue); white-space: nowrap; font-size: 14.5px; }
.sec-tag { width: 9px; height: 26px; border-radius: 3px; background: var(--blue); flex: none; }
.gt { width: 100%; border-collapse: collapse; }
.gt thead th { font-family: var(--head); font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); background: #fcfdff; white-space: nowrap; }
.gt td { padding: 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.gt tr.r:hover td { background: #fafcff; } .gt tr.r.flash td { animation: flash 1.6s ease-out; } @keyframes flash { 0% { background: #fff3b8; } 100% { background: transparent; } }
.gt .c-h { width: 26px; text-align: center; color: var(--faint); } .gt .c-n { width: 34px; text-align: center; color: var(--faint); font-size: 12.5px; padding-top: 11px; font-variant-numeric: tabular-nums; }
.gt .c-u { width: 76px; } .gt .c-q { width: 86px; } .gt .c-p { width: 118px; } .gt .c-m { width: 66px; } .gt .c-d { width: 66px; } .gt .c-i { width: 124px; } .gt .c-a { width: 40px; }
.cell { width: 100%; border: 1px solid transparent; background: transparent; padding: 9px 6px; border-radius: 0; min-height: 38px; font-size: 14.5px; display: block; }
.cell:hover { background: #f3f7ff; } .cell:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); position: relative; z-index: 2; }
.cell.num { text-align: right; font-variant-numeric: tabular-nums; } .cell[disabled] { color: var(--ink); opacity: 1; cursor: not-allowed; background: #f6f7fb; }
textarea.cell { resize: none; overflow: hidden; line-height: 1.35; }
.cell.nm { font-weight: 700; color: var(--blue-900); } .cell.ds { font-size: 13.5px; color: var(--ink-2); padding-top: 4px; min-height: 30px; }
.amt { padding: 11px 8px 0 4px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--head); font-size: 14px; }
.gt-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.dragging { opacity: .4; } .drop-before td { box-shadow: inset 0 3px 0 var(--blue); }
.thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); display: block; margin: 4px 0 0 6px; }
.hdr-card .card-b { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.hdr-card .f3 { grid-column: span 3; } .hdr-card .f4 { grid-column: span 4; } .hdr-card .f6 { grid-column: span 6; } .hdr-card .f12 { grid-column: span 12; } .hdr-card .f8 { grid-column: span 8; }
.add-sec { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
.sumbox { margin-left: auto; width: min(420px, 100%); }
.sumrow { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; font-variant-numeric: tabular-nums; } .sumrow.total { border-top: 2px solid var(--blue); margin-top: 6px; padding-top: 10px; font-family: var(--head); font-weight: 800; font-size: 19px; color: var(--blue); }
.words { font-style: italic; color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.side-tabs { display: flex; padding: 10px 12px 0; gap: 4px; } 
.side-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.side-list { flex: 1; overflow-y: auto; padding: 8px; }
.cit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 8px; align-items: start; padding: 9px 8px; border-radius: 10px; border: 1px solid transparent; cursor: grab; }
.cit:hover { background: #f5f8ff; border-color: var(--blue-100); } .cit .nm { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--blue-900); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cit .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.cit .add { align-self: center; } .cit.open .nm { -webkit-line-clamp: unset; } .cit .full { grid-column: 2 / 4; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.cit.dragging { opacity: .5; }
.catchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; } .catchips .chip { padding: 3px 10px; font-size: 12.5px; }
.sets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; }
.signer { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fbfcfe; }
.sigimg { height: 56px; border: 1px dashed var(--blue-200); border-radius: 8px; display: grid; place-items: center; background: #fff; color: var(--faint); font-size: 13px; overflow: hidden; } .sigimg img { max-height: 100%; max-width: 100%; object-fit: contain; }
.ed-tabs-m { display: none; }
.note-item { display: flex; gap: 8px; align-items: flex-start; } .note-item textarea { flex: 1; }
.img-sec { display: grid; gap: 12px; padding: 12px; } .img-sec .it { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; } .img-sec .it img { width: 100%; height: 150px; object-fit: cover; display: block; }
.img-sec .it .cap { padding: 6px; display: flex; gap: 4px; }
.conflict { background: var(--red-50); border: 1px solid #ffc9ce; color: #8a0013; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.preview-pane { flex: 1; overflow-y: auto; padding: 18px 12px 30px; background: #dfe5f1; }

/* ───── Membretes ───── */
.lh-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lh-prev { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }

/* ───── Protección (modo protegido) ───── */
.wm { position: fixed; inset: 0; z-index: 9990; pointer-events: none; }
.shield { position: fixed; inset: 0; z-index: 9999; background: var(--blue-900); color: #fff; display: grid; place-items: center; text-align: center; padding: 30px; font-family: var(--head); font-weight: 700; font-size: 20px; }
body.protected .app :not(input):not(textarea):not(select):not([contenteditable="true"]) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protected img { -webkit-user-drag: none; }
@media print { body * { display: none !important; } body::before { content: 'La impresión está deshabilitada en esta aplicación.'; display: block; padding: 40px; font-size: 18px; } }

/* ───── Adaptación a tableta y celular ───── */
@media (max-width: 1280px) { .ed-body { grid-template-columns: minmax(0, 1fr) 330px; } .cat-layout { grid-template-columns: 210px minmax(0, 1fr); } }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-3); }
  body.nav-open .sidebar { transform: none; } body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6, 18, 52, .5); z-index: 39; }
  .topbar { display: flex; align-items: center; gap: 10px; height: var(--bar-h); padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar img { height: 30px; width: auto; border-radius: 2px; display: block; }
  .content { padding: 18px 18px 80px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .ed-body { grid-template-columns: minmax(0, 1fr); position: relative; overflow: hidden; }
  .ed-bar { flex-wrap: wrap; row-gap: 4px; }
  .ed-side { position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 94vw); z-index: 25; box-shadow: var(--shadow-3); transform: translateX(104%); transition: transform .2s; }
  .ed-side.open { transform: none; }
  .lh-layout { grid-template-columns: minmax(0, 1fr); } .lh-prev { position: static; max-height: none; }
  .hdr-card .f3 { grid-column: span 6; } .hdr-card .f4 { grid-column: span 6; } .hdr-card .f8 { grid-column: span 12; }
}
@media (max-width: 900px) { .ed-bar .title-in { order: 5; flex-basis: 100%; max-width: none; } }
@media (max-width: 860px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-layout { grid-template-columns: minmax(0, 1fr); } .cat-filter { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 6px; } .cat-filter button { width: auto; white-space: nowrap; flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
  /* tabla del editor → tarjetas */
  .gt, .gt thead, .gt tbody, .gt tr, .gt td { display: block; } .gt thead { display: none; }
  .gt tr.r { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 4px; padding: 10px 10px 8px; border-bottom: 8px solid #f1f4fa; position: relative; }
  .gt td { border: 0; } .gt .c-h { display: none; } .gt .c-n { position: absolute; left: 10px; top: 12px; width: auto; padding: 0; } 
  .gt td.c-name { grid-column: 1 / -1; padding-left: 22px; padding-right: 36px; } .gt td.c-desc { grid-column: 1 / -1; }
  .gt td.c-q, .gt td.c-u, .gt td.c-p, .gt td.c-m, .gt td.c-d, .gt td.c-i { width: auto; }
  .gt td.c-u { grid-column: span 2; } .gt td.c-q { grid-column: span 2; } .gt td.c-m { grid-column: span 2; } .gt td.c-p { grid-column: span 3; } .gt td.c-d { grid-column: span 1; } .gt td.c-i { grid-column: span 2; } 
  .gt td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 700; color: var(--faint); font-family: var(--head); padding: 4px 6px 0; }
  .gt td.c-a { position: absolute; right: 4px; top: 4px; width: auto; }
  .gt td.c-i .amt { padding: 6px 6px 0; text-align: left; }
  .cell { border-color: #e2e7f2; border-radius: 8px; margin: 2px 0; background: #fcfdff; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .content { padding: 14px 12px 96px; } .page-title { font-size: 21px; }
  .only-sm { display: initial !important; } .hide-sm { display: none !important; }
  .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; }
  .login { grid-template-columns: minmax(0, 1fr); } .login-art { display: none; } .login-form { padding: 22px 18px; align-items: flex-start; padding-top: 8vh; }
  .login-box .mobile-logo { display: block; width: 190px; margin-bottom: 26px; border-radius: 3px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); box-shadow: 0 -4px 20px rgba(10, 30, 80, .08); }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; font-weight: 700; font-family: var(--head); color: var(--muted); border: 0; background: none; text-decoration: none; }
  .bottomnav .ic { width: 22px; height: 22px; } .bottomnav .on { color: var(--blue); } .bottomnav .plus span.pl { width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 4px 12px rgba(255, 0, 0, .4); border: 4px solid #fff; } .bottomnav .plus .ic { width: 24px; height: 24px; }
  .modal-wrap-sm { padding: 0; align-items: end; } .overlay { padding: 0; align-items: end; } .modal { max-width: 100% !important; border-radius: 16px 16px 0 0; max-height: 92vh; } .modal-f { border-radius: 0; padding-bottom: calc(14px + var(--safe-b)); }
  .tbl-resp thead { display: none; } .tbl-resp, .tbl-resp tbody, .tbl-resp tr, .tbl-resp td { display: block; width: 100%; } .tbl-resp tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); } .tbl-resp td { border: 0; padding: 2px 0; text-align: left !important; } .tbl-resp td.act { width: auto; margin-top: 6px; }
  .tbl-resp td[data-l]::before { content: attr(data-l) ': '; color: var(--faint); font-size: 12.5px; font-weight: 700; }
  .ed-bar { gap: 6px; padding: 6px 8px; flex-wrap: wrap; } .ed-bar .title-in { order: 5; flex-basis: 100%; max-width: none; }
  .ed-canvas { padding: 10px 8px 24px; } .ed-foot { padding: 7px 12px; gap: 14px; } .ed-foot .tot.sm-hide { display: none; }
  .ed-tabs-m { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
  .ed-tabs-m button { border: 0; background: none; padding: 9px 4px 8px; font-family: var(--head); font-weight: 700; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; } .ed-tabs-m button.on { color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
  .ed-side { position: static; width: auto; transform: none; box-shadow: none; border: 0; }
  .hdr-card .card-b { grid-template-columns: minmax(0, 1fr); } .hdr-card .f3, .hdr-card .f4, .hdr-card .f6, .hdr-card .f8, .hdr-card .f12 { grid-column: auto; }
  .stat .vl { font-size: 23px; } .toasts { left: 12px; right: 12px; bottom: 78px; max-width: none; }
  .sumbox { width: 100%; }
  .qcards { display: flex; flex-direction: column; gap: 10px; } .qcards + .tbl-wrap, .tbl-wrap.hide-sm { display: none; }
}

/* editor: ajustes de paneles */
.panel-btn { display: none !important; }
@media (max-width: 1100px) { .panel-btn { display: inline-flex !important; } }
@media (min-width: 1101px) { .catalog-toggle { display: none !important; } }
@media (max-width: 700px) {
  .ed-body { display: block; position: relative; overflow: hidden; } .ed-body > * { height: 100%; }
  .ed-body[data-m="doc"] .ed-side, .ed-body[data-m="preview"] .ed-side, .ed-body[data-m="preview"] .ed-canvas { display: none; }
  .ed-body[data-m="catalog"] .ed-canvas { display: none; } .ed-body[data-m="doc"] .preview-pane, .ed-body[data-m="catalog"] .preview-pane { display: none; }
  .ed-side { display: flex; } .catalog-toggle, .hide-phone { display: none !important; }
}

/* hojas membretadas */
.lh-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lh-prev { position: sticky; top: 14px; }
.lh-mini { border: 1px solid var(--line); border-radius: 6px; height: 120px; background: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.lh-mini .h { height: 26px; border-bottom: 2px solid var(--blue); position: relative; } .lh-mini .h i { position: absolute; left: 0; bottom: -2px; width: 36%; height: 3px; }
.lh-mini .f { height: 18px; border-top: 1px solid var(--blue); }
.thumb { height: 38px; max-width: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 2px; }
@media (max-width: 1100px) { .lh-cols { grid-template-columns: minmax(0, 1fr); } .lh-prev { position: static; } }
.ed ~ .toasts { bottom: 74px; }
@media (max-width: 700px) { .ed-bar .menu-wrap:has(> .hide-phone) { display: none; } .ed-bar .num-tag { font-size: 13px; } }
@media (max-width: 700px) {
  .toolbar .select { flex: 1 1 140px; width: auto !important; min-width: 0; max-width: none !important; }
  .cat-tbl tr { display: grid !important; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 4px; align-items: start; }
  .cat-tbl td { width: auto !important; padding: 2px 0 !important; }
  .cat-tbl .c-sel { grid-column: 1; grid-row: 1; padding-top: 8px !important; } .cat-tbl .c-star { grid-column: 2; grid-row: 1; }
  .cat-tbl .c-main { grid-column: 3; grid-row: 1; } .cat-tbl .c-price { grid-column: 3; grid-row: 2; text-align: left !important; margin-top: 4px; } .cat-tbl .c-act { grid-column: 4; grid-row: 1; margin-top: 0 !important; }
  .cat-tbl .c-price b { font-size: 16px; } .cat-tbl .c-price .sub-cell { display: inline; margin-left: 6px; }
}
