:root {
  --bg: #fff8ef;
  --bg-soft: #fff2df;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --line: rgba(111, 84, 41, 0.12);
  --text: #2f2116;
  --muted: #7d6c5d;
  --brand: #de631d;
  --brand-soft: #ffe3c4;
  --leaf: #acd66c;
  --leaf-deep: #6ba83f;
  --danger: #bf4f39;
  --shadow: 0 24px 64px rgba(123, 82, 28, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 198, 102, 0.38), transparent 26%),
    radial-gradient(circle at top right, rgba(173, 214, 108, 0.18), transparent 24%),
    linear-gradient(180deg, #fffcf7 0%, #fff4e7 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(135deg, rgba(255, 245, 236, 0.96), rgba(255, 248, 241, 0.98)),
    radial-gradient(circle at right 22px center, rgba(244, 223, 207, 0.92) 0, rgba(244, 223, 207, 0.92) 32px, transparent 33px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23706051' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: 0 0, right 0 center, right 20px center;
  background-size: auto, 74px 100%, 18px;
  padding-right: 72px;
  min-height: 72px;
  border-radius: 24px;
  font-weight: 700;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(222, 99, 29, 0.34);
  box-shadow: 0 0 0 4px rgba(255, 168, 94, 0.18);
}

.surface {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  gap: 18px;
}

.topbar {
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 520px) auto;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 18px;
  z-index: 20;
}

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

.menu-btn {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 14px;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-name {
  margin: 2px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-box {
  position: relative;
  min-width: 0;
}

.function-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 60;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 22px;
  max-height: min(420px, 62vh);
  overflow-y: auto;
}

.function-search-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.66);
  text-align: left;
  color: var(--text);
}

.function-search-item:hover,
.function-search-item:focus {
  border-color: rgba(222, 99, 29, 0.18);
  background: linear-gradient(135deg, rgba(255, 238, 219, 0.96), rgba(255, 248, 241, 0.96));
}

.function-search-item strong {
  font-size: 0.98rem;
}

.function-search-item small {
  color: var(--muted);
  line-height: 1.35;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  justify-self: end;
}

.user-session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  justify-self: end;
}

.user-session-icon {
  font-size: 0.95rem;
}

