/*
 * TacoNexo · Bloqueo visual premium
 * Capa final de presentación. No modifica lógica, rutas ni comportamiento.
 * Se carga después de app.css para conservar una apariencia comercial uniforme.
 */

:root {
  --premium-bg: #f6f4f0;
  --premium-surface: rgba(255, 255, 255, 0.96);
  --premium-surface-soft: #fbfaf8;
  --premium-text: #211d1a;
  --premium-muted: #706961;
  --premium-border: rgba(54, 43, 35, 0.10);
  --premium-border-strong: rgba(54, 43, 35, 0.16);
  --premium-shadow-sm: 0 8px 24px rgba(50, 37, 27, 0.055);
  --premium-shadow-md: 0 16px 44px rgba(50, 37, 27, 0.085);
  --premium-shadow-lg: 0 28px 80px rgba(35, 25, 18, 0.14);
  --premium-radius-sm: 12px;
  --premium-radius: 18px;
  --premium-radius-lg: 24px;
  --premium-sidebar: #171513;
  --premium-sidebar-soft: #211e1b;
  --premium-ring: color-mix(in srgb, var(--primary) 20%, transparent);
}

html {
  min-width: 320px;
  background: var(--premium-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--secondary) 9%, transparent), transparent 32rem),
    radial-gradient(circle at 25% -15%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 35rem),
    var(--premium-bg);
  color: var(--premium-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--primary) 22%, white);
  color: var(--premium-text);
}

:focus-visible {
  outline: 3px solid var(--premium-ring);
  outline-offset: 2px;
}

/* Estructura principal */
.app-shell {
  min-height: 100vh;
  grid-template-columns: 284px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 18px 20px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 18rem),
    linear-gradient(180deg, var(--premium-sidebar-soft), var(--premium-sidebar));
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 18px 0 48px rgba(25, 18, 13, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
  z-index: 50;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }

.sidebar .brand {
  position: sticky;
  top: -22px;
  z-index: 3;
  min-height: 76px;
  margin: -4px -2px 18px;
  padding: 12px 8px 14px;
  background: linear-gradient(180deg, rgba(31,28,25,.98) 75%, rgba(31,28,25,0));
  color: #fff;
}

