@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");
:root {
  --navy: #173958;
  --blue: #245f8d;
  --blue-2: #357aa8;
  --sky: #dcecf6;
  --mist: #f3f7fa;
  --line: #dce5ec;
  --ink: #172431;
  --muted: #667887;
  --white: #fff;
  --green: #28785c;
  --green-bg: #e6f4ee;
  --amber: #854807;
  --amber-bg: #fff0d9;
  --red: #a23b46;
  --red-bg: #fbe8ea;
  --shadow: 0 12px 34px rgba(30, 63, 88, 0.09);
  --radius: 18px;
  --control-height: 48px;
  --large-control-height: 54px;
  --compact-control-height: 36px;
  --touch-target: 44px;
}
* {
  box-sizing: border-box;
}
[hidden]:not([hidden="until-found"]) {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--mist);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.45;
}
h1,
h2,
h3,
strong {
  font-family: "Manrope", "DM Sans", sans-serif;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.08;
  margin: 0.15rem 0 0.5rem;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
h3 {
  margin: 0.35rem 0;
}
p {
  margin: 0.35rem 0;
  color: var(--muted);
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 11px;
  padding: 0.78rem 0.9rem;
  outline: none;
  transition: 0.18s;
}
input,
select {
  min-height: var(--control-height);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(53, 122, 168, 0.13);
}
:where(a, button, input, select, textarea, label[for]):focus-visible {
  outline: 3px solid rgba(53, 122, 168, 0.24);
  outline-offset: 2px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #435565;
}
label small {
  font-weight: 400;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  font-weight: 800;
  color: var(--blue-2);
  margin: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 11px;
  padding: 0.73rem 1rem;
  min-height: var(--control-height);
  font-weight: 700;
  white-space: nowrap;
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.18s;
}
.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 7px 18px rgba(36, 95, 141, 0.18);
}
.btn-primary:hover {
  background: var(--navy);
}
.btn-soft {
  background: var(--sky);
  color: var(--navy);
}
.btn-soft:hover {
  background: #c9e1f0;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}
.btn-danger:hover {
  background: #f5d5d9;
}
.btn-large {
  padding: 0.95rem 1.3rem;
  min-height: var(--large-control-height);
}
.btn-small {
  padding: 0.45rem 0.7rem;
  min-height: var(--compact-control-height);
  font-size: 0.82rem;
}
.btn-full {
  width: 100%;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--compact-control-height);
  width: var(--compact-control-height);
  min-width: var(--compact-control-height);
  height: var(--compact-control-height);
  min-height: var(--compact-control-height);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--sky);
  color: var(--navy);
  font-size: 1.2rem;
  line-height: 1;
}
.icon-button-danger {
  background: var(--red-bg);
  color: var(--red);
}
.admin-body {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--navy);
  color: white;
  padding: 1.2rem 0.9rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.3rem 0.55rem 1.1rem;
  font-weight: 800;
}
.sidebar-brand-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.sidebar-business-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-brand small {
  display: block;
  font-family: "DM Sans";
  font-weight: 400;
  color: #a9c4d8;
  font-size: 0.72rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #e6f0f6;
  color: var(--navy);
  border-radius: 12px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  overflow: auto;
  gap: 0.12rem;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: var(--touch-target);
  color: #dbe9f3;
  padding: 0.6rem 0.7rem;
  border-radius: 9px;
  font-size: 0.88rem;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: white;
}
.sidebar nav .nav-primary {
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.nav-label {
  text-transform: uppercase;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  color: #799bb4;
  margin: 1rem 0.7rem 0.25rem;
}
.sidebar-logout {
  margin-top: auto;
  padding: 0.8rem 0.6rem 0;
}
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  border: 0;
  background: none;
  color: #bdd2e0;
  padding: 0;
}
.admin-shell {
  margin-left: 240px;
  min-height: 100vh;
}
.topbar {
  height: 68px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.topbar-page {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: baseline;
  gap: 0.6rem;
}
.topbar-page > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-help {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.6rem;
  margin-left: 1rem;
}
.cash-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 34px;
  padding: 0.42rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.cash-status:hover {
  filter: brightness(0.97);
}
.cash-status:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.cash-status-open {
  border-color: #b9dfc9;
  background: var(--green-bg);
  color: var(--green);
}
.cash-status-closed {
  border-color: #efc3c8;
  background: var(--red-bg);
  color: var(--red);
}
.cash-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
}
.user-chip {
  background: var(--sky);
  color: var(--navy);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.menu-button,
.nav-toggle,
.nav-backdrop {
  display: none;
}
.content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.7rem 2rem 4rem;
}
.flash {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.flash-success {
  background: var(--green-bg);
  color: var(--green);
}
.flash-error {
  background: var(--red-bg);
  color: var(--red);
}
.flash-warning {
  background: var(--amber-bg);
  color: var(--amber);
}
.hero-panel {
  border-radius: 24px;
  background: linear-gradient(115deg, #dcecf6, #edf5f8);
  padding: 1.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}
.hero-panel p {
  max-width: 580px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.metric-grid.six {
  grid-template-columns: repeat(6, 1fr);
}
.metric-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  min-width: 0;
}
.metric-card.accent {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
.metric-card.accent span,
.metric-card.accent small {
  color: #cfe1ec;
}
.metric-card strong {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  display: block;
  margin: 0.4rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.status-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 1rem;
  color: var(--ink);
}
.status-card > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.status-card.warning > span {
  background: var(--amber-bg);
  color: var(--amber);
}
.status-card.ok > span {
  background: var(--green-bg);
  color: var(--green);
}
.status-card div {
  display: flex;
  flex-direction: column;
}
.status-card small {
  color: var(--muted);
}
.status-card b {
  margin-left: auto;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin: 1rem 0;
}
.quick-actions a {
  display: flex;
  align-items: center;
  min-height: 52px;
  background: white;
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  color: var(--navy);
}
.panel {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 4px 18px rgba(30, 63, 88, 0.035);
}
.two-columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.two-columns.uneven {
  grid-template-columns: 0.75fr 1.7fr;
}
.panel-head,
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.panel-head {
  margin-bottom: 0.8rem;
}
.page-head {
  margin-bottom: 1.3rem;
}
.page-head.compact {
  margin-bottom: 0.8rem;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.table-wrap {
  overflow: auto;
}
.panel.table-wrap {
  padding: 0;
}
.pagination-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.panel > .pagination-shell {
  margin-bottom: -0.35rem;
  padding-inline: 0;
  border-top: 1px solid var(--line);
}
.pagination-summary {
  margin: 0;
  white-space: nowrap;
}
.pagination-summary strong {
  color: var(--navy);
}
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pagination-nav a,
.pagination-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--navy);
  font-weight: 800;
}
.pagination-nav a:hover {
  border-color: var(--blue-2);
  color: var(--blue);
}
.pagination-nav .current {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}
.pagination-nav .disabled,
.pagination-nav .ellipsis {
  border-color: transparent;
  background: transparent;
  color: #8d9aa4;
}
.pagination-nav .disabled {
  opacity: 0.65;
}
.public-pagination {
  margin-top: 1.4rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.87rem;
}
th {
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 0.82rem 1rem;
  border-bottom: 1px solid #edf2f5;
  vertical-align: middle;
}
tfoot td {
  font-weight: 800;
  background: #f6f9fb;
}
.table-sub {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}
.row-inactive {
  opacity: 0.55;
}
.badge {
  display: inline-flex;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge-ok {
  background: var(--green-bg);
  color: var(--green);
}
.badge-warn {
  background: var(--amber-bg);
  color: var(--amber);
}
.badge-muted {
  background: #edf1f4;
  color: #687581;
}
.badge-blue {
  background: var(--sky);
  color: var(--blue);
}
.badge-offer {
  background: #e8e1f8;
  color: #68459b;
}
.positive {
  color: var(--green);
}
.negative {
  color: var(--red);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}
.list-rows > a,
.account-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #edf2f5;
  color: var(--ink);
}
.list-rows span,
.account-list span {
  display: flex;
  flex-direction: column;
}
.list-rows small,
.account-list small {
  color: var(--muted);
}
.account-list .void {
  text-decoration: line-through;
  opacity: 0.45;
}
.filters,
.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
  align-items: flex-end;
}
.filters .filter-field {
  flex: 0 1 230px;
  min-width: 0;
}
.filters .filter-search {
  flex: 1 1 280px;
  max-width: 360px;
}
.sales-filters .filter-field:not(.filter-search) {
  flex-basis: 160px;
}
.sales-filters .filter-field:last-of-type {
  flex-basis: 230px;
}
.period-tabs button,
.period-tabs a {
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 0.55rem 0.8rem;
  min-height: var(--touch-target);
  color: var(--navy);
  font-weight: 700;
}
.period-tabs button.active {
  background: var(--navy);
  color: white;
}
.period-tabs input {
  max-width: 160px;
  min-height: var(--touch-target);
}
.period-tabs label {
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.form-layout,
.settings-grid,
.purchase-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.settings-grid {
  grid-template-columns: 1fr 1fr;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-grid h2 {
  grid-column: 1/-1;
  margin: 0;
}
.span-2 {
  grid-column: 1/-1;
}
.product-promotion-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-body .panel.product-promotion-panel {
  border-color: #8bc4a0;
  background: linear-gradient(135deg, #edf8ef 0%, #f7fcf8 58%, #eaf6ed 100%);
  box-shadow: 0 8px 24px rgba(57, 116, 76, 0.12);
}
.admin-body .panel.form-grid.product-promotion-panel > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  border-bottom-color: #add5b8;
  color: #245e3a;
}
.product-promotion-kind {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #a4d0ae;
  border-radius: 999px;
  background: #dfefe2;
  color: #286443;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.product-promotion-kind::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #4c9562;
  content: "";
}
.admin-body .product-promotion-panel label {
  color: #315d40;
}
.admin-body .product-promotion-panel input {
  border-color: #a8c9b1;
  background: rgba(255, 255, 255, 0.96);
}
.admin-body .product-promotion-panel input:focus {
  border-color: #569a6a;
  box-shadow: 0 0 0 3px rgba(86, 154, 106, 0.19);
}
.product-promotion-help {
  grid-column: 1/-1;
  margin: -0.35rem 0 0;
  font-size: 0.86rem;
}
.admin-body .product-promotion-panel .product-promotion-help {
  color: #557460;
}
.product-promotion-panel > input[type="hidden"] {
  display: none;
}
.promotion-field-error {
  color: var(--red);
  font-size: 0.76rem;
  line-height: 1.4;
}
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.check {
  flex-direction: row;
  align-items: center;
}
.check input {
  width: 20px;
  min-height: 20px;
  height: 20px;
}
.toggle-row {
  grid-column: 1/-1;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #edf2f5;
  padding: 0.8rem 0;
}
.toggle-row span {
  display: flex;
  flex-direction: column;
}
.toggle-row input {
  appearance: none;
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  min-height: 28px;
  height: 28px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: #bdcbd5;
  cursor: pointer;
  box-shadow: none;
}
.toggle-row input::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(23, 57, 88, 0.25);
  transition: transform 0.18s;
}
.toggle-row input:checked {
  background: var(--blue);
}
.toggle-row input:checked::after {
  transform: translateX(20px);
}
.toggle-row input:focus {
  box-shadow: 0 0 0 3px rgba(53, 122, 168, 0.2);
}
.read-only {
  display: flex;
  flex-direction: column;
  background: var(--mist);
  padding: 0.8rem;
  border-radius: 11px;
}
.read-only span {
  font-size: 0.75rem;
  color: var(--muted);
}
.product-stock-panel {
  align-content: start;
}
.product-stock-current {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.42rem;
  align-self: start;
}
.product-stock-current > span {
  color: #435565;
  font-size: 0.88rem;
  font-weight: 600;
}
.product-stock-control {
  display: flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.3rem 0.35rem 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fbfd;
}
.product-stock-control > strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-stock-adjust {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0.32rem 0.6rem;
}
.form-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  align-items: center;
}
.inline-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inline-edit input {
  min-width: 180px;
}
.narrow {
  max-width: 760px;
  margin: 0 auto;
}
.summary-list > div {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #edf2f5;
}
.summary-total {
  font-size: 1.1rem;
}
.summary-total strong {
  color: var(--blue);
}
.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  min-height: 110px;
  background: var(--mist);
  border-radius: 13px;
  padding: 1rem;
}
.sale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(350px, 0.85fr);
  gap: 1rem;
  align-items: start;
}
.sale-catalog {
  min-width: 0;
  container: sale-catalog / inline-size;
}
.catalog-search {
  font-size: 1rem;
  padding: 1rem;
  margin-bottom: 0.8rem;
}
.category-chips,
.public-chips {
  display: flex;
  gap: 0.5rem;
  overflow: auto;
  padding-bottom: 0.7rem;
}
.category-chips button,
.public-chips button,
.public-chips a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  padding: 0.55rem 0.85rem;
  min-height: var(--touch-target);
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.category-chips .active,
.public-chips .active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
.admin-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}
.admin-product-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 0.8rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  min-width: 0;
}
.admin-product-card:hover {
  border-color: var(--blue-2);
  transform: translateY(-1px);
}
.admin-product-card > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-product-card strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-product-card small {
  color: var(--blue);
  font-weight: 700;
}
.admin-product-card em {
  font-size: 0.7rem;
  color: var(--muted);
  font-style: normal;
}
.admin-product-card > b {
  margin-left: auto;
  color: var(--blue);
  font-size: 1.25rem;
}
.product-emoji {
  font-size: 1.5rem;
}
.combo-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  background: transparent url("../icons/combo.svg") center / contain no-repeat;
}
.combo-icon-inline {
  width: 1.45em;
  height: 1.45em;
  min-width: 1.45em;
  vertical-align: -0.18em;
}
.catalog-item-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}
.category-icon-empty {
  opacity: 0;
}
.chip-category-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
}
.category-chips .active .combo-icon {
  filter: brightness(0) invert(1);
}
.sale-catalog-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.sale-catalog-head,
.sale-catalog-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.42fr) minmax(100px, 0.32fr) 96px;
  align-items: center;
  column-gap: 0.75rem;
}
.sale-catalog-head {
  min-height: 38px;
  padding: 0 0.8rem;
  border-bottom: 1px solid var(--line);
  background: #eef4f8;
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sale-catalog-head span:last-child {
  text-align: center;
}
.sale-catalog-body {
  min-height: 250px;
  max-height: min(560px, calc(100vh - 330px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.sale-catalog-row {
  position: relative;
  min-height: 58px;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #e7edf2;
  transition: background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.sale-catalog-row:last-child {
  border-bottom: 0;
}
.sale-catalog-row:hover {
  background: #f4f9fc;
  box-shadow: inset 3px 0 0 var(--blue-2);
}
.sale-catalog-row.combo-row {
  background: linear-gradient(90deg, #f3f8ff, #fff 60%);
}
.sale-catalog-row.combo-row:hover {
  background: #edf6ff;
}
.sale-catalog-row.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
.sale-catalog-product,
.sale-catalog-price,
.sale-catalog-stock,
.sale-catalog-actions {
  min-width: 0;
}
.sale-catalog-product {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.sale-catalog-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.sale-catalog-name > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo-label {
  border-radius: 999px;
  background: #dcecff;
  color: var(--blue);
  padding: 0.14rem 0.4rem;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sale-catalog-price,
.sale-catalog-stock {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.sale-catalog-price strong {
  color: var(--blue);
  white-space: nowrap;
}
.sale-catalog-price small,
.sale-catalog-stock small {
  color: var(--muted);
  font-size: 0.68rem;
}
.sale-catalog-price .combo-regular-price {
  text-decoration: line-through;
}
.sale-catalog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}
.catalog-info-button,
.catalog-add-button {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid #bdd4e5;
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  font-weight: 900;
}
.catalog-add-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-size: 1.2rem;
}
.catalog-info-button:hover {
  background: var(--sky);
}
.catalog-add-button:hover {
  background: var(--navy);
}
.catalog-add-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.combo-hover-detail {
  display: none;
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}
.combo-hover-detail b {
  color: var(--navy);
}
.combo-hover-detail small {
  display: block;
  flex-basis: 100%;
  margin-top: 0.12rem;
}
@media (hover: hover) {
  .sale-catalog-row.combo-row:hover .combo-hover-detail,
  .sale-catalog-row.combo-row:focus-within .combo-hover-detail {
    display: block;
  }
}
.sale-catalog-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  margin: 0;
}
.sale-cart {
  position: sticky;
  top: 84px;
}
.sale-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 36vh;
  overflow: auto;
  margin-bottom: 1rem;
}
.sale-line {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
}
.sale-line-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}
.line-fields {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.line-fields label {
  font-size: 0.68rem;
}
.line-fields input {
  padding: 0.55rem;
}
.sale-line > small {
  color: var(--muted);
}
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0.7rem 0;
}
.sale-summary {
  background: var(--mist);
  border-radius: 13px;
  margin: 0.8rem 0;
  padding: 0.5rem 0.8rem;
}
.sale-summary > div {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
}
.sale-summary strong {
  font-size: 1.45rem;
  color: var(--blue);
}
.form-error {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0.5rem 0;
}
.purchase-layout {
  grid-template-columns: 0.7fr 1.3fr;
  align-items: start;
}
.purchase-line {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr 0.8fr auto auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.65rem 0;
  border-bottom: 1px solid #edf2f5;
}
.purchase-line-total {
  align-self: start;
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  margin-top: 1.7rem;
  white-space: nowrap;
}
.purchase-line > .icon-button {
  align-self: start;
  margin-top: calc(1.7rem + 6px);
}
.purchase-total {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 1.2rem;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #d9eaf4, #f7fafc);
  padding: 1rem;
}
.login-card {
  width: min(420px, 100%);
  background: white;
  border-radius: 25px;
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo {
  width: 64px;
  height: 64px;
  background: var(--sky);
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin: 0 auto 1rem;
  font-size: 2rem;
}
.login-card .stack-form {
  text-align: left;
  margin: 1.4rem 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  font-size: 0.85rem;
}
.public-body {
  background: #f8fafb;
}
.public-header {
  height: 76px;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  padding: 0 max(5vw, 1rem);
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}
.public-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.public-brand span {
  display: flex;
  flex-direction: column;
}
.public-brand small {
  color: var(--muted);
}
.public-header nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
}
.public-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  color: var(--ink);
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.public-header nav a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.cart-trigger {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 50;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, var(--blue-2), var(--navy));
  color: white;
  border-radius: 999px;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  min-height: 52px;
  font-weight: 800;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(23, 57, 88, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.cart-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(23, 57, 88, 0.38);
  filter: saturate(1.08);
}
.cart-trigger:focus-visible {
  outline: 3px solid rgba(53, 122, 168, 0.34);
  outline-offset: 3px;
}
.cart-trigger-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cart-trigger-count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.38rem;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.public-hero {
  min-height: 520px;
  background-size: cover;
  background-position: right center;
  display: flex;
  align-items: center;
  padding: 4rem max(7vw, 1.2rem);
}
.hero-copy {
  max-width: 520px;
}
.hero-copy > img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin-bottom: 1rem;
}
.hero-copy h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  color: var(--navy);
}
.hero-copy > p:not(.eyebrow) {
  font-size: 1.15rem;
  max-width: 430px;
  margin-bottom: 1.4rem;
}
.public-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 5rem max(4vw, 1rem);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}
.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0.2rem 0;
}
.public-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.public-product-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 25px rgba(30, 63, 88, 0.05);
}
.offer-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #5e3b91;
  color: white;
  border-radius: 7px;
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  z-index: 2;
}
.product-photo {
  position: relative;
  aspect-ratio: 1.2/1;
  background: linear-gradient(145deg, #eef5f8, #d9e9f2);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.65rem;
}
.product-photo img {
  position: absolute;
  inset: 0.65rem;
  display: block;
  width: calc(100% - 1.3rem);
  height: calc(100% - 1.3rem);
  object-fit: contain;
  object-position: center;
}
.product-placeholder {
  font-size: 4rem;
  filter: saturate(0.6);
}
.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}
.product-category {
  font-size: 0.7rem;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.product-info h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  min-height: 3.1em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.product-buy {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: auto;
}
.product-buy p {
  display: flex;
  flex-direction: column;
}
.product-buy strong {
  color: var(--navy);
  font-size: 1.16rem;
}
.product-buy button {
  width: var(--touch-target);
  min-width: var(--touch-target);
  height: var(--touch-target);
  min-height: var(--touch-target);
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  font-size: 1.3rem;
}
.product-quantity-promotion,
.product-cart-status {
  overflow-wrap: anywhere;
  font-size: 0.74rem;
  line-height: 1.5;
}
.product-quantity-promotion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.28rem;
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.65rem;
  color: var(--green);
  background: var(--green-bg);
  border-radius: 11px;
}
.product-quantity-promotion strong,
.product-quantity-promotion span {
  color: var(--green);
  font-size: inherit;
}
.product-quantity-promotion span {
  font-weight: 800;
}
.product-cart-status {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.65rem;
  color: var(--navy);
  background: var(--mist);
  border-radius: 10px;
  font-weight: 700;
}
.product-cart-status.promotion-applied {
  color: var(--green);
  background: var(--green-bg);
}
.catalog-hero {
  background: linear-gradient(135deg, #dcecf6, #edf5f8);
  padding: 4rem max(7vw, 1rem);
  text-align: center;
}
.catalog-hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  color: var(--navy);
}
.public-empty {
  grid-column: 1/-1;
  padding: 4rem;
  text-align: center;
}
.public-empty span {
  font-size: 3rem;
}
.public-body footer {
  background: var(--navy);
  color: white;
  padding: 3rem max(6vw, 1rem);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.public-body footer img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: white;
  border-radius: 14px;
  padding: 0.2rem;
  display: block;
  margin-bottom: 0.6rem;
}
.public-body footer p {
  color: #bdd2e0;
}
.public-body footer .developer-credit {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 1.25rem;
  text-align: center;
  color: #bdd2e0;
  font-size: 0.82rem;
}
.public-body footer .developer-credit a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.public-body footer .developer-credit a:hover,
.public-body footer .developer-credit a:focus-visible {
  text-decoration: underline;
}
.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(440px, 100%);
  background: white;
  z-index: 60;
  padding: 1.3rem;
  transform: translateX(102%);
  transition: 0.25s;
  overflow: auto;
}
.cart-drawer.open {
  transform: none;
}
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 32, 44, 0.45);
  z-index: 55;
}
.drawer-backdrop.open {
  display: block;
}
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-head .icon-button,
.dialog-close {
  background: var(--mist);
  border-radius: 50%;
  font-size: 1.4rem;
}
.public-cart-lines article {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.public-cart-lines article > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.public-cart-lines small {
  color: var(--muted);
}
.cart-line-detail {
  gap: 0.35rem;
}
.cart-line-name {
  overflow-wrap: anywhere;
}
.cart-line-unit-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
}
.cart-line-promo-price,
.cart-line-discount {
  color: var(--green);
  font-weight: 800;
}
.cart-line-regular-price {
  color: var(--muted);
}
.cart-line-subtotal {
  color: var(--navy);
  font-size: 0.84rem;
}
.cart-line-quantity {
  min-width: max-content;
  font-size: 0.78rem;
  font-weight: 700;
}
.cart-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cart-stepper button {
  background: var(--sky);
}
.cart-stepper .icon-button-danger {
  background: var(--red-bg);
}
.public-cart-total {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 1.18rem;
}
.cart-customer {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.cart-notice {
  font-size: 0.78rem;
  background: var(--mist);
  padding: 0.7rem;
  border-radius: 9px;
}
.btn-whatsapp {
  background: #1b8f61;
  color: white;
}
.weight-dialog {
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: var(--shadow);
  width: min(440px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
.weight-dialog::backdrop {
  background: rgba(17, 32, 44, 0.5);
}
.weight-dialog form {
  padding: 1.4rem;
  position: relative;
}
.weight-dialog h2 {
  padding-right: 2rem;
  overflow-wrap: anywhere;
}
.weight-existing-cart {
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 700;
}
.weight-price-preview {
  display: grid;
  gap: 0.35rem;
  margin: 0.9rem 0 1rem;
  padding: 0.9rem;
  background: var(--mist);
  border-radius: 13px;
  overflow-wrap: anywhere;
}
.weight-price-preview > span,
.weight-price-preview > small {
  color: var(--muted);
  font-size: 0.8rem;
}
.weight-price-preview > strong {
  color: var(--navy);
  font-size: 0.96rem;
}
.weight-price-preview .weight-promotion-applied {
  color: var(--green);
  font-weight: 800;
}
.weight-price-preview .weight-promotion-missing {
  color: var(--amber);
}
.combo-detail-dialog {
  width: min(480px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.combo-detail-dialog::backdrop {
  background: rgba(17, 32, 44, 0.5);
}
.combo-detail-dialog form {
  position: relative;
  padding: 1.4rem;
}
.combo-detail-components {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}
.combo-detail-components span {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--mist);
}
.combo-detail-components b {
  color: var(--blue);
}
.dialog-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
}
.weight-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 1rem 0;
}
.weight-options button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sky);
  color: var(--navy);
  padding: 0.8rem;
  min-height: var(--control-height);
  font-weight: 800;
}
@media (max-width: 1100px) {
  .metric-grid.six {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .public-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sale-layout {
    grid-template-columns: 1fr;
  }
  .sale-cart {
    position: static;
  }
  .sale-lines {
    max-height: none;
  }
  .purchase-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-102%);
    transition: 0.22s;
  }
  .nav-toggle:checked ~ .sidebar {
    transform: none;
  }
  .nav-toggle:checked ~ .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 25;
  }
  .admin-shell {
    margin-left: 0;
  }
  .menu-button {
    display: grid;
    place-items: center;
    width: var(--touch-target);
    height: var(--touch-target);
    border-radius: 10px;
    background: var(--sky);
    color: var(--navy);
    font-size: 1.35rem;
    cursor: pointer;
  }
  .topbar {
    gap: 0.7rem;
    padding: 0 1rem;
  }
  .topbar-page {
    min-width: 0;
  }
  .topbar-help {
    display: none;
  }
  .topbar-actions {
    margin-left: 0;
  }
  .content {
    padding: 1.1rem 1rem 5rem;
  }
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding: 1.3rem;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .alert-grid,
  .two-columns,
  .two-columns.uneven,
  .form-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
  .page-head {
    align-items: flex-start;
  }
  .public-header {
    height: auto;
    min-height: 66px;
    padding: 0.55rem 1rem 0.45rem;
    gap: 0.45rem;
    flex-wrap: wrap;
  }
  .public-header nav {
    display: flex;
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .public-header nav a {
    flex: 0 0 auto;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 999px;
  }
  .public-header nav a.active {
    background: var(--sky);
  }
  .public-brand {
    flex: 1;
    min-width: 0;
  }
  .public-brand img {
    width: 40px;
    height: 40px;
  }
  .public-brand small {
    display: none;
  }
  .public-hero {
    min-height: 480px;
    background-position: 67% center;
    padding: 3rem 1.2rem;
  }
  .hero-copy {
    background: rgba(240, 247, 250, 0.76);
    backdrop-filter: blur(5px);
    padding: 1.2rem;
    border-radius: 20px;
  }
  .hero-copy h1 {
    font-size: 2.7rem;
  }
  .public-section {
    padding: 3.5rem 1rem;
  }
  .public-product-grid {
    grid-template-columns: 1fr 1fr;
  }
  .public-body footer {
    grid-template-columns: 1fr;
  }
  .purchase-line {
    grid-template-columns: 1fr 1fr auto;
  }
  .purchase-line label:first-child {
    grid-column: 1/-1;
  }
  .purchase-line-total {
    grid-column: 1/3;
    justify-self: end;
    margin-top: 0;
  }
  .purchase-line > .icon-button {
    grid-column: 3;
  }
  .period-tabs {
    flex-wrap: wrap;
  }
  .head-actions {
    flex-wrap: wrap;
  }
  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filters .filter-field {
    width: 100%;
    max-width: none;
  }
  .filters .filter-search,
  .sales-filters .filter-field:last-of-type {
    grid-column: 1/-1;
    max-width: none;
  }
  .filters .btn {
    width: 100%;
  }
  .btn-small,
  .icon-button {
    min-height: var(--touch-target);
  }
  .icon-button {
    flex-basis: var(--touch-target);
    width: var(--touch-target);
    min-width: var(--touch-target);
    height: var(--touch-target);
  }
  .table-with-actions th:last-child,
  .table-with-actions td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -10px 0 14px -14px rgba(23, 57, 88, 0.65);
  }
  .table-with-actions th:last-child {
    z-index: 3;
    background: #f9fbfc;
  }
}
@media (max-width: 520px) {
  .cart-trigger {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    min-height: 48px;
    max-width: calc(100vw - 1.5rem);
    padding: 0.58rem 0.62rem 0.58rem 0.82rem;
    gap: 0.5rem;
    font-size: 0.82rem;
  }
  .cart-trigger-count {
    min-width: 26px;
    height: 26px;
  }
  .metric-grid,
  .metric-grid.six {
    grid-template-columns: 1fr 1fr;
  }
  .metric-card {
    padding: 0.9rem;
  }
  .metric-card strong {
    font-size: 1.15rem;
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
  .admin-product-grid {
    grid-template-columns: 1fr;
  }
  .public-product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .product-photo {
    aspect-ratio: 1/1;
  }
  .product-info {
    padding: 0.75rem;
  }
  .product-info h3 {
    font-size: 0.96rem;
  }
  .product-buy strong {
    font-size: 0.95rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .product-promotion-panel {
    grid-template-columns: 1fr;
  }
  .product-promotion-help {
    grid-column: auto;
  }
  .product-quantity-promotion,
  .product-cart-status {
    padding: 0.5rem;
    font-size: 0.68rem;
  }
  .weight-dialog form {
    padding: 1rem;
  }
  .span-2 {
    grid-column: auto;
  }
  .line-fields {
    grid-template-columns: 1fr 1fr;
  }
  .line-fields label:last-child {
    grid-column: 1/-1;
  }
  .topbar {
    gap: 0.5rem;
    padding: 0 0.65rem;
  }
  .topbar .user-chip {
    display: none;
  }
  .topbar-actions {
    gap: 0;
  }
  .cash-status {
    min-height: 32px;
    padding: 0.38rem 0.55rem;
    font-size: 0.7rem;
  }
  .page-head {
    flex-direction: column;
  }
  .head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .head-actions .btn {
    width: 100%;
  }
  .page-head > .btn {
    width: 100%;
  }
  .public-hero {
    min-height: 440px;
  }
  .public-brand strong {
    font-size: 0.86rem;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .filters .filter-field,
  .filters .filter-search,
  .sales-filters .filter-field:last-of-type {
    grid-column: 1;
  }
  .period-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .period-filters > * {
    width: 100%;
    max-width: none;
  }
  .period-filters > button:last-child {
    grid-column: 1/-1;
  }
  .purchase-line {
    grid-template-columns: 1fr auto;
  }
  .purchase-line label,
  .purchase-line label:first-child {
    grid-column: 1/-1;
  }
  .purchase-line-total {
    grid-column: 1;
  }
  .purchase-line > .icon-button {
    grid-column: 2;
    margin-top: 0;
  }
  .public-cart-lines article {
    align-items: flex-start;
    flex-direction: column;
  }
  .cart-stepper {
    width: 100%;
    justify-content: flex-end;
  }
}
/* Filtrado instantáneo de productos. */
.live-filter-status {
  min-width: 100px;
  min-height: 1.2em;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
}
#product-results {
  transition: opacity 0.15s;
}
#product-results[aria-busy="true"] {
  opacity: 0.58;
}
.product-filters.is-filtering .live-filter-status {
  color: var(--blue);
  font-weight: 700;
}

/* Acciones compactas dentro de historiales y tablas. */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  white-space: nowrap;
}
.table-actions form {
  margin: 0;
}
.product-table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
}
.product-table-actions form {
  display: flex;
  align-items: center;
}
.table-with-actions td:last-child {
  white-space: nowrap;
}
.purchase-line label small {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-weight: 400;
}