.user-session-name {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.logout-btn {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(191, 79, 57, 0.22);
  background: linear-gradient(135deg, rgba(255, 236, 232, 0.98), rgba(255, 248, 241, 0.98));
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.logout-btn:hover,
.logout-btn:focus {
  background: linear-gradient(135deg, rgba(255, 218, 211, 0.98), rgba(255, 240, 232, 0.98));
  box-shadow: 0 10px 26px rgba(191, 79, 57, 0.12);
}

.lang-btn {
  min-width: 56px;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.lang-btn.is-active {
  background: linear-gradient(135deg, #ffe2bf 0%, #ffc47f 100%);
  color: #4a2711;
}

.page-body {
  min-height: 0;
}

.pos-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(420px, 33vw);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.pos-layout.is-order-overview {
  grid-template-columns: minmax(0, 1fr);
}

.pos-layout.is-order-overview .pos-main-stack {
  grid-column: 1 / -1;
}

.pos-layout.is-order-overview .pos-bill-board {
  min-height: min(72vh, 760px);
  align-content: start;
}

.pos-category-toolbar,
.catalog-panel,
.order-panel,
.section-card,
.metric-card {
  border-radius: var(--radius-xl);
}

.pos-category-toolbar,
.catalog-panel,
.section-card {
  padding: 24px;
}

.pos-category-toolbar {
  position: sticky;
  top: 140px;
  grid-column: 1;
  grid-row: 2;
  display: grid;
  gap: 18px;
}

.pos-left-complete-btn {
  width: 100%;
  min-height: 54px;
  background: linear-gradient(135deg, #2a9b4b 0%, #177b35 100%);
  box-shadow: 0 14px 26px rgba(31, 135, 58, 0.2);
}

.pos-category-list,
.pos-main-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pos-main-stack {
  display: contents;
}

.scanner-panel,
.scanner-form,
.scanner-helper {
  display: grid;
  gap: 14px;
}

.scanner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.scanner-actions > * {
  flex: 1 1 220px;
}

.scanner-status {
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff0df;
  border: 1px solid rgba(222, 99, 29, 0.18);
  color: #9a4517;
  font-weight: 700;
}

.scanner-video-shell {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(111, 84, 41, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.scanner-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #22170f;
}

.pos-catalog-panel {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.pos-catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: stretch;
}

.pos-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
}

.pos-search-field input {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 14px 0;
  min-height: 54px;
}

.pos-search-field input:focus {
  box-shadow: none;
}

.pos-tool-btn {
  min-height: 54px;
  white-space: nowrap;
}

.pos-scan-status {
  margin: 0;
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  max-height: min(58vh, 720px);
  overflow: auto;
  padding: 2px 2px 6px;
}

.pos-product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(70px, auto) auto;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(111, 84, 41, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(63, 42, 22, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(222, 99, 29, 0.2);
  box-shadow: 0 18px 40px rgba(63, 42, 22, 0.1);
}

.pos-product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.78;
  overflow: hidden;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.88), transparent 32%),
    linear-gradient(135deg, #fff3dc 0%, #eef9dc 100%);
  font-size: clamp(2rem, 4vw, 3rem);
}

.pos-product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos-product-media span {
  position: relative;
  z-index: 1;
}

.pos-product-copy {
  min-width: 0;
}

.pos-product-copy h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.pos-product-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-product-meta {
  display: grid;
  gap: 3px;
  padding-right: 52px;
}

.pos-product-meta strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.pos-product-meta small {
  color: var(--muted);
  font-size: 0.78rem;
}

.pos-add-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f27523 0%, #d84f12 100%);
  color: #fffaf4;
  box-shadow: 0 12px 22px rgba(214, 83, 18, 0.24);
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 500;
}

.pos-bottom-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(111, 84, 41, 0.08);
  background: rgba(255, 248, 239, 0.82);
}

.scanner-capture-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.order-panel {
  padding: 22px;
  position: sticky;
  top: 140px;
  grid-column: 3;
  grid-row: 2;
  display: grid;
  gap: 18px;
  min-width: 0;
  max-height: calc(100vh - 156px);
  overflow: auto;
}

.section-top,
.order-panel-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.order-panel-top {
  flex-wrap: wrap;
}

.section-title {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.page-section {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.page-header {
  border-radius: var(--radius-xl);
  padding: clamp(18px, 2.2vw, 28px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  overflow: hidden;
}

.page-header > div:first-child {
  min-width: 0;
}

.page-header .section-title {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.page-header small {
  display: block;
  margin-top: 12px;
  max-width: 780px;
  line-height: 1.45;
}

.category-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin: 18px 0 20px;
}

.category-pill-toolbar {
  width: 100%;
  justify-content: flex-start;
  padding: 16px 18px;
}

.category-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  border: 1px solid var(--line);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.category-pill:hover,
.product-card:hover,
.ghost-btn:hover,
.primary-btn:hover,
.order-chip:hover {
  transform: translateY(-1px);
}

.category-pill.is-active {
  background: linear-gradient(135deg, #ffe0bc 0%, #ffc47f 100%);
  box-shadow: 0 14px 28px rgba(222, 99, 29, 0.16);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(111, 84, 41, 0.08);
  min-width: 0;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-emoji {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff0da 0%, #f2ffd9 100%);
  font-size: 1.8rem;
}

.product-copy h3,
.order-item h3,
.template-preview h3 {
  margin: 0;
  font-size: 1.06rem;
}

.product-copy p,
.order-item p,
.list-row p,
.template-preview p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.product-meta strong,
.summary-list strong,
.metric-card strong,
.list-row strong {
  font-family: "Space Grotesk", sans-serif;
}

.product-meta span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.primary-btn,
.ghost-btn,
.qty-btn {
  border-radius: 16px;
  padding: 12px 16px;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand) 0%, #f28a4b 100%);
  color: #fffaf4;
  font-weight: 700;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-btn.active-toggle {
  background: linear-gradient(135deg, rgba(244, 186, 128, 0.34), rgba(255, 245, 235, 0.92));
  border-color: rgba(219, 93, 23, 0.35);
  color: var(--brand);
  font-weight: 700;
}

.danger-text {
  color: var(--danger);
}

.order-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
}

.order-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.item-badge {
  flex: 0 0 auto;
  padding: 16px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe2c0 0%, #ffd09d 100%);
  color: var(--brand);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.order-chip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  min-width: 0;
}

.order-switcher-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 320px));
  overflow-x: hidden;
  padding: 2px;
  gap: 12px;
  align-items: stretch;
  justify-content: start;
}

.order-chip-board {
  width: 100%;
  min-height: 118px;
  aspect-ratio: auto;
  padding: 14px;
  align-content: center;
  justify-items: start;
}

.order-chip-board span {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.98rem, 1.1vw, 1.28rem);
  line-height: 1.1;
}

.order-chip-board .order-chip-id {
  word-break: break-word;
}

.order-chip-board small {
  font-size: 0.8rem;
}

.order-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(222, 99, 29, 0.24);
  background: rgba(255, 247, 238, 0.92);
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.order-chip.is-active .order-card-action {
  background: linear-gradient(135deg, #ee6a21 0%, #c74d0d 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(222, 99, 29, 0.2);
}

.order-card-action-success {
  background: #ecf9ef;
  color: #168034;
  border-color: rgba(37, 166, 72, 0.22);
}

.order-board-more-btn {
  grid-column: 1 / -1;
  min-height: 54px;
  border-radius: 18px;
  border: 1px dashed rgba(222, 99, 29, 0.32);
  background:
    linear-gradient(90deg, rgba(222, 99, 29, 0.18), rgba(222, 99, 29, 0.03), rgba(222, 99, 29, 0.18)),
    rgba(255, 248, 240, 0.9);
  color: var(--brand);
  font-weight: 900;
}

.order-chip small {
  color: var(--muted);
}

.order-chip.is-active {
  background: linear-gradient(135deg, #ffe2bf 0%, #ffd3a0 100%);
}

.order-chip-status-new {
  border-color: #8eb9ff;
  background: linear-gradient(135deg, #eef6ff 0%, #dcecff 100%);
}

.order-chip-status-preparing {
  border-color: #eac77a;
  background: linear-gradient(135deg, #fff9e8 0%, #fff3d0 100%);
}

.order-chip-status-held {
  border-color: #e3bd5b;
  background: linear-gradient(135deg, #fff7df 0%, #ffe8a3 100%);
}

.order-chip-status-needs_action {
  border-color: #ee8c80;
  background: linear-gradient(135deg, #fff0f0 0%, #ffd8d3 100%);
}

.order-chip-status-ready {
  border-color: #cfa269;
  background: linear-gradient(135deg, #fff4e6 0%, #ffe1bf 100%);
}

.order-chip-status-completed {
  border-color: #9bd7a8;
  background: linear-gradient(135deg, #effaf1 0%, #dff5e4 100%);
}

.recipe-component-palette {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.recipe-component-helper {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.recipe-component-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(229, 213, 199, 0.82);
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.78);
}

.recipe-component-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recipe-component-group-head strong {
  font-size: 0.9rem;
  color: var(--text);
}

.recipe-component-group-head span {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #fff1df;
  color: var(--brand);
  font-weight: 900;
}

.recipe-component-chips {
  gap: 8px;
}

.recipe-component-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recipe-component-chip small {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 0.72em;
}

.pos-status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.status-filter-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(47, 33, 22, 0.08);
  color: currentColor;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
}

.status-filter-btn.is-active {
  border-color: #e7a566;
  background: linear-gradient(135deg, #ffe2bf 0%, #ffc47f 100%);
  color: #4a2711;
}

.status-filter-new {
  border-color: #8eb9ff;
  color: #1e5abf;
}

.status-filter-new.is-active {
  border-color: #6aa3ff;
  background: linear-gradient(135deg, #edf6ff 0%, #cfe4ff 100%);
  color: #164a9d;
}

.status-filter-held {
  border-color: #e3bd5b;
  color: #8a650a;
}

.status-filter-held.is-active {
  border-color: #d5a92e;
  background: linear-gradient(135deg, #fff7df 0%, #ffe6a1 100%);
  color: #745100;
}

.status-filter-needs_action {
  border-color: #ee8c80;
  color: #b5372d;
}

.status-filter-needs_action.is-active {
  border-color: #dc675b;
  background: linear-gradient(135deg, #fff0f0 0%, #ffd6d1 100%);
  color: #9a2a22;
}

.status-filter-completed {
  border-color: #9bd7a8;
  color: #1f873a;
}

.status-filter-completed.is-active {
  border-color: #72bf83;
  background: linear-gradient(135deg, #effaf1 0%, #d8f3df 100%);
  color: #176f2e;
}

.needs-action-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #ef9c7d;
  background: linear-gradient(135deg, #fff0e9 0%, #ffd7c7 100%) !important;
  color: #9f3518 !important;
  box-shadow: 0 8px 18px rgba(191, 79, 57, 0.12);
  font-weight: 900 !important;
}

.order-chip .needs-action-chip {
  padding: 6px 10px;
  border-radius: 999px;
}

.order-chip-create {
  justify-content: center;
}

.pos-bill-board {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  gap: 16px;
}

.discount-box,
.field {
  display: grid;
  gap: 8px;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.payment-grid-single {
  grid-template-columns: 1.4fr 0.8fr;
}

.payment-select {
  font-weight: 700;
}

.payment-select-shell {
  position: relative;
}

.payment-select-trigger {
  width: 100%;
  min-height: 76px;
  padding: 14px 72px 14px 18px;
  border-radius: 24px;
  border: 1px solid rgba(232, 196, 170, 0.9);
  background: rgba(255, 253, 249, 0.96);
  color: #776a5d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(145, 103, 47, 0.08);
}

.payment-select-trigger span:first-child {
  font-size: clamp(1rem, 1.4vw, 1.16rem);
}

.payment-select-trigger.is-placeholder {
  color: #a79a8f;
  border-color: rgba(205, 120, 76, 0.45);
  background: #fffaf4;
}

.payment-select-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f7e4d6;
  color: #766758;
  font-size: 1.1rem;
  line-height: 1;
}

.payment-select-shell.is-open .payment-select-icon {
  transform: translateY(-50%) rotate(180deg);
}

.payment-select-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  padding: 10px;
  border-radius: 24px;
  border: 1px solid rgba(232, 196, 170, 0.92);
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 26px 60px rgba(145, 103, 47, 0.16);
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 35;
}

.payment-select-option {
  width: 100%;
  min-height: 66px;
  padding: 12px 16px;
  border-radius: 18px;
  background: transparent;
  color: #776a5d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  font-size: clamp(0.96rem, 1.3vw, 1.08rem);
  font-weight: 700;
}

.payment-select-option.is-active {
  background: #fff0e2;
  border: 1px solid rgba(239, 196, 164, 0.95);
}

.payment-select-check {
  color: #7c6c5f;
  font-size: 1.35rem;
  line-height: 1;
}

.discount-box span,
.field span {
  font-size: 0.92rem;
  color: var(--muted);
}

.field small {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.order-items,
.list-stack {
  display: grid;
  gap: 12px;
}

.order-item,
.list-row {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(111, 84, 41, 0.08);
  border-radius: 20px;
  padding: 16px;
}

.order-item-head,
.qty-row,
.button-row,
.summary-list div,
.list-row,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qty-row {
  margin: 14px 0 12px;
}

.qty-btn {
  min-width: 42px;
  min-height: 42px;
  background: rgba(255, 242, 225, 0.92);
  color: var(--text);
}

.line-total {
  margin-left: auto;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

.item-discount-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) auto minmax(76px, 0.65fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 248, 239, 0.88);
  border: 1px solid rgba(111, 84, 41, 0.08);
}

.item-discount-row > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.item-discount-row input {
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
}

.item-discount-row strong {
  min-width: 56px;
  color: var(--brand);
  font-size: 0.86rem;
  text-align: right;
  white-space: nowrap;
}

.discount-mode-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.discount-mode-btn {
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.discount-mode-btn.is-active {
  background: #fff0e4;
  color: var(--brand);
}

.addon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.addon-chip {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  color: var(--muted);
}

.addon-chip.is-active {
  background: #fff2dc;
  color: var(--brand);
  border-color: rgba(222, 99, 29, 0.18);
}

.order-item-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 248, 239, 0.92);
  border: 1px dashed rgba(111, 84, 41, 0.18);
  color: var(--muted);
  line-height: 1.35;
}

.order-item-note strong {
  color: var(--brand-strong);
  flex: 0 0 auto;
}

.summary-list {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 248, 239, 0.9);
  border: 1px solid rgba(111, 84, 41, 0.08);
}

.summary-total {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px dashed rgba(111, 84, 41, 0.18);
}

.button-row {
  flex-wrap: wrap;
}

.button-row > * {
  flex: 1 1 0;
}

.quick-cash-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.cash-chip {
  padding: 16px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffe8d4 0%, #ffdcbc 100%);
  color: #9e4212;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  min-height: 74px;
}

.button-row-main > * {
  min-height: 74px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(0.98rem, 1.6vw, 1.25rem);
  white-space: nowrap;
  padding-inline: 20px;
}

.preview-btn {
  border-color: rgba(222, 99, 29, 0.26);
  color: #9a4517;
}

.checkout-btn {
  box-shadow: 0 18px 34px rgba(205, 100, 35, 0.18);
}

.needs-action-pill {
  text-transform: none;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(191, 79, 57, 0.14);
}

.button-row-secondary > * {
  min-height: 54px;
}

.stack-view {
  display: grid;
  gap: 18px;
}

.card-grid {
  display: grid;
  gap: 18px;
}

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

.metric-card {
  padding: 22px;
  display: grid;
  gap: 12px;
}

.metric-label {
  color: var(--muted);
}

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

.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-sidebar {
  padding: 20px;
  border-radius: var(--radius-xl);
  position: sticky;
  top: 140px;
  display: grid;
  gap: 18px;
}

.settings-nav,
.settings-content,
.settings-pane,
.management-list {
  display: grid;
  gap: 12px;
}

.settings-content {
  min-width: 0;
}

.sales-history-scroll {
  max-height: min(70vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.sales-history-scroll::-webkit-scrollbar {
  width: 10px;
}

.sales-history-scroll::-webkit-scrollbar-track {
  background: rgba(235, 221, 207, 0.35);
  border-radius: 999px;
}

.sales-history-scroll::-webkit-scrollbar-thumb {
  background: rgba(181, 103, 51, 0.42);
  border-radius: 999px;
}

.purchase-history-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(150px, 0.65fr) minmax(240px, 1.4fr) minmax(180px, 0.85fr) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0 10px;
}

.purchase-history-toolbar .field {
  margin: 0;
}

.purchase-history-toolbar input,
.purchase-history-toolbar select {
  min-height: 54px;
  border-radius: 18px;
}

.purchase-history-clear {
  min-height: 54px;
  white-space: nowrap;
}

.purchase-history-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.purchase-item-names {
  margin-top: 6px;
  color: #9a4d1d;
  font-weight: 800;
}

.settings-nav-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.settings-nav-btn.is-active {
  background: linear-gradient(135deg, #ffe2bf 0%, #ffc47f 100%);
  box-shadow: 0 16px 32px rgba(222, 99, 29, 0.14);
}

.component-workspace-switch {
  position: sticky;
  top: 128px;
  z-index: 15;
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.88);
  border: 1px solid rgba(235, 221, 207, 0.78);
  box-shadow: 0 18px 44px rgba(102, 65, 33, 0.08);
  backdrop-filter: blur(18px);
}

.form-card {
  display: grid;
  gap: 16px;
}

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

.product-image-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 140px;
  padding: 12px;
  border-radius: 20px;
  border: 1px dashed rgba(222, 99, 29, 0.24);
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.88), transparent 32%),
    linear-gradient(135deg, #fff7ec 0%, #eef9dc 100%);
}

.product-image-preview img {
  width: min(180px, 100%);
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
  border-radius: 16px;
}

.product-image-preview span {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

.product-image-preview small {
  color: var(--muted);
  font-weight: 800;
}

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

.muted-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.conversion-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(280px, 320px);
  gap: 16px;
  align-items: stretch;
}

.conversion-panel,
.conversion-summary {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 252, 247, 0.82);
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.conversion-panel h3,
.conversion-summary h3 {
  margin: 0;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
}

.conversion-step {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #ffe2bf 0%, #ffc47f 100%);
  color: #7b3817;
  font-weight: 800;
}

.conversion-summary {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 196, 127, 0.28), transparent 34%),
    rgba(255, 248, 239, 0.92);
}

.conversion-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px dashed rgba(149, 116, 88, 0.28);
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--muted);
}

.conversion-preview-row strong {
  color: var(--text);
  white-space: nowrap;
}

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

.invoice-template-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(111, 84, 41, 0.1);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  text-align: left;
}

.invoice-template-card strong {
  display: block;
  font-size: 1rem;
}

.invoice-template-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.invoice-template-card span {
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 243, 230, 0.95);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.invoice-template-card.is-active {
  border-color: rgba(222, 99, 29, 0.22);
  background: rgba(255, 241, 227, 0.94);
  box-shadow: 0 14px 30px rgba(222, 99, 29, 0.12);
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(111, 84, 41, 0.08);
}

.toggle-card input {
  width: auto;
}

.template-preview,
.barcode-preview,
.empty-state {
  border-radius: 22px;
  border: 1px dashed rgba(111, 84, 41, 0.16);
  background: rgba(255, 248, 239, 0.84);
  padding: 18px;
}

.template-preview small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.invoice-preview-line,
.invoice-preview-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
}

.invoice-preview-line {
  font-size: 0.95rem;
  color: var(--text);
}

.invoice-preview-total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed rgba(111, 84, 41, 0.18);
  font-weight: 700;
}

.template-preview-title {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
}

.export-section,
.export-table-grid {
  display: grid;
  gap: 16px;
}

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

.export-table-card.is-active {
  border-color: rgba(222, 99, 29, 0.22);
  background: rgba(255, 241, 227, 0.92);
}

.barcode-preview {
  display: grid;
  gap: 10px;
  width: min(100%, 320px);
}

.barcode-preview-size {
  font-size: 0.92rem;
  color: var(--muted);
}

.barcode-sample-card {
  padding: 28px 30px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff4e7 100%);
  border: 1px solid rgba(231, 194, 164, 0.72);
  box-shadow: 0 24px 56px rgba(123, 82, 28, 0.1);
}

.barcode-sample-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.barcode-sample-store {
  font-size: 1.1rem;
  color: #73685d;
}

.barcode-sample-name {
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.08;
}

.barcode-sample-price {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.95rem;
  font-weight: 700;
  color: #9e4518;
  white-space: nowrap;
}

.barcode-sample-art {
  margin-top: 24px;
  padding: 16px 18px 10px;
  background: #fff;
}

.barcode-sample-code {
  margin-top: 10px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  color: #74695d;
}

.barcode-sample-category {
  margin-top: 26px;
  font-size: 1rem;
  color: #74695d;
}

.barcode-live-preview,
.barcode-inline {
  width: 100%;
  display: block;
}

.barcode-inline-card {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 248, 239, 0.92);
  border: 1px solid rgba(111, 84, 41, 0.08);
  max-width: 220px;
}

.barcode-lines {
  height: 44px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--barcode-accent, var(--brand)) 0 3px,
      transparent 3px 6px,
      var(--barcode-accent, var(--brand)) 6px 8px,
      transparent 8px 11px
    );
}

