:root {
  --ink: #18212b;
  --muted: #6b7280;
  --line: #d9e0e7;
  --paper: #eef2f5;
  --panel: #ffffff;
  --accent: #9f3f54;
  --accent-strong: #7f2f42;
  --warn: #b54708;
  --danger: #b42318;
  --ok: #177245;
  --soft-accent: #fbedf1;
  --soft-warn: #fff4df;
  --soft-danger: #fff0ed;
  --soft-ok: #eaf7ef;
  --shadow: 0 16px 38px rgba(27, 38, 49, .09);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.70), rgba(255,255,255,0) 220px),
    var(--paper);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
  min-height: 0;
}
.app-shell[data-sidebar="closed"] { grid-template-columns: 0 1fr; }
.app-shell[data-sidebar="closed"] .sidebar {
  transform: translateX(-100%);
  padding-inline: 0;
}
.app-shell[data-sidebar="closed"] .workspace::before {
  inset: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 28%),
    #311827;
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, padding .2s ease;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.35), transparent 28%),
    linear-gradient(135deg, #f9d56e 0%, #f27b55 48%, #9f3f54 100%);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(0,0,0,.20);
}
.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand small, .sidebar-card small { color: #b7c0ca; display: block; font-size: 12px; }
.sidebar nav {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
}
.sidebar a {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  color: #f1dbe2;
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.sidebar a svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}
.sidebar a.active,
.sidebar a:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.12);
  color: #fff;
}
.sidebar a.active::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: #ffd166;
}
.sidebar-card {
  margin-top: auto;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.sidebar-card strong { display: block; font-size: 21px; margin-top: 5px; color: #fff; }
.sidebar-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1dbe2;
}
.sidebar-card-label svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffd166;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.user-chip {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 12px;
  padding-bottom: 8px;
}
.store-switcher {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 8px;
  padding-bottom: 8px;
}
.store-switcher label {
  color: #f1dbe2;
  font-size: 12px;
}
.store-switcher select {
  height: 36px;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color: #fff;
}
.user-chip span {
  font-weight: 800;
  color: #fff;
}
.logout-button {
  width: 100%;
  height: 34px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  color: #fff;
}
.logout-button:hover { background: rgba(255,255,255,.16); }

.workspace {
  position: relative;
  isolation: isolate;
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px;
}
.workspace::before {
  content: "";
  position: fixed;
  inset: 0 0 0 250px;
  z-index: -1;
  pointer-events: none;
  opacity: .46;
  background-image:
    url("data:image/svg+xml,%3Csvg width='360' height='280' viewBox='0 0 360 280' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%236b7280' stroke-opacity='.14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(44 28) rotate(-8)'%3E%3Cpath d='M0 0h52v82l-9-5-8 5-9-5-8 5-9-5-9 5z'/%3E%3Cpath d='M12 18h28M12 34h22M12 50h31'/%3E%3C/g%3E%3Cg transform='translate(228 44) rotate(7)'%3E%3Cpath d='M0 0h58v34H0z'/%3E%3Cpath d='M10 8v18M18 8v18M29 8v18M39 8v18M48 8v18'/%3E%3C/g%3E%3Cg transform='translate(120 172) rotate(4)'%3E%3Cpath d='M0 0h74M0 17h52M0 34h84'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.62));
  background-size: 360px 280px, auto;
  background-position: 24px 16px, 0 0;
}
.workspace > * {
  position: relative;
  z-index: 1;
}
.workspace.page-venta {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}
.topbar {
  display: grid;
  grid-template-columns: 44px minmax(260px, 520px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  justify-content: start;
  margin-bottom: 14px;
}
.topbar-sale .topbar-actions {
  justify-self: end;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.topbar-stock, .topbar-history {
  grid-template-columns: 44px minmax(260px, 500px) repeat(4, max-content);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  height: 44px;
}
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
}
.section-title {
  display: grid;
  align-content: center;
  min-height: 44px;
}
.section-title strong { font-size: 16px; }
.section-title span { color: var(--muted); font-size: 13px; }
.period-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.period-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.period-tabs a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.period-tabs a small {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(15, 23, 42, .08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.period-tabs a.active small {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.icon-button, .ghost-button, .primary-button {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  color: var(--ink);
  padding: 0 14px;
  white-space: nowrap;
}
.icon-button {
  width: 44px;
  padding: 0;
  font-size: 20px;
}
.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(8, 127, 140, .20);
}
.primary-button:hover { background: var(--accent-strong); }
.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.primary-button:disabled:hover { background: var(--accent); }
.ghost-button:hover, .icon-button:hover { border-color: #9aa4b2; }
.wide { width: 100%; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.metrics article {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.metrics article.metric-alert {
  background: var(--soft-warn);
  border-color: #efd099;
}
.metrics span { color: var(--muted); font-size: 13px; }
.metrics strong { display: block; font-size: 22px; margin-top: 2px; }
.cash-metric {
  display: grid;
  align-content: center;
}
.cash-metric .cash-status {
  margin-top: 2px;
}
.cash-status {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
.cash-status i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(23, 114, 69, .12);
}
.cash-status.online { color: var(--ok); }
.cash-status.online i { background: var(--ok); }
.cash-status.offline { color: var(--danger); }
.cash-status.offline i {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, .12);
}
.notice-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 10px;
  border: 1px solid #efd099;
  border-radius: 8px;
  background: var(--soft-warn);
  padding: 10px 12px;
}
.notice-band span {
  color: var(--muted);
}

.pos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.products-panel, .cart-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.cart-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head.tight { padding-bottom: 12px; }
h1, h2, p { margin: 0; }
h1 { font-size: 22px; letter-spacing: 0; }
h2 { font-size: 18px; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }

.product-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  min-height: 0;
  overflow: auto;
}
.product-list.is-locked {
  background: repeating-linear-gradient(135deg, rgba(255,244,223,.65), rgba(255,244,223,.65) 10px, rgba(255,255,255,.8) 10px, rgba(255,255,255,.8) 20px);
  pointer-events: none;
  user-select: none;
}
.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  align-items: center;
  gap: 16px;
  min-height: 58px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  text-align: left;
}
.product-row:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.product-row:disabled:hover,
.product-row:disabled:focus {
  border-color: var(--line);
  box-shadow: none;
}
.product-row.is-low {
  background: linear-gradient(90deg, var(--soft-warn), #fff 34%);
  border-color: #f0d3a1;
}
.product-row.is-empty {
  background: linear-gradient(90deg, var(--soft-danger), #fff 34%);
  border-color: #e8b9b2;
}
.product-row.is-ok {
  background: linear-gradient(90deg, var(--soft-ok), #fff 30%);
}
.product-row:hover, .product-row:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}
.product-row strong, .cart-item strong { display: block; }
.product-row > span:first-child {
  min-width: 0;
}
.product-row small, .cart-item small { color: var(--muted); }
.product-row > span:first-child small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.product-meta {
  display: grid;
  grid-template-columns: minmax(88px, max-content) minmax(82px, max-content);
  align-items: center;
  justify-content: end;
  gap: 16px;
  text-align: right;
}
.product-meta b {
  font-variant-numeric: tabular-nums;
  min-width: 88px;
}
.product-meta small {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 82px;
  white-space: nowrap;
}
.danger { color: var(--danger) !important; font-weight: 800; }
.warning { color: var(--warn) !important; font-weight: 800; }

.cart-list {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.cart-panel.is-locked .cart-list,
.cart-panel.is-locked .totals {
  opacity: .62;
  pointer-events: none;
}
.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px 96px 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}
.qty-control {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.qty-control button {
  border: 0;
  background: #f1f3f5;
}
.qty-control input {
  width: 100%;
  border: 0;
  text-align: center;
  min-width: 0;
}
.line-price { text-align: right; font-weight: 800; }

.totals {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 7px;
}
.payment-fields {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(104px, .72fr) minmax(112px, .75fr);
  gap: 8px;
  align-items: end;
}
.discount-fields {
  display: grid;
  grid-template-columns: minmax(108px, .55fr) minmax(160px, 1fr);
  gap: 8px;
  align-items: end;
}
.discount-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.discount-panel summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.discount-panel[open] {
  padding-bottom: 10px;
}
.discount-panel .discount-fields {
  padding: 0 10px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}
input.input-error {
  border-color: var(--danger);
  background: var(--soft-danger);
  color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .10);
}
.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 5px;
  font-size: 16px;
}
.total-line strong { font-size: 25px; }
.compact-money-line {
  padding-top: 0;
  font-size: 13px;
}
.compact-money-line strong {
  font-size: 14px;
}
.muted { color: var(--muted); }

@media (max-width: 980px) {
  .payment-fields {
    grid-template-columns: 1fr;
  }
  .discount-fields {
    grid-template-columns: 1fr;
  }
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.ghost-link:hover { border-color: #9aa4b2; }
.mini-link {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.stock-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stock-filter {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-decoration: none;
  text-align: center;
}
.stock-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.stock-filter strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  line-height: 1;
}
.stock-filter.danger-filter { background: var(--soft-danger); border-color: #e8b9b2; }
.stock-filter.low { background: var(--soft-warn); border-color: #efd099; }
.stock-filter.ok { background: var(--soft-ok); border-color: #bfe4cc; }
.stock-filter.active {
  outline: 3px solid rgba(8, 127, 140, .18);
  border-color: var(--accent);
}

.split-page {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .75fr);
  gap: 14px;
}
.data-list, .receipt-table {
  display: grid;
  gap: 8px;
  padding: 12px;
}
.data-list.compact { max-height: 650px; overflow: auto; }
.stock-row, .sale-row, .movement-row {
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
}
.stock-row {
  position: relative;
}
.stock-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.stock-row.is-empty { background: var(--soft-danger); border-color: #e8b9b2; }
.stock-row.is-empty::before { background: var(--danger); }
.stock-row.is-low { background: var(--soft-warn); border-color: #efd099; }
.stock-row.is-low::before { background: var(--warn); }
.stock-row.is-ok { background: #fbfffc; }
.stock-row.is-ok::before { background: var(--ok); }
.stock-row {
  grid-template-columns: minmax(0, 1fr) 120px 110px;
}
.user-row {
  grid-template-columns: minmax(0, 1fr) 130px 110px 90px;
}
.product-admin-row {
  grid-template-columns: minmax(0, 1fr) 130px 128px 166px;
  column-gap: 22px;
}
.product-price {
  justify-self: end;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.unit-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.category-chip {
  --category-color: #64748b;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid color-mix(in srgb, var(--category-color) 40%, #ffffff);
  border-radius: 999px;
  padding: 0 8px 0 6px;
  background: color-mix(in srgb, var(--category-color) 12%, #ffffff);
  color: color-mix(in srgb, var(--category-color) 72%, #111827);
  font-size: 12px;
  font-weight: 900;
}
.category-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 5px;
  background: var(--category-color);
}
.stock-row small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.mini-button {
  min-height: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}
.delete-product-btn {
  border-color: #e4aaa2;
  background: var(--soft-danger);
  color: var(--danger);
}
.delete-product-btn:hover {
  border-color: #cf7f74;
}
.stock-row strong, .movement-row strong, .sale-row strong { display: block; }
.stock-row:not(.product-admin-row) small, .movement-row small, .sale-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.movement-row {
  grid-template-columns: minmax(0, 1fr) minmax(92px, max-content);
}
.movement-row > span,
.category-count {
  justify-self: end;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cash-session-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
}
.audit-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, .85fr) minmax(140px, .8fr) minmax(148px, .7fr) minmax(148px, .7fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.92);
}
.audit-filters label {
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}
.audit-filters input,
.audit-filters select {
  height: 36px;
  border-radius: 7px;
  font-size: 13px;
}
.audit-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
.audit-filter-actions .primary-button,
.audit-filter-actions .ghost-link {
  min-height: 36px;
  height: 36px;
  padding-inline: 12px;
}
.audit-row {
  grid-template-columns: minmax(0, 1fr) 140px 150px;
}
.movement-row small { grid-column: 1 / -1; }
.cash-session-row > span {
  justify-self: start;
  white-space: normal;
  color: var(--ink);
}
.cash-session-row small { grid-column: 1 / 2; }
.cash-session-row .mini-link {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}
.history-page { min-height: 690px; }
.sale-row {
  grid-template-columns: 170px minmax(0, 1fr) 110px 172px;
}
.sale-row.is-void {
  background: var(--soft-danger);
  border-color: #e8b9b2;
  color: #7f1d1d;
}
.void-sale-btn {
  border-color: #e4aaa2;
  background: var(--soft-danger);
  color: var(--danger);
}
.refund-sale-btn,
.refund-row {
  border-color: #b8d7c6;
  background: #f2fbf5;
  color: #155b34;
}
.refund-lines {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.refund-lines label {
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfd;
}
.refund-lines input {
  height: 36px;
}
.cash-movement-form {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.form-section-label {
  color: var(--ink);
  font-size: 13px;
}
.sale-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.sale-items span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #e9edf2;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}
.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: 92px;
  height: 24px;
  flex: 0 0 92px;
  border-radius: 999px;
  padding: 0 7px;
  font-weight: 800;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.product-admin-row .stock-pill {
  justify-self: center;
}
.stock-pill.danger-pill {
  background: #fff;
  color: var(--danger);
  border: 1px solid #e4aaa2;
}
.stock-pill.low {
  background: #fff;
  color: var(--warn);
  border: 1px solid #e7c178;
}
.stock-pill.ok {
  background: #fff;
  color: var(--ok);
  border: 1px solid #b8dfc5;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
  border: 1px dashed #c7ced6;
  border-radius: 8px;
}
.empty.inline { min-height: 0; border: 0; }

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(13, 22, 32, .24);
  width: min(560px, calc(100vw - 28px));
}
dialog::backdrop { background: rgba(14, 20, 28, .45); }
.dialog-card { padding: 18px; display: grid; gap: 14px; }
.dialog-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dialog-actions .ghost-button,
.dialog-actions .primary-button {
  width: 100%;
}
.stock-scan input[name="sku"] {
  height: 56px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}
.sale-done-summary {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-accent);
  padding: 18px;
}
.bulk-product, .bulk-preview {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-accent);
  padding: 14px;
}
.bulk-product span, .bulk-preview span {
  color: var(--muted);
}
.bulk-product strong, .bulk-preview strong {
  font-size: 24px;
}
.bulk-sale input[type="number"] {
  height: 58px;
  font-size: 26px;
  font-weight: 800;
}
.operator-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.operator-strip div {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  padding: 10px 12px;
}
.operator-strip strong {
  display: block;
  margin-bottom: 2px;
}
.operator-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}
.settings-grid.single-settings {
  grid-template-columns: 1fr;
}
.client-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}
.clients-panel { margin-top: 14px; }
.client-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.client-list article.inactive {
  opacity: .72;
  background: #f7f7f7;
}
.client-list article.active {
  border-color: var(--accent);
  background: var(--soft-accent);
}
.client-list strong { display: block; }
.client-list span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 13px;
}
.membership-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.membership-list small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
  color: var(--muted);
}
.membership-list small.inactive {
  background: #f3f4f6;
  color: #8b2f2f;
}
.membership-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}
.membership-list form { display: inline; }
.membership-list button {
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0;
  font-size: 12px;
}
.client-actions {
  display: grid;
  gap: 8px;
  align-items: center;
}
.client-actions form {
  display: grid;
  gap: 6px;
  margin: 0;
}
.client-actions select,
.client-actions input {
  height: 36px;
  min-width: 190px;
}
.danger-button {
  color: var(--danger);
  border-color: #e4aaa2;
}
.danger-primary {
  background: var(--danger);
  border-color: var(--danger);
}
.dialog-note {
  color: var(--muted);
  font-size: 14px;
}
.fixed-client-box,
.delete-code-box {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-accent);
  padding: 12px;
}
.fixed-client-box span,
.delete-code-box span {
  color: var(--muted);
  font-size: 13px;
}
.fixed-client-box strong {
  font-size: 18px;
}
.delete-code-box strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 32px;
  letter-spacing: 0;
}
.access-blocked {
  display: grid;
  gap: 16px;
  max-width: 720px;
  padding: 22px;
}
.access-blocked p {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}
.user-chip a {
  color: #ffd166;
  text-decoration: none;
}
.login-body {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.68), rgba(238,242,245,.88)),
    #eef2f5;
}
.login-sales-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 44px));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 30px 90px rgba(23, 50, 77, .26);
  backdrop-filter: blur(18px);
}
.login-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-width: 0;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(17,24,39,.76), rgba(17,24,39,.18) 62%),
    linear-gradient(180deg, rgba(17,24,39,.10), rgba(17,24,39,.72) 72%),
    url("/static/pos/img/login-customers-scene.png") center / cover no-repeat,
    #311827;
  color: #fff;
}
.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 24%);
  pointer-events: none;
}
.login-panel > * {
  position: relative;
  z-index: 1;
}
.login-card {
  width: 100%;
  display: grid;
  align-content: center;
  gap: 22px;
  border: 0;
  border-left: 1px solid rgba(24,33,43,.08);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  padding: 46px;
}
.login-brand {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
  color: #fff;
}
.login-brand .brand-mark {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.35), transparent 28%),
    linear-gradient(135deg, #f9d56e 0%, #f27b55 48%, #9f3f54 100%);
  color: #fff;
}
.login-copy {
  max-width: 600px;
}
.login-kicker {
  color: #9f3f54;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.login-panel .login-kicker {
  color: #ffd166;
}
.login-copy h1 {
  margin: 10px 0 14px;
  max-width: 620px;
  font-size: 50px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 12px 38px rgba(0,0,0,.32);
}
.login-copy p,
.login-card-head p,
.login-footnote {
  color: var(--muted);
  line-height: 1.5;
}
.login-copy p {
  max-width: 500px;
  color: #eef4f6;
  font-size: 17px;
  text-shadow: 0 8px 24px rgba(0,0,0,.34);
}
.login-assurance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.login-assurance article {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(17,24,39,.48);
  backdrop-filter: blur(10px);
  padding: 14px;
}
.login-assurance svg {
  width: 22px;
  height: 22px;
  margin-bottom: 12px;
  fill: none;
  stroke: #ffd166;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-assurance strong,
.login-assurance span {
  display: block;
}
.login-assurance span {
  margin-top: 5px;
  color: #dbe4ec;
  font-size: 13px;
  line-height: 1.4;
}
.not-found-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(255,255,255,.90), rgba(255,255,255,.68)),
    linear-gradient(135deg, #17324d 0%, #9f3f54 58%, #f0b84f 100%);
}
.not-found-card {
  width: min(760px, 100%);
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 28px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 8px;
  padding: 42px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 30px 90px rgba(23, 50, 77, .26);
}
.not-found-brand {
  margin-bottom: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.not-found-copy {
  display: grid;
  gap: 10px;
  max-width: 620px;
}
.not-found-copy h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
}
.not-found-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.not-found-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 154px;
  min-height: 44px;
  text-align: center;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.not-found-actions .not-found-button,
