:root {
  color-scheme: light;
  --ink: #172326;
  --muted: #65757a;
  --line: #d9e3e4;
  --panel: #ffffff;
  --surface: #eef4f5;
  --soft: #e5f0f2;
  --accent: #1f6f8b;
  --accent-strong: #164c61;
  --gold: #c28a22;
  --danger: #b33b32;
  --success: #357a4d;
  --sidebar: #102329;
  --shadow: 0 18px 45px rgba(22, 45, 50, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(31, 111, 139, 0.08), rgba(238, 244, 245, 0) 260px),
    var(--surface);
  color: var(--ink);
}

body.locked {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(242, 184, 75, 0.10), rgba(255, 255, 255, 0) 190px),
    var(--sidebar);
  color: #f7fbf8;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  background: #f2b84b;
  color: #132429;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(242, 184, 75, 0.22);
}

.brand strong {
  font-size: 1.02rem;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.shift-panel small {
  color: rgba(247, 251, 248, 0.66);
  font-size: 0.82rem;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(247, 251, 248, 0.78);
  text-align: left;
  padding: 0 10px;
}

.tab span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f2b84b;
}

.tab.active {
  border-color: rgba(242, 184, 75, 0.34);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.tab-group {
  display: grid;
  gap: 6px;
}

.nav-submenu {
  display: none;
  gap: 4px;
  padding: 0 0 0 16px;
}

.inventory-tab-group:focus-within .nav-submenu,
.inventory-tab-group:hover .nav-submenu,
.inventory-tab-group:has(.tab.active) .nav-submenu,
.reports-tab-group:focus-within .report-menu,
.reports-tab-group:hover .report-menu,
.reports-tab-group:has(.tab.active) .report-menu {
  display: grid;
}

.nav-submenu button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(247, 251, 248, 0.72);
  text-align: left;
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.nav-submenu button:hover,
.nav-submenu button:focus,
.nav-submenu button.active {
  border-color: rgba(242, 184, 75, 0.28);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  outline: none;
}

.shift-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(242, 184, 75, 0.22);
  background: rgba(255, 255, 255, 0.09);
}

.shift-panel span,
.shift-panel strong,
.shift-panel small {
  display: block;
}

.shift-panel strong {
  margin: 8px 0 2px;
  font-size: 1.65rem;
}

.shift-breakdown {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px auto auto auto;
  gap: 12px;
  align-items: end;
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 251, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(22, 45, 50, 0.06);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(16, 35, 41, 0.96), rgba(22, 76, 97, 0.92)),
    var(--sidebar);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, 0.04) 31px 32px),
    linear-gradient(transparent 0 31px, rgba(255, 255, 255, 0.04) 31px 32px);
  background-size: 32px 32px;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  position: relative;
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 0;
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.login-brand {
  padding-bottom: 8px;
  color: var(--ink);
}

.login-brand span {
  color: var(--muted);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.demo-users {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  border-left: 3px solid var(--gold);
}

.demo-users strong {
  color: var(--ink);
}

.cashier-badge {
  display: grid;
  align-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 12px;
  box-shadow: 0 1px 0 rgba(22, 45, 50, 0.04);
}

.cashier-badge span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cashier-badge strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.14);
}

.view {
  display: none;
  min-height: 0;
  flex: 1;
}

.view.active {
  display: block;
}

.register-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: calc(100vh - 75px);
}

.catalog-pane {
  min-width: 0;
  padding: 18px 20px 28px;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.category-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  white-space: nowrap;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(22, 45, 50, 0.04);
}

.category-button.active {
  border-color: var(--accent);
  background: #dcebef;
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(31, 111, 139, 0.10);
}

.swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.product-card {
  display: grid;
  align-content: start;
  min-height: 118px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
  text-align: left;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22, 45, 50, 0.06);
}

.product-card:hover:not(:disabled) {
  border-color: rgba(31, 111, 139, 0.42);
  box-shadow: 0 16px 30px rgba(22, 45, 50, 0.11);
}

.product-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.product-card strong,
.product-card span {
  display: block;
}

.product-card strong {
  min-height: 34px;
  font-size: 0.9rem;
  line-height: 1.25;
}