.barcode-preview span,
.barcode-preview small {
  color: var(--muted);
}

.stock-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef8df;
  color: #4d7b2b;
  font-weight: 700;
}

.list-row-actions {
  align-items: center;
}

.list-row.is-selected {
  border-color: rgba(222, 99, 29, 0.24);
  background: rgba(255, 241, 227, 0.92);
}

.row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.selection-toolbar {
  align-items: center;
}

.label-qty-field {
  display: grid;
  gap: 6px;
  min-width: 92px;
}

.label-qty-field span {
  color: var(--muted);
  font-size: 0.8rem;
}

.label-qty-field input {
  width: 92px;
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 12px;
}

.select-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.select-row input {
  width: auto;
  margin: 0;
}

.stock-editor {
  align-items: center;
}

.stock-editor input {
  width: 120px;
  min-width: 120px;
  padding-block: 12px;
}

.stock-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.stock-check-meta {
  min-width: 0;
}

.stock-check-meta p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-check-row .stock-editor {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 14px;
}

.stock-check-row .stock-editor .ghost-btn {
  white-space: nowrap;
  min-width: 112px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

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

.detail-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(32, 20, 10, 0.24);
  backdrop-filter: blur(12px);
}

.detail-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 30px;
}

.detail-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-modal-head small,
.detail-summary-grid span,
.stock-detail-main small,
.stock-detail-money small {
  color: var(--muted);
}

