:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f1;
  --ink: #18201f;
  --muted: #6b7472;
  --line: #dfe6e3;
  --brand: #0f766e;
  --brand-dark: var(--brand);
  --accent: #b7791f;
  --secondary: var(--accent);
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 24px 70px rgba(20, 35, 33, 0.14);
  --font-latin: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-arabic-script: "NRT Bold", "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-receipt: "NRT Bold", "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

@font-face {
  font-family: "NRT Bold";
  src: url("../fonts/NRT-Bd.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-latin);
  background: var(--bg);
  color: var(--ink);
  direction: inherit;
  text-align: start;
}

html[lang="ckb"] body,
html[lang="ar"] body {
  font-family: var(--font-arabic-script);
}

button, input, select, textarea { font: inherit; }
a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.app-shell { min-height: 100vh; }

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 520px);
  min-height: 100vh;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: 100vh;
  padding: 56px;
  overflow: hidden;
  background:
    linear-gradient(rgba(13, 45, 42, 0.78), rgba(13, 45, 42, 0.74)),
    url("https://images.unsplash.com/photo-1556742502-ec7c0e9f34b1?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #ffffff;
}

.brand-panel h1 {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  font-size: 28px;
}

.brand-mark.small { width: 40px; height: 40px; font-size: 20px; }
.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
}
.brand-logo.small {
  width: 40px;
  height: 40px;
}
.eyebrow {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

.photo-band { display: flex; align-items: end; min-height: 220px; }
.metric-card {
  width: min(100%, 340px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
}

.metric-card span, .metric-card small, .kpi-card span, .kpi-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.metric-card span, .metric-card small { color: rgba(255, 255, 255, 0.78); }
.metric-card strong { display: block; margin: 8px 0; font-size: 34px; }

.login-card {
  align-self: center;
  width: min(100% - 40px, 440px);
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-heading, .sidebar-brand, .topbar, .topbar-actions, .panel-heading, .form-row, .check-row {
  display: flex;
  align-items: center;
}

.form-heading { gap: 14px; margin-bottom: 28px; }
.form-heading h2, .topbar h2, .panel h3 { margin: 4px 0 0; }

.alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #ffd2cc;
  border-radius: 8px;
  background: #fff0ee;
  color: var(--danger);
  font-weight: 800;
}

.login-card label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.login-card input:not([type="checkbox"]) {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfcfc;
  outline: none;
}

.login-card input[dir="ltr"] {
  text-align: left;
}

.login-card .primary-button {
  justify-content: space-between;
  width: 100%;
}

.login-card input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.form-row { justify-content: space-between; gap: 14px; margin: 18px 0 26px; }
.check-row { grid-template-columns: auto 1fr; margin: 0; gap: 8px; color: var(--muted); font-size: 13px; }

.primary-button, .secondary-button, .ghost-button, .icon-button, .danger-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  min-height: 50px;
  padding: 0 18px;
  background: var(--brand);
  color: #ffffff;
  text-align: center;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  text-align: center;
}
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  background: #fff0ee;
  color: var(--danger);
  text-align: center;
}
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  text-align: center;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.danger-button:hover {
  box-shadow: 0 8px 22px rgba(20, 35, 33, 0.1);
  transform: translateY(-1px);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.danger-button:hover {
  background: #ffdcd7;
}

.brand-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.language-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.brand-panel .language-switcher {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-panel .language-switcher a {
  color: #ffffff;
}

.language-switcher a.active {
  background: var(--brand);
  color: #ffffff;
}

.dashboard-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: #ffffff;
}

html[dir="ltr"] .sidebar {
  border-left: 0;
  border-right: 1px solid var(--line);
}

.sidebar-brand { gap: 12px; min-height: 44px; }
.sidebar-close,
.mobile-sidebar-toggle,
.mobile-dashboard-header,
.sidebar-backdrop {
  display: none;
}
.sidebar-nav { display: grid; gap: 18px; }
.sidebar-section {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sidebar-section:first-child {
  padding-top: 0;
  border-top: 0;
}
.sidebar-section-title {
  margin: 0;
  padding: 0 14px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.88;
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
}
.sidebar nav a:hover { background: var(--surface-soft); color: var(--brand-dark); }
.sidebar nav a.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}
.sidebar form { margin-top: auto; }

.dashboard-main { min-width: 0; padding: 28px; }
.topbar { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.topbar-actions { gap: 10px; }

.icon-button, .avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.avatar {
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand-dark);
  font-weight: 900;
}

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

.kpi-card, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(20, 35, 33, 0.06);
}

