:root {
  --red: #d71920;
  --red-dark: #9f1018;
  --red-soft: #fff0f1;
  --ink: #1a1415;
  --muted: #7a7071;
  --line: #eee4e5;
  --paper: #ffffff;
  --milk: #faf7f6;
  --smoke: #f5f0f0;
  --green: #14845f;
  --amber: #b86b00;
  --blue: #2757a8;
  --shadow: none;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --sidebar-w: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ——— Sidebar (clara) ——— */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 14px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
}

.brand-mark-text {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand strong,
.user-pill strong,
.store-card strong {
  display: block;
}

.brand strong {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand span,
.user-pill small,
.store-card small,
.muted {
  color: var(--muted);
  font-size: 0.78rem;
}

.brand span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.nav-list::-webkit-scrollbar {
  width: 4px;
}

.nav-list::-webkit-scrollbar-thumb {
  background: #e4d4d5;
  border-radius: 999px;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-group-label {
  padding: 2px 10px 6px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--smoke);
}

.nav-item.active {
  color: var(--red-dark);
  background: var(--red-soft);
  font-weight: 700;
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex-shrink: 0;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 800;
}

.nav-item.active .nav-icon {
  color: #fff;
  background: var(--red);
}

.nav-label {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
}

.store-card {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  padding: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.store-card--setup {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.store-card--setup:hover,
.store-card--setup:focus-visible {
  border-color: #e8b4b8;
  background: var(--red-soft);
  outline: none;
}

.store-card:disabled {
  cursor: default;
}

.app-logged-out .topbar {
  display: none;
}

.app-logged-out .login-stage {
  min-height: calc(100vh - 40px);
}

.mini-progress,
.bar-track {
  overflow: hidden;
  height: 6px;
  margin-top: 10px;
  background: var(--smoke);
  border-radius: 999px;
}

.mini-progress span,
.bar-track span {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: inherit;
}

/* ——— Workspace ——— */
.workspace {
  min-width: 0;
  padding: 20px 28px 32px;
  background: var(--milk);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -20px -28px 18px;
  padding: 16px 28px;
  background: rgba(250, 247, 246, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-copy {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 0.95rem;
  font-weight: 750;
}

.eyebrow {
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-pill {
  display: inline-grid;
  grid-template-columns: 8px auto;
  align-items: center;
  column-gap: 8px;
  min-height: 38px;
  padding: 6px 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.sync-pill span {
  grid-row: span 2;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
}

.sync-pill strong,
.sync-pill small {
  line-height: 1.05;
}

.sync-pill strong {
  font-size: 0.74rem;
}

.sync-pill small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.sync-pill.warn span {
  background: var(--amber);
}

.sync-pill.danger span {
  background: var(--red-dark);
}

.sync-pill.syncing span {
  background: var(--red);
  animation: syncPulse 1s ease-in-out infinite;
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-box input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
}

.table-search {
  min-width: 200px;
  max-width: 300px;
  flex: 1 1 200px;
}

select,
.ghost-button,
.primary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

select,
.ghost-button {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
}

.ghost-button:hover:not(:disabled) {
  border-color: #dfc4c6;
  background: var(--smoke);
}

.primary-button,
.danger-button {
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  font-weight: 750;
}

.primary-button:hover:not(:disabled) {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.mini-button {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
}

.danger-button {
  background: var(--ink);
  border-color: var(--ink);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.user-pill > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

.view {
  animation: enter 0.28s var(--ease) both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— Page chrome ——— */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel,
.card,
.metric-card,
.hero-card,
.table-card,
.pos-panel,
.form-card,
.login-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.panel,
.card,
.table-card,
.form-card {
  padding: 16px;
}

.panel-header,
.section-heading,
.table-toolbar,
.hero-row,
.split-row,
.total-row,
.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-footnote {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

/* ——— Login ——— */
.login-stage {
  display: grid;
  min-height: calc(100vh - 40px);
  place-items: center;
}

.login-card {
  display: grid;
  width: min(100%, 400px);
  gap: 20px;
  padding: 28px;
}

.auth-brand {
  padding: 0;
}

.login-frame,
.login-panel-brand,
.login-highlights,
.login-brand-copy {
  display: contents;
}

/* ——— Dashboard / metrics ——— */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 14px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: auto;
  padding: 18px;
}

.hero-card::after,
.hero-card::before,
.metric-card::after {
  display: none;
}

.hero-content {
  display: grid;
  gap: 14px;
  max-width: none;
}

.hero-number {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.metric-grid-dashboard {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card {
  padding: 14px;
  transition: border-color 0.15s ease;
}

.metric-card:hover {
  border-color: #e4c4c6;
  transform: none;
  box-shadow: none;
}

.metric-label,
.metric-card .eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.metric-card-dual .metric-split {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.metric-split-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card-dual .metric-split-item .metric-value {
  margin-top: 4px;
  font-size: 1.05rem;
}

.metric-value-sub {
  color: var(--ink);
}

.metric-delta {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  color: var(--muted);
  background: var(--smoke);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.metric-delta.warn {
  color: var(--amber);
  background: #fff5df;
}

.metric-delta.danger {
  color: var(--red-dark);
  background: var(--red-soft);
}

.module-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  margin-top: 0;
}

.content-grid-dashboard {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
}

.two-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.chip-row,
.action-row,
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
}

.chip {
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #f4d0d2;
}

.badge {
  color: var(--muted);
  background: var(--smoke);
}

.badge.success {
  color: var(--green);
  background: #eaf8f1;
}

.badge.warn {
  color: var(--amber);
  background: #fff5df;
}

.badge.danger {
  color: var(--red-dark);
  background: var(--red-soft);
}

.alert-inline {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 650;
}

.alert-inline.success {
  color: var(--green);
  background: #eaf8f1;
  border-color: #cbeede;
}

.alert-inline.danger {
  color: var(--red-dark);
  background: var(--red-soft);
  border-color: #f2c9cc;
}

.alert-inline.warn {
  color: var(--amber);
  background: #fff5df;
  border-color: #f3dfb8;
}

.alert-list {
  display: grid;
  gap: 8px;
}

.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.alert-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.alert-row strong {
  display: block;
  font-size: 0.86rem;
}

.alert-row .muted {
  display: block;
  margin-top: 2px;
}

.compact-table {
  border-radius: var(--radius-lg);
}

.onboarding-backdrop,
.pix-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26, 20, 21, 0.4);
}

.onboarding-backdrop {
  z-index: 1300;
}

.onboarding-modal,
.pix-modal {
  width: min(100%, 480px);
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.pix-modal {
  width: min(100%, 400px);
  text-align: center;
}

.pix-qr {
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.pix-copy-field {
  width: 100%;
  padding: 10px;
  font: inherit;
  font-size: 0.76rem;
  color: var(--ink);
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}

.inline-input {
  width: 100%;
  min-width: 100px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.bar-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-side-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
}

.stock-panel-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stock-panel-section:first-child {
  padding-top: 0;
}

.stock-panel-section:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.stock-panel-heading h3 {
  margin: 4px 0 0;
}

.stock-panel-copy {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.stock-side-panel .bars {
  gap: 8px;
}

.stock-side-panel .bar-track {
  margin-top: 0;
}

.stock-side-panel .bar-label {
  margin-bottom: 4px;
  font-size: 0.76rem;
}

.stock-side-panel .empty-state {
  margin: 0;
  padding: 4px 0 0;
  font-size: 0.82rem;
  min-height: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--milk);
}

td {
  font-size: 0.86rem;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 240, 241, 0.4);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.product-tile {
  display: grid;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--ease);
}

.product-tile:hover {
  border-color: #efb9bd;
  box-shadow: 0 8px 22px rgba(26, 20, 21, 0.08);
  transform: translateY(-1px);
}

.product-tile-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--milk);
  overflow: hidden;
}

.product-tile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s var(--ease);
}

.product-tile:hover .product-tile-thumb {
  transform: scale(1.04);
}

.product-tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.64rem;
}

.product-tile-body {
  display: grid;
  gap: 3px;
  padding: 10px;
}

.product-tile-category {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-tile-body h3 {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.25;
}

.product-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.product-tile-footer strong {
  color: var(--red-dark);
  font-size: 0.92rem;
}

.product-tile-sku {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
}

/* ——— PDV shell (janela exclusiva) ——— */
body.pdv-shell .sidebar,
body.pdv-shell .topbar {
  display: none !important;
}

body.pdv-shell .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.pdv-shell .workspace {
  padding: 0;
  margin: 0;
  background: var(--paper);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.pdv-shell .view {
  animation: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.pdv-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--milk);
}

.pdv-topbar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: end;
  flex: 0 0 auto;
  padding: 12px 16px 14px;
  background:
    linear-gradient(180deg, #fff 0%, #fbf8f8 100%);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}

.pdv-brand-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 64px;
  padding-bottom: 6px;
}

.pdv-brand-chip strong {
  color: var(--red-dark);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pdv-search-panel {
  display: grid;
  gap: 5px;
  max-width: 760px;
  width: 100%;
}

.pdv-search-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pdv-top-search {
  max-width: none;
}

.pdv-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-bottom: 2px;
}

.pdv-banner {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.pdv-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 340px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.pdv-categories,
.pdv-catalog,
.pdv-checkout {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
}

.pdv-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.pdv-categories-title {
  margin: 0 6px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdv-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdv-cat-item:hover {
  background: var(--smoke);
}

.pdv-cat-item.active {
  background: var(--red-soft);
  border-color: #f2c9cc;
  box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.04);
}

.pdv-cat-thumb {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--smoke);
  border: 1px solid var(--line);
}

.pdv-cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdv-cat-thumb-all {
  border-color: #f2c9cc;
}

.pdv-cat-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.pdv-cat-text strong {
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdv-cat-text small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.pdv-catalog {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px 16px;
  overflow: auto;
}

.pdv-product-grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.pdv-product-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdv-checkout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #faf7f6 0%, #f7f2f2 100%);
  border-left: 1px solid var(--line);
}

.pdv-checkout-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid #eadfdf;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(26, 20, 21, 0.02);
}

.pdv-customer-panel {
  flex: 0 0 auto;
}

.pdv-panel-heading,
.pdv-cart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pdv-panel-heading h4,
.pdv-cart-header h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pdv-panel-heading .muted,
.pdv-cart-header .muted {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 650;
}

.pdv-cart-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.pdv-payment-panel {
  flex: 0 0 auto;
  margin-top: auto;
  gap: 10px;
  background:
    linear-gradient(180deg, #fff 0%, #fffafb 100%);
  border-color: #f0d9db;
}

.pdv-checkout-actions {
  display: grid;
  gap: 6px;
}

.pdv-pay-button {
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 12px;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px rgba(215, 25, 32, 0.18);
}

.pdv-pay-button:disabled {
  box-shadow: none;
}

.pdv-clear-cart-btn {
  min-height: 40px;
  border-radius: 10px;
}

/* legado / fallback */
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.pos-panel {
  padding: 16px;
}

.pos-catalog {
  min-height: 640px;
}

.pos-checkout {
  position: sticky;
  top: 76px;
}

.pdv-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pdv-search-icon {
  position: absolute;
  left: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.pdv-search-svg {
  display: block;
}

.pdv-search-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 44px 12px 42px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #e5d8d9;
  border-radius: 12px;
  outline: 0;
  font-size: 0.95rem;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdv-top-search .pdv-search-input {
  min-height: 50px;
  background: #fff;
  border-color: #e2d4d5;
  box-shadow: 0 1px 0 rgba(26, 20, 21, 0.03);
}

.pdv-search-input:focus {
  border-color: #efb9bd;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.1);
}

.pdv-search-input::placeholder {
  color: #9a8e8f;
  font-weight: 550;
}

.pdv-search-clear {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: var(--smoke);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.category-card {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.category-card:hover {
  border-color: #efb9bd;
  transform: none;
}

.category-card.active {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: none;
}

.category-card-thumb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.15rem;
}

.category-card-thumb.all {
  background: var(--smoke);
}

.category-card-label {
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.2;
}

.category-card-count {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.pdv-results-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pdv-results-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pdv-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--smoke);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pdv-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 750;
  transition: background 0.15s ease, color 0.15s ease;
}

.pdv-view-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.pdv-view-btn.active {
  color: var(--red-dark);
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(26, 20, 21, 0.06);
}

.pdv-view-btn svg {
  display: block;
  flex-shrink: 0;
}

.product-list-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 12px 8px 8px;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  overflow: visible;
  z-index: 1;
}

.product-list-row:hover {
  z-index: 20;
  border-color: #efb9bd;
  background: #fffafb;
  box-shadow: 0 6px 18px rgba(26, 20, 21, 0.08);
}

.product-list-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--milk);
  border: 1px solid var(--line);
}

.product-list-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-list-body h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-list-body .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
}

.product-list-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex-shrink: 0;
}

.product-list-side strong {
  color: var(--red-dark);
  font-size: 0.95rem;
  white-space: nowrap;
}

.pdv-list-photo-preview {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 6px;
  width: 180px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid #efb9bd;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(26, 20, 21, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s var(--ease), visibility 0.16s ease;
}

.pdv-list-photo-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.pdv-list-photo-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--milk);
  display: block;
}

.pdv-list-photo-preview span {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-list-row:hover .product-list-thumb {
  border-color: #efb9bd;
  box-shadow: 0 0 0 2px rgba(215, 25, 32, 0.08);
}

.pdv-empty-catalog {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--milk);
}

.pdv-product-grid.is-list .pdv-empty-catalog {
  width: 100%;
}

.pdv-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pdv-customer-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(135deg, #fff7f8 0%, #faf7f6 55%, #fff 100%);
  border: 1px solid #f0d9db;
  border-radius: 12px;
}

.pdv-customer-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--red-dark);
  background: #ffe8ea;
  border: 1px solid #f2c9cc;
  border-radius: 11px;
  font-size: 1rem;
  font-weight: 800;
}

.pdv-customer-avatar.is-identified {
  color: #fff;
  background: linear-gradient(160deg, #d71920 0%, #9f1018 100%);
  border-color: #9f1018;
}

.pdv-customer-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pdv-customer-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--smoke);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pdv-customer-status.is-on {
  color: #0f6b4d;
  background: #e8f7f0;
  border-color: #c7e8d8;
}

.pdv-customer-info h3 {
  margin: 4px 0 2px;
  font-size: 0.95rem;
  line-height: 1.25;
}

.pdv-customer-info .muted {
  margin: 0;
  font-size: 0.74rem;
}

.pdv-customer-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdv-customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.pdv-loyalty-chip {
  color: var(--red-dark);
  background: #fff0f1;
  border: 1px solid #f2c9cc;
  border-radius: 999px;
  padding: 1px 7px;
}

.pdv-customer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.pdv-customer-search-field {
  position: relative;
  z-index: 20;
}

.pdv-customer-search-field .pdv-search-input {
  min-height: 40px;
  font-size: 0.86rem;
}

.pdv-customer-search-box {
  display: grid;
  gap: 8px;
}

.pdv-new-customer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 750;
}

