﻿:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  --sidebar-width: clamp(194px, 14vw, 216px);
  --sidebar-width-collapsed: 68px;
  --space-2: clamp(6px, 0.6vw, 10px);
  --space-3: clamp(10px, 0.8vw, 14px);
  --space-4: clamp(12px, 1.1vw, 18px);
  --radius-md: 8px;
  --radius-lg: 12px;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;
  --pink-700: #be185d;
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-500: #f43f5e;
  --green-500: #16a34a;
  --red-500: #ef4444;
  --shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  overflow-x: auto;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.with-sidebar .top-header,
body.with-sidebar .shell {
  margin-left: var(--sidebar-width);
  transition: margin-left 180ms ease;
}

body.with-sidebar.sidebar-collapsed .top-header,
body.with-sidebar.sidebar-collapsed .shell {
  margin-left: var(--sidebar-width-collapsed);
}

button,
input,
select {
  border-radius: var(--radius-md);
  font: inherit;
}

button {
  border: 0;
  background: var(--pink-600);
  color: white;
  cursor: pointer;
  font-weight: 600;
  padding: 6px 10px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover:not(:disabled) {
  background: var(--pink-700);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

input,
select {
  background: #ffffff;
  border: 2px solid var(--pink-200);
  color: #1a1a1a;
  min-height: 32px;
  padding: 5px 8px;
  width: 100%;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(244, 114, 182, 0.18);
  outline-offset: 1px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.top-header {
  align-items: center;
  background: var(--pink-600);
  box-shadow: var(--shadow);
  color: white;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: var(--space-3);
  width: 100%;
}

.top-header h1 {
  font-size: clamp(18px, 2vw, 24px);
  margin-bottom: 4px;
}

.top-header .eyebrow {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.top-header .intro {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0;
  max-width: 706px;
}

.brand-block {
  min-width: 0;
}

.subcopy {
  margin-bottom: 0;
  opacity: 0.9;
}

.header-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

.header-client-tools {
  align-items: center;
  display: flex;
  gap: var(--space-2);
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

.header-client-tools input {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text);
  flex: 1;
  max-width: 288px;
}

.header-client-tools input::placeholder {
  color: #6b7280;
}

.header-client-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  grid-column: 1 / -1;
  min-height: 20px;
  min-width: 0;
  width: 100%;
}

.header-branch {
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 81px;
  max-width: min(158px, 100%);
  text-transform: uppercase;
}

.header-branch select {
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.28);
  margin-top: 6px;
  max-width: 100%;
  width: 100%;
}

.meta-pill {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.meta-pill--profile {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  color: white;
  min-height: 46px;
  padding: 6px 10px;
}

.meta-pill--compact {
  max-width: 158px;
}

.meta-pill__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.meta-pill__copy strong,
.meta-pill__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-pill__copy small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.connection-status {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  gap: 10px;
  min-height: 38px;
  padding: 8px 14px;
}

.connection-dot {
  background: #9ca3af;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.16);
  display: inline-block;
  height: 10px;
  width: 10px;
}

.connection-status.is-online .connection-dot {
  background: var(--green-500);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}

.connection-status.is-offline .connection-dot {
  background: var(--red-500);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}

.connection-status .connection-label {
  font-size: 13px;
  font-weight: 700;
}

.header-meta > *,
.header-client-status > * {
  flex: 0 1 auto;
  max-width: 100%;
}

.meta-icon {
  align-items: center;
  display: inline-flex;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.shell {
  display: grid;
  gap: var(--space-4);
  margin: 0 auto;
  max-width: 1030px;
  min-width: 0;
  padding: clamp(5px, 0.5vw, 9px);
  width: 100%;
}

.erp-sidebar {
  background: #111827;
  bottom: 0;
  box-shadow: var(--shadow);
  color: white;
  left: 0;
  padding: 12px 10px;
  position: fixed;
  top: 0;
  width: var(--sidebar-width);
  z-index: 90;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}

.erp-sidebar::-webkit-scrollbar {
  width: 10px;
}

.erp-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.erp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.erp-sidebar__backdrop {
  display: none;
}

.erp-sidebar-mobile-toggle {
  align-items: center;
  background: var(--pink-600);
  border-radius: 8px;
  bottom: 18px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  gap: 4px;
  height: 44px;
  justify-content: center;
  padding: 0;
  position: fixed;
  right: 18px;
  width: 44px;
  z-index: 110;
}

.erp-sidebar-mobile-toggle span {
  background: white;
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 20px;
}

.erp-sidebar__head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.erp-sidebar__brand {
  display: grid;
  gap: 4px;
}

.erp-sidebar__brand small {
  color: rgba(255, 255, 255, 0.72);
}

.erp-sidebar__toggle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  min-width: 34px;
  padding: 8px 0;
}

.erp-sidebar__nav {
  display: grid;
  gap: 8px;
}

.erp-sidebar__group {
  display: grid;
  gap: 8px;
}

.erp-sidebar__group summary {
  list-style: none;
}

.erp-sidebar__group summary::-webkit-details-marker {
  display: none;
}

.erp-sidebar__group-links {
  display: grid;
  gap: 8px;
  padding-left: 12px;
}

.erp-sidebar__link--nested {
  min-height: 34px;
}

.erp-sidebar__link {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  text-decoration: none;
}

.erp-sidebar__link:hover,
.erp-sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: white;
}

.erp-sidebar__icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0;
}

.erp-sidebar__icon svg {
  display: block;
  height: 18px;
  width: 18px;
}

body.sidebar-collapsed .erp-sidebar {
  width: var(--sidebar-width-collapsed);
}

body.sidebar-collapsed .erp-sidebar {
  padding-left: 6px;
  padding-right: 6px;
}

body.sidebar-collapsed .erp-sidebar__head {
  justify-content: center;
}

body.sidebar-collapsed .erp-sidebar__group-links {
  padding-left: 0;
}

.top-header,
.shell,
.status,
.header-meta,
.section-head,
.metric,
.catalog-item,
.panel-card,
.meta-pill,
.header-client-tools,
.header-client-status {
  min-width: 0;
}

.top-header h1,
.section-head h2,
.panel-head h2,
.meta-pill__copy strong,
.meta-pill__copy small,
.status-badge,
.cart-badge {
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  body.with-sidebar .top-header,
  body.with-sidebar .shell,
  body.with-sidebar.sidebar-collapsed .top-header,
  body.with-sidebar.sidebar-collapsed .shell {
    margin-left: 0;
  }

  .erp-sidebar {
    left: -100%;
    width: min(86vw, 320px);
    transition: left 180ms ease;
  }

  body.sidebar-open .erp-sidebar {
    left: 0;
  }

  .erp-sidebar__backdrop {
    display: block;
    inset: 0;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 24, 39, 0.3);
    border: 0;
    padding: 0;
  }

  .erp-sidebar-mobile-toggle {
    display: inline-flex;
  }

  .top-header {
    grid-template-columns: 1fr;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .top-header > div,
  .top-header .header-meta,
  .top-header .header-client-tools,
  .top-header .header-client-status,
  .header-branch,
  .meta-pill--profile,
  .connection-status {
    max-width: 100%;
    width: 100%;
  }
}

body.sidebar-collapsed .erp-sidebar__brand strong,
body.sidebar-collapsed .erp-sidebar__brand small,
body.sidebar-collapsed .erp-sidebar__label {
  display: none;
}

body.sidebar-collapsed .erp-sidebar__link {
  justify-content: center;
  padding: 8px 6px;
}

.erp-shortcuts,
.control-strip,
.module-tabs,
.kpi-grid,
.sales-layout,
.debug-panel {
  display: grid;
  gap: 16px;
}

.erp-shortcuts {
  align-items: center;
  grid-template-columns: repeat(7, auto) 1fr auto;
}

.erp-shortcuts a {
  color: var(--muted);
  text-decoration: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 12px;
  text-align: center;
}

.erp-shortcuts a:hover {
  border-color: var(--pink-200);
  color: var(--pink-600);
}

.control-strip {
  align-items: end;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  grid-template-columns: repeat(3, minmax(130px, 180px)) auto;
  padding: 16px;
}

.control-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.outline-button {
  background: white;
  border: 2px solid var(--pink-200);
  color: var(--muted);
}

.outline-button:hover:not(:disabled) {
  background: var(--pink-50);
  border-color: var(--pink-400);
  color: var(--pink-600);
}

.module-tabs {
  display: flex;
  gap: 8px;
}

.module-tab {
  align-items: center;
  background: white;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  gap: 8px;
  padding: 10px 18px;
}

.module-tab.active {
  background: var(--pink-600);
  border-color: var(--pink-600);
  color: white;
  box-shadow: var(--shadow);
}

.kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  padding: 18px;
}