/* El acceso rápido a ventas se destaca sin parecer la sección activa. */
.sidebar nav .nav-primary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.sidebar nav .nav-primary.active {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}

/* Filtros de trazabilidad. */
.period-tabs a.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.movement-tabs {
  flex-wrap: wrap;
}

/* Enlaces directos de contacto del pie público. */
.public-body footer .footer-link {
  display: inline-flex;
  align-items: flex-start;
  min-height: var(--touch-target);
  gap: 0.6rem;
  color: #bdd2e0;
  margin: 0.35rem 0;
  transition: color 0.18s;
}
.public-body footer .footer-link:hover {
  color: #fff;
}
.public-body footer .footer-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: currentColor;
  margin-top: 0.08rem;
}
.public-body footer .footer-icon-map {
  color: #8fc9ef;
}
.public-body footer .footer-icon-whatsapp {
  color: #25d366;
}
.public-body footer .footer-link-label {
  display: block;
  color: inherit;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  margin-bottom: 0.05rem;
}

/* Vista previa al seleccionar la imagen de un producto. */
.image-preview {
  position: relative;
  aspect-ratio: 1.2/1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #eef5f8, #d9e9f2);
  min-height: 180px;
  padding: 0.65rem;
  overflow: hidden;
}
.image-preview[hidden] {
  display: none;
}
.image-preview img {
  position: absolute;
  inset: 0.65rem;
  display: block;
  width: calc(100% - 1.3rem);
  height: calc(100% - 1.3rem);
  object-fit: contain;
  object-position: center;
}
.image-preview span {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  z-index: 2;
  background: rgba(23, 57, 88, 0.85);
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
}
.image-current-note {
  color: var(--green);
  font-weight: 600;
}
@media (max-width: 520px) {
  .image-preview {
    aspect-ratio: 1/1;
  }
}