.pdv-customer-results {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #eadfdf;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(26, 20, 21, 0.08);
}

.pdv-customer-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pdv-customer-result:hover,
.pdv-customer-result.active {
  background: var(--red-soft);
  border-color: #f4d0d2;
}

.pdv-customer-result-name {
  font-size: 0.84rem;
  font-weight: 750;
}

.pdv-customer-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-align: center;
}

.pdv-cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #f2c9cc;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pdv-cart-list {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.pdv-cart-list.is-empty {
  display: flex;
  align-items: stretch;
}

.pdv-cart-empty {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  width: 100%;
  min-height: 96px;
  padding: 16px 12px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(180deg, #fcfafa 0%, #f7f2f2 100%);
  border: 1px dashed #e5d8d9;
  border-radius: 12px;
}

.pdv-cart-empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  color: #b39a9c;
  background: #fff;
  border: 1px solid #eadfdf;
  border-radius: 12px;
}

.pdv-cart-empty strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.pdv-cart-empty p {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 650;
  max-width: 22ch;
}

.cart-item-rich {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid #eadfdf;
  border-radius: 12px;
}

.cart-item-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--milk);
}

.cart-item-details {
  min-width: 0;
}

.cart-item-details strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.cart-item-details .muted {
  margin: 2px 0 0;
  font-size: 0.7rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.cart-item-total {
  align-self: start;
  padding-top: 2px;
  white-space: nowrap;
  color: var(--red-dark);
  font-weight: 800;
  font-size: 0.88rem;
}

.qty-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--red-dark);
  background: var(--paper);
  border: 1px solid #eadfdf;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.qty-btn:hover {
  background: var(--red-soft);
  border-color: #f2c9cc;
}