.kpi-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.kpi-card strong {
  font-size: 32px;
}

.pink-card {
  background: linear-gradient(135deg, var(--pink-50), var(--pink-100));
  border-color: var(--pink-200);
}

.rose-card {
  background: linear-gradient(135deg, var(--rose-50), var(--rose-100));
  border-color: #fecdd3;
}

.kpi-icon {
  align-items: center;
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.pink-card .kpi-icon { background: var(--pink-500); }
.rose-card .kpi-icon { background: var(--rose-500); }

.module-panel { display: none; }
.module-panel.active { display: block; }

.sales-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(clamp(144px, 15.8vw, 178px), 0.54fr);
}

.panel-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.product-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 560px;
}

.panel-head,
.client-head,
.cart-title-row,
.cart-total-row,
.payment-total-block,
.client-search-row,
.client-create-row,
.client-action-row,
.payment-methods,
.payment-status-grid {
  align-items: center;
  display: flex;
  gap: 10px;
}

.panel-head,
.client-head,
.cart-title-row,
.cart-total-row,
.payment-total-block {
  justify-content: space-between;
}

.panel-head p,
.client-head p,
.panel-card p,
.tax-note,
.payment-hint {
  color: var(--muted);
}

.search-wrap {
  margin: 10px 0 14px;
  position: relative;
}

.search-wrap input {
  padding-left: 14px;
}

.product-scroll {
  min-height: 0;
  overflow-y: auto;
}

.product-group + .product-group {
  margin-top: 22px;
}

.product-group h3 {
  color: #4b5563;
  font-size: 14px;
  margin-bottom: 10px;
}

.products-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  margin-bottom: 10px;
}