/* Cuenta corriente de proveedores */
.alert-grid {
  grid-template-columns: repeat(3, 1fr);
}
.purchase-document {
  align-content: start;
}
.purchase-products .panel-head h2 {
  margin-bottom: 0.25rem;
}
.purchase-products .panel-head p {
  font-size: 0.8rem;
}
.purchase-payment-box {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.8fr 1.15fr;
  gap: 0.8rem;
  align-items: start;
  background: linear-gradient(135deg, #eef6fa, #f8fbfc);
  border: 1px solid #dbeaf2;
  border-radius: 15px;
  padding: 1rem;
  margin-top: 0.4rem;
}
.account-state,
.projected-balance {
  display: grid;
  grid-template-rows: auto var(--control-height);
  gap: 0.42rem;
  min-width: 0;
}
.account-state span,
.projected-balance span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}
.account-state strong,
.projected-balance strong {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  font-size: 1rem;
  margin: 0;
}
.account-note {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--sky);
  color: var(--navy);
  border-radius: 11px;
  padding: 0.85rem;
}
.account-note span,
.form-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.read-only small {
  color: var(--muted);
}
.supplier-metrics {
  grid-template-columns: repeat(2, minmax(0, 280px));
  margin-bottom: 1rem;
}
.supplier-account-head {
  align-items: stretch;
}
.account-balance-card {
  min-width: 240px;
  border-radius: 18px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.account-balance-card span {
  font-size: 0.75rem;
  font-weight: 700;
}
.account-balance-card strong {
  font-size: 1.65rem;
}
.account-balance-card.debt {
  background: var(--red-bg);
  color: var(--red);
}
.account-balance-card.credit {
  background: var(--green-bg);
  color: var(--green);
}
.account-balance-card.settled {
  background: var(--sky);
  color: var(--navy);
}
.supplier-account-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.65fr) minmax(0, 1.8fr);
  gap: 1rem;
  align-items: start;
}
.supplier-movement-form {
  position: sticky;
  top: 84px;
}
.two-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.opening-help {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.opening-help p {
  font-size: 0.8rem;
}
.supplier-ledger {
  min-width: 0;
}
@media (max-width: 1100px) {
  .purchase-payment-box {
    grid-template-columns: 1fr 1fr;
  }
  .supplier-account-layout {
    grid-template-columns: 1fr;
  }
  .supplier-movement-form {
    position: static;
  }
}
@media (max-width: 800px) {
  .alert-grid {
    grid-template-columns: 1fr;
  }
  .supplier-account-head {
    align-items: stretch;
  }
  .account-balance-card {
    width: 100%;
  }
}
@media (max-width: 520px) {
  .purchase-payment-box,
  .two-field-row {
    grid-template-columns: 1fr;
  }
  .supplier-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .supplier-metrics .metric-card {
    min-width: 0;
  }
}


/* Ayuda contextual y campos numéricos */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.field-label-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.field-label-row > label {
  display: inline;
}
.help-tooltip {
  position: relative;
  display: inline-flex;
  z-index: 5;
}
.help-tooltip-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border: 1px solid #a9c4d8;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}
.help-tooltip-button:hover {
  background: #c9e1f0;
}
.help-tooltip-content {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  width: min(340px, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 14px 35px rgba(23, 57, 88, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translate(var(--tooltip-offset, 0px), -4px);
  transition: opacity 0.16s ease, visibility 0.16s ease;
  pointer-events: none;
  z-index: 40;
}
.help-tooltip-content strong,
.help-tooltip-content span {
  display: block;
}
.help-tooltip-content strong {
  margin-top: 0.7rem;
  color: var(--navy);
  font-size: 0.82rem;
}
.help-tooltip-content strong:first-child {
  margin-top: 0;
}
.help-tooltip-content span {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
}
.help-tooltip:hover .help-tooltip-content,
.help-tooltip:focus-within .help-tooltip-content,
.help-tooltip.is-open .help-tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translate(var(--tooltip-offset, 0px), 0);
  pointer-events: auto;
}
.supplier-movement-form {
  container-type: inline-size;
}
.supplier-movement-form .two-field-row {
  grid-template-columns: minmax(128px, 0.9fr) minmax(0, 1.35fr);
}
.supplier-movement-form .two-field-row > label,
.supplier-movement-form .two-field-row input {
  min-width: 0;
}
@container (max-width: 340px) {
  .supplier-movement-form .two-field-row {
    grid-template-columns: 1fr;
  }
}


/* Estadísticas financieras */
.stats-page-head {
  margin-bottom: 1.6rem;
}
.stats-section + .stats-section {
  margin-top: 2.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stats-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.stats-section-head h2,
.ranking-panel .panel-head h2,
.stats-overview-columns .panel-head h2 {
  margin-bottom: 0.2rem;
}
.stats-live-badge {
  flex: 0 0 auto;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
}
.stats-situation-grid,
.stats-results-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-metric-wrap {
  position: relative;
  min-width: 0;
}
.stats-metric-wrap > .metric-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.stats-metric-wrap > .metric-card > span:first-child {
  padding-right: 1.9rem;
}
.stats-card-help {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 7;
}
.stats-card-help .help-tooltip-content {
  right: 0;
  left: auto;
}
.financial-card {
  position: relative;
  color: var(--ink);
  border-left-width: 5px;
  box-shadow: 0 7px 22px rgba(30, 63, 88, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.financial-card:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(30, 63, 88, 0.1);
}
.financial-card.receivable,
.financial-card.receivable-count {
  border-color: #79afd0;
  background: linear-gradient(135deg, #fff 45%, #eef7fc);
}
.financial-card.payable,
.financial-card.payable-count,
.financial-card.net-negative {
  border-color: #d98189;
  background: linear-gradient(135deg, #fff 45%, var(--red-bg));
}
.financial-card.credit,
.financial-card.net-positive {
  border-color: #72b59c;
  background: linear-gradient(135deg, #fff 45%, var(--green-bg));
}
.financial-card.receivable strong,
.financial-card.receivable-count strong {
  color: var(--blue);
}
.financial-card.payable strong,
.financial-card.payable-count strong,
.financial-card.net-negative strong,
.payable-text {
  color: var(--red);
}
.financial-card.credit strong,
.financial-card.net-positive strong,
.receivable-text {
  color: var(--green);
}
.financial-card small {
  min-height: 2.3em;
}
.stats-rankings {
  align-items: start;
}
.stats-overview-columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.stats-overview-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.stats-products-panel {
  display: flex;
  flex-direction: column;
  min-height: 330px;
}
.stats-products-scroll {
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.stats-products-scroll table {
  width: 100%;
}
.stats-products-scroll th,
.stats-products-scroll td {
  padding-right: 0.65rem;
  padding-left: 0.65rem;
}
.stats-products-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--sky);
}
.stats-products-panel .panel-footnote {
  margin-top: auto;
  padding-top: 0.9rem;
}
.ranking-panel {
  padding-bottom: 0.55rem;
}
.ranking-panel .panel-head {
  align-items: flex-start;
}
.ranking-panel .panel-head > a,
.stock-summary-panel .panel-head > a {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 800;
}
.ranking-list {
  display: grid;
}
.ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 62px;
  padding: 0.62rem 0;
  border-top: 1px solid #edf2f5;
  color: var(--ink);
}
.ranking-row:hover .ranking-name strong {
  color: var(--blue);
}
.ranking-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}
.ranking-number.payable-number {
  background: var(--red-bg);
  color: var(--red);
}
.ranking-name {
  min-width: 0;
}
.ranking-name strong,
.ranking-name small {
  display: block;
}
.ranking-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking-name small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.ranking-row > b {
  white-space: nowrap;
}
.empty-state.compact {
  min-height: 76px;
}
.period-section .period-filters {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}
.stats-results-grid .profit-card {
  border-color: #add7c7;
  background: linear-gradient(135deg, #fff 45%, var(--green-bg));
}
.stats-results-grid .profit-card strong {
  color: var(--green);
}
.money-flow-list > div,
.category-summary-list > div {
  gap: 1rem;
  align-items: baseline;
}
.money-flow-list b,
.category-summary-list b {
  text-align: right;
  white-space: nowrap;
}
.money-flow-list .summary-total {
  padding: 0.9rem 1rem;
  margin-bottom: 0.35rem;
  border: 0;
  border-radius: 12px;
  background: var(--sky);
}
.panel-footnote {
  margin-top: 0.9rem;
  font-size: 0.76rem;
}
.stock-value-block {
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
}
.stock-value-block span,
.stock-value-block strong {
  display: block;
}
.stock-value-block span {
  color: #cfe1ec;
  font-size: 0.78rem;
}
.stock-value-block strong {
  margin-top: 0.35rem;
  font-size: clamp(1.4rem, 2vw, 2rem);
}
.stock-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}
.stock-status-grid a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mist);
  color: var(--ink);
}
.stock-status-grid strong {
  font-size: 1.45rem;
}
.stock-status-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}
.stock-status-grid .stock-danger {
  border-color: #efc3c8;
  background: var(--red-bg);
}
.stock-status-grid .stock-danger strong {
  color: var(--red);
}
.stock-status-grid .stock-warning {
  border-color: #efd19f;
  background: var(--amber-bg);
}
.stock-status-grid .stock-warning strong {
  color: var(--amber);
}
.category-summary-list small {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 900px) {
  .stats-situation-grid,
  .stats-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .stats-overview-columns {
    grid-template-columns: 1fr;
  }
  .stats-products-panel {
    min-height: 0;
  }
  .stats-products-scroll {
    max-height: 360px;
  }
}

@media (max-width: 600px) {
  .pagination-shell {
    align-items: stretch;
    flex-direction: column;
  }
  .pagination-summary {
    text-align: center;
    white-space: normal;
  }
  .pagination-nav {
    justify-content: center;
  }
  .pagination-nav a,
  .pagination-nav span {
    flex: 0 0 auto;
  }
  .stats-section-head {
    align-items: flex-start;
  }
  .stats-live-badge {
    display: none;
  }
  .stats-situation-grid,
  .stats-results-grid {
    grid-template-columns: 1fr;
  }
  .financial-card small {
    min-height: 0;
  }
  .stats-card-help {
    top: 0.75rem;
    right: 0.75rem;
  }
  .stats-products-scroll {
    max-height: 320px;
  }
  .ranking-panel .panel-head {
    display: block;
  }
  .ranking-panel .panel-head > a {
    display: inline-block;
    margin-top: 0.5rem;
  }
  .ranking-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .ranking-row > b {
    grid-column: 2;
    margin-top: -0.35rem;
  }
  .period-section .period-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .period-section .period-filters label {
    grid-column: span 3;
  }
  .period-section .period-filters input {
    max-width: none;
  }
  .period-section .period-filters button[value="custom"] {
    grid-column: span 3;
  }
  .stock-status-grid {
    grid-template-columns: 1fr;
  }
  .stock-status-grid a {
    min-height: 72px;
  }
  .money-flow-list > div,
  .category-summary-list > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
  .money-flow-list b,
  .category-summary-list b {
    text-align: left;
    white-space: normal;
  }
}

/* Combos */
.admin-product-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}
.combo-card {
  border-color: #b7d2f0;
  background: linear-gradient(145deg, #fff 0%, #f1f7ff 100%);
}
.combo-card .combo-regular-price {
  color: var(--muted);
  font-size: 0.7rem;
  text-decoration: line-through;
}
.stock-unavailable {
  color: var(--red) !important;
  font-weight: 800;
}
.sale-combo-line {
  border-color: #9fc4ed;
  background: #f7fbff;
}
.combo-line-components {
  display: block;
  margin-top: 0.35rem;
  line-height: 1.35;
}
.sale-detail-combo td {
  background: #f7fbff;
}
.combo-main-fields {
  margin-bottom: 1rem;
}
.combo-pricing-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(120px, 0.65fr);
  gap: 0.7rem;
}
.combo-pricing-fields > label {
  min-width: 0;
}
.combo-discount-policy {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.1rem;
  padding-top: 0.7rem;
  border-top: 1px solid #edf2f5;
}
.combo-discount-policy-label {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.combo-discount-policy-label > input {
  flex: 0 0 21px;
  width: 21px;
  min-height: 21px;
  height: 21px;
  margin-top: 0.08rem;
  padding: 0;
  accent-color: var(--blue);
}
.combo-discount-policy-label > span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.combo-discount-policy-label strong {
  color: var(--navy);
  line-height: 1.35;
}
.combo-discount-policy-label small {
  line-height: 1.35;
}
.combo-delete-help .help-tooltip-content {
  right: 0;
  left: auto;
}
.combo-table-actions {
  flex-wrap: nowrap;
}
.combo-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 1rem;
  align-items: start;
}
.combo-product-picker {
  min-width: 0;
}
.combo-picker-head {
  margin-bottom: 0.75rem;
}
.combo-picker-note {
  margin: 0.5rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.combo-composition {
  position: sticky;
  top: 84px;
}
.combo-component-lines {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 42vh;
  overflow: auto;
  margin-bottom: 0.8rem;
}
.combo-component-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px auto;
  gap: 0.55rem;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
}
.combo-component-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.combo-component-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo-component-line small,
.combo-components-list {
  color: var(--muted);
  line-height: 1.4;
}
.combo-component-values {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.18rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}
.combo-component-values span {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.combo-component-values b {
  color: var(--ink);
  white-space: nowrap;
}
.combo-component-line label {
  font-size: 0.68rem;
}
.combo-component-line input {
  padding: 0.55rem;
}
.combo-product-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.admin-product-card.combo-product-selected {
  cursor: default;
  opacity: 1;
}
.combo-live-summary {
  padding: 0.45rem 0.8rem;
  border-radius: 13px;
  background: var(--mist);
}
.combo-live-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.46rem 0;
  border-bottom: 1px solid #e2eaf0;
}
.combo-live-summary > div:last-child {
  border-bottom: 0;
}
.combo-profit-row {
  font-size: 1.06rem;
  margin-top: 0.2rem;
  border-top: 2px solid #cfdce5;
}
.combo-profit-row strong {
  color: var(--blue);
}
.combo-regular-profit-row b,
.combo-profit-row strong {
  font-weight: 850;
}
.combo-discount-impact-row b {
  color: var(--red);
}
.combo-final-price-row {
  font-weight: 750;
}
.combo-warning {
  margin: 0.75rem 0 0;
  padding: 0.7rem;
  border: 1px solid #f0b4af;
  border-radius: 10px;
  background: #fff3f2;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 750;
}
.combo-table {
  min-width: 1240px;
}
.combo-pricing-badge {
  width: fit-content;
  margin-top: 0.25rem;
  padding: 0.16rem 0.4rem;
  border-radius: 999px;
  background: var(--sky);
  color: var(--blue);
  font-weight: 800;
}
.combo-profit-breakdown {
  min-width: 190px;
}
.combo-profit-breakdown > span,
.combo-profit-breakdown > strong {
  display: block;
}
.combo-discount-subtract {
  color: var(--red);
}
.stats-category-panel {
  margin-top: 1rem;
}

