:root {
  --ivory: #fbf8f4;
  --cream: #f5eee5;
  --paper: #fffdf9;
  --sand: #eadbc9;
  --sand-dark: #c19155;
  --gold: #b8894d;
  --gold-dark: #8a6235;
  --ink: #3f362f;
  --muted: #7d746d;
  --line: #e6d9cc;
  --sage: #74866d;
  --sage-light: #edf3e9;
  --rose: #c98587;
  --rose-light: #f8e8e8;
  --danger: #b95656;
  --danger-light: #fdeaea;
  --shadow: 0 18px 42px rgba(83, 62, 43, .10);
  --soft-shadow: 0 8px 22px rgba(83, 62, 43, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ivory); color: var(--ink); }
body { font-family: "Segoe UI", Inter, Arial, sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 245px; padding: 28px 18px 24px;
  display: flex; flex-direction: column; background: #f7efe4; border-right: 1px solid var(--line); z-index: 40;
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 0 8px 34px; }
.brand-mark {
  width: 43px; height: 58px; border: 1.5px solid var(--gold); border-radius: 24px;
  display: grid; place-items: center; font-family: Georgia, "Times New Roman", serif; font-size: 32px; color: var(--gold-dark);
}
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 25px; letter-spacing: .12em; }
.brand-subtitle { margin-top: 4px; font-size: 10px; letter-spacing: .22em; color: var(--muted); }
.nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border: 0; border-radius: 16px; background: transparent; color: #716960; cursor: pointer; text-align: left;
  transition: .18s ease;
}
.nav-item span { width: 18px; text-align: center; font-size: 18px; }
.nav-item b { font-weight: 650; }
.nav-item:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.nav-item.active { background: #fffdf9; color: var(--gold-dark); box-shadow: var(--soft-shadow); }
.sidebar-bottom { margin-top: auto; padding: 0 10px; display: grid; gap: 12px; }
.local-badge { width: max-content; max-width: 100%; padding: 8px 10px; border-radius: 999px; background: var(--sage-light); color: #52664d; font-size: 11px; }
.local-badge span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7fa073; margin-right: 6px; }
.version { font-size: 11px; color: var(--muted); }
.text-button { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; font-size: 12px; }
.danger-text { color: var(--danger); }

.main-content { grid-column: 2; min-width: 0; padding: 34px 30px 60px; }
.topbar { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 34px; line-height: 1.1; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 25px; cursor: pointer; }

.btn {
  border: 1px solid var(--line); border-radius: 13px; min-height: 42px; padding: 10px 16px;
  background: #fffdf9; cursor: pointer; font-weight: 650; transition: .15s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--soft-shadow); }
.btn-primary { border-color: var(--gold); background: var(--sand-dark); color: white; }
.btn-soft { background: var(--cream); }
.btn-sage { border-color: #b9c8b3; background: var(--sage-light); color: #4a6545; }
.btn-danger { border-color: #e5bebe; color: var(--danger); background: white; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 12px; border-radius: 10px; }
.btn-icon { width: 40px; padding: 0; display: inline-grid; place-items: center; }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--soft-shadow); }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.card-body { padding: 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
.stat-card { min-height: 112px; padding: 19px; }
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.stat-value { margin-top: 10px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; line-height: 1; }
.stat-note { margin-top: 9px; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .9fr; gap: 16px; margin-top: 16px; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #eee5dc; }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--cream); color: var(--gold-dark); font-weight: 800; }
.activity-row strong { display: block; }
.activity-row small { color: var(--muted); }
.amount-positive { color: #4e7650; font-weight: 800; }
.amount-negative { color: var(--danger); font-weight: 800; }
.stock-pill { min-width: 44px; padding: 7px 10px; border-radius: 999px; text-align: center; background: var(--rose-light); color: var(--danger); font-weight: 800; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { font-size: 34px; margin-bottom: 8px; color: var(--gold); }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; margin-bottom: 16px;
  background: #fff8e9; border: 1px solid #ead5a9; color: #735b2e;
}
.notice strong { display: block; margin-bottom: 3px; }
.notice small { color: inherit; opacity: .8; }

.toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) 220px auto; gap: 10px; margin-bottom: 14px; }
.search-wrap { position: relative; }
.search-wrap .search-symbol { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fffdf9; color: var(--ink); outline: none;
  padding: 12px 14px; min-height: 44px; transition: .15s ease;
}
.search-wrap .input { padding-left: 43px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,137,77,.13); }
.textarea { min-height: 90px; resize: vertical; }
.label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #665e56; }
.label small { font-weight: 400; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input-group { display: flex; }
.input-group .input { border-radius: 13px 0 0 13px; }
.input-group .suffix { display: grid; place-items: center; min-width: 60px; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 13px 13px 0; background: var(--cream); color: var(--muted); }

.table-card { overflow: hidden; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 13px; background: #f5eee6; color: #6c645c; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: 13px; border-top: 1px solid #eee4d9; vertical-align: middle; }
tr:hover td { background: rgba(250,246,241,.65); }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.product-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #f2e9df; border: 1px solid #eaded1; flex: 0 0 auto; }
.product-placeholder { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--cream); color: var(--gold-dark); font-weight: 800; flex: 0 0 auto; }
.product-name { font-weight: 750; }
.product-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.code-text { font-family: Consolas, monospace; font-size: 12px; }
.money-main { font-weight: 750; white-space: nowrap; }
.money-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.margin-positive { color: #52704e; font-weight: 750; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.stock-control { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.stock-number { min-width: 32px; text-align: center; font-weight: 800; }
.stock-number.low { padding: 7px 10px; border-radius: 999px; background: var(--rose-light); color: var(--danger); }

.invoice-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 16px; }
.invoice-left { display: grid; gap: 14px; align-content: start; }
.invoice-right { display: grid; gap: 14px; align-content: start; }
.scan-box { padding: 16px; }
.scan-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.product-results { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 12px; max-height: 260px; overflow: auto; }
.product-option { border: 1px solid var(--line); background: white; border-radius: 14px; padding: 11px; text-align: left; cursor: pointer; transition: .15s; }
.product-option:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: var(--soft-shadow); }
.product-option:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.product-option-top { display: flex; align-items: center; gap: 9px; }
.product-option .product-placeholder, .product-option .product-thumb { width: 38px; height: 38px; border-radius: 10px; }
.product-option strong { display: block; font-size: 13px; line-height: 1.2; }
.product-option small { display: block; color: var(--muted); margin-top: 4px; }
.product-option-bottom { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12px; }
.cart-table td, .cart-table th { padding: 11px; }
.qty-control { display: inline-flex; align-items: center; gap: 5px; }
.qty-control button { width: 29px; height: 29px; border-radius: 9px; border: 1px solid var(--line); background: white; cursor: pointer; }
.qty-control input { width: 48px; min-height: 30px; padding: 5px; text-align: center; border: 1px solid var(--line); border-radius: 9px; }
.price-edit { width: 105px; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; text-align: right; }
.checkout-card .card-body { display: grid; gap: 16px; }
.summary-lines { display: grid; gap: 9px; padding-top: 5px; }
.summary-line { display: flex; justify-content: space-between; gap: 15px; }
.summary-line.total { padding-top: 12px; border-top: 1px solid var(--line); font-size: 21px; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.payment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payment-chip { min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.payment-chip.selected { border-color: var(--gold); background: #f7ecdd; color: var(--gold-dark); font-weight: 750; }
.customer-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: transparent; padding: 0; cursor: pointer; font-weight: 750; }
.collapsible { display: none; padding-top: 14px; }
.collapsible.open { display: grid; }
.checkout-actions { display: grid; grid-template-columns: .65fr 1.35fr; gap: 9px; }

.sale-status { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.sale-status.completed { background: var(--sage-light); color: #4e6948; }
.sale-status.voided { background: var(--danger-light); color: var(--danger); }

.settings-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.settings-stack { display: grid; gap: 16px; }
.data-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.fiscal-card { background: #fff9ef; border-color: #ead7b4; }
.fiscal-lock { display: flex; gap: 12px; align-items: flex-start; }
.fiscal-lock .lock { width: 39px; height: 39px; border-radius: 12px; background: #f3dfbc; display: grid; place-items: center; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(40,33,27,.34); display: grid; place-items: center; padding: 20px; z-index: 100; backdrop-filter: blur(3px); }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(42,32,23,.25); }
.modal.wide { width: min(930px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 21px; border-bottom: 1px solid var(--line); background: rgba(255,253,249,.96); }
.modal-header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.modal-close { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.modal-body { padding: 21px; }
.modal-footer { position: sticky; bottom: 0; padding: 15px 21px; border-top: 1px solid var(--line); background: rgba(255,253,249,.96); display: flex; justify-content: flex-end; gap: 9px; }
.image-preview { width: 110px; height: 110px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); background: var(--cream); }

.receipt { width: 370px; max-width: 100%; margin: 0 auto; padding: 24px 22px; background: white; color: #28231f; font-family: Arial, sans-serif; }
.receipt-brand { text-align: center; }
.receipt-brand h2 { margin: 0; font-family: Georgia, serif; letter-spacing: .15em; font-size: 26px; }
.receipt-brand p { margin: 5px 0; font-size: 11px; letter-spacing: .12em; }
.receipt-warning { margin: 15px 0; padding: 8px; border: 1px dashed #777; text-align: center; font-size: 11px; font-weight: bold; }
.receipt-meta { font-size: 12px; line-height: 1.6; }
.receipt-items { width: 100%; margin-top: 13px; font-size: 12px; }
.receipt-items th, .receipt-items td { background: white; color: #28231f; padding: 7px 3px; border-top: 1px dotted #aaa; text-transform: none; letter-spacing: normal; }
.receipt-items .right { text-align: right; }
.receipt-totals { margin-top: 13px; font-size: 12px; display: grid; gap: 5px; }
.receipt-totals div { display: flex; justify-content: space-between; }
.receipt-totals .grand { font-size: 17px; font-weight: bold; border-top: 1px solid #333; padding-top: 8px; }
.receipt-footer { margin-top: 20px; white-space: pre-line; text-align: center; font-size: 11px; line-height: 1.5; }
.receipt-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.toast-host { position: fixed; top: 18px; right: 24px; z-index: 200; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 420px; padding: 13px 15px; border-radius: 13px; background: #40372f; color: white; box-shadow: var(--shadow); animation: slideIn .2s ease; }
.toast.success { background: #4f6a4b; }
.toast.error { background: #9f4b4b; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }

.loading { min-height: 55vh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #e8ddd2; border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(150px,1fr)); }
  .product-results { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-105%); transition: .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main-content { grid-column: 1; padding: 22px 16px 50px; }
  .mobile-menu { display: block; }
  .topbar { justify-content: flex-start; }
  .top-actions { margin-left: auto; }
  .invoice-layout, .settings-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr 190px; }
  .toolbar > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .topbar h1 { font-size: 27px; }
  .top-actions .btn span.hide-small { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(130px,1fr)); }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .product-results { grid-template-columns: 1fr; }
  .payment-options { grid-template-columns: 1fr 1fr; }
  .data-actions { grid-template-columns: 1fr; }
}

/* V0.3 · introducción, imágenes ampliables, cotizaciones e IVA */
#splashScreen.splash-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #fffdf9 0, #f7eee4 58%, #ead8c4 100%);
  transition: opacity .45s ease, visibility .45s ease;
}
#splashScreen.hide { opacity: 0; visibility: hidden; }
.splash-card { width: min(430px, 86vw); text-align: center; padding: 18px; }
.splash-logo { width: min(310px, 72vw); max-height: 310px; object-fit: contain; mix-blend-mode: multiply; filter: drop-shadow(0 18px 35px rgba(91,65,38,.10)); }
.splash-title { margin-top: 3px; color: var(--gold-dark); font-family: Georgia, "Times New Roman", serif; font-size: 19px; letter-spacing: .22em; }
.splash-subtitle { margin-top: 11px; color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.splash-loader { width: 125px; height: 2px; margin: 25px auto 0; overflow: hidden; background: rgba(184,137,77,.18); border-radius: 99px; }
.splash-loader span { display: block; width: 45%; height: 100%; background: var(--gold); animation: splashMove 1.15s ease-in-out infinite alternate; }
@keyframes splashMove { from { transform: translateX(-100%); } to { transform: translateX(220%); } }

.product-thumb-zoom { position: relative; flex: 0 0 auto; border-radius: 12px; cursor: zoom-in; }
.product-thumb-zoom::after { content: "⌕"; position: absolute; right: -3px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-dark); color: white; font-size: 10px; box-shadow: 0 3px 8px rgba(50,35,20,.25); }
.product-name-button { border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; color: inherit; }
.product-name-button:hover { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }
.tax-badge, .quote-edit-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: #f4eadc; color: var(--gold-dark); font-size: 11px; font-weight: 750; }
.tax-line { color: #776a5f; font-size: 12px; }

.image-current-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.image-preview-button { border: 0; background: transparent; padding: 0; display: grid; gap: 5px; justify-items: start; cursor: zoom-in; color: var(--gold-dark); font-size: 11px; font-weight: 700; }
.image-preview-button:hover .image-preview { box-shadow: 0 0 0 4px rgba(184,137,77,.14); border-color: var(--gold); }
.product-detail-grid { display: grid; grid-template-columns: minmax(240px,.75fr) minmax(320px,1.25fr); gap: 25px; align-items: start; }
.product-detail-image-panel { min-height: 340px; border-radius: 20px; background: linear-gradient(145deg,#f7eee4,#fffdf9); display: grid; place-items: center; padding: 20px; border: 1px solid var(--line); }
.product-detail-image-button { border: 0; padding: 0; background: transparent; display: grid; justify-items: center; gap: 10px; cursor: zoom-in; color: var(--gold-dark); font-size: 12px; font-weight: 700; }
.product-detail-image-button img { max-width: 100%; width: 310px; max-height: 390px; object-fit: contain; border-radius: 16px; box-shadow: var(--soft-shadow); background: white; }
.product-detail-placeholder { width: 190px; height: 190px; border-radius: 45px; display: grid; place-items: center; background: var(--cream); color: var(--gold-dark); font-family: Georgia, serif; font-size: 72px; }
.product-detail-info .eyebrow { color: var(--gold-dark); letter-spacing: .14em; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.product-detail-info h2 { margin: 7px 0 4px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.detail-subtitle { margin: 0 0 18px; color: var(--muted); }
.detail-kpis { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail-kpis > div { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fffaf4; }
.detail-kpis span, .detail-list span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.detail-list { margin-top: 15px; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.detail-list > div { display: grid; grid-template-columns: 145px 1fr; gap: 15px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-notes { margin-top: 15px; padding: 14px; border-radius: 13px; background: var(--cream); }
.detail-notes p { margin: 6px 0 0; line-height: 1.55; color: var(--muted); }

.image-lightbox-backdrop { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 30px; background: rgba(30,25,21,.88); backdrop-filter: blur(8px); }
.image-lightbox-card { max-width: min(1200px,95vw); max-height: 90vh; display: grid; gap: 10px; justify-items: center; }
.image-lightbox-card img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 16px; background: white; box-shadow: 0 25px 90px rgba(0,0,0,.45); }
.image-lightbox-caption { color: white; font-size: 13px; letter-spacing: .03em; }
.image-lightbox-close { position: fixed; top: 22px; right: 28px; width: 45px; height: 45px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(255,255,255,.12); color: white; font-size: 28px; cursor: pointer; }

.quote-notice { background: #f5f0e7; border-color: #dfcfbb; color: #655343; }
.quote-layout { margin-bottom: 16px; }
.quote-checkout-card { position: sticky; top: 20px; }
.quote-save-button { width: 100%; min-height: 50px; }
.quote-history-card { margin-top: 16px; overflow: hidden; }
.quote-history-card .card-header { align-items: center; }
.quote-history-card .card-header p { margin: 4px 0 0; }
.quote-history-search { width: min(310px,42vw); }
.quote-description-wrap { width: min(330px,32vw); display: grid; gap: 5px; }
.quote-description-input, .quote-variant-input { width: 100%; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--ink); padding: 3px 2px; outline: none; }
.quote-description-input { font-weight: 750; }
.quote-variant-input { color: var(--muted); font-size: 12px; }
.quote-description-input:focus, .quote-variant-input:focus { border-bottom-color: var(--gold); }
.tax-select { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 5px 7px; }

.quotation-document { position: relative; width: min(760px,100%); margin: 0 auto; padding: 38px 42px; background: white; color: #3d342d; border: 1px solid #e5d9cb; box-shadow: 0 10px 35px rgba(60,45,30,.08); font-family: Arial, sans-serif; }
.quote-document-header { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.quote-brand { display: flex; align-items: center; gap: 13px; }
.quote-brand-mark { width: 50px; height: 68px; border: 1.5px solid var(--gold); border-radius: 30px; display: grid; place-items: center; color: var(--gold-dark); font-family: Georgia,serif; font-size: 36px; }
.quote-brand h2 { margin: 0; font-family: Georgia,serif; font-size: 28px; letter-spacing: .13em; font-weight: 500; }
.quote-brand p { margin: 4px 0 0; font-size: 10px; letter-spacing: .18em; color: #796c61; text-transform: uppercase; }
.quote-title-block { text-align: right; }
.quote-document-label { color: var(--gold-dark); font-family: Georgia,serif; font-size: 25px; letter-spacing: .12em; }
.quote-title-block b { display: block; margin-top: 5px; color: #74675c; font-size: 12px; }
.quote-divider { height: 2px; margin: 25px 0 18px; background: linear-gradient(90deg,var(--gold),rgba(184,137,77,.12)); }
.quote-document-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding: 12px 0 22px; }
.quote-document-meta div { display: grid; gap: 4px; }
.quote-document-meta span, .quote-parties span { color: #887a6f; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 19px; background: #faf5ee; border-radius: 12px; }
.quote-parties h3 { margin: 5px 0 7px; font-family: Georgia,serif; font-size: 18px; }
.quote-parties p { margin: 3px 0; font-size: 11px; color: #6e6258; }
.quote-business-data { border-left: 1px solid #e4d5c5; padding-left: 24px; }
.quotation-items { margin-top: 24px; }
.quotation-items th { background: #eee1d2; color: #5f5042; }
.quotation-items td { font-size: 12px; padding: 11px 9px; }
.quotation-items td small { display: block; color: #7c7066; margin-top: 4px; }
.quotation-items .right { text-align: right; }
.quote-bottom { display: grid; grid-template-columns: 1fr 260px; gap: 28px; margin-top: 25px; align-items: start; }
.quote-terms h4 { margin: 0 0 8px; font-family: Georgia,serif; font-size: 16px; }
.quote-terms p { margin: 0 0 8px; color: #6d6259; font-size: 11px; line-height: 1.5; white-space: pre-line; }
.quote-small { font-size: 9px !important; }
.quote-totals { display: grid; gap: 8px; }
.quote-totals > div { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; }
.quote-grand-total { margin-top: 6px; padding-top: 12px; border-top: 2px solid var(--gold); color: var(--gold-dark); font-size: 18px !important; }
.quote-document-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 14px; border-top: 1px solid #e6ddd5; color: #776b61; font-size: 10px; }
.quote-document-footer div { max-width: 55%; white-space: pre-line; }
.quote-void-banner { position: absolute; inset: 45% 16%; transform: rotate(-10deg); padding: 18px; border: 5px solid rgba(178,55,55,.42); color: rgba(178,55,55,.5); font-size: 40px; text-align: center; font-weight: 900; letter-spacing: .15em; }
.sale-status.expired { background: #eee8df; color: #76695e; }

#printHost { display: none; }

@media (max-width: 920px) {
  .product-detail-grid { grid-template-columns: 1fr; }
  .product-detail-image-panel { min-height: 260px; }
  .quote-checkout-card { position: static; }
  .quote-history-search { width: 100%; }
}
@media (max-width: 640px) {
  .quotation-document { padding: 24px 18px; }
  .quote-document-header, .quote-document-footer { display: grid; }
  .quote-title-block { text-align: left; }
  .quote-document-meta, .quote-parties, .quote-bottom { grid-template-columns: 1fr; }
  .quote-business-data { border-left: 0; border-top: 1px solid #e4d5c5; padding-left: 0; padding-top: 14px; }
  .quote-description-wrap { width: 220px; }
}

@media print {
  body { background: white !important; }
  .app-shell, .modal-backdrop, .toast-host, #imageLightboxHost, #splashScreen { display: none !important; }
  #printHost { display: block !important; }
  body.printing-receipt #printHost .receipt { width: 78mm; padding: 3mm; margin: 0; box-shadow: none; }
  body.printing-quote #printHost .quotation-document { width: 190mm; max-width: none; margin: 0; padding: 10mm; border: 0; box-shadow: none; }
  body.printing-catalog #printHost .catalog-document { width: 190mm; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
}

/* V0.4 · jerarquía visual por sectores y actualización local */
:root {
  --section-sand: #f8ead7;
  --section-sand-strong: #efd6b3;
  --section-sage: #eef4ec;
  --section-sage-strong: #dce8d8;
  --section-rose: #f8ecec;
  --section-rose-strong: #efd7d8;
  --section-blue: #eef3f4;
  --section-blue-strong: #dae5e8;
  --section-taupe: #f2ede8;
  --section-taupe-strong: #e6dbd1;
  --section-lilac: #f3eff6;
  --section-lilac-strong: #e4dce9;
}

.section-panel,
.section-toolbar {
  position: relative;
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.section-panel::before,
.section-toolbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(184,137,77,.42);
  pointer-events: none;
}
.section-panel .card-header {
  background: rgba(255,255,255,.42);
  backdrop-filter: blur(3px);
}
.section-toolbar {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}
.section-toolbar .input,
.section-toolbar .select { background: rgba(255,255,255,.88); }

/* Facturación: búsqueda, carrito y cobro quedan claramente separados. */
body[data-view="invoice"] .section-search {
  background: linear-gradient(145deg, #fffdf9 0%, #f8f2ea 100%);
  border-color: #e5d6c8;
}
body[data-view="invoice"] .section-cart {
  background: linear-gradient(145deg, #fffdfb 0%, #faf4ef 100%);
  border-color: #eadfd5;
}
body[data-view="invoice"] .section-cart::before { background: #c99a6a; }
body[data-view="invoice"] .section-checkout {
  background: linear-gradient(155deg, #fbf0df 0%, var(--section-sand) 58%, #f5e4ca 100%);
  border-color: #ddb982;
  box-shadow: 0 18px 42px rgba(153,105,48,.13);
}
body[data-view="invoice"] .section-checkout::before { background: #b98648; width: 5px; }
body[data-view="invoice"] .section-checkout .card-header { background: rgba(255,248,236,.68); }
body[data-view="invoice"] .section-checkout .input,
body[data-view="invoice"] .section-checkout .payment-chip { background: rgba(255,255,255,.88); }
body[data-view="invoice"] .section-checkout .summary-lines {
  margin: 0 -5px;
  padding: 12px 12px 4px;
  border-radius: 14px;
  background: rgba(255,255,255,.38);
}
body[data-view="invoice"] .section-checkout .summary-line.total {
  margin: 4px -6px 0;
  padding: 12px 8px 2px;
  border-top-color: #d8b786;
}

/* Cotizaciones: editor, resumen y archivo visualmente independientes. */
body[data-view="quote"] .section-quote-search {
  background: linear-gradient(145deg, #fffdf9 0%, var(--section-rose) 100%);
  border-color: #e8cecf;
}
body[data-view="quote"] .section-quote-search::before { background: #c98587; }
body[data-view="quote"] .section-quote-items {
  background: linear-gradient(145deg, #fffdfb 0%, #faf5ef 100%);
  border-color: #e8dbce;
}
body[data-view="quote"] .section-quote-summary {
  background: linear-gradient(155deg, #f6faf4 0%, var(--section-sage) 100%);
  border-color: #c8d8c3;
}
body[data-view="quote"] .section-quote-summary::before { background: #7f9478; width: 5px; }
body[data-view="quote"] .section-quote-summary .input,
body[data-view="quote"] .section-quote-summary .textarea { background: rgba(255,255,255,.9); }
body[data-view="quote"] .section-history {
  background: linear-gradient(145deg, #fbfcfc 0%, var(--section-blue) 100%);
  border-color: #d4e0e3;
}
body[data-view="quote"] .section-history::before { background: #7c969d; }

/* Inventario */
body[data-view="inventory"] .section-inventory-filter {
  background: linear-gradient(135deg, #f7faf5 0%, var(--section-sage) 100%);
  border-color: #cedcc9;
}
body[data-view="inventory"] .section-inventory-filter::before { background: #768b70; }
body[data-view="inventory"] .section-inventory {
  background: linear-gradient(145deg, #fffdfb 0%, #f6faf4 100%);
  border-color: #d7e1d4;
}
body[data-view="inventory"] .section-inventory::before { background: #7d9276; }
body[data-view="inventory"] .section-inventory th { background: #e9f0e6; color: #53624e; }

/* Ventas */
body[data-view="sales"] .section-sales-filter {
  background: linear-gradient(135deg, #fff9f5 0%, var(--section-rose) 100%);
  border-color: #ead4d4;
}
body[data-view="sales"] .section-sales-filter::before { background: #c98587; }
body[data-view="sales"] .section-sales {
  background: linear-gradient(145deg, #fffdfb 0%, #fbf1f1 100%);
  border-color: #ead7d7;
}
body[data-view="sales"] .section-sales::before { background: #c98587; }
body[data-view="sales"] .section-sales th { background: #f4e4e4; color: #765859; }

/* Movimientos */
body[data-view="movements"] .section-movements-filter {
  background: linear-gradient(135deg, #f8fbfb 0%, var(--section-blue) 100%);
  border-color: #d3e0e3;
}
body[data-view="movements"] .section-movements-filter::before { background: #78949b; }
body[data-view="movements"] .section-movements {
  background: linear-gradient(145deg, #fffdfb 0%, #f2f6f7 100%);
  border-color: #d7e2e4;
}
body[data-view="movements"] .section-movements::before { background: #78949b; }
body[data-view="movements"] .section-movements th { background: #e6eef0; color: #52666b; }

/* Configuración */
body[data-view="settings"] .section-business {
  background: linear-gradient(145deg, #fffdf9 0%, var(--section-sand) 100%);
  border-color: #e1c9aa;
}
body[data-view="settings"] .section-business::before { background: #b9874e; }
body[data-view="settings"] .section-fiscal {
  background: linear-gradient(145deg, #fff9ef 0%, #f6e7c8 100%);
  border-color: #e3c894;
}
body[data-view="settings"] .section-data {
  background: linear-gradient(145deg, #fbfdf9 0%, var(--section-sage) 100%);
  border-color: #cad9c6;
}
body[data-view="settings"] .section-data::before { background: #73896d; }
body[data-view="settings"] .section-demo {
  background: linear-gradient(145deg, #fffafa 0%, var(--section-rose) 100%);
  border-color: #e7cfd0;
}
body[data-view="settings"] .section-demo::before { background: #bd7f82; }
body[data-view="settings"] .section-update {
  background: linear-gradient(145deg, #f9fcfc 0%, var(--section-blue) 100%);
  border-color: #ccdde1;
}
body[data-view="settings"] .section-update::before { background: #708f98; }
body[data-view="settings"] .section-program {
  background: linear-gradient(145deg, #fffdfb 0%, var(--section-taupe) 100%);
  border-color: #ded2c7;
}
body[data-view="settings"] .section-program::before { background: #97816d; }

/* Inicio: tarjetas con códigos suaves para lectura rápida. */
body[data-view="dashboard"] .stats-grid .stat-card:nth-child(1) { background: linear-gradient(145deg,#fffdf9,var(--section-sand)); border-color:#e3c9a8; }
body[data-view="dashboard"] .stats-grid .stat-card:nth-child(2) { background: linear-gradient(145deg,#fffdf9,var(--section-blue)); border-color:#d3dfe2; }
body[data-view="dashboard"] .stats-grid .stat-card:nth-child(3) { background: linear-gradient(145deg,#fffdf9,var(--section-sage)); border-color:#cedbc9; }
body[data-view="dashboard"] .stats-grid .stat-card:nth-child(4) { background: linear-gradient(145deg,#fffdf9,var(--section-taupe)); border-color:#ddd1c6; }
body[data-view="dashboard"] .stats-grid .stat-card:nth-child(5) { background: linear-gradient(145deg,#fffdf9,var(--section-rose)); border-color:#e7cfd0; }
body[data-view="dashboard"] .dashboard-grid:nth-of-type(2) .card:first-child { background: linear-gradient(145deg,#fffdfb,#f8eee6); }
body[data-view="dashboard"] .dashboard-grid:nth-of-type(2) .card:last-child { background: linear-gradient(145deg,#fbfdf9,var(--section-sage)); }
body[data-view="dashboard"] .dashboard-grid:nth-of-type(3) .card:first-child { background: linear-gradient(145deg,#f9fcfc,var(--section-blue)); }
body[data-view="dashboard"] .dashboard-grid:nth-of-type(3) .card:last-child { background: linear-gradient(145deg,#fffdf9,var(--section-sand)); }

.update-ready-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: #54717a;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #c8d9dd;
}
.update-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.68);
  border: 1px solid #d4e1e4;
}
.update-help { display: block; margin-top: 9px; color: var(--muted); line-height: 1.45; }
.update-install-screen { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at center,#fffdf9,#eee0d0); }
.update-install-card { width: min(440px,90vw); padding: 36px; text-align: center; border: 1px solid #ddcab5; border-radius: 24px; background: rgba(255,253,249,.92); box-shadow: var(--shadow); }
.update-install-card .brand-mark { margin: 0 auto 18px; }
.update-install-card h2 { margin: 0 0 9px; font-family: Georgia,serif; font-weight: 500; }
.update-install-card p { color: var(--muted); line-height: 1.55; }

@media (max-width: 920px) {
  .section-toolbar { padding: 11px; }
  .section-panel::before, .section-toolbar::before { width: 3px; }
}


/* V1.0 · catálogo comercial */
body[data-view="catalog"] .section-catalog-filter {
  background: linear-gradient(135deg,#fffdf9 0%,var(--section-sand) 100%);
  border-color: #e2c9a9;
}
body[data-view="catalog"] .section-catalog-filter::before { background: #b9874e; }
.catalog-toolbar-grid { display: grid; grid-template-columns: minmax(260px,1fr) 250px; gap: 12px; }
.catalog-options { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.catalog-options label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.catalog-options input { accent-color: var(--gold-dark); }
.catalog-status-row { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 10px; color: var(--muted); font-size: 12px; }
.catalog-status-row b { color: var(--ink); font-size: 15px; }
.catalog-warning { color: #9a6648; font-weight: 700; }
.catalog-ok { color: #557458; font-weight: 700; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 14px; }
.catalog-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fffdf9; box-shadow: 0 6px 22px rgba(61,49,39,.05); }
.catalog-card.sold-out { opacity: .68; }
.catalog-image { height: 205px; display: grid; place-items: center; padding: 10px; background: linear-gradient(145deg,#f8f0e6,#fffdf9); }
.catalog-image .product-thumb-zoom, .catalog-image .product-thumb, .catalog-image .product-placeholder { width: 100%; height: 100%; }
.catalog-image .product-thumb { object-fit: contain; border-radius: 12px; }
.catalog-image .product-placeholder { display: grid; place-items: center; border-radius: 12px; background: #efe3d4; color: var(--gold-dark); font-family: Georgia,serif; font-size: 42px; }
.catalog-card-body { padding: 15px 16px 16px; }
.catalog-brand { margin-bottom: 5px; color: var(--gold-dark); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.catalog-card h3 { margin: 0; min-height: 42px; font-family: Georgia,serif; font-size: 18px; line-height: 1.2; font-weight: 500; }
.catalog-variant { min-height: 30px; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.catalog-price { margin-top: 12px; color: var(--ink); font-size: 16px; font-weight: 850; }
.catalog-availability { margin-top: 9px; color: #657a62; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.catalog-card.sold-out .catalog-availability { color: #9c6b6b; }

.catalog-document { width: min(920px,100%); margin: 0 auto; padding: 36px; background: white; color: #3d342d; font-family: Arial,sans-serif; }
.catalog-print-header { display: grid; grid-template-columns: 55px 1fr auto; gap: 14px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid #dbc6ad; }
.catalog-print-mark { width: 48px; height: 64px; display: grid; place-items: center; border: 1.5px solid #b8894d; border-radius: 28px; color: #91662f; font-family: Georgia,serif; font-size: 34px; }
.catalog-print-header h1 { margin: 0; font-family: Georgia,serif; font-size: 27px; font-weight: 500; letter-spacing: .12em; }
.catalog-print-header p { margin: 4px 0 0; color: #7a6e63; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.catalog-print-contact { display: grid; gap: 4px; max-width: 180px; color: #786b61; font-size: 9px; text-align: right; }
.catalog-print-title { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 4px; }
.catalog-print-title span { color: #8d632e; font-family: Georgia,serif; font-size: 25px; letter-spacing: .14em; }
.catalog-print-title small { color: #8a7b70; }
.catalog-print-section { break-inside: avoid; margin-top: 22px; }
.catalog-print-category { margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #eadfd3; color: #6b5948; font-family: Georgia,serif; font-size: 18px; }
.catalog-print-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.catalog-print-card { break-inside: avoid; overflow: hidden; border: 1px solid #eadfd3; border-radius: 10px; background: #fffdfa; }
.catalog-print-image { height: 135px; display: grid; place-items: center; padding: 8px; background: #f8f2eb; }
.catalog-print-image img { width: 100%; height: 100%; object-fit: contain; }
.catalog-print-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #9a7548; font-family: Georgia,serif; font-size: 32px; }
.catalog-print-copy { padding: 10px; }
.catalog-print-brand { color: #956d3e; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.catalog-print-copy h3 { margin: 4px 0; font-family: Georgia,serif; font-size: 14px; font-weight: 500; line-height: 1.2; }
.catalog-print-copy p { min-height: 22px; margin: 4px 0 8px; color: #7a6d62; font-size: 9px; line-height: 1.25; }
.catalog-print-copy strong { color: #4c4138; font-size: 12px; }
.catalog-print-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 10px; border-top: 1px solid #e5d8ca; color: #827469; font-size: 8px; }

@media (max-width: 760px) {
  .catalog-toolbar-grid { grid-template-columns: 1fr; }
  .catalog-print-grid { grid-template-columns: repeat(2,1fr); }
}

/* V1.1 · facturación electrónica visual, mensajería y catálogo refinado */
.invoice-document { position: relative; width: min(820px,100%); margin: 0 auto; padding: 38px 42px; background: white; color: #3d342d; border: 1px solid #e5d9cb; box-shadow: 0 10px 35px rgba(60,45,30,.08); font-family: Arial,sans-serif; }
.invoice-document-header { display:flex; align-items:center; justify-content:space-between; gap:25px; }
.invoice-title-block { text-align:right; display:grid; gap:4px; }
.invoice-document-label { color:var(--gold-dark); font-family:Georgia,serif; font-size:22px; letter-spacing:.1em; }
.invoice-title-block b { color:#66594e; font-size:13px; }
.invoice-title-block small { color:#8d8176; font-size:10px; }
.invoice-business-strip { display:grid; grid-template-columns:1fr 1fr; gap:20px; padding:12px 0 16px; color:#71665d; font-size:10px; }
.invoice-business-strip > div { display:flex; flex-wrap:wrap; gap:8px 14px; }
.invoice-document-warning { margin: 4px 0 18px; padding:9px 12px; border:1px solid #ead5a9; border-radius:10px; background:#fff8e9; color:#795f30; font-size:10px; font-weight:700; text-align:center; }
.invoice-items { margin-top:22px; }
.invoice-document-footer { margin-top:28px; }

body[data-view="messaging"] .main-content { background:linear-gradient(160deg,#fbf8f4 0%,#f8f4ef 100%); }
.messaging-tabs { display:flex; gap:8px; margin-bottom:14px; padding:5px; width:max-content; max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:14px; background:#f4ece3; }
.messaging-tab { border:0; border-radius:10px; padding:10px 16px; background:transparent; color:#746960; font-weight:700; cursor:pointer; white-space:nowrap; }
.messaging-tab.active { background:white; color:var(--gold-dark); box-shadow:var(--soft-shadow); }
.messaging-shell { display:grid; grid-template-columns:280px minmax(420px,1fr) 280px; gap:14px; min-height:650px; }
.chat-list,.chat-main,.chat-profile { overflow:hidden; }
.chat-list { background:#fbf6ef; }
.chat-list-head { padding:13px; border-bottom:1px solid var(--line); }
.chat-contact-list { max-height:590px; overflow:auto; }
.chat-contact { width:100%; display:grid; grid-template-columns:42px minmax(0,1fr); gap:10px; align-items:center; padding:12px 13px; border:0; border-bottom:1px solid #eee5dc; background:transparent; text-align:left; cursor:pointer; }
.chat-contact:hover,.chat-contact.active { background:#fffdf9; }
.chat-contact.active { box-shadow:inset 4px 0 0 var(--gold); }
.chat-avatar { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; background:#eadbc9; color:#855f35; font-weight:800; }
.chat-contact-copy { min-width:0; }
.chat-contact-copy b,.chat-contact-copy small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-contact-copy small { margin-top:3px; color:var(--muted); font-size:11px; }
.chat-main { display:grid; grid-template-rows:auto 1fr auto; min-height:650px; background:#fffdfa; }
.chat-main-head { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:15px 18px; border-bottom:1px solid var(--line); background:#fffaf4; }
.chat-main-head h2 { margin:0; font-family:Georgia,serif; font-size:20px; font-weight:500; }
.chat-main-head p { margin:4px 0 0; color:var(--muted); font-size:11px; }
.chat-history { padding:18px; overflow:auto; background:linear-gradient(180deg,#fdfaf6 0%,#fbf6ef 100%); }
.chat-empty { min-height:100%; display:grid; place-items:center; align-content:center; text-align:center; color:var(--muted); }
.chat-empty > div { font-size:34px; color:#b98b55; }
.chat-empty p { margin:10px 0 4px; color:var(--ink); font-weight:700; }
.chat-empty small { max-width:410px; line-height:1.5; }
.message-row { display:flex; margin:8px 0; }
.message-row.outbound { justify-content:flex-end; }
.message-row.inbound { justify-content:flex-start; }
.message-bubble { max-width:72%; padding:10px 12px; border-radius:14px; background:white; border:1px solid #e8ddd1; box-shadow:0 4px 14px rgba(64,48,34,.04); }
.message-row.outbound .message-bubble { background:#f2e5d4; border-color:#e0c9ab; }
.message-bubble small { display:block; margin-top:5px; color:var(--muted); font-size:9px; }
.chat-compose { padding:12px; border-top:1px solid var(--line); background:#fffdf9; }
.chat-compose .textarea { min-height:72px; }
.chat-compose-actions { display:grid; grid-template-columns:170px 1fr; gap:8px; margin-top:8px; }
.chat-profile { background:#f5f0e9; }
.customer-profile { display:grid; gap:14px; }
.customer-profile > div:not(.profile-note):not(.profile-sale) { display:grid; gap:3px; }
.customer-profile span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.07em; }
.customer-profile b { font-size:12px; line-height:1.4; word-break:break-word; }
.profile-note { padding:11px; border-radius:11px; background:white; color:#74695f; font-size:11px; line-height:1.5; }
.profile-sale { display:grid; gap:5px; padding-top:13px; border-top:1px solid #dfd4c8; }
.profile-sale-actions { display:grid; gap:7px; margin-top:6px; }
.messaging-customers-card { overflow:hidden; }
.customer-search { max-width:430px; }
.connector-grid { display:grid; grid-template-columns:1.15fr .85fr; gap:16px; }
.connector-card { overflow:hidden; }
.connector-whatsapp { background:linear-gradient(145deg,#f5faf3,#eef5ea); border-color:#c9d8c3; }
.connector-google { background:linear-gradient(145deg,#fffdf9,#f5f1ea); }
.connector-status { padding:6px 9px; border-radius:999px; background:#eee6dc; color:#7b6d60; font-size:10px; font-weight:800; }
.connector-status.ok { background:#e3efdf; color:#55724f; }
.connector-body { display:grid; gap:16px; }
.connector-body h3 { margin:0 0 4px; }
.connector-body p,.connector-copy { margin:0; color:#70665d; line-height:1.55; font-size:12px; }
.connector-icon { width:54px; height:54px; border-radius:18px; display:grid; place-items:center; background:#dbead5; color:#486743; font-size:26px; font-weight:800; }
.connector-icon.google { background:#f1e5d8; color:#8b6135; font-family:Georgia,serif; }
.connector-actions { display:flex; gap:8px; flex-wrap:wrap; }
.connector-feature-list { display:grid; gap:9px; color:#625950; font-size:12px; }
.connector-steps { display:grid; gap:16px; }
.connector-steps > div { display:grid; grid-template-columns:30px 1fr; gap:10px; align-items:center; }
.connector-steps b { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#eadbc9; color:#865f34; }
.customer-picker-list { display:grid; gap:7px; max-height:420px; overflow:auto; }
.customer-picker-row { width:100%; display:grid; grid-template-columns:42px 1fr; gap:10px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:12px; background:#fffdfa; text-align:left; cursor:pointer; }
.customer-picker-row:hover { border-color:var(--gold); }
.customer-picker-row b,.customer-picker-row small { display:block; }
.customer-picker-row small { color:var(--muted); margin-top:3px; }

/* Catálogo: imagen aislada, descripción debajo y precio siempre fuera de la foto */
.catalog-grid { grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px; }
.catalog-card { display:grid; grid-template-rows:245px 1fr; min-height:440px; }
.catalog-image-stage { display:grid; place-items:center; padding:18px; background:linear-gradient(145deg,#f8f1e8,#fffdf9); border-bottom:1px solid #eee2d5; overflow:hidden; }
.catalog-image-stage .product-thumb-zoom,.catalog-image-stage .product-thumb,.catalog-image-stage .product-placeholder { width:100%; height:100%; }
.catalog-image-stage .product-thumb { object-fit:contain; border:0; border-radius:12px; }
.catalog-image-stage .product-placeholder { display:grid; place-items:center; background:#eee2d3; border-radius:12px; color:#9a7447; font-family:Georgia,serif; font-size:42px; }
.catalog-card-body { display:flex; flex-direction:column; padding:16px; }
.catalog-card h3 { min-height:auto; margin-bottom:5px; }
.catalog-variant { min-height:auto; margin-top:0; }
.catalog-purpose { margin:10px 0 16px; color:#736960; font-size:12px; line-height:1.45; }
.muted-purpose { color:#aaa096; }
.catalog-card-footer { margin-top:auto; display:flex; align-items:flex-end; justify-content:space-between; gap:10px; padding-top:12px; border-top:1px solid #eee4d9; }
.catalog-code { color:#9a8e83; font-size:9px; letter-spacing:.04em; }
.catalog-price { margin:0; color:#5c4732; font-family:Georgia,serif; font-size:18px; font-weight:700; }
.catalog-print-card { display:grid; grid-template-rows:155px 1fr; min-height:300px; }
.catalog-print-image { height:155px; border-bottom:1px solid #eadfd3; }
.catalog-print-copy { display:flex; flex-direction:column; min-height:130px; padding:11px; }
.catalog-print-variant { min-height:auto !important; margin-bottom:3px !important; }
.catalog-print-purpose { min-height:36px !important; margin:5px 0 10px !important; }
.catalog-print-bottom { margin-top:auto; display:flex; justify-content:space-between; align-items:flex-end; gap:8px; padding-top:8px; border-top:1px solid #eee3d7; }
.catalog-print-bottom small { color:#94877b; font-size:7px; }
.catalog-print-bottom strong { font-size:12px; }

@media (max-width:1180px) {
  .messaging-shell { grid-template-columns:250px 1fr; }
  .chat-profile { grid-column:1 / -1; }
  .customer-profile { grid-template-columns:repeat(4,1fr); }
  .profile-sale,.profile-note { grid-column:1 / -1; }
}
@media (max-width:820px) {
  .messaging-shell { grid-template-columns:1fr; }
  .chat-list { max-height:260px; }
  .chat-main { min-height:560px; }
  .connector-grid { grid-template-columns:1fr; }
  .customer-profile { grid-template-columns:1fr 1fr; }
}
@media (max-width:640px) {
  .invoice-document { padding:24px 18px; }
  .invoice-document-header,.invoice-business-strip { display:grid; grid-template-columns:1fr; }
  .invoice-title-block { text-align:left; }
  .chat-compose-actions { grid-template-columns:1fr; }
  .customer-profile { grid-template-columns:1fr; }
}

@media print {
  body.printing-invoice #printHost .invoice-document { width:190mm; max-width:none; margin:0; padding:10mm; border:0; box-shadow:none; }
}

/* ===== DÉLICATE Gestión 1.2 · Catálogo Premium ===== */
body[data-view="catalog"] .main-content {
  background:
    radial-gradient(circle at 82% 5%, rgba(214,170,145,.12), transparent 28%),
    linear-gradient(180deg,#fbf8f4 0%,#f8f4ef 100%);
}
.catalog-premium-hero {
  position:relative;
  display:grid;
  grid-template-columns:auto 1px minmax(300px,1fr) auto;
  gap:24px;
  align-items:center;
  min-height:142px;
  margin-bottom:14px;
  padding:25px 28px;
  overflow:hidden;
  border:1px solid #e7d8c8;
  border-radius:20px;
  background:
    radial-gradient(circle at 78% 35%, rgba(238,203,190,.58), transparent 20%),
    linear-gradient(118deg,#fffdf9 0%,#f8eee4 52%,#f1dfd3 100%);
  box-shadow:0 12px 34px rgba(76,55,36,.08);
}
.catalog-premium-hero::after {
  content:"";
  position:absolute;
  width:290px;
  height:290px;
  right:150px;
  top:-126px;
  border:1px solid rgba(181,130,76,.12);
  border-radius:50%;
  box-shadow:0 0 0 28px rgba(255,255,255,.18),0 0 0 56px rgba(255,255,255,.1);
  pointer-events:none;
}
.catalog-hero-brand { display:flex; align-items:center; gap:14px; min-width:310px; z-index:1; }
.catalog-hero-monogram {
  width:50px; height:66px; display:grid; place-items:center;
  border:1.5px solid #b8894d; border-radius:28px;
  font-family:Georgia,"Times New Roman",serif; font-size:34px; color:#8a6235;
  background:rgba(255,255,255,.42);
}
.catalog-hero-name { font-family:Georgia,"Times New Roman",serif; font-size:31px; letter-spacing:.17em; color:#3e3025; }
.catalog-hero-tagline { margin-top:5px; color:#8d6c51; font-size:9px; font-weight:700; letter-spacing:.25em; text-transform:uppercase; }
.catalog-hero-divider { align-self:stretch; width:1px; background:linear-gradient(180deg,transparent,#cfad8b 18%,#cfad8b 82%,transparent); z-index:1; }
.catalog-hero-copy { z-index:1; }
.catalog-hero-kicker { margin-bottom:7px; color:#9a6a38; font-size:10px; font-weight:800; letter-spacing:.2em; }
.catalog-hero-copy h2 { margin:0; max-width:630px; font-family:Georgia,"Times New Roman",serif; font-size:27px; line-height:1.15; font-weight:500; color:#4b3b2e; }
.catalog-hero-copy p { margin:7px 0 0; color:#81746a; font-size:12px; line-height:1.5; }
.catalog-hero-accent { z-index:1; display:grid; gap:8px; justify-items:end; align-items:center; color:#ad7a45; }
.catalog-hero-accent span { width:66px; height:1px; background:#c79561; }
.catalog-hero-accent b { font-size:24px; font-weight:400; }

.catalog-category-bar {
  display:flex; gap:8px; align-items:center; overflow:auto;
  margin-bottom:12px; padding:5px 2px 8px;
}
.catalog-category-chip {
  flex:0 0 auto; border:1px solid #e3d4c5; border-radius:999px;
  padding:8px 13px; background:#fffdf9; color:#74685d;
  font-size:11px; font-weight:700; cursor:pointer; transition:.16s ease;
}
.catalog-category-chip:hover { border-color:#caa375; color:#8a6235; transform:translateY(-1px); }
.catalog-category-chip.active { border-color:#c79a66; background:#eee0cf; color:#7d552c; box-shadow:0 4px 12px rgba(100,72,42,.08); }
.catalog-control-card { background:rgba(255,253,249,.82); backdrop-filter:blur(4px); }

.catalog-grid { grid-template-columns:repeat(auto-fill,minmax(248px,1fr)); gap:18px; }
.catalog-card {
  position:relative;
  display:grid;
  grid-template-rows:270px minmax(210px,1fr);
  min-height:500px;
  overflow:hidden;
  border:1px solid #e4d5c6;
  border-radius:18px;
  background:#fffdf9;
  box-shadow:0 8px 25px rgba(70,50,31,.07);
  transition:.18s ease;
}
.catalog-card:hover { transform:translateY(-2px); border-color:#d2b28f; box-shadow:0 13px 30px rgba(70,50,31,.11); }
.catalog-image-stage {
  position:relative;
  display:grid; place-items:center;
  padding:12px;
  overflow:hidden;
  border-bottom:1px solid #e7d8c8;
  background:linear-gradient(145deg,#f2e8dd 0%,#fbf7f1 55%,#efe0d3 100%);
}
.catalog-image-frame {
  width:100%; height:100%; display:grid; place-items:center; overflow:hidden;
  border:1px solid rgba(255,255,255,.75); border-radius:12px;
  background:rgba(255,255,255,.25);
}
.catalog-image-stage .product-thumb-zoom {
  width:100%; height:100%; display:grid; place-items:center; overflow:hidden; border-radius:12px;
}
.catalog-image-stage .product-thumb-zoom::after {
  right:10px; bottom:10px; width:28px; height:28px; font-size:12px;
  background:rgba(89,62,38,.88); box-shadow:0 4px 10px rgba(50,35,20,.2);
}
.catalog-image-stage .product-thumb {
  display:block; width:100%; height:100%; max-width:100%; max-height:100%;
  object-fit:contain; object-position:center; border:0; border-radius:10px;
}
.catalog-image-stage .product-placeholder {
  width:100%; height:100%; display:grid; place-items:center;
  background:linear-gradient(145deg,#efe5d9,#faf5ee);
  border-radius:10px; color:#9a7447; font-family:Georgia,serif; font-size:46px;
}
.catalog-stock-ribbon {
  position:absolute; top:18px; right:18px; padding:6px 9px; border-radius:999px;
  background:rgba(140,84,84,.92); color:white; font-size:9px; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
}
.catalog-card.sold-out { opacity:.78; }
.catalog-card-body { display:flex; flex-direction:column; min-height:0; padding:17px 18px 16px; background:#fffdf9; }
.catalog-copy-main { display:block; }
.catalog-brand { margin-bottom:6px; color:#9c6d3a; font-size:10px; font-weight:850; letter-spacing:.11em; text-transform:uppercase; }
.catalog-card h3 { min-height:auto; margin:0 0 5px; font-family:Georgia,"Times New Roman",serif; font-size:19px; line-height:1.22; font-weight:500; color:#3f332a; }
.catalog-variant { min-height:0; margin-top:0; color:#625951; font-size:12px; line-height:1.35; }
.catalog-purpose { min-height:38px; margin:8px 0 13px; color:#756b62; font-size:11.5px; line-height:1.45; }
.catalog-card-footer {
  margin-top:auto; display:flex; align-items:flex-end; justify-content:space-between; gap:10px;
  min-height:44px; padding-top:12px; border-top:1px solid #eadfd4;
}
.catalog-code { max-width:62%; color:#91857a; font-size:9px; line-height:1.35; letter-spacing:.02em; word-break:break-word; }
.catalog-price { margin:0; color:#4a3525; font-family:Georgia,"Times New Roman",serif; font-size:20px; font-weight:700; white-space:nowrap; }

/* PDF / impresión premium */
.catalog-document {
  width:min(980px,100%); margin:0 auto; padding:0 0 26px;
  overflow:hidden; background:#fffdfa; color:#3d342d;
  border:1px solid #e5d7c8; border-radius:16px; box-shadow:0 12px 32px rgba(70,50,32,.07);
  font-family:Arial,sans-serif;
}
.catalog-print-header-premium {
  position:relative;
  display:grid; grid-template-columns:minmax(240px,auto) 1px minmax(260px,1fr) minmax(120px,auto);
  gap:18px; align-items:center; min-height:116px; padding:23px 28px;
  overflow:hidden; border-bottom:1px solid #dec9b3;
  background:
    radial-gradient(circle at 73% 20%,rgba(225,186,169,.5),transparent 26%),
    linear-gradient(118deg,#fffdf9 0%,#f7ece1 55%,#efddcf 100%);
}
.catalog-print-header-premium::after {
  content:""; position:absolute; width:200px; height:200px; right:170px; top:-100px;
  border:1px solid rgba(176,126,73,.12); border-radius:50%; box-shadow:0 0 0 24px rgba(255,255,255,.16);
}
.catalog-print-brand-lockup { position:relative; z-index:1; display:flex; align-items:center; gap:12px; }
.catalog-print-mark { width:42px; height:56px; display:grid; place-items:center; flex:0 0 auto; border:1.3px solid #b8894d; border-radius:25px; color:#8f6638; font-family:Georgia,serif; font-size:28px; }
.catalog-print-brand-lockup h1 { margin:0; color:#3d3027; font-family:Georgia,serif; font-size:25px; font-weight:500; letter-spacing:.15em; }
.catalog-print-brand-lockup p { margin:4px 0 0; color:#8c7058; font-size:7.5px; font-weight:700; letter-spacing:.2em; text-transform:uppercase; }
.catalog-print-head-divider { position:relative; z-index:1; align-self:stretch; width:1px; background:linear-gradient(180deg,transparent,#ceb092 18%,#ceb092 82%,transparent); }
.catalog-print-head-copy { position:relative; z-index:1; display:grid; gap:4px; }
.catalog-print-head-copy span { color:#9a6b3d; font-size:8px; font-weight:800; letter-spacing:.18em; }
.catalog-print-head-copy strong { color:#49382d; font-family:Georgia,serif; font-size:15px; font-weight:500; }
.catalog-print-head-copy small { color:#89796c; font-size:7.5px; }
.catalog-print-contact-premium { position:relative; z-index:1; display:grid; gap:3px; color:#786b60; font-size:7.5px; text-align:right; }
.catalog-print-intro { display:flex; align-items:center; gap:12px; padding:13px 28px 5px; color:#9b6c3c; }
.catalog-print-intro span { font-size:7.5px; font-weight:800; letter-spacing:.18em; }
.catalog-print-intro i { height:1px; flex:1; background:#dfcdbb; }
.catalog-print-intro small { color:#8f8175; font-family:Georgia,serif; font-style:italic; font-size:8.5px; }
.catalog-print-section { break-inside:avoid; margin:18px 24px 0; }
.catalog-print-category-wrap { display:flex; align-items:flex-end; gap:12px; margin-bottom:10px; }
.catalog-print-category { margin:0; padding:0; border:0; color:#49382d; font-family:Georgia,serif; font-size:21px; line-height:1; }
.catalog-print-category-sub { margin-top:4px; color:#9a7b62; font-size:7px; letter-spacing:.08em; text-transform:uppercase; }
.catalog-print-category-line { height:1px; flex:1; margin-bottom:4px; background:#d9c1a8; }
.catalog-print-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.catalog-print-card {
  break-inside:avoid; display:grid; grid-template-rows:165px minmax(130px,1fr); min-height:310px;
  overflow:hidden; border:1px solid #e5d7c8; border-radius:10px; background:#fffdfa;
}
.catalog-print-image { height:165px; padding:7px; overflow:hidden; border-bottom:1px solid #e8dbce; background:linear-gradient(145deg,#f2e8dd,#fbf7f1); }
.catalog-print-image-inner { width:100%; height:100%; display:grid; place-items:center; overflow:hidden; border-radius:7px; background:rgba(255,255,255,.26); }
.catalog-print-image img { display:block; width:100%; height:100%; object-fit:contain; object-position:center; }
.catalog-print-placeholder { width:100%; height:100%; display:grid; place-items:center; color:#9a7548; font-family:Georgia,serif; font-size:32px; }
.catalog-print-copy { display:flex; flex-direction:column; min-height:130px; padding:10px 11px 9px; background:#fffdfa; }
.catalog-print-brand { color:#986a39; font-size:7.2px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.catalog-print-copy h3 { margin:4px 0 3px; color:#40332a; font-family:Georgia,serif; font-size:13.5px; font-weight:500; line-height:1.18; }
.catalog-print-variant { min-height:0 !important; margin:0 0 2px !important; color:#675d55 !important; font-size:8px !important; }
.catalog-print-purpose { min-height:30px !important; margin:4px 0 8px !important; color:#786d64 !important; font-size:7.5px !important; line-height:1.35 !important; }
.catalog-print-bottom { margin-top:auto; display:flex; justify-content:space-between; align-items:flex-end; gap:6px; padding-top:7px; border-top:1px solid #eadfd4; }
.catalog-print-bottom small { max-width:58%; color:#94877b; font-size:6.4px; line-height:1.25; word-break:break-word; }
.catalog-print-bottom strong { color:#4a3525; font-family:Georgia,serif; font-size:11px; white-space:nowrap; }
.catalog-print-footer-premium {
  display:flex; justify-content:space-between; gap:20px; margin:24px 24px 0; padding:12px 3px 0;
  border-top:1px solid #ddc8b3; color:#86786c; font-size:7px;
}
.catalog-print-footer-premium > div { display:flex; gap:12px; align-items:center; }
.catalog-print-footer-premium b { color:#604c3b; font-family:Georgia,serif; letter-spacing:.12em; }

@media (max-width:980px) {
  .catalog-premium-hero { grid-template-columns:1fr; gap:14px; }
  .catalog-hero-brand { min-width:0; }
  .catalog-hero-divider,.catalog-hero-accent { display:none; }
}
@media (max-width:640px) {
  .catalog-grid { grid-template-columns:1fr; }
  .catalog-card { grid-template-rows:250px auto; min-height:0; }
  .catalog-premium-hero { padding:20px; }
  .catalog-hero-name { font-size:26px; }
}

@media print {
  body.printing-catalog #printHost .catalog-document {
    width:190mm; max-width:none; margin:0; padding:0 0 3mm; border:0; border-radius:0; box-shadow:none;
  }
  body.printing-catalog #printHost .catalog-print-header-premium { min-height:30mm; padding:5mm 6mm; }
  body.printing-catalog #printHost .catalog-print-section { margin:4.5mm 5mm 0; }
  body.printing-catalog #printHost .catalog-print-grid { gap:2.5mm; }
  body.printing-catalog #printHost .catalog-print-card { grid-template-rows:42mm minmax(31mm,1fr); min-height:75mm; }
  body.printing-catalog #printHost .catalog-print-image { height:42mm; }
  body.printing-catalog #printHost .catalog-print-footer-premium { margin:5mm 5mm 0; }
}

/* ===== DÉLICATE Gestión 1.3 · Ventas por período + reporte ===== */
.sales-filter-card { margin-bottom:12px; padding:14px; background:linear-gradient(135deg,#fffdf9,#f7eee5); border:1px solid #e8d8c8; }
.sales-filter-grid { display:grid; grid-template-columns:minmax(320px,1.6fr) minmax(150px,.55fr) minmax(150px,.55fr) auto; gap:10px; align-items:end; }
.sales-date-field { display:grid; gap:5px; color:#7b6b5d; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.sales-filter-actions { display:flex; gap:8px; align-items:center; }
.sales-period-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.sales-summary-card { display:grid; gap:5px; min-height:96px; padding:14px 16px; border:1px solid #e7ddd3; border-radius:14px; background:#fffdfa; box-shadow:0 5px 15px rgba(64,45,28,.04); }
.sales-summary-card span { color:#847569; font-size:10px; font-weight:750; text-transform:uppercase; letter-spacing:.07em; }
.sales-summary-card b { color:#45362b; font-family:Georgia,serif; font-size:21px; line-height:1.05; }
.sales-summary-card small { color:#94877c; font-size:9px; line-height:1.35; }
.sales-summary-card.accent { background:linear-gradient(135deg,#f3e2cd,#fbf4ec); border-color:#dfc3a3; }
.sales-summary-card.accent b { color:#7d552c; }
.sales-summary-card.muted { background:#f4f1ee; }

.sales-report-document { width:100%; padding:0; color:#362e28; background:#fff; font-family:Arial,sans-serif; }
.sales-report-header { display:grid; grid-template-columns:1.1fr 1fr .9fr; gap:18px; align-items:center; padding:15px 18px; border:1px solid #dfcbb8; border-radius:12px; background:linear-gradient(120deg,#fffdf9 0%,#f6eadf 56%,#edd7c8 100%); }
.sales-report-brand { display:flex; align-items:center; gap:11px; }
.sales-report-mark { width:38px; height:50px; display:grid; place-items:center; border:1.3px solid #b8894d; border-radius:24px; color:#8e663a; font-family:Georgia,serif; font-size:25px; }
.sales-report-brand h1 { margin:0; font-family:Georgia,serif; font-size:21px; font-weight:500; letter-spacing:.13em; }
.sales-report-brand p { margin:3px 0 0; color:#90765f; font-size:7px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; }
.sales-report-title { padding-left:18px; border-left:1px solid #d6b99d; }
.sales-report-title span { color:#9a6b3d; font-size:7px; font-weight:800; letter-spacing:.17em; }
.sales-report-title h2 { margin:4px 0 3px; font-family:Georgia,serif; font-size:20px; font-weight:500; }
.sales-report-title p { margin:0; color:#7e7065; font-size:9px; }
.sales-report-business { display:grid; gap:3px; justify-items:end; color:#776a5f; font-size:7.5px; text-align:right; }
.sales-report-business b { color:#4f4135; }
.sales-report-meta { display:flex; gap:18px; flex-wrap:wrap; margin:9px 0; padding:8px 12px; border-radius:9px; background:#f8f3ed; color:#75695f; font-size:7.5px; }
.sales-report-kpis { display:grid; grid-template-columns:repeat(6,1fr); gap:7px; margin-bottom:9px; }
.sales-report-kpis > div { display:grid; gap:3px; min-height:48px; padding:8px 9px; border:1px solid #e5d8cb; border-radius:8px; background:#fffdf9; }
.sales-report-kpis span { color:#887a6f; font-size:6.5px; text-transform:uppercase; letter-spacing:.04em; }
.sales-report-kpis b { color:#4b392b; font-family:Georgia,serif; font-size:11px; }
.sales-report-payments { margin-bottom:9px; padding:8px 10px; border:1px solid #e4d6c7; border-radius:8px; background:#fbf7f2; }
.sales-report-payments h3 { margin:0 0 6px; color:#594638; font-family:Georgia,serif; font-size:10px; font-weight:500; }
.sales-report-payments > div { display:flex; gap:7px; flex-wrap:wrap; }
.sales-report-payments span { display:flex; gap:7px; align-items:center; padding:5px 8px; border-radius:999px; background:#fff; color:#71665d; font-size:7px; }
.sales-report-table-wrap { border:1px solid #e1d4c6; border-radius:8px; overflow:hidden; }
.sales-report-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.sales-report-table th { padding:6px 5px; background:#ead9c7; color:#5e4c3d; font-size:6.6px; text-transform:uppercase; letter-spacing:.03em; text-align:left; }
.sales-report-table td { padding:5px; border-top:1px solid #eee5dd; color:#4d443d; font-size:6.9px; vertical-align:top; }
.sales-report-table td small { display:block; margin-top:2px; color:#94877d; font-size:5.9px; }
.sales-report-table th:nth-child(1){width:10%}.sales-report-table th:nth-child(2){width:8%}.sales-report-table th:nth-child(3){width:18%}.sales-report-table th:nth-child(4){width:10%}.sales-report-table th:nth-child(5){width:5%}.sales-report-table th:nth-child(6){width:9%}.sales-report-table th:nth-child(7){width:9%}.sales-report-table th:nth-child(8){width:9%}.sales-report-table th:nth-child(9){width:11%}.sales-report-table th:nth-child(10){width:11%}
.sales-report-table .void-row { color:#9b7777; background:#fbf3f3; text-decoration:none; }
.sales-report-footer { display:flex; justify-content:space-between; gap:20px; margin-top:9px; padding-top:7px; border-top:1px solid #dfd2c5; color:#887c72; font-size:6.5px; }

@media (max-width:1100px) {
  .sales-filter-grid { grid-template-columns:1fr 1fr; }
  .sales-period-summary { grid-template-columns:1fr 1fr; }
}
@media (max-width:640px) {
  .sales-filter-grid,.sales-period-summary { grid-template-columns:1fr; }
  .sales-filter-actions { width:100%; }
}
@media print {
  body.printing-sales-report #printHost .sales-report-document { width:277mm; max-width:none; margin:0; padding:0; }
}


/* V1.4 · resumen financiero del inventario */
.inventory-finance-card { background: linear-gradient(145deg,#fffdf9 0%,#faf1e4 100%) !important; border-color:#e1c59e !important; }
.inventory-finance-card .card-header { border-bottom-color:#ead7bd; }
.inventory-finance-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.finance-metric { min-height:132px; padding:16px; border:1px solid #e4d6c6; border-radius:15px; display:flex; flex-direction:column; gap:7px; box-shadow:0 5px 18px rgba(76,56,36,.035); }
.finance-metric > span { text-transform:uppercase; letter-spacing:.08em; font-size:10px; font-weight:800; color:#84694b; }
.finance-metric > strong { font-family:Georgia,"Times New Roman",serif; font-size:25px; line-height:1.1; font-weight:500; color:var(--ink); }
.finance-metric > small { margin-top:auto; color:var(--muted); line-height:1.42; }
.finance-sales { background:linear-gradient(145deg,#fffdf9,#f7ead8); }
.finance-cost { background:linear-gradient(145deg,#fffdfb,#f2ede8); }
.finance-margin { background:linear-gradient(145deg,#fbfdf9,#eaf2e7); border-color:#cbdcc6; }
.finance-warning { margin-top:12px; padding:10px 12px; border-radius:11px; background:#fff6df; border:1px solid #eed59a; color:#735a28; font-size:11px; }
.finance-actions { margin-top:14px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.finance-actions > span { color:var(--muted); font-size:10px; line-height:1.4; }
@media (max-width:900px) { .inventory-finance-grid { grid-template-columns:1fr; } .finance-metric { min-height:105px; } }

/* ===== DÉLICATE Gestión 2.0 · Operativa ===== */
.admin-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.admin-tab { border:1px solid #dfcdbb; background:#fffdf9; color:#6d5a49; border-radius:999px; padding:10px 14px; font-weight:700; cursor:pointer; transition:.16s ease; }
.admin-tab:hover { transform:translateY(-1px); border-color:#c9a27b; }
.admin-tab.active { background:#ead8c3; border-color:#c99b6b; color:#6f4923; box-shadow:0 6px 18px rgba(91,62,35,.08); }
.admin-summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:16px; }
.section-admin-sand { background:linear-gradient(145deg,#fffdfa,#f8ead7); }
.section-admin-sage { background:linear-gradient(145deg,#fbfdf9,#edf4e9); }
.section-admin-blue { background:linear-gradient(145deg,#fcfefe,#edf3f5); }
.section-admin-rose { background:linear-gradient(145deg,#fffafa,#f7ebec); }
.section-admin-taupe { background:linear-gradient(145deg,#fffdfb,#f1ece7); }
.section-admin-sand::before { background:#bd8d55 !important; }
.section-admin-sage::before { background:#758c70 !important; }
.section-admin-blue::before { background:#78939a !important; }
.section-admin-rose::before { background:#bd8084 !important; }
.section-admin-taupe::before { background:#95806d !important; }
.purchase-add-line { display:grid; grid-template-columns:minmax(260px,1fr) 100px 140px auto; gap:8px; margin:16px 0; }
.purchase-lines { max-height:320px; overflow:auto; border:1px solid #eadfd3; border-radius:12px; }
.return-items { display:grid; gap:8px; margin-bottom:18px; }
.return-line { display:grid; grid-template-columns:minmax(220px,1fr) 100px 170px; gap:12px; align-items:center; padding:11px; border:1px solid #eadfd3; border-radius:12px; background:#fffdf9; }
.return-line small { display:block; margin-top:3px; color:#85786c; }
.check { display:flex; align-items:center; gap:7px; color:#66594e; font-size:12px; }
.cloud-state { padding:7px 10px; border-radius:999px; background:#f2e9df; color:#8c6e52; font-size:11px; font-weight:800; }
.cloud-state.ok { background:#e3efe0; color:#567151; }
.local-badge.cloud-ok { background:#e5f2e2; color:#4e7049; }
.local-badge.cloud-pending { background:#fff0d6; color:#8b652d; }
.local-badge.cloud-error { background:#f8e0df; color:#934b48; }
.local-badge.cloud-off { background:#eef2f3; color:#66777c; }
.report-toolbar { grid-template-columns:180px 180px auto; align-items:end; }
.report-toolbar .label { margin:0; }
.label-document { width:52mm; min-height:32mm; padding:4mm; color:#33281f; text-align:center; border:1px solid #c8a783; font-family:Arial,sans-serif; }
.label-brand { font-family:Georgia,serif; letter-spacing:.18em; font-size:14pt; }
.label-product { margin-top:3mm; font-weight:700; font-size:9pt; }
.label-variant { color:#75695e; font-size:7pt; }
.label-price { margin-top:2mm; font-family:Georgia,serif; font-weight:700; font-size:14pt; }
.label-code { margin-top:1.5mm; font-size:6.5pt; color:#71665c; }
.barcode-bars { margin-top:1mm; letter-spacing:.7px; font-family:monospace; font-size:9pt; transform:scaleX(.7); }
.admin-report-document { width:190mm; margin:0 auto; padding:12mm; color:#3f332a; background:#fff; font-family:Arial,sans-serif; }
.report-letterhead { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; padding-bottom:7mm; border-bottom:1px solid #c9a780; }
.report-letterhead h1 { margin:0; font-family:Georgia,serif; font-size:24pt; font-weight:500; letter-spacing:.14em; }
.report-letterhead p,.report-letterhead small { margin:3px 0 0; color:#8b7765; font-size:8pt; }
.report-letterhead > div:last-child { text-align:right; display:grid; gap:4px; }
.report-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:4mm; margin:7mm 0; }
.report-kpis > div { border:1px solid #e2d4c7; border-radius:3mm; padding:4mm; background:#fbf6f0; }
.report-kpis span { display:block; color:#8d7967; font-size:7pt; }
.report-kpis b { display:block; margin-top:2mm; font-family:Georgia,serif; font-size:12pt; }
.admin-report-document h2 { font-family:Georgia,serif; font-weight:500; }
.admin-report-document table { width:100%; border-collapse:collapse; font-size:8pt; }
.admin-report-document th,.admin-report-document td { padding:2.2mm; border-bottom:1px solid #e8ddd3; text-align:left; }
.admin-report-document th { color:#7c674f; background:#f8f1e8; }
.report-footnote { margin-top:7mm; padding-top:4mm; border-top:1px solid #dfd1c4; color:#817367; font-size:7pt; }
.detail-kpis small { display:block; color:#8d7e70; font-size:9px; }
.catalog-badge { background:#b98750 !important; color:white !important; }

@media (max-width:900px){
  .purchase-add-line,.return-line,.report-toolbar { grid-template-columns:1fr; }
  .report-kpis { grid-template-columns:1fr 1fr; }
}

@media print {
  body.printing-label #printHost { display:block !important; }
  body.printing-label #printHost .label-document { margin:0; }
  body.printing-admin-report #printHost { display:block !important; }
  body.printing-admin-report #printHost .admin-report-document { width:auto; margin:0; padding:5mm; }
}

/* ===== DÉLICATE Gestión 2.1 · Etiquetas boutique ===== */
.label-workbench { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr); gap:18px; align-items:start; }
.label-format-panel,.label-preview-panel { border:1px solid #e6d7c8; border-radius:18px; background:#fffdf9; padding:18px; }
.label-format-intro { display:grid; gap:5px; margin-bottom:14px; }
.label-format-intro b { font-family:Georgia,serif; font-size:18px; color:#49372a; }
.label-format-intro span { color:#887666; font-size:12px; line-height:1.55; }
.label-format-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.label-format-card { text-align:left; border:1px solid #e4d7ca; background:#fff; border-radius:13px; padding:12px; display:grid; gap:4px; color:#4a3c31; cursor:pointer; transition:.16s ease; }
.label-format-card:hover { border-color:#cfa77f; transform:translateY(-1px); box-shadow:0 8px 20px rgba(79,54,33,.06); }
.label-format-card.active { border-color:#bd8b59; background:linear-gradient(145deg,#fffaf3,#f5e7d7); box-shadow:0 0 0 2px rgba(189,139,89,.08); }
.label-format-card.disabled { opacity:.46; cursor:not-allowed; transform:none; box-shadow:none; }
.label-format-card b { font-size:12px; }
.label-format-card span { font-size:11px; font-weight:800; color:#a06f41; }
.label-format-card small { font-size:10px; line-height:1.4; color:#8b7b6d; }
.label-price-option { margin-top:14px; padding:10px 12px; border:1px solid #eadbc9; background:#fbf4ea; border-radius:11px; }
.label-url-info { margin-top:14px; border:1px solid #e6ddd3; background:#faf7f3; padding:10px 12px; border-radius:11px; display:grid; gap:5px; }
.label-url-info span { font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:#9a8067; font-weight:800; }
.label-url-info code { font-size:10px; line-height:1.5; color:#5f5044; overflow-wrap:anywhere; }
.label-printer-note { margin-top:12px; padding:11px 12px; border-radius:12px; background:#eef4ec; border:1px solid #d9e5d5; display:grid; gap:4px; }
.label-printer-note b { color:#536b50; font-size:11px; }
.label-printer-note span { color:#5f785b; font-size:11px; font-weight:700; }
.label-printer-note small { color:#748471; line-height:1.45; font-size:9.5px; }
.label-preview-panel { background:linear-gradient(145deg,#f7f0e8,#efe5da); position:sticky; top:16px; }
.label-preview-title { display:flex; justify-content:space-between; align-items:end; gap:12px; margin-bottom:14px; color:#7f6d5e; font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.label-preview-title b { text-transform:none; letter-spacing:0; font-size:11px; color:#59493c; }
.label-preview-stage { min-height:360px; border:1px dashed #d5c2af; border-radius:14px; background:repeating-linear-gradient(45deg,#f9f6f2,#f9f6f2 10px,#f6f1eb 10px,#f6f1eb 20px); display:flex; align-items:center; justify-content:center; padding:22px; overflow:auto; }
.label-preview-paper { background:#fff; box-shadow:0 10px 26px rgba(70,50,34,.15); flex:0 0 auto; }
.label-preview-paper.format-internal { width:29mm; height:15mm; }
.label-preview-paper.format-product { width:62mm; height:29mm; }
.label-preview-paper.format-qr { width:62mm; height:40mm; }
.label-preview-paper.format-display,.label-preview-paper.format-collection { width:62mm; height:80mm; }

.delicate-label { width:100%; height:100%; box-sizing:border-box; overflow:hidden; background:#fff; color:#2f261f; font-family:Arial,sans-serif; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.dl-mini-brand { font-family:Georgia,serif; letter-spacing:.18em; color:#7c5635; font-weight:700; }
.delicate-label-internal { padding:1.2mm 1.5mm; display:grid; align-content:center; text-align:center; border:.25mm solid #d8c4ae; }
.delicate-label-internal .dl-mini-brand { font-size:5pt; line-height:1; }
.dl-internal-code { margin-top:1.15mm; font-family:Consolas,monospace; font-weight:800; font-size:8pt; line-height:1; letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dl-mini-variant { margin-top:.8mm; font-size:5pt; color:#6f655d; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.delicate-label-product { padding:3mm 4mm 2.6mm; position:relative; display:flex; flex-direction:column; justify-content:center; border:.3mm solid #d4b994; background:linear-gradient(145deg,#fffdf9,#fbf2e7); }
.delicate-label-product .dl-mini-brand { font-size:7pt; }
.dl-product-name { margin-top:1.5mm; font-family:Georgia,serif; font-size:10pt; line-height:1.06; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dl-product-meta { margin-top:1mm; font-size:6.4pt; color:#71645a; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dl-product-price { position:absolute; right:4mm; bottom:3mm; font-family:Georgia,serif; font-size:11pt; font-weight:700; }
.dl-product-code { margin-top:auto; padding-top:1.8mm; border-top:.2mm solid #e4d6c7; font-family:Consolas,monospace; font-size:5.6pt; color:#786d64; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:70%; }

.delicate-label-qr { padding:3mm; display:grid; grid-template-columns:31mm 1fr; gap:3mm; align-items:center; border:.3mm solid #d8c2a8; background:#fffdf9; }
.dl-qr-box { width:29mm; height:29mm; display:flex; align-items:center; justify-content:center; background:#fff; }
.dl-qr-box svg,.dl-display-qr svg { width:100%; height:100%; display:block; }
.dl-qr-copy { min-width:0; align-self:stretch; display:flex; flex-direction:column; justify-content:center; }
.delicate-label-qr .dl-mini-brand { font-size:7pt; }
.delicate-label-qr .dl-product-name { font-size:9pt; white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.dl-qr-caption { margin-top:2mm; color:#8a6848; font-weight:700; font-size:6.2pt; line-height:1.25; }
.delicate-label-qr .dl-product-code { max-width:100%; padding-top:1mm; margin-top:1.5mm; }

.delicate-label-display { padding:5mm 4.5mm 4mm; text-align:center; display:flex; flex-direction:column; align-items:center; border:.3mm solid #d7b994; background:linear-gradient(180deg,#fffdf9 0%,#fbf2e8 100%); }
.dl-display-kicker { font-size:6pt; font-weight:800; letter-spacing:.18em; color:#a06f43; text-transform:uppercase; }
.dl-display-title { margin-top:2.5mm; font-family:Georgia,serif; font-size:14pt; line-height:1.05; color:#3f3026; max-width:52mm; }
.dl-display-variant { margin-top:1mm; font-size:7pt; color:#76665a; }
.dl-display-rule { width:16mm; border-top:.35mm solid #c89b70; margin:2.3mm 0 2mm; }
.dl-display-copy { font-size:6.3pt; line-height:1.4; color:#76695f; max-height:12mm; overflow:hidden; max-width:50mm; }
.dl-display-qr { width:29mm; height:29mm; margin-top:auto; background:#fff; padding:1mm; box-sizing:border-box; }
.dl-display-cta { margin-top:1.4mm; font-size:6.3pt; font-weight:800; color:#6f4c2d; }
.dl-display-domain { margin-top:1.2mm; font-size:5.3pt; letter-spacing:.06em; color:#9a8370; }

@media (max-width:900px){
  .label-workbench { grid-template-columns:1fr; }
  .label-preview-panel { position:static; }
}
@media (max-width:620px){
  .label-format-grid { grid-template-columns:1fr; }
}

@media print {
  body.printing-label { margin:0 !important; padding:0 !important; width:auto !important; min-width:0 !important; }
  body.printing-label #printHost { margin:0 !important; padding:0 !important; width:100% !important; height:100% !important; }
  body.printing-label #printHost .delicate-label { margin:0 !important; width:100% !important; height:100% !important; border-radius:0 !important; box-shadow:none !important; }
}

.auth-screen{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top,#fffdf9,#f5eee5 70%)}
.auth-card{width:min(440px,100%);padding:34px}.auth-logo{display:block;width:150px;max-height:90px;object-fit:contain;margin:0 auto 18px}.auth-title{text-align:center;font-family:Georgia,serif;font-size:30px;margin:0}.auth-sub{text-align:center;color:var(--muted);margin:8px 0 24px}.auth-form{display:grid;gap:14px}.auth-error{min-height:20px;color:var(--danger);font-size:13px}.user-chip{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:var(--paper);font-size:12px}.hidden{display:none!important}.role-pill{padding:5px 9px;border-radius:999px;background:var(--cream);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px}.quick-card{padding:18px;cursor:pointer}.quick-card h3{margin:0 0 6px;font-family:Georgia,serif}.quick-card p{margin:0;color:var(--muted);font-size:12px}.login-note{margin-top:16px;padding:12px;border-radius:12px;background:var(--cream);font-size:12px;color:var(--muted)}
@media(max-width:850px){.quick-grid{grid-template-columns:1fr}.user-chip{display:none}}