.product-customizer-modal {
  width: min(720px, 100%);
}

.customizer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: 22px;
  border: 1px solid rgba(222, 99, 29, 0.14);
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.96), rgba(255, 242, 225, 0.9));
  color: var(--muted);
}

.customizer-summary strong {
  color: var(--brand-strong);
  font-size: 1.25rem;
}

.customizer-section {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.section-top.compact {
  margin-bottom: 0;
}

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

.customizer-addon-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  text-align: left;
}

.customizer-addon-chip strong {
  color: var(--brand-strong);
  white-space: nowrap;
}

.customizer-note-field {
  margin-bottom: 18px;
}

.customizer-note-field textarea {
  min-height: 92px;
}

.customizer-actions {
  justify-content: flex-end;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.detail-summary-grid div,
.stock-detail-line {
  border: 1px solid rgba(111, 84, 41, 0.1);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 20px;
}

.detail-summary-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.stock-detail-list {
  display: grid;
  gap: 12px;
}

.stock-detail-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, auto) minmax(130px, auto);
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.stock-detail-main {
  display: grid;
  gap: 8px;
}

.stock-detail-main .stock-badge {
  width: fit-content;
}

.stock-detail-money {
  display: grid;
  gap: 6px;
  text-align: right;
}

.stock-detail-money strong {
  white-space: nowrap;
}

