/* ==========================================================
   CNA Upholstery — estilos (web pública + panel + documentos)
   ========================================================== */

:root {
  --gold: #c8a165;
  --gold-600: #b48a4d;
  --gold-soft: #f6efe4;
  --ink: #161b22;
  --ink-2: #222a35;
  --ink-3: #2f3946;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f5f4;
  --white: #fff;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --err: #b91c1c;
  --err-soft: #fee2e2;
  --info-soft: #e0f2fe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--gold-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; color: var(--ink); }
p { margin: 0 0 .75rem; }
.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.center-block { display: flex; justify-content: center; margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.strong { font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ok { color: var(--ok); } .warn { color: var(--warn); }
.mt-2 { margin-top: 2rem; }
.inline { display: inline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Marca ---------- */
.brand-mark { font-family: var(--serif); font-weight: 700; color: var(--gold); letter-spacing: .04em; font-size: 1.6rem; }
.brand-sub { font-weight: 700; letter-spacing: .22em; font-size: .72rem; color: #fff; margin-left: .45rem; }
.site-brand, .sidebar-brand { display: inline-flex; align-items: baseline; text-decoration: none !important; }
.site-brand.small .brand-mark { font-size: 1.2rem; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .65rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font: 600 .92rem var(--font); cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-600); color: var(--ink); }
.btn-dark { background: var(--ink-2); color: #fff; }
.btn-dark:hover { background: var(--ink); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.btn-outline-light:hover { border-color: var(--gold); color: var(--gold); }
.btn-whatsapp { background: #25d366; color: #073b1c; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-danger-ghost { background: #fff; color: var(--err); border-color: #fecaca; }
.btn-danger-ghost:hover { background: var(--err-soft); }
.btn.copied { border-color: var(--ok); color: var(--ok); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold-600); }
.icon-btn.danger:hover { border-color: var(--err); color: var(--err); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-600); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Idioma ---------- */
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: .25rem .55rem; font-size: .78rem; font-weight: 700; color: inherit; opacity: .75; text-decoration: none; }
.lang-switch a.on { background: var(--gold); color: var(--ink); opacity: 1; }

/* ---------- Mensajes ---------- */
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; font-size: .93rem; }
.alert i { margin-top: .2rem; }
.alert-success { background: var(--ok-soft); border-color: #86efac; color: #14532d; }
.alert-error { background: var(--err-soft); border-color: #fca5a5; color: #7f1d1d; }
.alert-warning { background: var(--warn-soft); border-color: #fcd34d; color: #78350f; }
.alert-info { background: var(--info-soft); border-color: #7dd3fc; color: #0c4a6e; }
.flash-wrap { padding-top: 1rem; }

/* ---------- Formularios ---------- */
label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--ink-3); }
label > span { font-weight: 600; }
input, select, textarea { width: 100%; font: 400 .95rem var(--font); color: var(--text); background: #fff; border: 1px solid #d1d5db; border-radius: 9px; padding: .6rem .75rem; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.form { display: grid; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; }

/* ==========================================================
   WEB PÚBLICA
   ========================================================== */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav > a:not(.btn) { color: #e5e7eb; font-weight: 500; }
.site-nav > a:not(.btn):hover { color: var(--gold); text-decoration: none; }
.nav-toggle { display: none; background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }

.hero { background: radial-gradient(900px 400px at 85% 0%, rgba(200,161,101,.25), transparent 60%), linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); color: #fff; }
.hero-inner { padding: 5.5rem 0 5rem; }
.eyebrow { color: var(--gold); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.hero h1 { color: #fff; font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: .02em; }
.gold-rule { width: 80px; height: 4px; background: var(--gold); border-radius: 4px; margin: 1rem 0 1.25rem; }
.hero-sub { font-size: 1.2rem; color: #d1d5db; max-width: 34ch; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }

.page-hero { background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); color: #fff; padding: 3.5rem 0; }
.page-hero h1 { color: #fff; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); }
.page-hero p { color: #d1d5db; margin: 0; }

.section { padding: 4.5rem 0; }
.section-alt { background: #fff; }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-family: var(--serif); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.service { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.75rem; transition: transform .2s, box-shadow .2s; }
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.service-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-600); font-size: 1.35rem; margin-bottom: 1rem; }
.service h3 { font-size: 1.1rem; }
.service p { color: var(--muted); margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.project-card { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; height: 100%; transition: box-shadow .2s, transform .2s; }
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-img { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #e7e2da, #f3efe9); display: grid; place-items: center; overflow: hidden; }
.project-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.placeholder-icon { font-size: 2.2rem; color: #c9bba6; }
.project-body { padding: 1.1rem 1.25rem 1.3rem; }
.project-body h3 { font-size: 1.05rem; }
.project-body p { color: var(--muted); font-size: .92rem; margin: 0; }

.site-footer { background: var(--ink); color: #d1d5db; padding: 4rem 0 0; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer h2 { font-family: var(--serif); font-size: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-list { list-style: none; padding: 0; margin: 1.25rem 0 1.75rem; display: grid; gap: 1.1rem; }
.contact-list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact-list i { color: var(--gold); font-size: 1.15rem; margin-top: .2rem; width: 20px; text-align: center; }
.contact-list a, .contact-list span { color: #fff; font-weight: 600; }
.contact-list small { display: block; color: #9ca3af; }
.contact-form { display: grid; gap: .9rem; }
.contact-form label { color: #d1d5db; }
.contact-form input, .contact-form textarea { background: var(--ink-2); border-color: #374151; color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; border-top: 1px solid #2a3340; margin-top: 3rem; padding: 1.5rem 0; font-size: .85rem; color: #9ca3af; }

/* ---------- Login / Demo ---------- */
.is-auth { background: radial-gradient(800px 400px at 50% -10%, rgba(200,161,101,.35), transparent 60%), var(--ink); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-card .site-brand { margin-bottom: 1.25rem; }
.auth-card .brand-sub { color: var(--ink); }
.auth-card h1 { font-size: 1.4rem; text-align: center; }
.auth-card > p.muted { text-align: center; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.25rem; font-size: .88rem; }
.auth-foot .lang-switch { border-color: var(--line); }
.demo-card { width: min(520px, 100%); }
.demo-pill { display: inline-block; background: var(--gold); color: var(--ink); font-weight: 800; letter-spacing: .12em; font-size: .72rem; padding: .2rem .6rem; border-radius: 999px; width: max-content; }
.demo-card .demo-pill { margin-bottom: .75rem; }
.demo-points { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .7rem; }
.demo-points li { display: flex; gap: .75rem; align-items: flex-start; font-size: .93rem; }
.demo-points i { color: var(--gold-600); margin-top: .25rem; width: 18px; text-align: center; }
.demo-choose { font-weight: 700; text-align: center; margin-top: 1rem; }
.demo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.demo-bar { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem; padding: .5rem 1rem; background: #111827; color: #f3f4f6; font-size: .85rem; border-bottom: 2px solid var(--gold); }
.demo-reset { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: .25rem .6rem; font: 600 .8rem var(--font); cursor: pointer; }
.demo-reset:hover { border-color: var(--gold); color: var(--gold); }
.is-public .demo-bar + .site-header { top: 38px; }

/* ==========================================================
   PANEL
   ========================================================== */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cbd5e1; display: flex; flex-direction: column; padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { padding: .25rem .5rem 1.5rem; }
.sidebar-nav { display: grid; gap: .25rem; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 10px; color: #cbd5e1; font-weight: 500; text-decoration: none; }
.sidebar-nav a i { width: 18px; text-align: center; color: #94a3b8; }
.sidebar-nav a:hover { background: var(--ink-2); color: #fff; }
.sidebar-nav a.active { background: var(--ink-3); color: #fff; }
.sidebar-nav a.active i { color: var(--gold); }
.sidebar-foot { margin-top: auto; display: grid; gap: .8rem; padding: 1rem .5rem 0; border-top: 1px solid #2a3340; font-size: .88rem; }
.sidebar-foot a, .sidebar-foot .link-btn { color: #cbd5e1; }
.sidebar-foot .lang-switch { width: max-content; }
.admin-main { min-width: 0; }
.topbar { display: none; }
.admin-content { padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: 1280px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head p { margin: .25rem 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.back-link { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.03); margin-bottom: 1.25rem; }
.card-title { font-size: 1rem; display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.card-title i { color: var(--gold-600); }
.stack { display: grid; gap: .6rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: flex; gap: .9rem; align-items: center; }
.stat > i { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-600); font-size: 1.1rem; flex: none; }
.stat span { display: block; font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.35rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-warn > i { background: var(--warn-soft); color: var(--warn); }
.stat-ok > i { background: var(--ok-soft); color: var(--ok); }

.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.filters label { min-width: 140px; }
.filters .grow { flex: 1 1 240px; }
.filter-buttons { display: flex; gap: .5rem; }

.table-wrap { overflow-x: auto; margin: -.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem; border-bottom: 1px solid #f1f1f1; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.row-link { cursor: pointer; }
.table tbody tr:hover { background: #fafaf9; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: .25rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; color: #d6d3d1; margin-bottom: .75rem; }

.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge-pendiente { background: var(--warn-soft); color: var(--warn); }
.badge-pagado { background: var(--ok-soft); color: var(--ok); }
.badge-confirmado { background: var(--info-soft); color: #0369a1; }
.badge-type-estimate { background: #f3f4f6; color: var(--ink-3); }
.badge-type-invoice { background: var(--gold-soft); color: #7c5a26; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; padding-top: 1rem; font-size: .88rem; color: var(--muted); }

/* Formulario de documento */
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.grid-main .card { margin-bottom: 0; }
.doc-form > .grid-main { margin-bottom: 1.25rem; }
.new-client { margin-top: 1rem; padding: 1rem; background: #fafaf9; border: 1px dashed #d6d3d1; border-radius: 10px; }
.doc-form .link-btn { margin-top: .6rem; font-size: .88rem; }
.items-head, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px 110px 34px; gap: .6rem; align-items: start; }
.items-head { font-size: .75rem; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: .04em; padding: 0 0 .4rem; }
.item-row { margin-bottom: .6rem; }
.item-row textarea { overflow: hidden; }
.line-total { padding-top: .6rem; font-weight: 600; }
#add-item { margin-top: .25rem; }
.form-totals { margin-left: auto; width: min(320px, 100%); margin-top: 1.25rem; display: grid; gap: .4rem; }
.form-totals > div { display: flex; justify-content: space-between; }
.form-totals .grand { border-top: 1px solid var(--line); padding-top: .5rem; font-size: 1.2rem; font-weight: 800; color: var(--ink); }

/* Vista de documento */
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.side-panel { position: sticky; top: 1rem; }
.status-form { display: grid; gap: .5rem; }
.status-opt { display: flex; justify-content: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.status-opt:hover:not(:disabled) { border-color: var(--gold); }
.status-opt.on { border-color: var(--gold); background: var(--gold-soft); cursor: default; }

/* ---------- Documento (papel) ---------- */
.doc-container { max-width: 860px; margin-inline: auto; }
.doc-page { padding-top: 2rem; }
.doc-toolbar { display: flex; justify-content: flex-end; gap: .5rem; margin-bottom: 1rem; }
.doc-paper { background: #fff; color: #111827; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.08); border: 1px solid var(--line); padding: 2.5rem; font-size: .95rem; }
.doc-head { display: flex; justify-content: space-between; gap: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--ink); }
.doc-logo { font-weight: 800; letter-spacing: .2em; font-size: .85rem; color: var(--ink); }
.doc-logo span { font-family: var(--serif); letter-spacing: .04em; color: var(--gold-600); font-size: 2rem; margin-right: .2rem; }
.doc-rule { width: 56px; height: 3px; background: var(--gold); margin: .6rem 0; }
.doc-company { font-size: .88rem; color: #374151; }
.doc-meta { text-align: right; font-size: .9rem; }
.doc-type { font-family: var(--serif); font-size: 2rem; color: var(--ink); letter-spacing: .04em; }
.doc-billto { background: #f8f7f5; border-radius: 8px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.doc-billto h4, .doc-notes h4, .doc-payment h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-600); margin-bottom: .6rem; }
.doc-billto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.5rem; }
.doc-billto-grid span { display: block; font-size: .75rem; color: var(--muted); }
.doc-items { width: 100%; border-collapse: collapse; }
.doc-items th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; text-align: left; border-bottom: 2px solid #e5e7eb; padding: .6rem .5rem; }
.doc-items td { padding: .8rem .5rem; border-bottom: 1px solid #f1f1f1; vertical-align: top; }
.doc-items th.num, .doc-items td.num { text-align: right; }
.doc-totals { margin-left: auto; width: min(300px, 100%); margin-top: 1.25rem; display: grid; gap: .4rem; }
.doc-totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.doc-totals .grand { border-top: 2px solid var(--ink); padding-top: .55rem; font-size: 1.25rem; font-weight: 800; }
.doc-notes { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.doc-notes p { margin: 0; color: #374151; }
.doc-foot { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); text-align: center; display: grid; gap: 1rem; }
.doc-thanks { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); }
.doc-payment { text-align: center; }
.doc-payment p { margin: 0; color: #374151; }

/* ---------- Galería (panel) ---------- */
.admin-gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.admin-project { display: flex; flex-direction: column; gap: .5rem; }
.admin-project-actions { display: flex; gap: .5rem; }
.project-preview { aspect-ratio: 16 / 9; border-radius: 10px; background: #f5f5f4; border: 1px dashed #d6d3d1; display: grid; place-items: center; overflow: hidden; color: #a8a29e; font-size: 1.8rem; }
.project-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Modales ---------- */
.modal { border: 0; border-radius: 16px; padding: 1.5rem; width: min(560px, 100% - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-lg { width: min(760px, 100% - 32px); }
.modal::backdrop { background: rgba(17,24,39,.55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .5rem; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1000px) {
  .services, .gallery { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .view-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 70; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .topbar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--ink); position: sticky; top: 0; z-index: 50; }
  .topbar .icon-btn { background: transparent; color: #fff; border-color: #374151; }
  .grid-main { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; background: var(--ink); flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 16px 1rem; display: none; border-top: 1px solid #2a3340; }
  .site-nav.open { display: flex; }
  .site-nav > a:not(.btn) { padding: .75rem 0; border-bottom: 1px solid #2a3340; }
  .site-nav .lang-switch { margin: .75rem 0; width: max-content; }
  .services, .gallery { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-inner { padding: 3.5rem 0; }
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 34px; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; }
  .item-row textarea { grid-column: 1 / -1; }
  .item-row .line-total { grid-column: 1 / 3; text-align: left; padding-top: 0; }
  .item-row .remove-item { grid-row: 3; grid-column: 3; }
  .doc-paper { padding: 1.25rem; }
  .doc-head { flex-direction: column; gap: 1rem; }
  .doc-meta { text-align: left; }
  .doc-billto-grid { grid-template-columns: 1fr; }
  .doc-items th:nth-child(3), .doc-items td:nth-child(3) { display: none; }
  .table .hide-sm { display: none; }
  .demo-buttons { grid-template-columns: 1fr; }
  .page-actions .btn { flex: 1; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
}

/* ==========================================================
   IMPRESIÓN: solo el documento
   ========================================================== */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .site-header, .site-footer, .sidebar, .topbar, .demo-bar, .no-print, .page-head, .side-panel, .alert, .doc-toolbar { display: none !important; }
  .admin-shell, .view-grid { display: block; }
  .admin-content, .section, .container { padding: 0 !important; margin: 0 !important; width: 100% !important; max-width: none !important; }
  .doc-paper { box-shadow: none; border: 0; padding: 0; }
  .doc-items tr { break-inside: avoid; }
}

/* Ajustes */
@media (min-width: 861px) {
  .admin-shell { background: linear-gradient(to right, var(--ink) 240px, var(--bg) 240px); }
}
.table .mono { white-space: nowrap; }