.pdv-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 10px;
}

.pdv-money-input,
.pdv-payment-select {
  min-height: 42px;
  border-radius: 10px;
  border-color: #e5d8d9;
  font-weight: 700;
}

.pdv-totals {
  display: grid;
  gap: 0;
  padding: 8px 10px;
  background: #fff7f8;
  border: 1px solid #f0d9db;
  border-radius: 12px;
}

.pdv-totals .total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-top: 0;
  font-size: 0.8rem;
}

.pdv-totals .total-row + .total-row {
  border-top: 1px solid #f3e0e1;
}

.pdv-totals .total-row.grand {
  margin-top: 2px;
  padding-top: 8px;
  font-size: 0.95rem;
}

.pdv-totals .total-row.grand strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.pdv-customer-modal {
  width: min(100%, 520px);
  max-height: 90vh;
  overflow: auto;
}

.product-image-upload {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--milk);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.product-image-preview {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.product-image-placeholder {
  display: grid;
  gap: 4px;
  justify-items: start;
  color: var(--muted);
}

.product-image-placeholder span {
  font-size: 1.4rem;
}

.product-image-placeholder p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
}

.product-image-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  cursor: pointer;
}

.product-cost-panel {
  margin-top: 4px;
}

.cost-lines-table th,
.cost-lines-table td {
  vertical-align: top;
}