.completed-sale-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.completed-sale-items {
  display: grid;
  gap: 12px;
}

.completed-sale-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(110px, auto));
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(111, 84, 41, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
}

.completed-sale-item > div:first-child {
  display: grid;
  gap: 6px;
}

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

.completed-sale-item-metric {
  display: grid;
  gap: 4px;
  text-align: right;
}

.completed-sale-item-metric strong {
  white-space: nowrap;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 20, 10, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 40;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: absolute;
  top: 18px;
  left: 18px;
  bottom: 18px;
  width: min(340px, calc(100vw - 36px));
  border-radius: 28px;
  padding: 22px;
  transform: translateX(-108%);
  transition: transform 220ms ease;
  display: grid;
  gap: 18px;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.drawer-title {
  margin: 8px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
}

.drawer-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(111, 84, 41, 0.08);
  text-align: left;
}

.drawer-link-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff0da 0%, #eef8df 100%);
  font-size: 1.3rem;
}

.drawer-link strong {
  display: block;
}

.drawer-link small {
  color: var(--muted);
}

.drawer-link.is-active {
  background: linear-gradient(135deg, #ffe0bc 0%, #ffc680 100%);
}

@media (max-width: 1240px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-catalog-tools {
    grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  }

  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    max-height: none;
  }

  .pos-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .order-panel {
    position: static;
    grid-column: 1 / -1;
    grid-row: 3;
    max-height: none;
  }

  .pos-category-toolbar {
    position: static;
  }

  .payment-grid,
  .payment-grid-single {
    grid-template-columns: 1fr;
  }

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

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

  .settings-sidebar {
    position: static;
  }
}

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

  .search-box,
  .lang-switch,
  .user-session-pill {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    padding: 18px;
  }

  .page-header .section-title {
    font-size: clamp(1.55rem, 8vw, 2.4rem);
  }

  .component-workspace-switch {
    top: 10px;
  }

  .lang-switch,
  .user-session-pill {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .split-grid,
  .field-grid,
  .toggle-grid,
  .invoice-template-grid,
  .export-table-grid,
  .conversion-board,
  .purchase-history-toolbar,
  .settings-layout,
  .payment-grid,
  .payment-grid-single {
    grid-template-columns: 1fr;
  }

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

  .pos-bill-board,
  .pos-category-toolbar,
  .pos-catalog-panel,
  .order-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .pos-category-toolbar {
    position: static;
  }

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

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

  .pos-catalog-tools,
  .pos-bottom-actions {
    grid-template-columns: 1fr;
  }

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

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

  .button-row-main {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row-main > * {
    white-space: normal;
  }

  .order-switcher {
    grid-template-columns: 1fr;
  }

  .stock-editor {
    width: 100%;
    justify-content: flex-start;
  }

  .stock-editor input {
    width: 100%;
    min-width: 0;
  }

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

  .stock-check-meta p {
    white-space: normal;
  }

  .stock-check-row .stock-editor {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    top: 12px;
    padding: 16px;
  }

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

  .product-grid,
  .pos-product-grid,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .pos-category-list,
  .order-switcher-board {
    grid-template-columns: 1fr;
  }

  .order-chip-board {
    flex-basis: 178px;
    min-height: 108px;
  }

  .item-discount-row {
    grid-template-columns: 1fr auto;
  }

  .item-discount-row .discount-mode-toggle,
  .item-discount-row input,
  .item-discount-row strong {
    width: 100%;
  }

  .quick-cash-row {
    grid-template-columns: 1fr 1fr;
  }

  .pos-category-toolbar,
  .catalog-panel,
  .order-panel,
  .section-card {
    padding: 18px;
  }

  .button-row > * {
    flex: 1 1 100%;
  }

  .order-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-badge {
    width: 100%;
    text-align: center;
  }

  .cash-chip {
    min-height: 66px;
    font-size: 0.94rem;
    padding: 14px 10px;
  }

  .button-row-main > * {
    min-height: 68px;
    font-size: 0.98rem;
  }

  .item-badge {
  font-size: 1.3rem;
}
}

.drawer-link strong {
  display: block;
}

.drawer-link small {
  color: var(--muted);
}

.drawer-link.is-active {
  background: linear-gradient(135deg, #ffe0bc 0%, #ffc680 100%);
}

@media (max-width: 1240px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .order-panel {
    position: static;
    grid-column: 1 / -1;
  }

  .pos-category-toolbar {
    position: static;
  }

  .payment-grid,
  .payment-grid-single {
    grid-template-columns: 1fr;
  }

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

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

  .settings-sidebar {
    position: static;
  }
}

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

  .search-box,
  .lang-switch {
    width: 100%;
  }

  .lang-switch {
    justify-self: stretch;
    justify-content: flex-start;
  }

  .split-grid,
  .field-grid,
  .toggle-grid,
  .invoice-template-grid,
  .export-table-grid,
  .conversion-board,
  .settings-layout,
  .payment-grid,
  .payment-grid-single {
    grid-template-columns: 1fr;
  }

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

  .pos-category-toolbar {
    position: static;
  }

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

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

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

  .button-row-main {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row-main > * {
    white-space: normal;
  }

  .order-switcher {
    grid-template-columns: 1fr;
  }

  .stock-editor {
    width: 100%;
    justify-content: flex-start;
  }

  .stock-editor input {
    width: 100%;
    min-width: 0;
  }

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

  .stock-check-meta p {
    white-space: normal;
  }

  .stock-check-row .stock-editor {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    top: 12px;
    padding: 16px;
  }

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

  .product-grid,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .pos-category-list,
  .order-switcher-board {
    grid-template-columns: 1fr;
  }

  .quick-cash-row {
    grid-template-columns: 1fr 1fr;
  }

  .pos-category-toolbar,
  .catalog-panel,
  .order-panel,
  .section-card {
    padding: 18px;
  }

  .button-row > * {
    flex: 1 1 100%;
  }

  .order-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-badge {
    width: 100%;
    text-align: center;
  }

  .cash-chip {
    min-height: 66px;
    font-size: 0.94rem;
    padding: 14px 10px;
  }

  .button-row-main > * {
    min-height: 68px;
    font-size: 0.98rem;
  }

  .detail-modal-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .detail-modal {
    max-height: calc(100vh - 24px);
    padding: 18px;
    border-radius: 24px;
  }

  .detail-modal-head {
    flex-direction: column;
  }

  .detail-modal-head .ghost-btn {
    width: 100%;
  }

  .detail-summary-grid,
  .stock-detail-line,
  .completed-sale-item {
    grid-template-columns: 1fr;
  }

  .stock-detail-money,
  .completed-sale-item-metric {
    text-align: left;
  }

  .detail-modal-head .row-actions {
    width: 100%;
  }

  .detail-modal-head .row-actions > * {
    flex: 1 1 100%;
  }

  .item-badge {
    padding: 14px 18px;
    font-size: 1rem;
  }
}

/* Hide spinners for custom number inputs */
.no-spinners::-webkit-outer-spin-button,
.no-spinners::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spinners {
  -moz-appearance: textfield;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.status-danger {
  background: #fff1eb;
  color: #9f3518;
  border: 1px solid #efb29a;
}

.status-warning {
  background: #fff6dc;
  color: #9a6507;
  border: 1px solid #eac77a;
}

.status-success {
  background: #edf9ef;
  color: #1f873a;
  border: 1px solid #9bd7a8;
}

button:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  filter: saturate(0.72);
}

.pos-payment-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(22, 17, 12, 0.5);
  backdrop-filter: blur(3px);
}

.pos-payment-panel {
  position: fixed !important;
  top: 18px !important;
  right: 18px;
  bottom: 18px;
  left: auto;
  z-index: 81;
  width: min(480px, calc(100vw - 32px));
  max-height: none !important;
  overflow: auto;
  border: 1px solid rgba(111, 84, 41, 0.12);
  box-shadow: 0 28px 80px rgba(33, 23, 15, 0.28);
  animation: paymentPanelIn 180ms ease-out;
}

.pos-payment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(111, 84, 41, 0.08);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.18rem;
}