.sidebar .brand strong {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .brand-logo,
.sidebar .logo-mark.small {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.sidebar nav a,
.sidebar nav span {
  position: relative;
  min-height: 44px;
  padding: 11px 13px 11px 38px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: rgba(255,255,255,.72);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.005em;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.sidebar nav a::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 17px;
  width: 7px;
  height: 7px;
  transform: translateY(-50%);
  border: 2px solid rgba(255,255,255,.28);
  border-radius: 50%;
  transition: .18s ease;
}

.sidebar nav a:hover {
  transform: translateX(2px);
  border-color: rgba(255,255,255,.07);
  background: rgba(255,255,255,.065);
  color: #fff;
}

.sidebar nav a:hover::before {
  border-color: color-mix(in srgb, var(--secondary) 72%, white);
  background: color-mix(in srgb, var(--secondary) 44%, transparent);
}

.sidebar nav .active {
  border-color: color-mix(in srgb, var(--primary) 60%, rgba(255,255,255,.18));
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 92%, #171513), color-mix(in srgb, var(--primary) 64%, #171513));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 24%, transparent);
  color: #fff;
}

.sidebar nav .active::before {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255,255,255,.13);
}

.sidebar-note {
  margin-top: 28px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  color: color-mix(in srgb, var(--secondary) 66%, white);
  font-size: 12.5px;
  line-height: 1.65;
}

.sidebar-close,
.mobile-menu-toggle,
.sidebar-backdrop {
  display: none;
}

.content {
  width: 100%;
  min-width: 0;
  padding: 30px clamp(20px, 3vw, 44px) 36px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 34;
  min-height: 74px;
  margin: 0 0 24px;
  padding: 14px 16px 14px 20px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 20px;
  background: rgba(255,255,255,.80);
  box-shadow: var(--premium-shadow-sm);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.topbar-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.topbar-heading > div { min-width: 0; }

.topbar h1 {
  margin: 0;
  color: var(--premium-text);
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.topbar p {
  max-width: 780px;
  margin: 5px 0 0;
  color: var(--premium-muted);
  font-size: 13.5px;
}

.topbar-actions {
  flex: 0 0 auto;
  gap: 9px;
}

.user-chip {
  max-width: 300px;
  overflow: hidden;
  padding: 10px 14px;
  border: 1px solid var(--premium-border);
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 18px rgba(50,37,27,.04);
  color: #5e574f;
  font-size: 12.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip:hover {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--premium-border));
  background: #fff;
  color: var(--primary);
}

/* Superficies, tarjetas y jerarquía */
.panel,
.cards article,
.role-card,
.branch-card,
.product-row,
.combo-card,
.reward-card,
.coupon-card,
.promotion-card,
.operation-cards article,
.driver-delivery-card,
.dining-table-card,
.command-ticket,
.kitchen-ticket,
.delivery-order-strip,
.profit-card {
  border: 1px solid var(--premium-border);
  background: var(--premium-surface);
  box-shadow: var(--premium-shadow-sm);
}

.panel,
.cards article,
.role-card {
  border-radius: var(--premium-radius-lg);
}

.panel {
  margin-top: 20px;
  padding: clamp(18px, 2vw, 24px);
}

.panel:hover,
.cards article:hover {
  border-color: color-mix(in srgb, var(--primary) 16%, var(--premium-border));
}

.cards {
  gap: 18px;
}

.cards article {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 22px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.cards article::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -36px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  pointer-events: none;
}

.cards article:hover {
  transform: translateY(-2px);
  box-shadow: var(--premium-shadow-md);
}

.cards span,
.cards small,
.muted,
.field-help {
  color: var(--premium-muted);
}

.cards span {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.cards strong {
  position: relative;
  z-index: 1;
  margin: 12px 0 7px;
  color: var(--premium-text);
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 850;
  letter-spacing: -.035em;
}

.panel h2,
.panel h3,
.section-title h2 {
  color: var(--premium-text);
  font-weight: 820;
  letter-spacing: -.025em;
}

.section-title {
  min-height: 42px;
  gap: 16px;
}

.section-title > div > p {
  margin: 5px 0 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

/* Botones */
.btn,
.quick-actions a,
.quick-actions button,
.ticket-actions a,
.ticket-actions button {
  min-height: 42px;
  gap: 8px;
  border-radius: 13px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -.005em;
  box-shadow: 0 5px 14px rgba(50,37,27,.045);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, filter .16s ease, background .16s ease;
}

.btn:hover,
.quick-actions a:hover,
.quick-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(50,37,27,.09);
}

.btn:active,
.quick-actions a:active,
.quick-actions button:active {
  transform: translateY(0) scale(.985);
}

.btn.primary {
  border: 1px solid color-mix(in srgb, var(--primary) 78%, #12100f);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 96%, white), color-mix(in srgb, var(--primary) 78%, #171513));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 20%, transparent);
  color: #fff;
}

.btn.primary:hover { filter: brightness(1.04) saturate(1.04); }

.btn.whatsapp {
  border: 1px solid #1fb454;
  background: linear-gradient(135deg, #2bd268, #159946);
  box-shadow: 0 8px 20px rgba(21,153,70,.22);
  color: #fff;
}

.btn.whatsapp:hover { filter: brightness(1.04); }

.btn.ghost,
.quick-actions a,
.quick-actions button {
  border: 1px solid var(--premium-border-strong);
  background: rgba(255,255,255,.88);
  color: #514a44;
}

.btn.ghost:hover,
.quick-actions a:hover,
.quick-actions button:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--premium-border));
  background: #fff;
  color: var(--primary);
}

.btn.danger {
  border: 1px solid rgba(185,43,43,.18);
  background: #fff6f5;
  color: #ae2929;
}

.btn.small {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(.2);
  opacity: .62;
  box-shadow: none;
}

/* Formularios */
label {
  gap: 7px;
  color: #443e38;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--premium-border-strong);
  border-radius: 13px;
  background: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 8px rgba(50,37,27,.02);
  color: var(--premium-text);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea { min-height: 104px; }

input::placeholder,
textarea::placeholder { color: #a19a93; }

input:hover,
select:hover,
textarea:hover { border-color: rgba(54,43,35,.24); }

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 65%, white);
  background: #fff;
  box-shadow: 0 0 0 4px var(--premium-ring), 0 8px 22px rgba(50,37,27,.055);
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: auto;
  box-shadow: none;
}

.form-grid,
.form-row,
.toolbar,
.form-actions,
.actions,
.quick-actions {
  gap: 12px;
}

.toolbar {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--premium-border);
  border-radius: 17px;
  background: color-mix(in srgb, var(--premium-surface-soft) 88%, white);
}

.toolbar label { font-size: 12px; }

.form-actions {
  padding-top: 4px;
}

/* Tablas y listados */
.table-wrap {
  border: 1px solid var(--premium-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(50,37,27,.035);
}

.data-table {
  background: transparent;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 15px;
  border-bottom: 1px solid var(--premium-border);
  background: #faf8f5;
  color: #776f68;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .075em;
}

.data-table td {
  padding: 15px;
  border-bottom-color: rgba(54,43,35,.075);
}

.data-table tbody tr {
  transition: background .15s ease;
}

.data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--secondary) 3.5%, #fff);
}