.cost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.cost-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.8rem;
}

.cost-summary-item.total {
  background: var(--red-soft);
  border-color: #f2c9cc;
  font-weight: 800;
}

.cost-summary-item.total strong {
  color: var(--red-dark);
}

.link-button {
  display: inline;
  border: 0;
  background: none;
  padding: 0;
  color: var(--red-dark);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.variant-table {
  min-width: 100%;
}

.variant-table th,
.variant-table td {
  white-space: normal;
}

.product-variant-flag {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 750;
}

.product-list-side .product-variant-flag {
  position: static;
  background: #eef4ff;
  border: 1px solid #d5e2f7;
}

.pdv-variant-modal {
  width: min(100%, 480px);
}

.pdv-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(26, 20, 21, 0.52) 0%, rgba(26, 20, 21, 0.62) 100%);
  backdrop-filter: blur(3px);
}

.pdv-overlay-modal {
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  max-height: min(920px, calc(100vh - 36px));
  max-height: min(920px, calc(100dvh - 36px));
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #eadfdf;
  border-radius: 18px;
  box-shadow: 0 28px 64px rgba(26, 20, 21, 0.28);
}

.pdv-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #fff 0%, #fbf8f8 100%);
}

.pdv-overlay-header h2 {
  margin: 4px 0 4px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.pdv-overlay-header .muted {
  margin: 0;
  max-width: 54ch;
}

.pdv-overlay-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.pdv-confirm-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px 18px 18px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #fcfafa;
}