.pos-payment-panel .order-panel-top {
  padding-right: 46px;
}

.pos-payment-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
}

.pos-payment-title .pos-payment-close {
  position: static;
  flex: 0 0 auto;
}

@keyframes paymentPanelIn {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (max-width: 720px) {
  .pos-payment-panel {
    inset: 12px;
    width: auto;
  }
}

/* Dashboard refresh */
.dashboard-shell {
  gap: 20px;
}

.dashboard-control-card {
  gap: 22px;
}

.dashboard-range-tabs {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-range-btn {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 54px;
  background: transparent;
  font-weight: 900;
}

.dashboard-range-btn:last-child {
  border-right: 0;
}

.dashboard-range-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #f05a16 0%, #ff8a3d 100%);
  box-shadow: 0 14px 28px rgba(222, 99, 29, 0.18);
}

.dashboard-custom-range {
  max-width: 660px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-kpi-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 34px rgba(72, 44, 20, 0.06);
}

.dashboard-kpi-card p,
.dashboard-kpi-card small {
  margin: 0;
}

.dashboard-kpi-card p {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-kpi-card strong {
  display: block;
  margin: 6px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 1.7vw, 1.55rem);
}

.dashboard-kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #e55f16;
  background: linear-gradient(135deg, rgba(255, 238, 216, 0.9), rgba(255, 248, 239, 0.9));
  font-size: 1.45rem;
  font-weight: 900;
}