.badge {
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 850;
}

.badge.success {
  border-color: rgba(46,125,50,.12);
  background: #ecf8ee;
  color: #246d32;
}

.badge.info {
  border-color: rgba(217,130,24,.12);
  background: #fff6e8;
  color: #8f5310;
}

.badge.error,
.badge.danger {
  border-color: rgba(185,43,43,.12);
  background: #fff0ef;
  color: #a32a2a;
}

.badge.muted {
  border-color: rgba(54,43,35,.08);
  background: #f2f0ed;
  color: #6f6962;
}

.alert {
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 13px 15px;
  box-shadow: 0 8px 20px rgba(50,37,27,.035);
  font-weight: 650;
}

.alert.success { border-color: rgba(46,125,50,.13); }
.alert.error { border-color: rgba(183,28,28,.13); }
.alert.warning { border-color: rgba(217,130,24,.16); background: #fff7e9; color: #8d5513; }

.empty-state {
  min-height: 130px;
  display: grid;
  place-items: center;
  padding: 36px 22px;
  color: #8d867f;
  font-weight: 650;
}

.pagination a {
  border-color: var(--premium-border-strong);
  border-radius: 11px;
  box-shadow: 0 4px 10px rgba(50,37,27,.025);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination a.active {
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Productos, pedidos, caja e inventario */
.product-row,
.combo-card,
.reward-card,
.coupon-card,
.promotion-card,
.pos-product-card,
.store-product-card,
.dining-table-card,
.command-ticket,
.kitchen-ticket,
.driver-delivery-card {
  border-radius: 19px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.product-row:hover,
.combo-card:hover,
.reward-card:hover,
.coupon-card:hover,
.promotion-card:hover,
.pos-product-card:hover,
.store-product-card:hover,
.dining-table-card:hover,
.command-ticket:hover,
.driver-delivery-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 20%, var(--premium-border));
  box-shadow: var(--premium-shadow-md);
}

.product-thumb,
.pos-product-photo,
.store-product-image,
.combo-image,
.editor-image {
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--secondary) 9%, #fff), #f7f2ea);
}

.product-thumb img,
.pos-product-photo img,
.store-product-image img,
.combo-image img,
.editor-image img {
  transition: transform .35s ease;
}

.product-row:hover img,
.pos-product-card:hover img,
.store-product-card:hover img,
.combo-card:hover img { transform: scale(1.035); }

.product-meta span {
  border-color: var(--premium-border);
  background: #faf8f5;
}

.product-editor,
.order-detail,
.sale-detail,
.purchase-editor,
.delivery-detail,
.driver-delivery-detail,
.account-summary {
  border-color: var(--premium-border);
  box-shadow: var(--premium-shadow-md);
}

.pos-layout,
.store-shell,
.order-layout,
.sales-layout,
.delivery-layout,
.customer-layout,
.inventory-layout,
.commands-layout,
.tables-layout {
  gap: 20px;
}

.pos-catalog,
.pos-cart,
.store-cart,
.command-cart,
.qr-cart {
  border: 1px solid var(--premium-border);
  border-radius: 23px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--premium-shadow-md);
}