.kpi-card { padding: 18px; }
.kpi-card strong { display: block; margin: 10px 0 8px; font-size: 28px; }
.positive { color: var(--brand) !important; }
.warning { color: var(--warning) !important; }

.dashboard-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  border-color: #d4e6e0;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f5 100%);
}

.dashboard-hero h1 {
  margin: 8px 0;
  font-size: 42px;
  line-height: 1;
}

.dashboard-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.dashboard-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.trend-filter {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.trend-filter select,
.trend-filter input {
  width: auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfcfc;
  color: var(--ink);
  font-weight: 800;
}

.trend-filter input {
  max-width: 150px;
}

.trend-filter .secondary-button {
  min-height: 38px;
}

.dashboard-bar-chart {
  align-items: stretch;
  height: 280px;
  padding-top: 0;
  width: 100%;
}

.dashboard-bar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
  height: 100%;
}

.dashboard-bar span {
  align-self: end;
  width: 100%;
  min-height: 8px;
}

.dashboard-bar small,
.dashboard-bar b {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar b {
  color: var(--ink);
}

.dashboard-health {
  display: grid;
  gap: 12px;
}

.dashboard-health article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e3ece8;
  border-radius: 8px;
  background: #fbfcfc;
}

.dashboard-health span,
.dashboard-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-health strong {
  font-size: 22px;
}

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

.dashboard-list a,
.dashboard-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e3ece8;
  border-radius: 8px;
  background: #fbfcfc;
}

.dashboard-list span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

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

.dashboard-list b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.content-grid.product-grid {
  grid-template-columns: minmax(340px, 0.75fr) minmax(0, 1.25fr);
  align-items: start;
}

.panel { padding: 20px; }
.panel-heading { justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.full-width-panel { grid-column: 1 / -1; }
.settings-subsection {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}
.nested-form {
  margin-top: 0;
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.logo-preview img {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
}
.danger-panel {
  margin-top: 18px;
  border-color: #f2c8c2;
  background: #fff8f7;
}
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--danger);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}
.button-group { display: flex; flex-wrap: wrap; gap: 10px; }
select { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #ffffff; }

.filter-panel {
  margin-bottom: 18px;
}

.filter-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-form label {
  display: grid;
  gap: 7px;
  flex: 1 1 240px;
  min-width: min(100%, 320px);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.filter-form input,
.filter-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfc;
  color: var(--ink);
  outline: none;
}

.filter-form .secondary-button,
.filter-form .primary-button {
  min-height: 42px;
}

.pos-sales-filter {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #dfe8e5;
  border-radius: 10px;
  background: #f7faf9;
}

.pos-sales-filter .ghost-button {
  align-self: end;
}

.pagination-wrap {
  margin-top: 16px;
}

.pagination-wrap nav > div:first-child {
  display: none;
}

.pagination-wrap nav > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-wrap nav span,
.pagination-wrap nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.pagination-wrap nav a:hover {
  background: var(--surface-soft);
  color: var(--brand-dark);
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #cdeee8;
  border-radius: 8px;
  background: #e8f7f4;
  color: var(--brand-dark);
  font-weight: 800;
}

.notice ul {
  margin: 0;
  padding-inline-start: 18px;
}

.notice-error {
  border-color: #f2c8c2;
  background: #fff1ef;
  color: #9f2f23;
}

.inventory-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stock-card,
.empty-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(20, 35, 33, 0.06);
}

.stock-card {
  padding: 18px;
}

.stock-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stock-card-category,
.stock-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stock-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.stock-card strong {
  display: block;
  margin-top: 14px;
  font-size: 28px;
}