.product-category {
  width: fit-content;
  margin-bottom: 6px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-card .price {
  margin-top: 7px;
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 800;
}

.product-card .stock {
  width: fit-content;
  margin-top: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(53, 122, 77, 0.10);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.product-card .low-stock-chip {
  background: rgba(179, 59, 50, 0.10);
  color: var(--danger);
}

.cart-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -12px 0 30px rgba(22, 45, 50, 0.05);
}

.cart-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

h1 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.2;
}

.cart-head span,
.section-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.cart-list {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  padding: 12px;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line);
  background: rgba(238, 244, 245, 0.56);
  color: var(--muted);
  text-align: center;
  border-radius: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-item strong,
.cart-item span {
  display: block;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.qty-controls {
  display: grid;
  grid-template-columns: 34px 38px 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.qty-controls button {
  min-height: 34px;
  border: 0;
  background: #f4f8f9;
  font-weight: 900;
}

.qty-controls span {
  color: var(--ink);
  text-align: center;
}

.item-total {
  justify-self: end;
  font-weight: 800;
}

.remove-item {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.82rem;
}

.totals-panel {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #f7fafb;
}

.adjustments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.totals {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.totals dt {
  color: var(--muted);
}

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

.grand-total {
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
}

.payment-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.pay-method,
.ghost-button,
.primary-button,
.danger-button,
.checkout-button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 800;
  border-radius: 6px;
}

.pay-method.active,
.primary-button,
.checkout-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(31, 111, 139, 0.18);
}

.danger-button {
  border-color: rgba(179, 59, 50, 0.28);
  color: var(--danger);
}

.danger-button:hover:not(:disabled) {
  background: rgba(179, 59, 50, 0.08);
}

.ghost-button:hover:not(:disabled),
.pay-method:hover:not(.active) {
  border-color: rgba(31, 111, 139, 0.26);
  background: #f2f8fa;
}

.ghost-button.small {
  min-height: 34px;
  padding: 0 10px;
}

.checkout-button {
  width: 100%;
  margin-top: 12px;
  min-height: 52px;
  font-size: 1rem;
  letter-spacing: 0;
}

.checkout-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.customer-field,
.cash-field,
.deposit-field,
.split-fields {
  margin-top: 12px;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.split-fields[hidden] {
  display: none;
}

.customer-field {
  margin-bottom: 12px;
}

.change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.change-row span {
  color: var(--muted);
}

.change-row strong {
  font-size: 1.1rem;
}

.inventory-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1fr) minmax(0, 1.1fr);
  gap: 18px;
  padding: 18px 20px 0;
}

.standalone-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
}

.standalone-layout.single {
  grid-template-columns: minmax(0, 1fr);
}

.inventory-stats,
.sales-stats,
.financial-stats,
.stock-count-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 0;
}

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

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

.stat-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22, 45, 50, 0.05);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-card strong {
  color: var(--accent-strong);
  font-size: 1.28rem;
}

.product-form,
.supplier-form,
.purchase-form,
.purchase-list-wrap,
.inventory-table-wrap,
.sales-list {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22, 45, 50, 0.05);
}

.product-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
}

.supplier-form,
.purchase-form,
.purchase-list-wrap {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.purchase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.purchase-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.purchase-head span,
.po-line span,
.purchase-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.po-entry-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 90px 120px auto;
  gap: 10px;
  align-items: end;
}

.po-draft-items,
.supplier-list,
.purchase-order-list {
  display: grid;
  gap: 10px;
}

.po-line,
.supplier-card,
.purchase-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.po-line strong,
.po-line span,
.supplier-card strong,
.supplier-card span,
.purchase-card strong,
.purchase-card span {
  display: block;
}

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

.balance-line {
  margin-top: 6px;
  font-weight: 900;
  color: var(--ink) !important;
}

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

.purchase-card.received {
  background: rgba(53, 122, 77, 0.055);
}

.purchase-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.status-chip {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 900;
}

.po-empty {
  min-height: 92px;
}

.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inventory-table-wrap {
  overflow-x: auto;
}

.inventory-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 210px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.sales-tools,
.stock-count-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  gap: 12px;
  align-items: end;
  margin: 18px 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22, 45, 50, 0.05);
}

.stock-count-tools {
  grid-template-columns: minmax(220px, 1fr) 200px;
}

.stock-count-wrap {
  margin: 18px 20px;
}