.pos-categories,
.store-category-nav {
  scrollbar-width: thin;
}

.pos-categories button,
.store-category-nav button {
  border: 1px solid var(--premium-border);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #665f58;
  font-weight: 750;
}

.pos-categories button:hover,
.store-category-nav button:hover,
.pos-categories button.active,
.store-category-nav button.active {
  border-color: color-mix(in srgb, var(--primary) 55%, white);
  background: var(--primary);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 18%, transparent);
  color: #fff;
}

.pos-charge-button {
  min-height: 54px;
  border-radius: 16px;
  font-size: 16px;
}

.change-box,
.grand-total,
.order-success-summary,
.order-totals .grand-total {
  border-radius: 15px;
  background: color-mix(in srgb, var(--secondary) 6%, #fff);
}

/* Modales */
.app-modal,
.app-dialog {
  border: 0;
  border-radius: 24px;
  background: transparent;
  padding: 0;
}

.app-modal::backdrop,
.app-dialog::backdrop {
  background: rgba(23,19,16,.58);
  backdrop-filter: blur(6px);
}

.modal-card {
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--premium-shadow-lg);
}

.modal-close {
  border-radius: 11px;
  background: #f5f2ee;
}

/* Acceso e instalación */
.auth-bg {
  position: relative;
  overflow-x: hidden;
  padding: 28px 16px;
  background:
    radial-gradient(circle at 12% 14%, color-mix(in srgb, var(--secondary) 13%, transparent), transparent 24rem),
    radial-gradient(circle at 88% 2%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 28rem),
    linear-gradient(145deg, #fffdfa, #f2eee8);
}

.auth-bg::before,
.auth-bg::after {
  content: "";
  position: fixed;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(80,60,45,.06);
  border-radius: 50%;
  pointer-events: none;
}

.auth-bg::before { left: -110px; bottom: -90px; }
.auth-bg::after { right: -130px; top: 18%; }

.auth-card,
.install-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--premium-shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-card { width: min(94%, 480px); padding: 34px; }
.install-card { width: min(96%, 880px); padding: clamp(24px, 4vw, 42px); }

.brand-lockup {
  margin-bottom: 22px;
}

.brand-lockup .brand-logo,
.brand-lockup .logo-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 18%, transparent);
}

.brand-lockup h1 {
  color: var(--premium-text);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.brand-lockup p {
  margin: 4px 0 0;
  color: var(--premium-muted);
}

.install-card h2 {
  margin: 26px 0 2px;
  padding-top: 20px;
  border-top: 1px solid var(--premium-border);
  color: var(--premium-text);
  font-size: 18px;
}

.install-card h2:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

/* Tienda pública y vistas del cliente */
.store-body,
.delivery-track-body,
.qr-order-page,
.order-success-body,
.public-result {
  background:
    radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--secondary) 10%, transparent), transparent 30rem),
    linear-gradient(145deg, #fffdfa, #f3efe9);
}

.store-header {
  border-bottom: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 30px rgba(50,37,27,.06);
  backdrop-filter: blur(18px) saturate(150%);
}

.store-brand strong {
  font-weight: 900;
  letter-spacing: -.025em;
}

.store-hero {
  overflow: hidden;
  border: 1px solid var(--premium-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--secondary) 18%, transparent), transparent 18rem),
    linear-gradient(135deg, #211d1a, #33271f);
  box-shadow: var(--premium-shadow-md);
}

.store-hero h1 {
  letter-spacing: -.04em;
}

.store-product-card {
  border-color: var(--premium-border);
  box-shadow: var(--premium-shadow-sm);
}

.store-cart {
  border-color: var(--premium-border);
  box-shadow: var(--premium-shadow-md);
}

.store-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, #171513, #26211d);
}

.order-success-card,
.result-card,
.delivery-track-hero,
.delivery-track-info article,
.delivery-public-events,
.qr-success-card {
  border: 1px solid var(--premium-border);
  border-radius: 25px;
  box-shadow: var(--premium-shadow-md);
}

.delivery-track-card { gap: 20px; }
.delivery-track-steps { border: 1px solid var(--premium-border); border-radius: 22px; box-shadow: var(--premium-shadow-sm); }