/* Biblioteca visual de íconos para categorías. */
.category-admin-layout {
  grid-template-columns: minmax(280px, 0.7fr) minmax(560px, 1.6fr);
  align-items: start;
}
.category-create-panel {
  position: sticky;
  top: 1rem;
}
.field-caption {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 750;
}
.category-icon-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mist);
}
.category-icon-preview {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 750;
}
.category-icon-preview img,
.category-icon-none-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}
.category-icon-preview.compact img,
.category-icon-preview.compact .category-icon-none-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}
.category-icon-preview.compact > span:last-child {
  display: none;
}
.category-icon-none-mark {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.category-icon-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.category-table {
  min-width: 660px;
}
.category-table td:nth-child(2) input {
  min-width: 180px;
}
.category-icon-dialog {
  width: min(920px, calc(100% - 2rem));
  max-height: min(780px, calc(100vh - 2rem));
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.category-icon-dialog::backdrop {
  background: rgba(17, 32, 44, 0.58);
}
.category-icon-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.category-icon-dialog-head h2,
.category-icon-dialog-head p {
  margin: 0;
}
.category-icon-dialog-head .dialog-close {
  position: static;
  flex: 0 0 var(--touch-target);
}
.category-icon-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 0.65rem;
  padding: 1.2rem 1.35rem 1.4rem;
}
.category-icon-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 120px;
  padding: 0.7rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 750;
}
.category-icon-choice:hover,
.category-icon-choice.selected {
  border-color: var(--blue);
  background: var(--sky);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.category-icon-choice img {
  width: 54px;
  height: 54px;
}
.category-icon-choice small {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  background: #e7f4ed;
  color: #23734a;
  font-size: 0.58rem;
}
.product-name-with-icon {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.product-name-with-icon > span {
  min-width: 0;
}
.category-icon-small {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.category-product-placeholder img {
  width: min(86px, 48%);
  height: min(86px, 48%);
  object-fit: contain;
}

@media (max-width: 1050px) {
  .category-admin-layout {
    grid-template-columns: 1fr;
  }
  .category-create-panel {
    position: static;
  }
  .category-icon-gallery {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }
}

@media (max-width: 620px) {
  .category-list-panel {
    padding: 0.8rem;
  }
  .category-list-panel .table-wrap {
    overflow: visible;
  }
  .category-table {
    display: block;
    min-width: 0;
  }
  .category-table thead {
    display: none;
  }
  .category-table tbody {
    display: grid;
    gap: 0.75rem;
  }
  .category-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      "icon products"
      "name name"
      "actions actions";
    gap: 0.75rem 0.8rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }
  .category-table td {
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .category-table .category-icon-cell {
    grid-area: icon;
    flex-wrap: wrap;
  }
  .category-table .category-icon-cell > form {
    display: none;
  }
  .category-table .category-name-cell {
    grid-area: name;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
  .category-table .category-name-cell::before,
  .category-table .category-products-cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .category-table td.category-name-cell input {
    min-width: 0;
  }
  .category-table .category-products-cell {
    grid-area: products;
    display: grid;
    justify-items: end;
    align-content: center;
    min-width: 74px;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    background: var(--mist);
    color: var(--navy);
    font-weight: 800;
  }
  .category-table.table-with-actions td.category-actions-cell {
    position: static;
    grid-area: actions;
    padding-top: 0.1rem;
    background: transparent;
    box-shadow: none;
  }
  .category-table .table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .category-table .table-actions > *,
  .category-table .table-actions .btn {
    width: 100%;
    min-width: 0;
  }
  .category-table .category-actions-cell .table-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 0.45rem 0.7rem;
    border-radius: 11px;
    background: var(--green-bg);
    color: var(--green);
    font-weight: 700;
  }
  .category-table .category-empty-row {
    display: block;
  }
  .category-table .category-empty-row .empty {
    display: block;
    padding: 1.4rem 0.75rem;
  }
  .category-icon-gallery {
    grid-template-columns: repeat(3, minmax(85px, 1fr));
    padding: 0.8rem;
  }
  .category-icon-choice {
    min-height: 105px;
  }
}

@media (max-width: 380px) {
  .category-icon-control {
    align-items: stretch;
    flex-direction: column;
  }
  .category-icon-control > .btn {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .combo-builder {
    grid-template-columns: 1fr;
  }
  .combo-composition {
    position: static;
  }
  .combo-component-lines {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .combo-pricing-fields {
    grid-template-columns: minmax(0, 1fr) minmax(105px, 0.6fr);
  }
  .combo-component-line {
    grid-template-columns: minmax(0, 1fr) 90px auto;
  }
  .combo-live-summary > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
  }
}

@media (max-width: 1100px) {
  .sale-catalog-body {
    max-height: 52vh;
  }
}

@container sale-catalog (max-width: 620px) {
  .sale-catalog-head {
    display: none;
  }
  .sale-catalog-body {
    min-height: 220px;
    max-height: 55vh;
  }
  .sale-catalog-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "product actions"
      "price actions"
      "stock actions";
    gap: 0.12rem 0.55rem;
    min-height: 78px;
    padding: 0.55rem 0.65rem;
  }
  .sale-catalog-product {
    grid-area: product;
  }
  .sale-catalog-price {
    grid-area: price;
    flex-direction: row;
    align-items: baseline;
    gap: 0.25rem;
    padding-left: 2.65rem;
  }
  .sale-catalog-stock {
    grid-area: stock;
    flex-direction: row;
    gap: 0.35rem;
    padding-left: 2.65rem;
    color: var(--muted);
    font-size: 0.76rem;
  }
  .sale-catalog-actions {
    grid-area: actions;
    align-self: center;
  }
  .catalog-info-button,
  .catalog-add-button {
    width: var(--touch-target);
    min-width: var(--touch-target);
    height: var(--touch-target);
    min-height: var(--touch-target);
  }
  .combo-hover-detail {
    display: none !important;
  }
}

@media (max-width: 700px) {
  .sale-catalog-head {
    display: none;
  }
  .sale-catalog-body {
    min-height: 220px;
    max-height: 55vh;
  }
  .sale-catalog-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "product actions"
      "price actions"
      "stock actions";
    gap: 0.12rem 0.55rem;
    min-height: 78px;
    padding: 0.55rem 0.65rem;
  }
  .sale-catalog-product {
    grid-area: product;
  }
  .sale-catalog-price {
    grid-area: price;
    flex-direction: row;
    align-items: baseline;
    gap: 0.25rem;
    padding-left: 2.65rem;
  }
  .sale-catalog-stock {
    grid-area: stock;
    flex-direction: row;
    gap: 0.35rem;
    padding-left: 2.65rem;
    color: var(--muted);
    font-size: 0.76rem;
  }
  .sale-catalog-actions {
    grid-area: actions;
    align-self: center;
  }
  .catalog-info-button,
  .catalog-add-button {
    width: var(--touch-target);
    min-width: var(--touch-target);
    height: var(--touch-target);
    min-height: var(--touch-target);
  }
  .combo-hover-detail {
    display: none !important;
  }
}