.empty-panel {
  grid-column: 1 / -1;
  padding: 24px;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.modal {
  box-sizing: border-box;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(86vh, 820px);
  overflow: hidden;
  margin: 0;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.modal-wide {
  width: min(980px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(24, 32, 31, 0.54);
  backdrop-filter: blur(4px);
}

body:has(dialog.modal[open]) {
  overflow-x: hidden;
}

.modal-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: min(86vh, 820px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-card-wide {
  width: 100%;
}

.modal-table {
  margin-top: 18px;
}

.panel-inner-form {
  margin-top: 18px;
}

.data-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.data-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.data-form input,
.data-form select,
.data-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fbfcfc;
  color: var(--ink);
  outline: none;
}

.data-form input,
.data-form select {
  min-height: 44px;
}

.data-form textarea {
  min-height: 86px;
  padding-block: 10px;
  resize: vertical;
}

.data-form input:focus,
.data-form select:focus,
.data-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.data-form input:disabled,
.data-form input[readonly] {
  background: #f3f7f6;
  color: #3f4d4a;
}

.data-form select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #66736f 50%),
    linear-gradient(135deg, #66736f 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 34px;
}

html[dir="rtl"] .data-form select {
  background-position: 18px 50%, 13px 50%;
  padding-inline-start: 34px;
  padding-inline-end: 13px;
}

.form-wide,
.field-error {
  grid-column: 1 / -1;
}

.field-error {
  color: var(--danger);
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.helper-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.helper-box code {
  overflow-x: auto;
  color: var(--ink);
  white-space: nowrap;
}

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

.option-grid fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.option-grid legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.variant-builder,
.calculated-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.attribute-picker {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.compact-heading {
  margin-bottom: 0;
}

.variant-rows {
  display: grid;
  gap: 14px;
}

.variant-row,
.bundle-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.bundle-rows,
.fabric-roll-rows {
  display: grid;
  gap: 14px;
}

.fabric-roll-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.calculated-total {
  display: grid;
  align-content: end;
  gap: 6px;
  min-height: 58px;
}

.calculated-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.calculated-total strong {
  color: var(--ink);
}

.existing-variants {
  display: grid;
  gap: 10px;
}

.existing-variant-grid {
  display: grid;
  gap: 12px;
}

.existing-variant-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.existing-variant-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.variant-row-edit {
  border-top: 0;
  padding-top: 0;
}

.compact-table {
  overflow-x: auto;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

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

.form-check {
  align-self: end;
  min-height: 42px;
}

.form-submit {
  grid-column: 1 / -1;
  justify-self: stretch;
  margin-top: 6px;
  width: 100%;
}

.transfer-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.transfer-form-panel {
  margin-bottom: 18px;
}

.receive-items-builder {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(244, 247, 246, 0.8);
}

.receive-items-list {
  display: grid;
  gap: 14px;
}

.receive-item-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.receive-item-row > label {
  grid-column: span 3;
  min-width: 0;
  align-content: start;
}

.receive-item-row select,
.receive-item-row input {
  min-width: 0;
}

.receive-item-row > label:nth-child(1),
.receive-item-row > label:nth-child(2) {
  grid-column: span 4;
}

.receive-item-row > label:nth-child(3),
.receive-item-row > label:nth-child(4) {
  grid-column: span 2;
}

.receive-item-row .row-actions {
  grid-column: 1 / -1;
  justify-content: end;
  padding-top: 2px;
}

.receive-hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.receive-variant-picker-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(124px, 136px);
  gap: 8px;
  align-items: start;
}

.receive-variant-picker-control input {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receive-variant-picker-control .secondary-button {
  min-height: 44px;
  white-space: nowrap;
}

.receive-variant-picker-head {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e2ebe7;
  border-radius: 8px;
  background: #f7faf9;
}

.receive-variant-picker-head strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receive-variant-picker-head small {
  color: var(--muted);
  font-weight: 800;
}

.receive-variant-card-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.receive-variant-option-groups {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.receive-variant-option-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2ebe7;
  border-radius: 8px;
  background: #ffffff;
}

.receive-variant-option-group > strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.receive-variant-option-group > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  min-width: 0;
}

.receive-variant-option-button {
  min-height: 42px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid #d9e5e1;
  border-radius: 8px;
  background: #fbfcfc;
  color: #233331;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receive-variant-option-button:hover:not(:disabled),
.receive-variant-option-button.active {
  border-color: #0f766e;
  background: #e8f6f3;
  color: #0f766e;
}

.receive-variant-option-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.receive-variant-selection-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 58px;
  padding: 14px;
  border: 1px solid #dbe8e3;
  border-radius: 8px;
  background: #f6fbf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.receive-variant-selection-summary > span,
.receive-variant-selection-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receive-variant-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.receive-variant-selected-chips span {
  max-width: 100%;
  min-height: 28px;
  padding: 6px 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f6f3;
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receive-variant-card {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #fbfcfc;
  text-align: start;
}

.receive-variant-card:hover,
.receive-variant-card.active {
  border-color: #0f766e;
  background: #eaf7f4;
}

.receive-variant-card strong,
.receive-variant-card span,
.receive-variant-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receive-variant-card strong {
  font-size: 13px;
}

.receive-variant-card span,
.receive-variant-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.transfer-items-builder {
  background: linear-gradient(180deg, rgba(243, 248, 246, 0.92) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.transfer-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4ece8;
}

.transfer-row-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.transfer-available-input {
  background: #f1f7f4 !important;
  color: #0f5e58 !important;
  font-weight: 900;
}

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

.compact-kpi {
  min-height: auto;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-body {
  background: #eef2f1;
}

.pos-app-shell {
  min-height: 100vh;
}

.pos-view {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(20, 35, 33, 0.08);
}

.pos-branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pos-branding h1 {
  margin: 4px 0 0;
  font-size: 26px;
}

.pos-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pos-branch-switcher {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pos-branch-switcher select,
.pos-search input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfc;
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.12fr) minmax(500px, 0.88fr);
  gap: 12px;
  align-items: start;
}

.pos-catalog-panel,
.pos-checkout-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(20, 35, 33, 0.08);
}

.pos-search {
  display: grid;
  gap: 6px;
  min-width: 240px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pos-search-group {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.pos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-inline-end: 3px;
}

.pos-product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  grid-template-rows: auto auto 1fr auto;
  gap: 7px 9px;
  min-width: 0;
  min-height: 152px;
  padding: 10px;
  border: 1px solid #d7e4df;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
  text-align: start;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pos-product-card:hover {
  border-color: #79b8ad;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.pos-product-card strong {
  display: -webkit-box;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  min-width: 0;
  max-height: 40px;
  color: #14201e;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pos-product-card small,
.pos-product-card span {
  color: var(--muted);
}

.pos-product-card small {
  grid-column: 1 / -1;
  grid-row: 3;
  overflow: hidden;
  align-self: start;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-media {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  place-items: center;
  overflow: hidden;
  width: 58px;
  height: 58px;
  border: 1px solid #dce8e4;
  border-radius: 10px;
  background: #eef5f2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

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

.pos-product-media span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: #0f766e;
  color: #ffffff !important;
  font-size: 24px;
  font-weight: 900;
}

.pos-product-top,
.pos-product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.pos-product-top {
  grid-column: 1;
  grid-row: 2;
}

.pos-product-bottom {
  grid-column: 1 / -1;
  grid-row: 4;
}

.pos-product-category,
.pos-product-stock {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-stock {
  padding: 3px 6px;
  border-radius: 999px;
  background: #e8f7f4;
  color: #0f766e;
}

.pos-product-bottom b {
  color: #8a4f0a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.pos-product-bottom span {
  overflow: hidden;
  max-width: 52%;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.pos-checkout-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
}

.pos-scan-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pos-scan-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfe0db;
  border-radius: 10px;
  padding: 0 16px;
  background: #fbfcfc;
  font-size: 15px;
  font-weight: 800;
}

.pos-checkout-branch {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #dbe5e1;
  border-radius: 10px;
  background: #f7faf9;
}

.pos-checkout-branch span,
.pos-cart-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pos-checkout-branch strong {
  font-size: 16px;
}

.pos-cart-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 520px);
  min-height: 150px;
  overflow: auto;
  padding-inline-end: 4px;
}

.pos-cart-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) minmax(310px, 1.8fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #e4ece8;
  border-radius: 8px;
  background: #fafcfb;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pos-cart-row-flash {
  border-color: #8ec5b7;
  background: #f3fbf7;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.pos-cart-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.pos-cart-product {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.pos-cart-product strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-product small {
  color: var(--muted);
  overflow: hidden;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-stats {
  display: grid;
  grid-template-columns: 70px 88px minmax(118px, 1fr) 92px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pos-cart-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pos-cart-stat strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-price-stack {
  display: grid;
  gap: 0;
}

.pos-price-stack strong,
.pos-cart-total strong {
  font-size: 11px;
  line-height: 1;
}

.pos-price-stack input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfc;
}

.pos-qty-stepper {
  display: grid;
  grid-template-columns: 26px minmax(42px, 1fr) 26px;
  gap: 4px;
  align-items: center;
}

.pos-step-button {
  min-height: 28px;
  border: 1px solid #d8e3df;
  border-radius: 6px;
  background: #f4f8f7;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.pos-qty-stepper input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 4px;
  background: #fbfcfc;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.pos-checkout-panel {
  position: sticky;
  top: 18px;
}

.pos-cart-total {
  padding: 6px 8px;
  border-radius: 7px;
  background: #f0f8f5;
}

.pos-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pos-customer-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e4ece8;
  border-radius: 10px;
  background: #fbfcfc;
}

.pos-customer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pos-phone-field {
  position: relative;
}

.pos-phone-suggestions {
  position: absolute;
  z-index: 20;
  inset-block-start: calc(100% + 6px);
  inset-inline: 0;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.pos-phone-suggestions[hidden] {
  display: none;
}

.pos-phone-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: #f8fbfa;
  text-align: start;
}

.pos-phone-suggestion:hover {
  background: #edf7f4;
}

.pos-phone-suggestion strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-phone-suggestion span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.pos-customer-account {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pos-customer-account article {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e5ece9;
  border-radius: 10px;
  background: #ffffff;
}

.pos-customer-account span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pos-customer-account strong {
  font-size: 15px;
}

.pos-delivery-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2ece8;
  border-radius: 10px;
  background: #f8fbfa;
}

.pos-delivery-toggle {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  min-height: 34px;
}

.pos-delivery-toggle input {
  width: 18px !important;
  min-height: 18px !important;
  accent-color: #0f766e;
}

.pos-delivery-toggle span {
  font-size: 13px;
  font-weight: 900;
}

.pos-delivery-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.pos-summary-grid label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.pos-summary-grid input,
.pos-summary-grid textarea,
.pos-summary-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfc;
}

.pos-summary-grid input,
.pos-summary-grid select {
  min-height: 38px;
}

.pos-summary-grid textarea {
  min-height: 54px;
  padding-block: 10px;
  resize: vertical;
}

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

.pos-totals article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e4ece8;
  border-radius: 8px;
  background: #ffffff;
}

.pos-totals span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pos-totals strong {
  font-size: 16px;
}

.pos-total-due {
  border-color: #cfe3dc !important;
  background: #f1f8f5 !important;
}

.pos-grand-total {
  grid-column: 1 / -1;
  background: #fff5ec !important;
  border-color: #ffd5af !important;
}

.pos-grand-total strong {
  font-size: 26px;
}

.pos-compact-field {
  align-self: end;
}

.pos-submit-button {
  width: 100%;
}

.pos-empty-cart {
  min-height: 140px;
}

.pos-scan-status {
  padding: 10px 12px;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.pos-scan-status[data-state="success"] {
  border-color: #bfe4d8;
  background: #edf8f3;
  color: #0f766e;
}

.pos-scan-status[data-state="error"] {
  border-color: #f1c4bf;
  background: #fff2f0;
  color: #b42318;
}

.pos-scan-status[data-state="info"] {
  border-color: #cfe0f5;
  background: #f4f8fd;
  color: #1d4ed8;
}

.pos-variant-picker-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.pos-variant-picker-head strong {
  font-size: 16px;
}

.pos-variant-picker-head small {
  color: var(--muted);
}

.pos-variant-picker-list {
  display: grid;
  gap: 10px;
}

.pos-variant-option-groups {
  display: grid;
  gap: 14px;
}

.pos-variant-option-group {
  display: grid;
  gap: 8px;
}

.pos-variant-option-group > strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pos-variant-option-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pos-variant-option-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d9e5e1;
  border-radius: 8px;
  background: #fbfcfc;
  color: #233331;
  font-size: 13px;
  font-weight: 900;
}

.pos-variant-option-button:hover:not(:disabled),
.pos-variant-option-button.active {
  border-color: #0f766e;
  background: #e8f6f3;
  color: #0f766e;
}

.pos-variant-option-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.pos-variant-selection-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid #dbe8e3;
  border-radius: 8px;
  background: #f6fbf9;
}

.pos-variant-selection-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pos-variant-selection-summary strong,
.pos-variant-selection-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-variant-selection-summary strong {
  color: #233331;
  font-size: 14px;
}

.pos-variant-choice {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: #fbfcfc;
  text-align: start;
}

.pos-variant-choice:hover {
  border-color: #9bc8bf;
  background: #f6fbf9;
}

.pos-variant-choice span,
.pos-variant-choice small {
  color: var(--muted);
}

.inline-link {
  margin-inline-start: 8px;
  color: inherit;
  font-weight: 900;
  text-decoration: underline;
}

.print-receipt-sheet {
  width: min(210mm, calc(100vw - 24px));
  min-height: 297mm;
  margin: 0 auto 24px;
  padding: 12mm;
}

.print-receipt-card {
  display: grid;
  gap: 20px;
  min-height: calc(297mm - 20mm);
  padding: 24px;
  border: 1px solid #d9e3df;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.receipt-hero {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 2px solid #e5ece9;
}

.receipt-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.receipt-brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #0f766e;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.receipt-brand p,
.receipt-meta span,
.receipt-panel-label,
.receipt-footer span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-brand h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.receipt-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: end;
}

.receipt-meta strong {
  font-size: 18px;
}

.receipt-meta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receipt-amount-strip {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 10px;
  background: #f2f8f6;
  border: 1px solid #d7e7e1;
}

.receipt-amount-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-amount-strip strong {
  font-size: 30px;
  line-height: 1;
}

.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.receipt-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e5ece9;
  border-radius: 10px;
  background: #fcfdfd;
}

.receipt-detail-list {
  grid-template-columns: minmax(120px, 0.52fr) minmax(0, 1fr);
  gap: 10px 14px;
}

.receipt-detail-list dt {
  font-size: 11px;
}

.receipt-detail-list dd {
  font-size: 14px;
}

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

.receipt-totals article {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid #e5ece9;
  border-radius: 10px;
  background: #ffffff;
}

.receipt-totals span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-totals strong {
  font-size: 20px;
}

.print-receipt-notes {
  padding: 18px;
  border: 1px solid #e5ece9;
  border-radius: 10px;
  background: #fcfdfd;
}

.print-receipt-notes h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.print-receipt-notes p {
  margin: 0;
  color: #334155;
  line-height: 1.7;
}

.receipt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px dashed #cfd8d5;
}

.receipt-footer div {
  display: grid;
  gap: 4px;
}

.receipt-footer strong {
  font-size: 14px;
}

.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  font-weight: 800;
}