/* Pie */
.app-footer {
  margin-top: 34px;
  padding: 16px;
  border-top: 1px solid var(--premium-border);
  color: #8a837c;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .025em;
}

/* Estados de carga y movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Tablet */
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 250px minmax(0,1fr); }
  .content { padding-inline: 22px; }
  .sidebar { padding-inline: 14px; }
  .sidebar nav a { padding-left: 34px; font-size: 12.5px; }
  .sidebar nav a::before { left: 15px; }
}

/* Navegación móvil */
@media (max-width: 900px) {
  .app-shell { display: block; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 310px);
    height: 100dvh;
    padding: 18px;
    transform: translateX(-104%);
    box-shadow: 26px 0 70px rgba(15,10,7,.30);
    transition: transform .22s ease;
    visibility: hidden;
  }

  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); visibility: visible; }

  .sidebar .brand {
    top: -18px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-inline: 4px;
  }

  .sidebar .brand strong { flex: 1; }

  .sidebar-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(255,255,255,.07);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .sidebar nav a { font-size: 13.5px; }

  .sidebar-backdrop {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(18,14,11,.48);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(3px);
    transition: opacity .2s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid var(--premium-border-strong);
    border-radius: 13px;
    background: #fff;
    color: var(--premium-text);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(50,37,27,.05);
  }

  .mobile-menu-toggle span,
  .mobile-menu-toggle span::before,
  .mobile-menu-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
  }

  .mobile-menu-toggle span { position: relative; }
  .mobile-menu-toggle span::before,
  .mobile-menu-toggle span::after { content: ""; position: absolute; left: 0; }
  .mobile-menu-toggle span::before { top: -6px; }
  .mobile-menu-toggle span::after { top: 6px; }

  .content { padding: 14px 14px 28px; }

  .topbar {
    top: 8px;
    min-height: 68px;
    padding: 12px;
    border-radius: 18px;
  }

  .topbar h1 { font-size: clamp(20px, 5vw, 26px); }
  .topbar p { font-size: 12.5px; }
}

@media (max-width: 680px) {
  .content { padding-inline: 12px; }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-actions .inline-form { flex: 0 0 auto; }
  .topbar-actions .btn { min-height: 38px; }
  .user-chip { max-width: calc(100% - 72px); }

  .cards { grid-template-columns: 1fr; gap: 12px; }
  .cards article { min-height: 112px; padding: 18px; }

  .panel { padding: 17px; border-radius: 20px; }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-title > .actions,
  .section-title > form,
  .section-title > .btn { width: 100%; }

  .section-title > .actions .btn,
  .section-title > form .btn,
  .section-title > .btn { width: 100%; }

  .toolbar { display: grid; padding: 12px; }
  .toolbar label,
  .toolbar .search,
  .toolbar .btn { width: 100%; min-width: 0; }

  .form-actions .btn,
  .quick-actions .btn,
  .quick-actions a { flex: 1 1 150px; }

  .data-table th,
  .data-table td { padding: 12px; }

  .auth-card { padding: 26px 22px; }
  .install-card { padding: 24px 18px; }

  .store-footer { align-items: flex-start; flex-direction: column; }
  .store-product-card { border-radius: 17px; }
  .store-cart { border-radius: 20px; }
}

@media (max-width: 430px) {
  body { font-size: 14px; }
  .topbar h1 { font-size: 21px; }
  .topbar p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .btn { width: 100%; }
  .inline-form .btn,
  .actions .btn,
  .topbar-actions .btn,
  .product-actions .btn,
  .cart-quantity button { width: auto; }
  .actions { width: 100%; }
  .actions > * { flex: 1 1 auto; }
  .product-row { grid-template-columns: 70px minmax(0,1fr); padding: 12px; }
  .product-thumb { width: 70px; height: 70px; }
  .product-actions { grid-column: 1 / -1; display: flex; justify-content: stretch; }
  .product-actions > * { flex: 1; }
}

/* Impresión: conservar formatos limpios */
@media print {
  body { background: #fff !important; }
  .panel,
  .cards article,
  .table-wrap { box-shadow: none !important; }
}