.product-card,
.product-row,
.catalog-item,
.cart-item {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.product-card {
  background: white;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 160ms ease;
}

.product-card.promo-active {
  border-color: #f59e0b;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.2);
}

.product-card:hover,
.product-row:hover {
  box-shadow: var(--shadow);
}

.product-thumb {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: #9ca3af;
  display: flex;
  font-size: 38px;
  font-weight: 900;
  justify-content: center;
  position: relative;
}

.add-bubble {
  align-items: center;
  background: var(--pink-600);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
}

.product-card-body {
  padding: 12px;
}

.sku,
.inline-chip,
.cart-sku {
  background: #f3f4f6;
  border-radius: 6px;
  color: #6b7280;
  display: inline-flex;
  font-family: Consolas, monospace;
  font-size: 11px;
  padding: 3px 8px;
}

.product-name {
  display: block;
  font-weight: 600;
  margin: 8px 0 10px;
  min-height: 38px;
}

.product-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.inline-chip.highlight {
  background: #fef3c7;
  color: #b45309;
}

.price-stock {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.product-price,
.cart-item-total {
  color: var(--pink-600);
  font-size: 22px;
  font-weight: 800;
}

.product-row {
  align-items: center;
  background: white;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 10px;
  padding: 12px;
}

.product-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.inline-chip.category {
  font-family: inherit;
}

.product-row-bottom {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkout-column {
  display: grid;
  gap: 16px;
}

.box-actions-grid {
  grid-template-columns: repeat(2, 1fr);
}

.client-card,
.cart-card,
.payment-card {
  display: grid;
  gap: 14px;
}

.status-badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.status-badge.idle {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.status-badge.valid {
  background: #dcfce7;
  color: var(--green-500);
}

.status-badge.invalid {
  background: #fee2e2;
  color: var(--red-500);
}

.client-search-row input,
.client-create-row input {
  flex: 1;
}

.client-action-row {
  flex-wrap: wrap;
}

.catalog-list {
  display: grid;
  gap: 10px;
}

.catalog-item {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 12px;
}

.cart-summary {
  background: linear-gradient(90deg, var(--pink-50), var(--rose-50));
  border: 1px solid var(--pink-100);
  border-radius: 14px;
  padding: 14px;
}

.cart-badge,
.liters-pill {
  align-self: flex-start;
  background: var(--pink-100);
  border-radius: 999px;
  color: var(--pink-600);
  display: inline-flex;
  font-size: 12px;
  flex: 0 0 auto;
  font-weight: 700;
  line-height: 1.1;
  max-width: max-content;
  padding: 5px 10px;
  white-space: nowrap;
}

.cart-total-row {
  border-top: 1px solid var(--pink-100);
  margin-top: 10px;
  padding-top: 10px;
}

.cart-total-row strong {
  color: var(--pink-600);
  font-size: 32px;
}

.tax-note {
  font-size: 12px;
  margin-bottom: 0;
  text-align: right;
}

.cart-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.cart-mode {
  display: inline-flex;
  width: fit-content;
}

.cart-mode.regular {
  color: #1d4ed8;
}

.cart-mode.promo {
  color: var(--pink-700);
  font-weight: 700;
}

.empty-cart {
  color: #9ca3af;
  padding: 24px 12px;
  text-align: center;
}

.cart-item {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.cart-item-main {
  min-width: 0;
}

.cart-item-main strong {
  display: block;
  font-size: 14px;
  margin: 6px 0;
}

.cart-item-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qty-box {
  align-items: center;
  background: #f3f4f6;
  border-radius: 8px;
  display: flex;
  gap: 6px;
  padding: 4px;
}

.qty-box button {
  background: transparent;
  color: #4b5563;
  font-size: 16px;
  min-width: 28px;
  padding: 4px;
}

.qty-box button:hover:not(:disabled) {
  background: white;
  color: var(--pink-600);
}

.qty-box input {
  background: transparent;
  border: 0;
  min-height: 28px;
  text-align: center;
  width: 42px;
}

.remove-button {
  background: transparent;
  color: var(--red-500);
  padding: 6px;
}

.remove-button:hover:not(:disabled) {
  background: #fef2f2;
}

.payment-total-block {
  align-items: baseline;
}

.payment-total-block strong {
  color: #111827;
  display: block;
  font-size: 38px;
  text-align: right;
}

.payment-total-block small {
  color: var(--muted);
  display: block;
  text-align: right;
}

.payment-methods {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
}

.payment-method {
  background: white;
  border: 2px solid var(--pink-200);
  color: #4b5563;
  min-height: 76px;
}

.payment-method.active {
  background: var(--pink-50);
  border-color: var(--pink-600);
  color: var(--pink-600);
}

.payment-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.payment-status-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
  padding-top: 12px;
}

.payment-status-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.payment-status-grid strong {
  font-size: 24px;
}

.caja-goal {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.caja-goal__head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.caja-goal__head span,
.caja-goal__meta small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.caja-goal__head strong {
  display: block;
  font-size: 22px;
}

.caja-goal__head small {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.caja-goal__battery {
  background: #eceff3;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.caja-goal__fill {
  background: linear-gradient(90deg, #f9a8d4 0%, var(--pink-500) 48%, var(--pink-700) 100%);
  border-radius: inherit;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.caja-goal__fill.is-over {
  background: linear-gradient(90deg, #86efac 0%, #22c55e 100%);
}

.caja-goal__meta {
  display: grid;
  gap: 4px;
}

.sell-button {
  font-size: 18px;
  min-height: 56px;
  width: 100%;
}

.payment-hint {
  font-size: 13px;
  margin-bottom: 0;
  text-align: center;
}

#promoBanner {
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(17, 24, 39, 0.22);
}

.topbar #promoBanner,
.top-header #promoBanner {
  color: #ffffff;
}

select,
select option,
select:focus {
  background-color: #ffffff;
  color: #1a1a1a;
}

.quick-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(clamp(96px, 7.9vw, 115px), 1fr));
}

.quick-product {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #f3c6d9;
  border-radius: 8px;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  gap: 6px;
  justify-content: space-between;
  min-height: 118px;
  padding: 12px;
  text-align: left;
}

.quick-product strong {
  font-size: 15px;
  line-height: 1.2;
}

.quick-product small {
  font-size: 13px;
}

.quick-product:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.compact-layout {
  align-items: start;
}

.placeholder-card {
  align-items: center;
  background: white;
  border: 1px solid var(--pink-100);
  border-radius: 14px;
  color: #9ca3af;
  display: grid;
  min-height: 360px;
  padding: 20px;
  place-items: center;
  text-align: center;
}

.debug-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-shell {
  display: grid;
  gap: 12px;
}

.report-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-card__head {
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: white;
  padding: 22px 24px;
}

.report-card__body {
  padding: 22px 24px;
}

.report-table {
  border-collapse: collapse;
  margin-bottom: 20px;
  width: 100%;
}

.report-table th,
.report-table td {
  border: 1px solid var(--line);
  padding: 10px;
}

.report-table th {
  text-align: left;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.update-toast {
  align-items: center;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  bottom: 20px;
  box-shadow: var(--shadow);
  color: white;
  display: flex;
  gap: 14px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  position: fixed;
  right: 20px;
  width: calc(100vw - 32px);
  z-index: 180;
}

.update-toast__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.update-toast__copy strong,
.update-toast__copy small {
  overflow-wrap: anywhere;
}

.update-toast__copy small {
  color: rgba(255, 255, 255, 0.78);
}

.update-toast__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.update-toast__refresh,
.update-toast__dismiss {
  min-height: 40px;
  white-space: nowrap;
}

.update-toast__dismiss {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.update-toast__dismiss:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

pre {
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 12px;
  min-height: 120px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  body.with-sidebar .top-header,
  body.with-sidebar .shell,
  body.with-sidebar.sidebar-collapsed .top-header,
  body.with-sidebar.sidebar-collapsed .shell {
    margin-left: 0;
  }

  .erp-sidebar {
    left: 0;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    width: min(88vw, 300px);
  }

  body.sidebar-open .erp-sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .erp-sidebar {
    width: min(88vw, 300px);
  }

  .erp-sidebar__backdrop {
    background: rgba(17, 24, 39, 0.4);
    border: 0;
    display: block;
    inset: 0;
    position: fixed;
    z-index: -1;
  }

  .erp-sidebar-mobile-toggle {
    display: inline-flex;
  }

  .erp-shortcuts,
  .control-strip,
  .sales-layout,
  .payment-methods,
  .payment-grid,
  .debug-panel,
  .inventory-layout,
  .operacion-layout,
  .task-columns {
    grid-template-columns: 1fr 1fr;
  }

  .checkout-column {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .top-header,
  .header-meta,
  .header-client-tools,
  .header-client-status,
  .module-tabs,
  .control-actions,
  .client-search-row,
  .client-create-row,
  .client-action-row,
  .panel-head,
  .client-head,
  .cart-title-row,
  .payment-total-block {
    flex-direction: column;
    align-items: stretch;
  }

  .shell {
    padding: 16px;
  }

  .erp-shortcuts,
  .control-strip,
  .kpi-grid,
  .sales-layout,
  .payment-methods,
  .payment-grid,
  .payment-status-grid,
    .debug-panel,
    .catalog-item,
    .product-row,
    .cart-item,
    .inventory-layout,
    .operacion-layout,
    .task-columns {
    grid-template-columns: 1fr;
  }

  .inventory-table-wrap {
    display: none;
  }

  .inventory-card-list {
    display: grid;
  }

  .operational-alerts {
    flex-direction: column;
  }
}

/* Shared legacy page system for the rest of the ERP screens */

body:has(.topbar) {
  background:
    linear-gradient(180deg, var(--pink-600) 0 170px, var(--bg) 170px 100%);
}

.shell:has(.topbar) {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

.topbar {
  align-items: start;
  background: var(--pink-600);
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: white;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 20px;
  padding: clamp(18px, 2vw, 28px);
}

.operational-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

.operational-alert {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
}

.operational-alert.is-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(254, 202, 202, 0.4);
}

.operational-alert.is-warning {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(253, 230, 138, 0.35);
}

.topbar > div,
.topbar h1,
.topbar .intro,
.topbar .eyebrow {
  min-width: 0;
}

.topbar .eyebrow {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.05em;
  margin-bottom: 8px;
}

.topbar .intro {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0;
  max-width: 980px;
}

.status {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

body.with-sidebar .status a {
  display: none !important;
}

.admin-dropdown {
  display: block;
  min-height: 42px;
  overflow: visible;
  position: relative;
  visibility: visible;
  z-index: 70;
  opacity: 1;
}

.admin-dropdown__trigger {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: #1a1a1a;
  cursor: pointer;
  display: block;
  font-weight: 600;
  min-height: 42px;
  opacity: 1;
  padding: 10px 14px;
  visibility: visible;
  width: 100%;
}

.admin-dropdown__menu {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  gap: 8px;
  min-height: 56px;
  min-width: 220px;
  opacity: 1;
  overflow: visible;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  visibility: visible;
  z-index: 80;
}

.admin-dropdown__menu a {
  background: #ffffff;
  border: 1px solid var(--pink-100);
  border-radius: 8px;
  color: #222;
  display: block;
  min-height: 40px;
  opacity: 1;
  overflow: visible;
  padding: 10px 12px;
  position: relative;
  text-decoration: none;
  visibility: visible;
  z-index: 81;
}

.admin-dropdown__menu a:hover {
  background: white;
  border-color: var(--pink-400);
  color: var(--pink-600);
}

.status a,
.status button,
.button-link {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 10px 14px;
  text-decoration: none;
}

.status a:hover,
.status button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

.outline-button.button-link {
  background: white;
  border: 2px solid var(--pink-200);
  color: var(--muted);
}

.outline-button.button-link:hover {
  background: var(--pink-50);
  border-color: var(--pink-400);
  color: var(--pink-600);
}

body.with-sidebar .status button[data-logout] {
  min-height: 42px;
  white-space: normal;
}

.status > * {
  flex: 0 1 auto;
  max-width: 100%;
}

.header-branch--global {
  min-width: 140px;
}

.topbar,
.top-header {
  overflow: visible;
}

.topbar > div,
.topbar .status,
.top-header > div,
.top-header .header-meta,
.top-header .header-client-status {
  min-width: 0;
}

.user-avatar-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 56px;
  object-fit: cover;
  width: 56px;
}

.user-avatar-preview.is-inline {
  border-radius: 999px;
  flex: 0 0 auto;
  height: 32px;
  width: 32px;
}

.user-avatar-preview.is-empty {
  display: none;
}

.user-performance-card__identity {
  align-items: center;
  display: flex;
  gap: 12px;
}

.user-performance-card__identity > div {
  min-width: 0;
}

.compact-corte-grid {
  margin-bottom: 12px;
}

.endpoint-card,
.products,
.cart,
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 10px;
}

.endpoint-card,
.products,
.cart,
.grid,
.actions,
.login-grid,
.metrics-list,
.catalog-list {
  display: grid;
  gap: 10px;
}

.endpoint-card {
  margin-bottom: 12px;
}

.endpoint {
  color: var(--pink-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hint {
  color: var(--muted);
  margin-bottom: 0;
}

.section-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.section-head p {
  color: var(--muted);
}

.grid {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(clamp(240px, 26vw, 300px), 0.86fr);
}

.login-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.actions {
  grid-template-columns: repeat(auto-fit, minmax(150px, auto));
  align-items: end;
}

.actions input {
  min-width: 0;
}

.check-inline {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 10px;
  text-transform: none;
}

.check-inline input {
  min-height: 18px;
  width: 18px;
}

.checkbox-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.catalog-item,
.metric {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.catalog-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.metric {
  grid-template-columns: 1fr auto;
}

.catalog-item strong,
.metric strong {
  display: block;
  margin-bottom: 4px;
}

.catalog-item small,
.metric span {
  color: var(--muted);
}

.remove {
  background: var(--rose-500);
}

.remove:hover:not(:disabled) {
  background: #e11d48;
}

.sell {
  min-height: 52px;
}

.products h2,
.cart h2,
.endpoint-card h2,
.login-card h2 {
  margin-bottom: 6px;
}

.products > h2,
.cart > h2 {
  margin-bottom: 0;
}

.login-page {
  background: #f6f3f5;
  min-height: 100vh;
}

.login-hero {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  width: 100%;
}

.login-visual {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.login-visual-backdrop {
  background: url("/brand-login.png") center center / cover no-repeat;
  filter: blur(20px);
  inset: 0;
  position: absolute;
  transform: scale(1.08);
}

.login-visual-overlay {
  background: rgba(232, 46, 136, 0.15);
  inset: 0;
  position: absolute;
}

.login-visual-stage {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 0;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  z-index: 1;
}

.login-visual-card {
  align-items: center;
  display: flex;
  flex: 0 1 auto !important;
  justify-content: center;
  height: auto !important;
  max-height: 80vh !important;
  max-width: none !important;
  width: 80% !important;
}

.login-visual-image {
  display: block;
  height: 100% !important;
  max-height: none !important;
  max-width: none !important;
  object-fit: contain !important;
  width: 100% !important;
}

.refined-login-card {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 56px;
  width: 100%;
}

.login-status-row {
  margin-bottom: 28px;
}

.connection-status-chip {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: 999px;
  display: inline-flex;
  gap: 10px;
  min-height: 38px;
  padding: 6px 12px;
}

.connection-status-dot {
  background: #f59e0b;
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.connection-status-chip.is-online .connection-status-dot {
  background: #10b981;
}

.connection-status-chip.is-warning .connection-status-dot,
.connection-status-chip.is-loading .connection-status-dot {
  background: #f59e0b;
}

.connection-status-chip span:last-child {
  color: #4b5563;
  font-size: 14px;
}

.login-card-copy {
  margin-bottom: 32px;
  max-width: 520px;
}

.login-card-copy .eyebrow.subtle {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: none;
}

.login-card-copy h1 {
  color: #111827;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.04;
}

.login-card-copy .intro {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.7;
  max-width: 520px;
}

.accent-word {
  color: #e82e88;
}

.login-form-stack {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
  max-width: 520px;
}

.login-form-stack label {
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-form-stack input {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  min-height: 56px;
  padding: 14px 18px;
}

.login-form-stack input:focus {
  border-color: #e82e88;
  outline: 3px solid rgba(232, 46, 136, 0.14);
}

.login-submit {
  background: #e82e88;
  border-radius: 12px;
  min-height: 56px;
  width: 100%;
}

.login-submit:hover:not(:disabled) {
  background: #d1287a;
}

.login-pending-row {
  margin-top: 6px;
  max-width: 520px;
}

.login-pending-button {
  background: transparent;
  border: 0;
  color: #9ca3af;
  cursor: default;
  font-weight: 500;
  padding: 0;
}

.login-result {
  background: rgba(232, 46, 136, 0.05);
  border: 1px solid rgba(232, 46, 136, 0.1);
  border-radius: 18px;
  color: #374151;
  margin-top: 18px;
  max-width: 520px;
  min-height: 110px;
  padding: 16px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .topbar,
  .grid {
    grid-template-columns: 1fr;
  }

  .status {
    justify-content: start;
  }

  .login-hero {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .refined-login-card {
    min-height: 100vh;
    padding: 32px 22px;
    width: 100%;
  }

  .login-card-copy h1 {
    font-size: 40px;
  }
}

.app-modal[hidden] {
  display: none;
}

.app-modal {
  align-items: center;
  display: grid;
  inset: 0;
  padding: 16px;
  position: fixed;
  justify-items: center;
  z-index: 220;
}

.app-modal__backdrop {
  background: rgba(63, 31, 57, 0.5);
  inset: 0;
  position: absolute;
}

.app-modal__dialog {
  background: radial-gradient(ellipse at center, #fffafc 0%, #fde7f1 48%, #f5cddd 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-width: min(1160px, calc(100vw - 48px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  padding: clamp(20px, 2vw, 28px);
  position: relative;
  width: min(1160px, calc(100vw - 48px));
}

.app-modal__head,
.app-modal__actions,
.sale-summary__totals {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.app-modal__close {
  background: white;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--aqua-dark);
}

.app-modal__body {
  color: var(--ink);
  display: grid;
  gap: 14px;
  margin: 16px 0 18px;
  max-height: min(68vh, 640px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.app-modal__body p,
.app-modal__body ul {
  margin: 0;
}

.app-modal__body ul {
  color: var(--muted);
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.app-modal__body .catalog-list {
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

body.modal-open .erp-sidebar,
body.modal-open .erp-sidebar-mobile-toggle {
  opacity: 0.05;
  pointer-events: none;
}

.denomination-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.denomination-grid .catalog-item {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 92px;
}

.denomination-grid .catalog-item input {
  min-width: 0;
}

.corte-counter {
  display: grid;
  gap: clamp(16px, 2.2vw, 22px);
}

.corte-counter-group {
  display: grid;
  gap: 10px;
}

.corte-counter-group h3 {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.corte-counter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}

.corte-counter-card {
  align-items: center;
  background: #2a2a27;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #f8f7f3;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(72px, 92px) minmax(116px, 148px) minmax(52px, 72px);
  min-height: clamp(76px, 10vw, 92px);
  padding: clamp(12px, 1.5vw, 16px);
}

.corte-counter-card__head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.corte-counter-card__head strong {
  color: inherit;
  font-size: clamp(16px, 1.7vw, 18px);
}

.corte-counter-card__head small {
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(11px, 1.2vw, 12px);
}

.corte-counter-card__controls {
  align-items: center;
  display: grid;
  gap: clamp(6px, 0.8vw, 8px);
  grid-template-columns: 30px minmax(48px, 56px) 30px;
}

.corte-counter-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(214, 83, 126, 0.4);
  border-radius: 8px;
  color: var(--aqua);
  cursor: pointer;
  display: inline-flex;
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 700;
  height: 30px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 30px;
}

.corte-counter-btn:hover {
  background: rgba(214, 83, 126, 0.18);
}

.corte-counter-input.erp-input,
.corte-counter-input {
  appearance: textfield;
  background: linear-gradient(180deg, #fde7f1 0%, #f8c9dd 100%) !important;
  border-color: rgba(236, 72, 153, 0.48) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  color: #111827;
  font-size: clamp(14px, 1.5vw, 16px);
  height: 30px;
  margin: 0;
  min-width: 0;
  padding-inline: 8px;
  text-align: center;
}

.corte-counter-input.erp-input:focus,
.corte-counter-input:focus {
  background: linear-gradient(180deg, #feeaf4 0%, #f4b6d2 100%) !important;
  border-color: rgba(219, 39, 119, 0.65) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 0 0 3px rgba(212, 83, 126, 0.12);
  color: #111827;
}

.corte-counter-input::-webkit-outer-spin-button,
.corte-counter-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.corte-counter-card__amount {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(13px, 1.3vw, 14px);
  font-weight: 800;
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}

.corte-counter-total {
  align-items: center;
  background: rgba(17, 24, 39, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: clamp(14px, 1.8vw, 18px);
}

.corte-counter-total span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 700;
}

.corte-counter-total strong {
  font-size: clamp(24px, 3vw, 32px);
  white-space: nowrap;
}

.app-modal__actions {
  flex-wrap: wrap;
  margin-top: auto;
}

.branch-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.branch-card {
  align-items: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 18px;
  text-align: left;
}

.branch-card:hover:not(:disabled),
.branch-card.active {
  background: #fff0f6;
  border-color: var(--aqua);
  box-shadow: 0 14px 24px rgba(201, 63, 123, 0.18);
}

.branch-card__eyebrow {
  color: var(--aqua-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.branch-card strong {
  font-size: 20px;
}

.branch-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.sale-summary__totals {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.sale-summary__totals div {
  display: grid;
  gap: 4px;
}

.sale-summary__totals span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sale-summary__totals strong {
  color: var(--aqua-dark);
  font-size: 20px;
}

.app-modal__dialog--corte {
  max-width: min(1200px, calc(100vw - 36px));
  width: min(1200px, calc(100vw - 36px));
  padding: clamp(16px, 1.5vw, 22px);
}

.app-modal__dialog--corte .app-modal__body {
  margin: 10px 0 12px;
  max-height: none;
  overflow: hidden;
  padding-right: 0;
}

.app-modal__dialog--corte .corte-counter {
  align-items: start;
  grid-template-columns: 1fr;
  row-gap: 12px;
}

.app-modal__dialog--corte .corte-counter-group {
  gap: 6px;
}

.app-modal__dialog--corte .corte-counter-grid {
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-modal__dialog--corte .corte-counter-card {
  gap: 6px;
  grid-template-columns: 58px minmax(98px, 120px) 48px;
  min-height: 62px;
  padding: 8px 10px;
}

.app-modal__dialog--corte .corte-counter-card__head strong {
  font-size: 14px;
}

.app-modal__dialog--corte .corte-counter-card__head small {
  font-size: 10px;
}

.app-modal__dialog--corte .corte-counter-card__controls {
  gap: 6px;
  grid-template-columns: 28px minmax(44px, 52px) 28px;
}

.app-modal__dialog--corte .corte-counter-btn,
.app-modal__dialog--corte .corte-counter-input {
  height: 28px;
}

.app-modal__dialog--corte .corte-counter-btn {
  width: 28px;
}

.app-modal__dialog--corte .corte-counter-total {
  padding: 10px 14px;
}

@media (max-width: 760px) {
  .app-modal__dialog {
    border-radius: 18px;
    max-height: calc(100vh - 16px);
    padding: 18px;
    width: 100%;
  }

  .app-modal__head,
  .app-modal__actions,
  .sale-summary__totals {
    align-items: stretch;
    flex-direction: column;
  }

  .app-modal {
    padding: 8px;
  }

  .denomination-grid {
    grid-template-columns: 1fr;
  }

  .denomination-grid .catalog-item {
    grid-template-columns: 1fr;
  }

  .corte-counter-card {
    grid-template-columns: 1fr;
  }

  .corte-counter-card__controls,
  .corte-counter-total {
    grid-template-columns: 1fr;
  }

  .corte-counter-grid {
    grid-template-columns: 1fr;
  }

  .corte-counter-card__amount,
  .corte-counter-total strong {
    text-align: left;
  }
}

@media (max-width: 1100px) {
  .app-modal__dialog--corte .corte-counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  .corte-counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gestion-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.gestion-toolbar label {
  display: grid;
  gap: 8px;
}

.gestion-toolbar__actions {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.gestion-widget {
  --brand-pink: #d4537e;
  --fill-pink: #ed93b1;
  --fill-pink-soft: rgba(212, 83, 126, 0.11);
  --pos: #3b6d11;
  --neg: #a32d2d;
  --egresos: #d3d1c7;
  --margen: #1d9e75;
  --flujo: #378add;
  --trend: #f4c0d1;
  --promo: #fac775;
  --alerta: #e24b4a;
  color: var(--color-text-primary, #2d2030);
  font-family: var(--font-sans, system-ui, sans-serif);
  width: 100%;
}

.gestion-widget,
.gestion-widget * {
  box-sizing: border-box;
  font-family: var(--font-sans, system-ui, sans-serif);
}

.gestion-header {
  align-items: end;
  border-bottom: 0.5px solid var(--color-border-tertiary, rgba(137, 106, 139, 0.24));
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 0 0 12px;
}

.gestion-eyebrow {
  color: var(--color-text-secondary, #7a647a);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.gestion-title {
  color: var(--color-text-primary, #2d2030);
  font-size: 19px;
  font-weight: 500;
  margin: 0;
}

.gestion-range {
  color: var(--color-text-secondary, #7a647a);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
  white-space: nowrap;
}

.gestion-tabs {
  border-bottom: 0.5px solid var(--color-border-tertiary, rgba(137, 106, 139, 0.24));
  display: flex;
  gap: 6px;
  padding: 10px 0 8px;
}

.gestion-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--color-text-secondary, #7a647a);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 10px;
}

.gestion-tab:hover {
  background: var(--color-background-secondary, rgba(255, 240, 246, 0.7));
  color: var(--color-text-primary, #2d2030);
}

.gestion-tab.on {
  border-bottom-color: #d4537e;
  color: #d4537e;
  font-weight: 500;
}

.admin-tab-shell {
  padding-bottom: 10px;
}

.admin-tabs {
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-pane {
  display: block;
}

.gestion-pane {
  padding-top: 14px;
}

.gestion-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-bottom: 16px;
}

.gestion-kpi {
  background: var(--color-background-secondary, rgba(255, 240, 246, 0.55));
  border-radius: var(--border-radius-md, 12px);
  padding: 12px 14px;
}

.gestion-kpi-label {
  color: var(--color-text-secondary, #7a647a);
  font-size: 12px;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
}

.gestion-kpi-value {
  color: var(--color-text-primary, #2d2030);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 4px;
}

.gestion-kpi-sub {
  color: var(--color-text-secondary, #7a647a);
  font-size: 12px;
  margin: 0;
}

.gestion-grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.gestion-block {
  min-width: 0;
}

.gestion-h {
  color: var(--color-text-primary, #2d2030);
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
}

.gestion-legend {
  color: var(--color-text-secondary, #7a647a);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  margin: 0 0 8px;
}

.gestion-legend-item {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.gestion-swatch {
  border-radius: 2px;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.gestion-line {
  border-top-style: solid;
  border-top-width: 2px;
  display: inline-block;
  height: 0;
  width: 18px;
}

.gestion-chart {
  height: 240px;
  position: relative;
}

.gestion-chart.h270 {
  height: 270px;
}

.gestion-chart.h165 {
  height: 165px;
}

.gestion-chart.h210 {
  height: 210px;
  margin-bottom: 22px;
}

.gestion-scroll-x {
  overflow-x: auto;
}

.gestion-scroll-y {
  max-height: 340px;
  overflow-x: auto;
  overflow-y: auto;
}

.gestion-table {
  border-collapse: collapse;
  font-size: 13.5px;
  width: 100%;
}

.gestion-table th {
  background: var(--color-background-secondary, rgba(255, 240, 246, 0.55));
  border-bottom: 0.5px solid var(--color-border-tertiary, rgba(137, 106, 139, 0.24));
  color: var(--color-text-secondary, #7a647a);
  font-weight: 500;
  padding: 7px 10px;
  text-align: left;
  white-space: nowrap;
}

.gestion-table td {
  border-bottom: 0.5px solid var(--color-border-tertiary, rgba(137, 106, 139, 0.24));
  padding: 6px 10px;
  vertical-align: top;
  white-space: nowrap;
}

.gestion-table tr:hover td {
  background: var(--color-background-secondary, rgba(255, 240, 246, 0.55));
}

.gestion-date-sub {
  color: var(--color-text-secondary, #7a647a);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.gestion-badge {
  border-radius: 10px;
  display: inline-flex;
  font-size: 12px;
  padding: 2px 7px;
}

.gestion-badge.red {
  background: #fcebeb;
  color: #a32d2d;
}

.gestion-badge.green {
  background: #eaf3de;
  color: #3b6d11;
}

.gestion-tfoot td {
  font-weight: 500;
}

.gestion-tfoot .sep td {
  border-top: 0.5px solid var(--color-border-secondary, var(--color-border-tertiary, rgba(137, 106, 139, 0.24)));
}

.gestion-widget .neg {
  color: #a32d2d !important;
}

.gestion-widget .pos {
  color: #3b6d11 !important;
}

.inventory-layout {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(clamp(180px, 20vw, 230px), 0.72fr) minmax(0, 1.08fr);
}

.inventory-toolbar,
.inventory-kpis,
.comparison-grid,
.operacion-layout,
.operacion-kpis,
.task-columns,
.task-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.inventory-toolbar,
.inventory-kpis,
.operacion-kpis {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.inventory-kpi {
  background: rgba(252, 231, 243, 0.8);
  border: 1px solid var(--pink-100);
  border-radius: 10px;
  padding: 10px;
}

.inventory-kpi strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.inventory-table-wrap {
  overflow: auto;
}

.inventory-table {
  border-collapse: collapse;
  width: 100%;
}

.inventory-table th,
.inventory-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

.inventory-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.inventory-table tbody tr:hover {
  background: var(--pink-50);
}

.stock-state {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
}

.stock-state.ok {
  background: #dcfce7;
  color: #166534;
}

.stock-state.low {
  background: #fef3c7;
  color: #b45309;
}

.stock-state.out {
  background: #fee2e2;
  color: #b91c1c;
}

.inventory-card-list {
  display: none;
  gap: 12px;
}

.inventory-mobile-card,
.task-card,
.audit-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-card .inventory-actions {
  align-items: flex-start;
}

.task-card .inventory-actions > * {
  width: auto;
}

.comparison-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.comparison-chip {
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 10px;
  padding: 10px;
}

.operacion-layout {
  align-items: start;
  gap: clamp(8px, 1vw, 12px);
  grid-template-columns: minmax(0, 1.05fr) minmax(clamp(200px, 22vw, 280px), 0.72fr);
}

.task-columns {
  gap: clamp(8px, 0.8vw, 12px);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.task-column {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  min-height: 240px;
  padding: clamp(8px, 0.8vw, 12px);
}

.task-card.is-critical {
  border-color: rgba(239, 68, 68, 0.35);
}

.task-card.is-complete {
  background: #f0fdf4;
}

.task-card.is-late,
.task-card.is-missed {
  background: #fff7ed;
}

.users-role-grid,
.user-performance-card__chips,
.user-performance-card__metrics,
.user-performance-card__side,
.users-overview {
  display: grid;
  gap: 12px;
}

.users-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 10px;
}

.user-performance-card {
  align-items: start;
  gap: 10px;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.65fr);
}

.user-performance-card__main,
.user-performance-card__side {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.user-performance-card__chips,
.user-performance-card__metrics {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.user-performance-card__side {
  justify-items: start;
  padding-left: 8px;
}

.operacion-guide {
  margin-bottom: 12px;
}

.operacion-photo-preview {
  align-items: center;
  background: #fff;
  border: 1px solid var(--pink-100);
  border-radius: 10px;
  display: grid;
  justify-items: center;
  min-height: 140px;
  overflow: hidden;
  padding: 10px;
}

.operacion-photo-preview img {
  border-radius: 10px;
  display: block;
  max-height: min(42vh, 280px);
  max-width: 100%;
  object-fit: contain;
}

.operacion-photo-preview--control {
  margin-top: 8px;
  max-width: min(100%, 320px);
}

@media (max-width: 900px) {
  .user-performance-card {
    grid-template-columns: 1fr;
  }

  .user-performance-card__side {
    padding-left: 0;
  }
}

.progress-shell {
  background: #f3f4f6;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--pink-500), var(--pink-600));
  height: 100%;
  width: 0;
}

@media (max-width: 860px) {
  .gestion-grid-2 {
    grid-template-columns: 1fr;
  }

  .gestion-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .gestion-range {
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .gestion-toolbar {
    grid-template-columns: 1fr;
  }

  .gestion-toolbar__actions {
    justify-content: stretch;
  }

  .gestion-toolbar__actions button {
    flex: 1 1 auto;
  }
}

/* Final responsive and header hardening overrides */

.topbar,
.top-header {
  max-width: 100%;
  overflow: visible;
  width: 100%;
}

.topbar > div,
.topbar .status,
.top-header > div,
.top-header .header-meta,
.top-header .header-client-status,
.top-header .header-client-tools,
.status,
.header-meta,
.header-client-tools,
.header-client-status,
.section-head,
.inventory-actions,
.catalog-item,
.metric,
.meta-pill,
.meta-pill__copy,
.user-performance-card__identity > div {
  min-width: 0;
}

.topbar .intro,
.topbar h1,
.meta-pill__copy strong,
.meta-pill__copy small,
.section-head h2,
.section-head p {
  overflow-wrap: anywhere;
}

.catalog-item--inventory-config {
  align-items: end;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(96px, 0.7fr)) minmax(96px, auto);
}

.catalog-item--inventory-config label {
  min-width: 0;
}

@media (max-width: 1200px) {
  .top-header,
  .topbar {
    grid-template-columns: 1fr;
  }

  .header-meta,
  .status {
    justify-content: flex-start;
  }

  .topbar > div,
  .topbar .status,
  .header-client-tools,
  .header-client-status {
    width: 100%;
  }

  .header-branch,
  .header-branch--global,
  .meta-pill--compact,
  .connection-status {
    max-width: 100%;
    width: 100%;
  }

  .catalog-item--inventory-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .sales-layout,
  .grid,
  .inventory-layout,
  .operacion-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .catalog-item--inventory-config,
  .section-head {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .status,
  .header-meta,
  .header-client-tools,
  .header-client-status {
    align-items: stretch;
    flex-direction: column;
  }

  .status > *,
  .header-meta > *,
  .header-client-tools > * {
    max-width: 100%;
    width: 100%;
  }

  .topbar {
    border-radius: 16px;
    padding: 18px;
  }

  .catalog-item,
  .metric {
    grid-template-columns: 1fr;
  }

  .update-toast {
    align-items: stretch;
    flex-direction: column;
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 24px);
  }

  .update-toast__actions {
    width: 100%;
  }

  .update-toast__actions button {
    flex: 1 1 auto;
  }
}

/* Cross-screen responsive finish */

.topbar,
.endpoint-card,
.panel-card,
.cart,
.products,
.grid,
.login-grid,
.inventory-toolbar,
.inventory-actions,
.actions,
.section-head,
.catalog-list,
.inventory-table-wrap,
.table-responsive,
.admin-pane,
.module-tabs,
.gestion-tabs,
.gestion-toolbar,
.control-strip,
.erp-shortcuts,
.kpi-grid,
.users-overview,
.task-columns,
.sales-layout {
  max-width: 100%;
  min-width: 0;
}

.topbar,
.status,
.header-meta,
.section-head,
.inventory-actions,
.actions,
.module-tabs,
.gestion-tabs,
.erp-shortcuts,
.control-actions {
  flex-wrap: wrap;
}

.topbar h1,
.topbar .intro,
.top-header h1,
.subcopy,
.section-head h2,
.section-head p,
.endpoint,
.hint,
.meta-pill__copy strong,
.meta-pill__copy small,
.catalog-item strong,
.catalog-item small,
.product-name,
.cart-item,
.kpi-card strong,
.kpi-card p,
th,
td,
label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.grid,
.login-grid,
.inventory-toolbar,
.users-overview,
.task-columns,
.kpi-grid,
.gestion-grid-2 {
  display: grid;
  gap: var(--space-3);
}

.inventory-table-wrap,
.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.inventory-table,
table {
  width: 100%;
}

@media (max-width: 1280px) {
  .sales-layout,
  .grid,
  .users-overview,
  .task-columns {
    grid-template-columns: 1fr;
  }

  .control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1480px) {
  .sales-layout,
  .grid,
  .inventory-layout,
  .operacion-layout,
  .crm-dashboard-grid,
  .crm-layout,
  .users-overview {
    grid-template-columns: 1fr;
  }

  .header-meta,
  .status,
  .inventory-actions,
  .control-actions,
  .crm-toolbar__actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .status > *,
  .inventory-actions > *,
  .control-actions > *,
  .crm-toolbar__actions > * {
    max-width: 100%;
  }
}

@media (max-width: 960px) {
  .login-grid,
  .inventory-toolbar,
  .erp-shortcuts,
  .kpi-grid,
  .box-actions-grid {
    grid-template-columns: 1fr 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .module-tabs,
  .gestion-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .module-tab,
  .gestion-tab {
    flex: 0 0 auto;
  }
}

@media (max-width: 720px) {
  .login-grid,
  .inventory-toolbar,
  .erp-shortcuts,
  .kpi-grid,
  .box-actions-grid,
  .control-strip,
  .products-grid,
  .catalog-item--inventory-config {
    grid-template-columns: 1fr;
  }

  .status,
  .inventory-actions,
  .actions,
  .control-actions,
  .panel-head,
  .client-head,
  .cart-title-row,
  .cart-total-row,
  .payment-total-block,
  .client-search-row,
  .client-create-row,
  .client-action-row,
  .payment-methods,
  .payment-status-grid {
    align-items: stretch;
    flex-direction: column;
  }

  .status > *,
  .inventory-actions > *,
  .actions > *,
  .control-actions > *,
  .panel-head > *,
  .client-head > *,
  .cart-title-row > *,
  .cart-total-row > *,
  .payment-total-block > * {
    max-width: 100%;
    width: 100%;
  }

  .catalog-item,
  .product-row,
  .cart-item,
  .user-performance-card {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1600px) {
  .shell {
    max-width: 1820px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.modal-shell {
  inset: 0;
  position: fixed;
  z-index: 160;
}

.modal-backdrop {
  background: rgba(17, 24, 39, 0.45);
  border: 0;
  inset: 0;
  position: absolute;
  width: 100%;
  height: 100%;
}

.modal-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  left: 50%;
  max-height: min(88vh, 920px);
  max-width: min(92vw, 760px);
  overflow: auto;
  padding: 20px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
}

.modal-card--wide {
  max-width: min(94vw, 1040px);
}

.report-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  max-height: 62vh;
  overflow: auto;
  padding: 16px;
}

.crm-shell {
  gap: 18px;
}

.crm-tabs .module-tab.active {
  background: var(--pink-600);
  color: white;
}

.crm-filter-strip,
.crm-toolbar {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  padding: 10px;
}

.crm-inline-note,
.crm-toolbar__actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-inline-note {
  color: var(--muted);
}

.crm-dashboard-grid,
.crm-layout {
  align-items: start;
  display: grid;
  gap: clamp(8px, 1vw, 12px);
  grid-template-columns: minmax(0, 1.02fr) minmax(clamp(200px, 22vw, 240px), 0.68fr);
}

.crm-table-card {
  align-content: start;
  display: grid;
  gap: 14px;
  grid-auto-rows: max-content;
}

.crm-segment-grid,
.crm-registrar-list,
.crm-trend-list,
.crm-rule-list,
.crm-card-list,
.crm-purchase-list,
.crm-profile-grid {
  display: grid;
  gap: 12px;
}

.crm-segment-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.crm-segment-card,
.crm-trend-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.crm-segment-card__head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.crm-segment-card p,
.crm-segment-card small,
.crm-trend-item span,
.muted-copy {
  color: var(--muted);
}

.crm-table-wrap {
  display: block;
  min-height: 0;
  overflow: auto;
}

.crm-table {
  border-collapse: collapse;
  width: 100%;
}

.crm-table th,
.crm-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.crm-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.crm-table tbody tr:hover {
  background: rgba(252, 231, 243, 0.4);
}

.crm-table tbody tr.is-selected {
  background: rgba(251, 207, 232, 0.38);
}

.crm-cell-main {
  display: grid;
  gap: 4px;
}

.crm-cell-main small {
  color: var(--muted);
}

.crm-chip {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}

.segment-purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.segment-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.segment-orange,
.warning {
  background: #ffedd5;
  color: #c2410c;
}

.segment-red {
  background: #fee2e2;
  color: #b91c1c;
}

.segment-green,
.success {
  background: #dcfce7;
  color: #15803d;
}

.segment-yellow,
.muted {
  background: #fef3c7;
  color: #a16207;
}

.crm-mini-bar {
  background: #f3f4f6;
  border-radius: 999px;
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
}

.crm-mini-bar span {
  background: var(--pink-500);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.crm-profile-card textarea {
  min-height: 96px;
  resize: vertical;
}

.crm-activity-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.crm-subcard {
  padding: 14px;
}

.crm-inline-form {
  display: grid;
  gap: clamp(10px, 1vw, 14px);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 14px;
}

.crm-inline-form .crm-full {
  grid-column: 1 / -1;
}

.crm-check {
  align-items: center;
  display: flex;
  gap: 8px;
}

.crm-stack-list {
  display: grid;
  gap: 10px;
}

.crm-stack-item {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.crm-stack-item__head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.crm-stack-item__meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.crm-stack-item p {
  margin: 0;
}

.crm-result-banner {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  margin-top: 14px;
  min-height: 44px;
  padding: 12px 14px;
  white-space: normal;
}

.crm-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.crm-profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.crm-profile-card,
.crm-table-card,
.crm-subcard,
.crm-filter-strip,
.crm-toolbar {
  padding: clamp(14px, 1.4vw, 20px);
}

.crm-table-card,
.crm-profile-card {
  align-self: start;
}

.crm-activity-grid {
  gap: clamp(12px, 1.2vw, 16px);
}

.crm-metric-end {
  display: grid;
  justify-items: end;
  text-align: right;
}

@media (max-width: 1100px) {
  .crm-dashboard-grid,
  .crm-layout {
    grid-template-columns: 1fr;
  }

  .operacion-layout,
  .task-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .crm-table-wrap {
    display: none;
  }

  .crm-card-list {
    display: grid;
  }

  .operacion-layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 961px) {
  .crm-card-list {
    display: none;
  }
}

@media (max-width: 720px) {
  .crm-filter-strip,
  .crm-toolbar,
  .crm-inline-form,
  .operacion-kpis,
  .inventory-toolbar {
    grid-template-columns: 1fr;
  }

  .task-card .inventory-actions {
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
  }

  .task-card .inventory-actions > * {
    max-width: 100%;
    width: auto;
  }
}

@media (min-width: 961px) {
  .crm-table-wrap {
    display: block !important;
  }

  .crm-card-list {
    display: none !important;
  }
}

/* Canonical width profile based on Cortes + Indicadores */

body.page-canonical-shell {
  background: var(--bg);
}

body.page-canonical-shell .shell {
  max-width: 1030px;
  padding: clamp(5px, 0.5vw, 9px);
}

body.page-canonical-shell .topbar,
body.page-canonical-shell .top-header {
  border-radius: 0;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 auto;
  max-width: 1030px;
  padding: var(--space-3);
  width: 100%;
}

body.page-canonical-shell .topbar h1,
body.page-canonical-shell .top-header h1 {
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0;
  margin-bottom: 4px;
}

body.page-canonical-shell .topbar .intro,
body.page-canonical-shell .top-header .intro {
  max-width: 600px;
}

body.page-canonical-shell .topbar .status,
body.page-canonical-shell .topbar .header-meta,
body.page-canonical-shell .topbar .header-client-tools,
body.page-canonical-shell .topbar .header-client-status,
body.page-canonical-shell .top-header .header-meta,
body.page-canonical-shell .top-header .header-client-tools,
body.page-canonical-shell .top-header .header-client-status {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

body.page-canonical-shell .topbar .header-meta,
body.page-canonical-shell .topbar .header-client-tools,
body.page-canonical-shell .topbar .header-client-status {
  min-width: 0;
  width: 100%;
}

body.page-canonical-shell .endpoint-card,
body.page-canonical-shell .panel-card,
body.page-canonical-shell .products,
body.page-canonical-shell .cart,
body.page-canonical-shell .admin-tab-shell {
  max-width: 100%;
}

body.page-clientes .crm-shell {
  gap: 12px;
}

body.page-clientes .topbar .header-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-start;
}

body.page-clientes .crm-dashboard-grid,
body.page-clientes .crm-layout,
body.page-clientes .crm-activity-grid {
  grid-template-columns: 1fr;
}

body.page-operacion .operacion-layout {
  grid-template-columns: 1fr;
}

body.page-operacion .task-columns {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

body.page-operacion .products,
body.page-operacion .cart {
  padding: 10px;
}

body.page-inventario .inventory-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

body.page-admin .grid {
  grid-template-columns: 1fr;
}

body.page-admin .login-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

body.page-admin .products,
body.page-admin .cart,
body.page-admin .endpoint-card {
  padding: 10px;
}

body.page-pos .sales-layout {
  grid-template-columns: minmax(0, 1fr) minmax(clamp(136px, 15vw, 170px), 0.5fr);
}

body.page-pos .checkout-column {
  gap: 10px;
}

body.page-pos .topbar .header-meta {
  align-items: end;
  display: grid;
  gap: var(--space-2);
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

body.page-pos .topbar .header-client-tools,
body.page-pos .topbar .header-client-status {
  grid-column: 1 / -1;
}

body.page-pos .topbar .header-client-tools {
  align-items: center;
  display: grid;
  gap: var(--space-2);
  grid-template-columns: minmax(0, 288px) auto;
}

body.page-pos .topbar .header-client-tools input {
  max-width: 288px;
}

body.page-pos .topbar .header-client-status {
  min-height: 0;
}