.bar-chart { display: flex; align-items: end; gap: 12px; height: 260px; padding-top: 26px; }
.bar-chart span { flex: 1; min-width: 18px; border-radius: 8px 8px 0 0; background: var(--brand); }
.status-list { display: grid; gap: 15px; padding: 0; margin: 0; list-style: none; }
.status-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 999px; }
.green { background: var(--brand); }
.amber { background: var(--warning); }
.red { background: var(--danger); }
.table-panel { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; border-top: 1px solid var(--line); text-align: start; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.pill.warning { background: #fff3e6; }
.pill.success { color: var(--brand) !important; background: #e8f7f4; }
.pill.danger { color: var(--danger) !important; background: #fff0ee; }

.print-body {
  background: #d8dedc;
}

.thermal-receipt-body {
  background: #edf1ef;
}

.print-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.thermal-toolbar {
  max-width: 110mm;
  margin: 0 auto;
}

.print-button {
  width: auto;
  min-width: 170px;
}

.thermal-receipt {
  width: min(100mm, calc(100vw - 20px));
  height: 160mm;
  overflow: hidden;
  margin: 0 auto 24px;
}

.thermal-ticket {
  width: 100mm;
  height: 160mm;
  max-width: 100%;
  overflow: hidden;
  padding: 5mm 6mm;
  background: #ffffff;
  color: #111;
  font-family: var(--font-receipt);
  font-size: 10px;
  line-height: 1.25;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  box-shadow: 0 18px 42px rgba(20, 35, 33, 0.16);
}

.thermal-ticket-head {
  display: block;
  padding-bottom: 5px;
  border-bottom: 1px dashed #222;
  text-align: center;
}

.thermal-ticket-head strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
}

.thermal-ticket-head span {
  display: block;
  font-size: 11px;
  font-weight: 800;
}

.thermal-ticket-head b {
  display: block;
  font-size: 11px;
}

.thermal-ticket-head small,
.thermal-items small,
.thermal-footer {
  color: #444;
  font-size: 9px;
  font-weight: 700;
}

.thermal-lines,
.thermal-item-list,
.thermal-total-lines {
  display: block;
  margin-top: 5px;
  padding-bottom: 5px;
  border-bottom: 1px dashed #222;
}

.thermal-lines p,
.thermal-item-list p {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 3px;
  color: #111;
  font-size: 10px;
  line-height: 1.25;
  text-align: start;
  word-break: break-word;
}

.thermal-lines span,
.thermal-item-list span {
  color: #333;
  font-weight: 800;
}

.thermal-lines b,
.thermal-item-list b {
  color: #111;
  font-weight: 900;
  text-align: end;
}

.thermal-item-list article {
  display: block;
  padding: 4px 0;
  border-bottom: 1px dashed #d0d0d0;
}

.thermal-item-list article:last-child {
  border-bottom: 0;
}

.thermal-item-list strong {
  display: block;
  color: #111;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.thermal-item-list small {
  display: block;
  margin-top: 2px;
}

.thermal-item-list p {
  display: block;
  margin-top: 3px;
}

.thermal-item-list p span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.thermal-total-lines {
  border-top: 1px dashed #222;
  padding-top: 5px;
}

.thermal-strong-line,
.thermal-strong-line span,
.thermal-strong-line b {
  font-size: 12px !important;
}

.thermal-notes {
  display: block;
  padding-bottom: 5px;
  border-bottom: 1px dashed #222;
}

.thermal-notes strong {
  font-size: 10px;
}

.thermal-notes p {
  margin: 0;
  overflow-wrap: anywhere;
}

.thermal-footer {
  padding-top: 4px;
  text-align: center;
}

.a4-sheet {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(8, 1fr);
  align-content: start;
  gap: 0;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  padding: 10mm;
  background: #ffffff;
}

.barcode-label {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 34.6mm;
  padding: 2mm;
  border: 1px dashed #cfd8d5;
  color: #111827;
  text-align: center;
  page-break-inside: avoid;
}

.barcode-label strong,
.barcode-label span,
.barcode-label small,
.barcode-label b,
.barcode-label em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barcode-label strong {
  font-size: 8px;
}

.barcode-label span,
.barcode-label small,
.barcode-label em {
  font-size: 7px;
  color: #4b5563;
  font-style: normal;
}

.barcode-label b {
  font-size: 8px;
}

.barcode-art {
  width: 100%;
  margin: 2mm 0 1mm;
}

.barcode-art svg {
  width: 100%;
  height: 10mm;
}

@page {
  size: A4;
  margin: 0;
}

@page thermal-receipt-page {
  size: 100mm 160mm;
  margin: 0;
}

@media print {
  html,
  body {
    width: 100mm;
    height: 160mm;
    overflow: hidden;
    background: #ffffff;
  }

  .thermal-receipt-body {
    page: thermal-receipt-page;
    width: 100mm;
    height: 160mm;
  }

  .print-toolbar {
    display: none;
  }

  .thermal-receipt {
    width: 100mm;
    height: 160mm;
    overflow: hidden;
    margin: 0;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .thermal-ticket {
    width: 100mm;
    height: 160mm;
    overflow: hidden;
    padding: 5mm 6mm;
    box-shadow: none;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .a4-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
  }

  .print-receipt-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 0;
  }

  .print-receipt-card {
    min-height: 297mm;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .login-view, .dashboard-view { grid-template-columns: 1fr; }
  .brand-panel { min-height: 44vh; padding: 34px; }
  body.sidebar-open { overflow: hidden; }
  .mobile-dashboard-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 64px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(223, 230, 227, 0.92);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(20, 35, 33, 0.1);
    backdrop-filter: blur(14px);
  }
  .mobile-brand {
    display: flex;
    position: static;
    min-height: 42px;
    padding: 0;
    background: transparent;
  }
  .mobile-sidebar-toggle {
    display: grid;
    place-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 10px;
    background: #f7faf9;
    color: var(--brand-dark);
    cursor: pointer;
  }
  .mobile-sidebar-toggle:hover,
  .mobile-sidebar-toggle:focus-visible {
    background: var(--surface-soft);
    outline: none;
  }
  .mobile-sidebar-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
  }
  .mobile-sidebar-toggle b {
    display: none;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(8, 22, 20, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(86vw, 360px);
    padding: 18px;
    border-left: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: -28px 0 70px rgba(20, 35, 33, 0.22);
    overflow-y: auto;
    transform: translateX(105%);
    transition: transform 220ms ease;
  }
  html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid var(--line);
    box-shadow: 28px 0 70px rgba(20, 35, 33, 0.22);
    transform: translateX(-105%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar > .sidebar-brand {
    position: sticky;
    top: -18px;
    z-index: 1;
    justify-content: space-between;
    padding: 6px 0 14px;
    background: #ffffff;
  }
  .sidebar-close {
    display: grid;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 24px;
    line-height: 1;
  }
  .sidebar-nav {
    display: grid;
    gap: 14px;
  }
  .sidebar-section {
    display: grid;
    gap: 7px;
    padding-top: 14px;
  }
  .sidebar-section-title {
    width: auto;
    padding: 0 10px;
  }
  .sidebar nav {
    display: grid;
    gap: 7px;
  }
  .sidebar nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
  }
  .sidebar form {
    margin-top: 12px;
    margin-right: 0;
  }
  html[dir="ltr"] .sidebar form { margin-left: 0; }
  .dashboard-main {
    padding-top: 72px;
  }
  .kpi-grid, .content-grid, .content-grid.product-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart-row { grid-template-columns: 1fr; }
  .pos-checkout-toolbar,
  .pos-cart-stats,
  .pos-totals,
  .pos-customer-fields,
  .pos-customer-account { grid-template-columns: 1fr 1fr; }
  .pos-summary-grid { grid-template-columns: 1fr; }
  .receive-item-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .receive-item-row > label,
  .receive-item-row > label:nth-child(1),
  .receive-item-row > label:nth-child(2),
  .receive-item-row > label:nth-child(3),
  .receive-item-row > label:nth-child(4) { grid-column: span 1; }
  .receive-variant-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .receive-summary-grid { grid-template-columns: 1fr; }
  .receipt-grid,
  .receipt-totals { grid-template-columns: 1fr; }
  .sales-panel, .table-panel { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .brand-panel { padding: 24px; }
  .login-card { width: calc(100% - 24px); padding: 24px; }
  .dashboard-main { padding: 18px; }
  .pos-view { padding: 12px; }
  .topbar, .panel-heading, .form-row { align-items: stretch; flex-direction: column; }
  .trend-filter {
    justify-content: stretch;
  }
  .trend-filter select,
  .trend-filter input,
  .trend-filter .secondary-button {
    width: 100%;
    max-width: none;
  }
  .dashboard-hero { align-items: stretch; flex-direction: column; }
  .dashboard-hero h1 { font-size: 32px; }
  .dashboard-hero-actions { justify-content: stretch; }
  .dashboard-hero-actions .primary-button,
  .dashboard-hero-actions .secondary-button { width: 100%; }
  .dashboard-kpis { grid-template-columns: 1fr; }
  .kpi-grid, .content-grid, .content-grid.product-grid, .data-form { grid-template-columns: 1fr; }
  .pos-header, .pos-header-actions, .pos-product-top, .pos-product-bottom, .pos-totals article { align-items: stretch; flex-direction: column; }
  .pos-search-group { align-items: stretch; flex-direction: column; }
  .pos-catalog-grid,
  .pos-checkout-toolbar,
  .pos-cart-stats,
  .pos-totals,
  .pos-customer-fields,
  .pos-customer-account { grid-template-columns: 1fr; }
  .receive-item-row { grid-template-columns: 1fr; }
  .receive-item-row > label,
  .receive-item-row > label:nth-child(1),
  .receive-item-row > label:nth-child(2),
  .receive-item-row > label:nth-child(3),
  .receive-item-row > label:nth-child(4) { grid-column: 1 / -1; }
  .receive-variant-card-grid,
  .receive-variant-picker-control { grid-template-columns: 1fr; }
  .receipt-hero,
  .receipt-amount-strip,
  .receipt-footer { flex-direction: column; align-items: stretch; }
  .receipt-meta { justify-items: start; text-align: start; }
  .receipt-amount-strip strong { font-size: 24px; }
  .bar-chart { height: 180px; }
  table { min-width: 620px; }
  .table-panel { overflow-x: auto; }
}