.pdv-confirm-customer {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #f0d9db;
  border-radius: 12px;
}

.pdv-confirm-customer strong {
  display: block;
  margin-top: 2px;
  font-size: 0.98rem;
}

.pdv-confirm-customer .muted {
  margin: 2px 0 0;
  font-size: 0.76rem;
}

.pdv-confirm-items {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 2px;
}

.pdv-confirm-item,
.pdv-receipt-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid #eadfdf;
  border-radius: 12px;
}

.pdv-confirm-thumb,
.pdv-receipt-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--milk);
}

.pdv-confirm-item-body,
.pdv-receipt-item > div {
  min-width: 0;
}

.pdv-confirm-item-body strong,
.pdv-receipt-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.pdv-confirm-item-body .muted,
.pdv-receipt-item .muted {
  margin: 3px 0 0;
  font-size: 0.74rem;
}

.pdv-confirm-item-qty {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #f2c9cc;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pdv-confirm-item-total,
.pdv-receipt-item > strong:last-child {
  color: var(--red-dark);
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.pdv-confirm-side,
.pdv-receipt-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px 18px 18px;
  overflow: auto;
  background: #fff;
}

.pdv-discount-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff7f8;
  border: 1px solid #f0d9db;
  border-radius: 12px;
}

.pdv-discount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdv-discount-head > label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.pdv-discount-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pdv-confirm-totals {
  display: grid;
  gap: 0;
  padding: 12px 14px;
  background: #fff7f8;
  border: 1px solid #f0d9db;
  border-radius: 12px;
}

.pdv-confirm-totals .total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 0;
  font-size: 0.86rem;
}

.pdv-confirm-totals .total-row + .total-row {
  border-top: 1px solid #f3e0e1;
}

.pdv-confirm-totals .total-row.grand {
  padding-top: 10px;
  color: var(--red-dark);
  font-size: 1.05rem;
}

.pdv-confirm-totals .total-row.grand strong {
  font-size: 1.25rem;
  font-weight: 800;
}