.item-tracking-panel {
  margin: 20px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22, 45, 50, 0.05);
}

.section-head.compact {
  padding: 16px 18px 0;
}

.section-head.compact h2 {
  margin: 0;
}

.item-tracking-tools,
.item-tracking-stats,
.item-tracking-panel .stock-count-wrap {
  margin-left: 18px;
  margin-right: 18px;
}

.item-tracking-stats {
  padding-left: 0;
  padding-right: 0;
}

.count-input {
  width: 96px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-weight: 800;
}

.variance-positive {
  color: var(--success);
  font-weight: 900;
}

.variance-negative {
  color: var(--danger);
  font-weight: 900;
}

.check-label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-transform: none;
}

.check-label input {
  width: 18px;
  min-height: 18px;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.inventory-table th {
  background: #f7fafb;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.inventory-table tfoot th {
  border-top: 2px solid var(--line);
  background: #eef4f5;
  color: var(--ink);
  font-size: 0.78rem;
}

.report-total-row th {
  font-weight: 900;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  border-radius: 6px;
}

.low-stock {
  color: var(--danger);
  font-weight: 900;
}

.needs-reorder {
  background: rgba(179, 59, 50, 0.045);
}

.stock-cell {
  display: inline-grid;
  grid-template-columns: 30px minmax(34px, auto) 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.stock-cell button {
  min-height: 30px;
  border: 0;
  background: #f4f8f9;
  font-weight: 900;
}

.stock-cell strong {
  padding: 0 8px;
  text-align: center;
}

.inventory-empty {
  min-height: 120px;
}

.sales-list {
  display: grid;
  gap: 0;
  margin: 18px 20px;
}

.report-stack {
  display: grid;
  gap: 18px;
  padding: 18px 20px;
}

.report-group {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(22, 45, 50, 0.05);
  overflow: hidden;
}

.report-group.active {
  display: block;
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.report-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.report-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.report-group .sales-stats {
  padding: 16px 16px 0;
}

.report-group .financial-stats {
  padding: 16px 16px 0;
}

.report-group .sales-tools {
  margin: 16px 16px 0;
}

.report-group .sales-list {
  margin: 16px;
}

.report-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sale-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.sale-card:hover,
.sale-card:focus {
  outline: none;
  background: #f6fafb;
  box-shadow: inset 3px 0 var(--accent);
  cursor: pointer;
}

.sale-card:last-child {
  border-bottom: 0;
}

.sale-card strong,
.sale-card span {
  display: block;
}

.sale-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.sale-total {
  text-align: right;
  font-size: 1.08rem;
  font-weight: 900;
}

.receipt-dialog {
  width: min(420px, calc(100vw - 28px));
  border: 1px solid var(--line);
  padding: 0;
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.form-dialog {
  width: min(460px, calc(100vw - 28px));
  border: 1px solid var(--line);
  padding: 0;
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.receipt-dialog::backdrop,
.form-dialog::backdrop {
  background: rgba(18, 28, 30, 0.44);
}

.form-dialog form {
  padding: 18px;
}

.receipt {
  padding: 22px;
  background: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
}

.receipt h2 {
  margin: 0 0 10px;
  text-align: center;
}

.receipt-row,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.statement-row {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px dashed #c5cdca;
}

.statement-row span {
  color: #4f5f61;
}

.statement-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-size: 0.78rem;
}

.receipt-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #9da6a3;
  font-weight: 900;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f8faf7;
}

.receipt-dialog[data-mode="receipt"] .dialog-actions {
  grid-template-columns: repeat(3, 1fr);
}

.whatsapp-button {
  background: #128c7e;
  color: #fff;
  border-color: #128c7e;
}

.whatsapp-button:hover:not(:disabled) {
  background: #0f766b;
  border-color: #0f766b;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .brand div:last-child,
  .tab span:last-child,
  .shift-panel span,
  .shift-panel small {
    display: none;
  }

  .sidebar {
    align-items: center;
    padding: 16px 12px;
  }

  .shift-panel {
    width: 100%;
    padding: 10px 4px;
    text-align: center;
  }

  .shift-panel strong {
    font-size: 1rem;
  }

  .register-grid {
    grid-template-columns: 1fr;
  }

  .cart-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  body {
    background: var(--surface);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    gap: 10px;
    padding: 10px;
    box-shadow: 0 10px 24px rgba(12, 27, 32, 0.18);
  }

  .brand {
    justify-content: space-between;
    gap: 10px;
  }

  .brand div:last-child,
  .tab span:last-child,
  .shift-panel span,
  .shift-panel small {
    display: block;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 0.94rem;
  }

  .brand span {
    font-size: 0.76rem;
  }

  .tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .tab-group {
    min-width: max-content;
  }

  .tab {
    min-height: 40px;
    min-width: max-content;
    padding: 0 10px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .tab span:first-child {
    width: 28px;
    height: 28px;
  }

  .nav-submenu {
    display: flex;
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    padding: 0;
  }

  .inventory-tab-group:focus-within .nav-submenu,
  .inventory-tab-group:hover .nav-submenu,
  .inventory-tab-group:has(.tab.active) .nav-submenu,
  .reports-tab-group:focus-within .report-menu,
  .reports-tab-group:hover .report-menu,
  .reports-tab-group:has(.tab.active) .report-menu {
    display: flex;
  }

  .nav-submenu button {
    min-width: max-content;
    min-height: 32px;
    border-radius: 999px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .shift-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    width: 100%;
    margin-top: 0;
    padding: 10px;
    text-align: left;
  }

  .shift-panel strong {
    margin: 0;
    font-size: 1.05rem;
    text-align: right;
  }

  .shift-breakdown {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 4px;
    padding-top: 8px;
  }

  .topbar,
  .inventory-layout,
  .purchase-layout,
  .standalone-layout,
  .inventory-stats,
  .inventory-tools,
  .stock-count-stats,
  .stock-count-tools,
  .financial-stats,
  .sales-stats,
  .sales-tools {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    padding: 12px;
  }

  .topbar button,
  .section-actions button,
  .form-actions button,
  .dialog-actions button {
    width: 100%;
  }

  .catalog-pane {
    padding: 12px;
  }

  .register-grid {
    min-height: 0;
  }

  .po-entry-row,
  .po-line,
  .payment-row,
  .split-fields,
  .supplier-card,
  .purchase-card {
    grid-template-columns: 1fr;
  }

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

  .table-actions button {
    flex: 1 1 120px;
  }

  .purchase-actions {
    justify-items: stretch;
  }

  .section-head,
  .section-actions,
  .report-head {
    align-items: stretch;
    flex-direction: column;
  }

  .report-stack {
    padding: 12px;
  }

  .section-head,
  .cart-head {
    padding: 14px 12px;
  }

  .inventory-layout,
  .purchase-layout,
  .standalone-layout {
    padding: 12px;
  }

  .inventory-stats,
  .stock-count-stats,
  .financial-stats,
  .sales-stats {
    gap: 8px;
    padding: 12px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card strong {
    font-size: 1.05rem;
  }

  .sales-tools,
  .stock-count-tools {
    margin: 12px;
    padding: 12px;
  }

  .sales-list,
  .stock-count-wrap {
    margin: 12px;
  }

  .report-group .sales-stats,
  .report-group .financial-stats {
    padding: 12px 12px 0;
  }

  .report-group .sales-tools,
  .report-group .sales-list {
    margin: 12px;
  }

  .report-head {
    padding: 14px 12px;
  }

  .product-form,
  .supplier-form,
  .purchase-form,
  .purchase-list-wrap {
    padding: 12px;
  }

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

  .product-card {
    min-height: 112px;
    padding: 9px;
  }

  .product-card strong {
    min-height: 0;
    font-size: 0.86rem;
  }

  .cart-list {
    min-height: 150px;
    max-height: 42vh;
  }

  .totals-panel {
    padding: 12px;
  }

  .form-pair,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .inventory-table-wrap {
    border-radius: 8px;
  }

  .inventory-table th,
  .inventory-table td {
    padding: 10px 9px;
    font-size: 0.82rem;
  }

  .inventory-table {
    min-width: 720px;
  }

  .report-table-wrap .inventory-table {
    min-width: 820px;
  }

  .sale-card {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .receipt-dialog,
  .form-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    overflow: auto;
  }

  .receipt {
    padding: 16px;
  }

  .statement-amounts {
    grid-template-columns: 1fr;
  }

  .dialog-actions,
  .receipt-dialog[data-mode="receipt"] .dialog-actions {
    grid-template-columns: 1fr;
  }
}

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

  .shift-breakdown {
    grid-template-columns: 1fr;
  }

  .payment-row {
    gap: 6px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .receipt-dialog,
  .receipt-dialog * {
    visibility: visible;
  }

  .receipt-dialog {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    border: 0;
    box-shadow: none;
  }

  .dialog-actions {
    display: none;
  }
}

/* codex-online-orders-widget-20260701 */
.customer-order-notifier{position:fixed;top:84px;right:18px;z-index:9999;width:min(230px,calc(100vw - 28px))}.customer-order-notify-button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:42px;border:1px solid rgba(183,121,31,.34);background:#fff7e6;color:#7c4a03;padding:0 12px;border-radius:8px;font-weight:900;box-shadow:0 8px 20px rgba(16,33,42,.12)}.customer-order-notify-button.has-new{border-color:rgba(194,65,50,.44);background:#fff1eb;color:#c24132;animation:customer-order-pulse 1.4s ease-in-out infinite}.customer-order-badge{display:inline-grid;min-width:26px;height:26px;place-items:center;border-radius:999px;background:#c24132;color:#fff;padding:0 7px;font-size:.78rem}.customer-order-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:10000;display:grid;width:min(520px,calc(100vw - 36px));max-height:min(620px,calc(100vh - 92px));overflow:auto;gap:12px;border:1px solid #dde6ea;background:#fff;padding:14px;border-radius:10px;box-shadow:0 18px 42px rgba(16,33,42,.16)}.customer-order-panel[hidden],.customer-order-notifier[hidden],.customer-order-alert[hidden]{display:none}.customer-order-panel-head,.customer-order-card-head,.customer-order-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}.customer-order-panel-head strong,.customer-order-card-head strong{display:block}.customer-order-panel-head span,.customer-order-meta,.customer-order-items{color:#64717d;font-size:.82rem}.customer-order-alert{border-left:4px solid #c24132;background:#fff1eb;color:#7f1d1d;padding:10px 12px;font-weight:800}.customer-order-list{display:grid;gap:10px}.customer-order-card{display:grid;gap:8px;border:1px solid #dde6ea;background:#f3f7f8;padding:12px;border-radius:8px}.customer-order-status{display:inline-flex;align-items:center;min-height:24px;border-radius:999px;background:#dff7f3;color:#0b5654;padding:0 9px;font-size:.75rem;font-weight:900}.customer-order-actions{flex-wrap:wrap;justify-content:flex-start}.customer-order-actions button{min-height:30px;border:1px solid #dde6ea;background:#fff;color:#10212a;padding:0 9px;border-radius:7px;font-size:.78rem;font-weight:900}@keyframes customer-order-pulse{0%,to{box-shadow:0 0 rgba(194,65,50,.22)}50%{box-shadow:0 0 0 8px rgba(194,65,50,0)}}@media(max-width:720px){.customer-order-notifier{top:auto;right:12px;bottom:70px;width:min(210px,calc(100vw - 24px));z-index:9999}.customer-order-panel{top:auto;right:0;bottom:calc(100% + 8px);max-height:min(520px,calc(100vh - 140px))}}
/* codex-orders-simple-button-20260701 */
#customerOrderNotifier{position:relative!important;top:auto!important;right:auto!important;bottom:auto!important;width:auto!important;z-index:20!important;align-self:end!important}#customerOrderNotifyBtn{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;width:auto!important;white-space:nowrap!important;min-height:42px!important;border:1px solid #dde6ea!important;background:#fff!important;color:#10212a!important;padding:0 14px!important;border-radius:8px!important;font-weight:900!important;box-shadow:0 8px 20px rgba(16,33,42,.07)!important}#customerOrderNotifyBtn .customer-order-icon,#customerOrderNotifyBtn .customer-order-copy small{display:none!important}#customerOrderNotifyBtn .customer-order-copy{display:inline!important}#customerOrderNotifyBtn .customer-order-copy span{font-size:.84rem!important;color:inherit!important}#customerOrderBadge{display:inline-grid!important;min-width:19px!important;height:19px!important;place-items:center!important;border-radius:999px!important;background:#08746f!important;color:#fff!important;padding:0 5px!important;font-size:.66rem!important;font-weight:900!important}