.not-found-actions .not-found-button:visited,
.not-found-actions .not-found-button:hover,
.not-found-actions .not-found-button:focus {
  text-decoration: none;
}
.login-card-head h2 {
  margin: 8px 0 6px;
  font-size: 34px;
  line-height: 1.05;
}
.login-card form {
  display: grid;
  gap: 14px;
}
.login-card label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}
.login-card input {
  height: 48px;
  border: 1px solid #cfd7df;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 14px;
  outline: 0;
}
.login-card input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(159,63,84,.12);
}
.login-error {
  border: 1px solid #e4aaa2;
  border-radius: 8px;
  background: var(--soft-danger);
  color: var(--danger);
  padding: 10px 12px;
  font-size: 13px;
}
.login-submit {
  width: 100%;
  margin-top: 4px;
}
.login-footnote {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 13px;
}
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.analytics-kpis article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  padding: 14px;
}
.analytics-kpis span {
  color: var(--muted);
  font-size: 13px;
}
.analytics-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 14px;
}
.analytics-panel { min-height: 290px; }
.chart-wide { grid-row: span 2; }
.daily-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  align-items: end;
  gap: 5px;
  height: 360px;
  padding: 18px 14px 12px;
}
.daily-bar {
  display: grid;
  grid-template-rows: 1fr 28px;
  align-items: end;
  min-width: 0;
  height: 100%;
}
.daily-bar span {
  display: block;
  min-height: 3px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #9f3f54, #d66572);
}
.daily-bar small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  transform: rotate(-45deg);
}
.bar-list, .decision-list, .insight-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}
.bar-list article {
  display: grid;
  gap: 8px;
}
.bar-list article > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.bar-list strong, .decision-list strong { display: block; }
.bar-list span, .decision-list span {
  color: var(--muted);
  font-size: 13px;
}
.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}
.bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--accent);
}
.decision-list article {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.insight-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.insight-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-accent);
  padding: 12px;
}
.insight-list strong {
  display: block;
  font-size: 24px;
}
.insight-list span {
  color: var(--muted);
  font-size: 13px;
}
.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.settings-fields.compact-fields {
  grid-template-columns: 1fr;
}
.settings-fields label:nth-child(6),
.settings-fields label:nth-child(7) {
  grid-column: 1 / -1;
}
.settings-fields p {
  display: grid;
  gap: 6px;
  margin: 0;
}
.settings-fields p label {
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}
.settings-fields p input,
.settings-fields p select {
  width: 100%;
}
.compact-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px;
}
.category-tabs {
  margin: 0 0 14px;
  overflow-x: auto;
}
.color-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.category-tabs .color-dot {
  margin-right: 0;
}
.settings-fields input[type="file"] {
  height: auto;
  padding: 10px;
}
.settings-actions {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: flex;
  justify-content: flex-end;
}
.receipt-preview { min-height: 520px; }
.preview-ticket {
  width: min(260px, calc(100% - 28px));
  margin: 18px auto;
  border: 1px dashed #9aa4b2;
  background: #fff;
  padding: 16px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.preview-ticket img {
  max-width: 120px;
  max-height: 70px;
  object-fit: contain;
  margin-bottom: 8px;
}
.preview-logo {
  display: grid;
  place-items: center;
  width: 84px;
  height: 54px;
  margin: 0 auto 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.preview-ticket h3 { margin: 0 0 4px; }
.preview-ticket span {
  display: block;
  color: #555;
  font-size: 12px;
  margin-top: 2px;
}
.preview-line {
  border-top: 1px dashed #777;
  margin: 12px 0;
}
.sale-done-summary span {
  color: var(--muted);
  font-size: 14px;
}
.sale-done-summary strong {
  font-size: 36px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 120%);
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  opacity: 0;
  transition: .2s ease;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app-shell, .app-shell[data-sidebar="closed"] { grid-template-columns: 1fr; }
  .app-shell {
    min-height: 100vh;
    height: auto;
  }
  .workspace,
  .workspace.page-venta {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block;
  }
  .workspace::before {
    inset: 0;
  }
  .sidebar {
    position: fixed;
    z-index: 4;
    width: 250px;
  }
  .app-shell[data-sidebar="closed"] .sidebar { transform: translateX(-100%); }
  .pos-grid, .split-page { grid-template-columns: 1fr; }
  .products-panel, .cart-panel { min-height: 520px; }
  .sale-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operator-strip { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .audit-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .audit-filter-actions {
    justify-content: stretch;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .audit-filter-actions > * { flex: 1 1 0; }
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-row: auto; }
  .login-body { place-items: start center; }
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .login-card {
    border-left: 0;
    padding: 34px;
  }
  .login-copy h1 {
    font-size: 38px;
  }
  .not-found-card { min-height: 0; }
}

@media (max-width: 640px) {
  .workspace { padding: 10px; }
  .topbar { grid-template-columns: 44px 1fr; }
  .topbar-sale .topbar-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    flex-wrap: wrap;
  }
  .topbar-sale .topbar-actions > * {
    flex: 1 1 auto;
  }
  .topbar .ghost-button, .topbar .primary-button, .topbar .ghost-link { grid-column: span 1; }
  .metrics { grid-template-columns: 1fr; }
  .stock-filters { grid-template-columns: 1fr; }
  .audit-filters { grid-template-columns: 1fr; }
  .cart-item, .stock-row { grid-template-columns: 1fr; }
  .line-price { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-fields { grid-template-columns: 1fr; }
  .analytics-kpis, .insight-list { grid-template-columns: 1fr; }
  .daily-chart { height: 260px; }
  .login-body { padding: 12px; }
  .login-panel,
  .login-card {
    padding: 22px;
  }
  .login-copy h1 {
    font-size: 30px;
  }
  .not-found-body { padding: 12px; }
  .not-found-card { padding: 24px; }
  .not-found-copy h1 { font-size: 30px; }
  .not-found-actions > * { flex: 1 1 100%; }
  .login-assurance {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }

  .workspace::before {
    inset: 0 0 0 220px;
  }

  .sidebar {
    padding: 10px;
  }

  .sidebar a {
    padding-inline: 8px;
  }

  .topbar,
  .topbar-stock,
  .topbar-history {
    grid-template-columns: 44px minmax(220px, 1fr);
  }

  .topbar-actions,
  .topbar-sale .topbar-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    flex-wrap: wrap;
  }

  .topbar-actions > *,
  .topbar-sale .topbar-actions > * {
    flex: 1 1 150px;
  }

  .pos-grid,
  .split-page,
  .analytics-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .products-panel,
  .cart-panel {
    min-height: 420px;
  }
}

@media (max-width: 980px) {
  body {
    min-width: 0;
  }

  .app-shell[data-sidebar="open"] .workspace {
    pointer-events: none;
  }

  .sidebar {
    width: min(82vw, 300px);
    max-width: 300px;
    overflow-y: auto;
    box-shadow: 18px 0 44px rgba(15, 23, 42, .22);
  }

  .app-shell[data-sidebar="open"] .sidebar {
    transform: translateX(0);
  }

  .app-shell[data-sidebar="closed"] .sidebar {
    transform: translateX(-105%);
  }

  .workspace {
    padding: 14px;
  }

  .workspace.page-venta {
    overflow: visible;
  }

  .panel {
    box-shadow: 0 10px 26px rgba(27, 38, 49, .07);
  }

  .data-list.compact,
  .product-list,
  .cart-list {
    max-height: none;
    overflow: visible;
  }

  .receipt-table,
  .data-list {
    overflow-x: auto;
  }

  .product-admin-row,
  .sale-row,
  .audit-row,
  .cash-session-row,
  .movement-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .cash-session-row .mini-link {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  .row-actions,
  .audit-filter-actions,
  .client-actions {
    width: 100%;
    justify-content: stretch;
  }

  .row-actions > *,
  .audit-filter-actions > *,
  .client-actions > * {
    flex: 1 1 auto;
  }

  .client-list article {
    grid-template-columns: 1fr;
  }

  .client-actions select,
  .client-actions input {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .topbar,
  .topbar-stock,
  .topbar-history {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-title {
    min-width: 0;
  }

  .section-title strong,
  .panel-head h2 {
    font-size: 17px;
  }

  .section-title span,
  .panel-head p {
    font-size: 12px;
  }

  .search-box {
    max-width: none;
  }

  .notice-band,
  .panel-head,
  .bar-list article > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .notice-band .ghost-button,
  .panel-head .ghost-button,
  .panel-head .primary-button,
  .panel-head .ghost-link {
    width: 100%;
  }

  .metrics,
  .analytics-kpis,
  .compact-kpis,
  .insight-list,
  .operator-strip {
    grid-template-columns: 1fr;
  }

  .product-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-meta {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    text-align: left;
  }

  .product-meta b,
  .product-meta small {
    min-width: 0;
    text-align: left;
  }

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

  .qty-control {
    max-width: 220px;
  }

  .line-price {
    text-align: left;
  }

  .payment-fields,
  .discount-fields,
  .settings-fields,
  .form-grid,
  .dialog-actions,
  .refund-lines label {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions .primary-button,
  .settings-actions .ghost-button {
    width: 100%;
  }

  .daily-chart {
    height: 260px;
    overflow-x: auto;
    grid-template-columns: repeat(14, minmax(26px, 1fr));
  }

  .login-shell {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .workspace {
    padding: 8px;
  }

  .icon-button,
  .ghost-button,
  .primary-button,
  .ghost-link {
    min-height: 42px;
    height: auto;
    padding-inline: 10px;
    white-space: normal;
  }

  .topbar-actions > *,
  .topbar-sale .topbar-actions > * {
    flex-basis: calc(50% - 5px);
  }

  .panel-head,
  .product-list,
  .cart-list,
  .totals,
  .data-list,
  .receipt-table,
  .settings-fields {
    padding: 10px;
  }

  .products-panel,
  .cart-panel {
    min-height: auto;
  }

  .product-row,
  .cart-item,
  .stock-row,
  .sale-row,
  .movement-row,
  .client-list article {
    padding: 10px;
  }

  .total-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .total-line strong {
    font-size: 22px;
  }

  .sale-items span {
    max-width: 100%;
  }

  .stock-filters {
    grid-template-columns: 1fr;
  }

  .audit-filters {
    padding: 10px;
  }

  .period-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .period-tabs a {
    flex: 0 0 auto;
  }

  .dialog-card {
    padding: 14px;
  }

  dialog {
    width: calc(100vw - 16px);
  }
}

@media (max-width: 760px) {
  .login-body {
    min-height: 100svh;
    place-items: start center;
    overflow: auto;
    padding: 10px;
  }

  .login-sales-canvas {
    opacity: .45;
  }

  .login-shell {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    border-radius: 8px;
  }

  .login-card {
    order: 1;
    min-height: auto;
    align-content: start;
    gap: 16px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 22px;
  }

  .login-panel {
    order: 2;
    min-height: auto;
    gap: 18px;
    padding: 20px;
    background:
      linear-gradient(90deg, rgba(17,24,39,.82), rgba(17,24,39,.56)),
      url("/static/pos/img/login-customers-scene.png") center / cover no-repeat,
      #311827;
  }

  .login-brand {
    gap: 10px;
  }

  .login-copy h1 {
    margin: 8px 0 8px;
    font-size: 28px;
    line-height: 1.05;
  }

  .login-copy p {
    font-size: 14px;
  }

  .login-card-head h2 {
    font-size: 28px;
  }

  .login-card input {
    height: 46px;
  }

  .login-assurance {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .login-assurance article {
    padding: 10px;
  }

  .login-assurance svg {
    width: 18px;
    height: 18px;
    margin-bottom: 8px;
  }
}

@media (max-width: 420px) {
  .login-body {
    padding: 0;
    background: #fff;
  }

  .login-shell {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-card {
    padding: 20px 16px;
  }

  .login-panel {
    padding: 18px 16px;
  }

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

  .login-card-head h2 {
    font-size: 26px;
  }

  .login-footnote {
    font-size: 12px;
  }
}