.dashboard-kpi-icon.dashboard-warn {
  color: #c44d2f;
}

.dashboard-delta {
  font-weight: 900;
}

.dashboard-delta.is-up {
  color: #10a85f;
}

.dashboard-delta.is-down {
  color: #e35a2f;
}

.dashboard-alert-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-color: rgba(224, 99, 29, 0.22);
  background: linear-gradient(135deg, rgba(255, 244, 229, 0.95), rgba(255, 255, 255, 0.92));
}

.dashboard-grid-main {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1fr;
  gap: 18px;
  align-items: stretch;
}

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

.dashboard-revenue-card,
.dashboard-top-products,
.dashboard-order-history {
  min-width: 0;
}

.dashboard-segment {
  display: inline-flex;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.dashboard-segment button {
  border: 0;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: transparent;
  font-weight: 900;
}

.dashboard-segment button.is-active {
  color: #df5d16;
  background: rgba(255, 239, 224, 0.95);
}

.dashboard-line-chart {
  height: 260px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 18px 8px 0;
  border-bottom: 1px dashed rgba(111, 84, 41, 0.18);
}

.dashboard-chart-column {
  flex: 1;
  min-width: 28px;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  text-align: center;
}

.dashboard-chart-bar {
  width: 100%;
  min-height: 8px;
  align-self: end;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #ff8a3d 0%, #f05a16 100%);
  box-shadow: 0 10px 22px rgba(240, 90, 22, 0.18);
}

.dashboard-chart-column small {
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-product-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-product-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-product-tile strong {
  font-size: 0.82rem;
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

.dashboard-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #f05a16;
  font-size: 0.78rem;
  font-weight: 900;
}

.dashboard-product-image {
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff8d7, #edfbd7);
  font-size: 1.8rem;
}

.dashboard-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-list {
  gap: 8px;
}

.compact-list .list-row {
  padding: 12px 14px;
}

.dashboard-timeline {
  max-height: 430px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.dashboard-order-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.dashboard-order-line time {
  width: 54px;
  flex-shrink: 0;
}

.dashboard-order-line > div {
  flex: 1;
  min-width: 120px;
}

.dashboard-order-line time,
.dashboard-order-line p {
  margin: 0;
  color: var(--muted);
}

.dashboard-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

.dashboard-breakdown > .compact-list {
  flex: 1;
  min-width: 200px;
}

.dashboard-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--text);
  position: relative;
  flex-shrink: 0;
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #fffaf4;
  box-shadow: inset 0 0 0 1px rgba(111, 84, 41, 0.08);
}

.dashboard-donut strong,
.dashboard-donut small {
  position: relative;
  z-index: 1;
}

.dashboard-donut strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
}

.dashboard-donut small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-donut-status {
  /* background dynamically set inline in React */
}

.dashboard-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.dashboard-breakdown-row small {
  color: var(--muted);
}

@media (max-width: 1280px) {
  .dashboard-kpi-grid,
  .dashboard-grid-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-order-history {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .dashboard-range-tabs,
  .dashboard-kpi-grid,
  .dashboard-grid-main,
  .dashboard-grid-secondary,
  .dashboard-breakdown {
    grid-template-columns: 1fr;
  }

  .dashboard-alert-card {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-order-line {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-product-podium {
    grid-template-columns: 1fr;
  }
}