.pdv-confirm-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.pdv-confirm-pay-btn {
  min-height: 52px;
  font-size: 0.98rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(215, 25, 32, 0.18);
}

.pdv-receipt-body {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
}

.pdv-receipt-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px 20px;
  overflow: auto;
  background:
    linear-gradient(180deg, #fff 0%, #fcfafa 100%);
  border-right: 1px solid var(--line);
}

.pdv-receipt-brand {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e5d8d9;
}

.pdv-receipt-brand strong {
  color: var(--red-dark);
  font-size: 1.2rem;
  font-weight: 800;
}

.pdv-receipt-brand span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.pdv-receipt-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pdv-receipt-meta > div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: #fff7f8;
  border: 1px solid #f0d9db;
  border-radius: 12px;
}

.pdv-receipt-meta span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pdv-receipt-meta strong {
  font-size: 0.9rem;
}

.pdv-receipt-items {
  display: grid;
  gap: 8px;
}

.pdv-receipt-item {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.pdv-receipt-item img {
  width: 56px;
  height: 56px;
}

.pdv-receipt-footer {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
}

.pdv-receipt-actions-panel .primary-button,
.pdv-receipt-actions-panel .ghost-button {
  min-height: 44px;
  justify-content: center;
}

.pdv-receipt-notice {
  min-height: 1.2em;
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}

.pdv-receipt-done {
  margin-top: auto;
}

@media (max-width: 960px) {
  .pdv-overlay-modal {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .pdv-overlay-body,
  .pdv-receipt-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .pdv-confirm-main,
  .pdv-receipt-sheet {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pdv-confirm-item {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .pdv-confirm-item-qty {
    display: none;
  }

  .pdv-confirm-thumb {
    width: 56px;
    height: 56px;
  }

  .pdv-discount-fields,
  .pdv-receipt-meta {
    grid-template-columns: 1fr;
  }
}

.product-modal {
  width: min(100%, 920px);
  max-height: 92vh;
  overflow: auto;
  padding: 20px 22px 16px;
}

.product-modal-form {
  gap: 14px;
}

.product-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-modal-header h2 {
  margin: 4px 0 0;
}

.product-modal-header .muted {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.product-modal-close {
  flex-shrink: 0;
}

.product-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.product-modal .product-variants-panel {
  margin-top: 4px;
}

#modalRoot,
#costModalRoot {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}

#modalRoot > *,
#costModalRoot > * {
  pointer-events: auto;
}

body.product-modal-open,
body.cost-sheet-modal-open,
body.stock-add-modal-open {
  overflow: hidden;
}

.stock-add-modal {
  width: min(100%, 760px);
}

.stock-add-results {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 2px;
}

.stock-add-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
}

.stock-add-result:hover {
  border-color: #efb9bd;
}

.stock-add-result.active {
  border-color: var(--red-dark);
  background: var(--red-soft);
}

.stock-add-specs {
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(60, 40, 30, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.stock-add-specs h3 {
  margin: 4px 0 2px;
}

.cost-sheet-modal {
  width: min(100%, 1080px);
  max-height: 92vh;
  overflow: auto;
  padding: 20px 22px 16px;
}

.cost-sheet-modal-backdrop {
  z-index: 2000;
}

.template-parts-panel {
  border: 1px solid rgba(60, 40, 30, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  margin-top: 14px;
}

.template-nested-backdrop {
  z-index: 2100;
}

.template-nested-modal {
  width: min(100%, 720px);
}

body.template-nested-open {
  overflow: hidden;
}

body.product-editor-shell .sidebar,
body.product-editor-shell .topbar {
  display: none;
}

body.product-editor-shell .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.product-editor-shell .workspace {
  padding: 20px;
  max-width: 1040px;
  margin: 0 auto;
  background: var(--paper);
}

.product-editor-page {
  padding: 4px 0 20px;
}

.product-modal-backdrop {
  z-index: 2000;
}

.variant-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.variant-picker-card {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 12px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

.variant-picker-card:hover:not(:disabled) {
  border-color: #efb9bd;
  transform: none;
  box-shadow: none;
}

.variant-picker-card.active {
  border-color: var(--red-dark);
  background: var(--red-soft);
}

.variant-picker-card:disabled {
  opacity: 0.4;
}

.variant-picker-value {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item.cart-item-rich {
  border-bottom: 0;
}

.qty-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid #f2c9cc;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

.total-row {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.total-row.grand {
  color: var(--red-dark);
  font-size: 1.1rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.wide {
  grid-column: span 2;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #efb9bd;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.07);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.dre-table td:nth-child(2),
.dre-table td:nth-child(3),
.dre-table th:nth-child(2),
.dre-table th:nth-child(3) {
  text-align: right;
}

.dre-table .level-1 td:first-child {
  font-weight: 800;
}

.dre-table .positive {
  color: var(--green);
  font-weight: 800;
}

.dre-table .negative {
  color: var(--red-dark);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: var(--red);
  border-radius: 50%;
}

.report-card {
  min-height: 140px;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--milk);
  font-size: 0.84rem;
}

.empty-state.compact {
  min-height: 88px;
  padding: 16px;
}

/* ——— Access ——— */
.access-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.access-header h2 {
  margin: 4px 0;
}

.access-metrics {
  margin-bottom: 14px;
}

.access-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.access-tab {
  padding: 8px 14px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 650;
}

.access-tab.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.access-list-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.access-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.access-list-toolbar h3 {
  margin: 0;
  font-size: 0.9rem;
}

.access-list {
  display: grid;
  gap: 6px;
}

.access-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: inherit;
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.access-list-item:hover {
  border-color: #dfc4c6;
  background: var(--paper);
}

.access-list-item.selected {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: none;
}

.access-list-item-main,
.access-list-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.access-list-item-main strong {
  font-size: 0.86rem;
}

.access-list-item .mini-button,
.access-list-toolbar .mini-button {
  margin-top: 0;
}

.access-empty {
  margin: 0;
  padding: 10px 2px;
}

.access-editor-panel {
  min-height: 360px;
}

.access-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.access-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.access-perm-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--milk);
}

.access-perm-details summary {
  cursor: pointer;
  font-weight: 750;
  margin-bottom: 8px;
}

.access-perm-groups {
  display: grid;
  gap: 12px;
}

.access-perm-group h4 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.access-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.access-perm-card {
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.access-perm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.access-perm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.access-perm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}

.access-perm-toggle.compact {
  font-size: 0.74rem;
}

/* ——— Responsive ——— */
@media (max-width: 1280px) {
  .metric-grid-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .pdv-workspace {
    grid-template-columns: 188px minmax(0, 1fr) 300px;
  }

  .pdv-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pdv-brand-chip {
    display: none;
  }

  .pdv-top-actions {
    justify-content: flex-start;
  }

  .pdv-view-btn span {
    display: none;
  }
}

@media (max-width: 900px) {
  .pdv-app {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .pdv-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .pdv-categories,
  .pdv-catalog,
  .pdv-checkout {
    max-height: none;
  }

  .pdv-categories {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pdv-categories-title {
    display: none;
  }

  .pdv-cat-item {
    min-width: 148px;
  }

  .pdv-checkout {
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .pdv-cart-panel {
    min-height: 180px;
  }

  .pdv-cart-list {
    max-height: 220px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 10px;
  }

  .brand div:not(.brand-mark),
  .nav-group-label,
  .nav-label,
  .store-card {
    display: none;
  }

  .brand {
    justify-content: center;
    border-bottom: 0;
    padding-bottom: 4px;
  }

  .nav-item {
    justify-content: center;
    padding: 8px;
  }

  .metric-grid,
  .module-grid,
  .product-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .content-grid,
  .content-grid-dashboard,
  .pos-layout {
    grid-template-columns: 1fr;
  }

  .pos-checkout {
    position: static;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  }
}

@media (max-height: 820px) {
  .sidebar {
    gap: 8px;
    padding-block: 12px;
  }

  .nav-item {
    padding: 7px 9px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand div:not(.brand-mark),
  .nav-group-label,
  .nav-label,
  .store-card {
    display: block;
  }

  .brand {
    justify-content: flex-start;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    flex: none;
    max-height: min(42vh, 22rem);
    overflow-y: auto;
  }

  .nav-item {
    justify-content: flex-start;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 12px 14px;
  }

  .page-toolbar,
  .topbar,
  .topbar-actions,
  .hero-row,
  .section-heading,
  .table-toolbar,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .metric-grid,
  .metric-grid-dashboard,
  .module-grid,
  .insight-grid,
  .two-col,
  .two-mini,
  .product-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: auto;
  }

  .access-layout {
    grid-template-columns: 1fr;
  }
}
