:root {
  --green: #28a745;
  --green-dark: #16642a;
  --green-soft: #eaf8ee;
  --yellow: #ffca2c;
  --ink: #102318;
  --muted: #64736a;
  --line: #dcece1;
  --surface: #ffffff;
  --surface-2: #f7fbf8;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(18, 84, 38, .11);
  --shadow-soft: 0 10px 28px rgba(18, 84, 38, .08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(40, 167, 69, .13), transparent 34rem),
    linear-gradient(180deg, #fbfefc 0%, #f3faf5 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-navbar,
.topbar {
  background: rgba(22, 100, 42, .94);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(13, 65, 28, .18);
}

.topbar {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px clamp(14px, 4vw, 32px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .navbar-toggler {
  color: #fff;
}

.app-navbar .navbar-brand {
  font-size: 1.08rem;
  letter-spacing: .01em;
}

.app-navbar .navbar-brand b,
.brand b,
.logo-block b {
  color: var(--yellow);
}

.app-navbar .nav-link {
  border-radius: 999px;
  color: rgba(255, 255, 255, .82);
  font-size: .94rem;
  font-weight: 750;
  margin: 2px;
  padding: .58rem .85rem;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .nav-link.active {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.app-navbar .navbar-toggler {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px;
  min-height: 44px;
}

.app-navbar .navbar-toggler-icon {
  filter: invert(1);
}

.brand,
.logo-block {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-size: 22px;
  gap: 8px;
}

.brand-logo {
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
  height: 42px;
  object-fit: cover;
  width: 42px;
}

.brand-icon {
  border: 3px solid var(--yellow);
  border-left-color: #fff;
  border-radius: 50%;
  display: inline-block;
  height: 28px;
  position: relative;
  width: 28px;
}

.brand-icon::after {
  background: #fff;
  border-radius: 999px;
  content: "";
  height: 5px;
  position: absolute;
  right: -10px;
  top: 9px;
  width: 14px;
}

.user-chip {
  color: #fff;
  display: flex;
  flex-direction: column;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.15;
}

.user-chip span {
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page {
  margin: 0 auto;
  max-width: 1220px;
  overflow-x: hidden;
  padding: 22px clamp(12px, 4vw, 34px) 96px;
}

.hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(16, 35, 24, .10), transparent 42%),
    linear-gradient(135deg, #16642a 0%, #28a745 72%);
  border-radius: 22px;
  box-shadow: var(--shadow);
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  overflow: hidden;
  padding: clamp(20px, 5vw, 34px);
  position: relative;
}

.hero::after {
  background: rgba(255, 202, 44, .22);
  border-radius: 999px;
  content: "";
  height: 170px;
  position: absolute;
  right: -48px;
  top: -54px;
  width: 170px;
}

.hero h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 850;
  letter-spacing: -.02em;
  margin: 0;
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--yellow);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .12em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.panel,
.login-card,
.cards article,
.accordion-item {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(220, 236, 225, .92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel {
  margin-bottom: 18px;
  padding: clamp(16px, 4vw, 24px);
}

.panel h1,
.panel h2 {
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.cards article {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,251,248,.96));
  padding: 18px;
}

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

.action-hub a,
.step-card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 16px;
}

.action-hub strong,
.step-card strong {
  color: var(--green-dark);
  font-size: 1.05rem;
  font-weight: 900;
}

.action-hub span,
.step-card span {
  color: var(--muted);
  font-size: .88rem;
}

.action-hub a:hover,
.step-card:hover {
  border-color: rgba(40, 167, 69, .45);
  transform: translateY(-1px);
}

.next-steps {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(234,248,238,.8));
}

.step-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.step-card {
  position: relative;
}

.step-card b {
  align-self: end;
  background: var(--green-soft);
  border-radius: 999px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: .76rem;
  font-weight: 900;
  justify-self: start;
  padding: 6px 9px;
}

.step-card.todo {
  border-color: rgba(255, 202, 44, .85);
}

.step-card.todo b {
  background: #fff4bf;
  color: #6c5200;
}

.step-card.done {
  opacity: .72;
}

.cards span,
.metric span {
  color: var(--muted);
  display: block;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cards strong,
.metric strong {
  color: var(--green-dark);
  display: block;
  font-size: clamp(1.45rem, 7vw, 1.95rem);
  line-height: 1.1;
  margin: 8px 0;
}

.cards small,
.muted {
  color: var(--muted);
}

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

form {
  display: grid;
  gap: 12px;
}

form.row,
.row,
.input-group,
.d-flex,
.accordion form.row {
  display: flex;
}

label,
.form-label {
  color: var(--green-dark);
  display: grid;
  font-size: .9rem;
  font-weight: 850;
  gap: 6px;
  margin: 0;
}

input,
select,
textarea,
button,
.primary,
.btn {
  border-radius: 12px;
  font: inherit;
  min-height: 46px;
}

input,
select,
textarea,
.form-control,
.form-select {
  background-color: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  min-height: 48px;
  padding: 11px 13px;
  width: 100%;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 .22rem rgba(40, 167, 69, .14);
}

button,
.primary,
.btn-success {
  align-items: center;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border: 0;
  box-shadow: 0 10px 18px rgba(40, 167, 69, .18);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  padding: 11px 16px;
}

button:hover,
.primary:hover,
.btn-success:hover,
.btn-success:focus {
  background: linear-gradient(135deg, #31b853, var(--green-dark));
  color: #fff;
}

.btn-outline-success {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(40, 167, 69, .35);
  color: var(--green-dark);
  font-weight: 800;
}

.btn-outline-success:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.danger {
  background: linear-gradient(135deg, #d92d20, var(--danger));
}

.flash {
  background: #fff8db;
  border: 1px solid #f1d36c;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  color: #5c4600;
  font-weight: 800;
  margin-bottom: 16px;
  padding: 13px 15px;
}

.login-card {
  margin: 34px auto;
  max-width: 440px;
  padding: 24px;
}

.login-card .logo-block {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  border-radius: 16px;
  color: #fff;
  margin-bottom: 20px;
  padding: 14px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  width: 100%;
}

th {
  background: var(--green-dark);
  color: #fff;
  font-size: .78rem;
  letter-spacing: .06em;
  padding: 12px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: middle;
}

tr:nth-child(even) td {
  background: #f8fcf9;
}

.pill,
.badge {
  border-radius: 999px;
  font-weight: 900;
}

.pill {
  background: #e7f7eb;
  color: var(--green-dark);
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
}

.danger-pill {
  background: #fee4e2;
  color: var(--danger);
}

.status {
  background: #eef4f0;
  border-radius: 999px;
  display: inline-block;
  font-weight: 900;
  padding: 9px 13px;
}

.status.ok {
  background: #dcfae6;
  color: var(--green-dark);
}

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

.denoms label,
.stock-count label {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.denoms label {
  align-items: center;
  grid-template-columns: 1fr 110px;
}

.sales-grid {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  grid-template-columns: 2fr 1fr 90px 90px 90px;
  margin-bottom: 8px;
  padding: 10px;
}

.sales-grid.head {
  background: transparent;
  border: 0;
  color: var(--green-dark);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sales-grid small {
  color: var(--muted);
  display: block;
  font-size: .74rem;
  font-weight: 650;
  margin-top: 2px;
}

.sales-grid.row-hit {
  animation: rowHit .9s ease;
}

@keyframes rowHit {
  0% { box-shadow: 0 0 0 0 rgba(255, 202, 44, .85); }
  100% { box-shadow: 0 0 0 12px rgba(255, 202, 44, 0); }
}

.barcode-box,
.payment-panel {
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

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

.barcode-video {
  border-radius: 16px;
  margin-bottom: 14px;
  max-height: 260px;
  object-fit: cover;
  transform-origin: center;
  width: 100%;
}

.barcode-video video,
.barcode-video canvas {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.camera-frame {
  background: #102318;
  border-radius: 16px;
  overflow: hidden;
}

.scanner-panel {
  align-items: center;
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px minmax(0, 1fr);
  margin-bottom: 14px;
  padding: 12px;
}

.scanner-panel .barcode-video {
  aspect-ratio: 4 / 3;
  background: #102318;
  margin: 0;
  min-height: 220px;
  max-height: 260px;
}

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

.scanner-panel strong {
  color: var(--green-dark);
  font-weight: 900;
}

.scanner-panel span {
  color: var(--muted);
  font-size: .88rem;
  margin: 3px 0 10px;
}

.scan-toast {
  align-items: center;
  background: rgba(16, 35, 24, .92);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: .9rem;
  font-weight: 800;
  justify-content: center;
  left: 50%;
  max-width: calc(100vw - 32px);
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  top: 18px;
  transform: translate(-50%, -10px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 40;
}

.scan-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.scan-toast[data-kind="good"] {
  background: rgba(22, 100, 42, .95);
}

.scan-toast[data-kind="bad"] {
  background: rgba(180, 35, 24, .95);
}

.camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.camera-actions .btn,
.camera-actions button {
  flex: 1 1 140px;
}

.camera-zoom {
  margin-top: 10px;
}

.cash-camera {
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 12px;
}

.cash-camera video {
  aspect-ratio: 4 / 3;
  background: #102318;
  border-radius: 14px;
  min-height: 180px;
  object-fit: cover;
  overflow: hidden;
  transform-origin: center;
  width: 100%;
}

.cash-photo img {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-height: 70vh;
  object-fit: contain;
  width: 100%;
}

.payment-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.register-shell {
  display: grid;
  gap: 16px;
}

.register-shell form {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.register-main,
.register-cart {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  padding: clamp(14px, 3vw, 22px);
}

.register-head {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  margin-bottom: 14px;
}

.register-head h1,
.register-cart h2 {
  font-weight: 900;
  letter-spacing: -.02em;
  margin: 0 0 8px;
}

.register-search input {
  background: #fff;
}

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

.category-chips {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chips button {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--green-dark);
  flex: 0 0 auto;
  font-size: .9rem;
  min-height: 42px;
  padding: 9px 13px;
}

.category-chips button.active {
  background: var(--green-dark);
  color: #fff;
}

.category-heading {
  align-self: end;
  color: var(--green-dark);
  font-size: .92rem;
  font-weight: 950;
  grid-column: 1 / -1;
  letter-spacing: .08em;
  margin: 8px 0 0;
  text-transform: uppercase;
}

.product-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.product-tile.selected {
  border-color: rgba(40, 167, 69, .7);
  box-shadow: 0 12px 26px rgba(40, 167, 69, .12);
}

.product-tile.stock-limit {
  animation: stockLimit .9s ease;
}

@keyframes stockLimit {
  0%, 100% { border-color: var(--line); }
  35% { border-color: var(--danger); box-shadow: 0 0 0 5px rgba(180, 35, 24, .12); }
}

.product-tile strong {
  color: var(--ink);
  display: block;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.product-tile span {
  color: var(--green-dark);
  display: block;
  font-weight: 900;
  margin-top: 6px;
}

.product-tile small {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 2px;
}

.qty-control {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.qty-control button {
  border-radius: 16px;
  flex: 0 0 52px;
  font-size: 1.35rem;
  min-height: 52px;
  padding: 0;
  width: 52px;
}

.qty-control input {
  flex: 0 0 78px;
  font-size: 1.18rem;
  font-weight: 900;
  min-height: 52px;
  min-width: 0;
  text-align: center;
  width: 78px;
}

.register-cart {
  position: sticky;
  top: 86px;
}

.cart-lines {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.cart-lines div {
  align-items: center;
  background: var(--green-soft);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.cart-lines span {
  color: var(--ink);
  font-weight: 750;
}

.cart-lines b {
  color: var(--green-dark);
  white-space: nowrap;
}

.cart-total {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
}

.cart-total span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.cart-total strong {
  color: var(--green-dark);
  font-size: 1.6rem;
  font-weight: 950;
}

.checkout-button {
  font-size: 1.05rem;
  margin-top: 12px;
  width: 100%;
}

.checkout-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.confirm-sale {
  margin-left: auto;
  margin-right: auto;
  max-width: 760px;
}

.confirm-total {
  margin-top: 14px;
}

.inline-form {
  display: inline-flex;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.report-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.warning-panel {
  border-color: rgba(255, 202, 44, .65);
  box-shadow: 0 18px 44px rgba(255, 202, 44, .15);
}

.warning-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.warning-list li {
  background: #fff8db;
  border: 1px solid #f1d36c;
  border-radius: 12px;
  font-weight: 850;
  padding: 10px 12px;
}

.stock-count {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.stock-count label {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 110px;
}

.stock-count-row[hidden] {
  display: none;
}

.stock-count small {
  color: var(--muted);
  display: block;
  font-weight: 600;
  margin-top: 2px;
}

.metric {
  background: linear-gradient(135deg, var(--green-soft), #fff);
  border-radius: 16px;
  margin-top: 18px;
  padding: 18px;
}

.accordion {
  display: grid;
  gap: 10px;
}

.accordion-item {
  border: 1px solid var(--line);
  overflow: hidden;
}

.accordion-button {
  border-radius: 0 !important;
  color: var(--ink);
  font-weight: 850;
  min-height: 54px;
}

.accordion-button:not(.collapsed) {
  background: var(--green-soft);
  color: var(--green-dark);
}

.accordion-button:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .14);
}

.price-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 960px;
  padding: clamp(16px, 4vw, 28px);
}

.price-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.price-header {
  align-items: center;
  border-bottom: 5px solid var(--green);
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  position: relative;
}

.price-header::after {
  background: var(--yellow);
  bottom: -5px;
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  width: 140px;
}

.price-header img {
  border-radius: 16px;
  height: 86px;
  width: 86px;
}

.price-header h1 {
  color: var(--green-dark);
  font-weight: 900;
  margin: 0;
}

.price-header p {
  margin: 0;
}

.price-table {
  min-width: 0;
}

.price-table th {
  background: var(--green-dark);
}

.price-table .category-row td {
  background: var(--yellow);
  color: #1f2d1f;
  font-weight: 900;
}

.price-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 10px;
}

.bottom-nav {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(220, 236, 225, .9);
  border-radius: 22px 22px 0 0;
  bottom: 0;
  box-shadow: 0 -14px 34px rgba(18, 84, 38, .14);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  left: 0;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 20;
}

.bottom-nav a {
  align-items: center;
  border-radius: 16px;
  color: var(--muted);
  display: flex;
  font-size: .72rem;
  font-weight: 900;
  justify-content: center;
  min-height: 52px;
  padding: 7px 4px;
  text-align: center;
}

.bottom-nav a.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

@media (max-width: 850px) {
  body {
    background: #f6fbf7;
  }

  .app-navbar .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-navbar .navbar-collapse {
    background: rgba(16, 35, 24, .18);
    border-radius: 16px;
    margin-top: 10px;
    padding: 8px;
  }

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

  .page {
    padding: 12px 8px 92px;
  }

  .table-wrap,
  .panel {
    max-width: 100%;
  }

  .row.g-2 > [class*="col"],
  .row.g-2 > [class*="col-"] {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .input-group {
    align-items: stretch;
    flex-direction: column;
  }

  .input-group .btn,
  .input-group .form-control {
    border-radius: 12px !important;
    width: 100%;
  }

  .cards,
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: flex-start;
    border-radius: 20px;
    flex-direction: column;
    padding: 22px;
  }

  .hero .primary,
  .hero .btn {
    width: 100%;
  }

  .panel {
    border-radius: 18px;
    margin-bottom: 12px;
    padding: 15px;
  }

  .cards {
    gap: 10px;
  }

  .action-hub,
  .step-list {
    grid-template-columns: 1fr 1fr;
  }

  .action-hub a {
    min-height: 96px;
    padding: 14px;
  }

  .cards article {
    padding: 15px;
  }

  .nav {
    display: none;
  }

  .bottom-nav {
    display: grid;
  }

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

  .denoms label {
    grid-template-columns: 1fr 118px;
  }

  .sales-grid {
    grid-template-columns: minmax(130px, 1fr) 72px 72px 72px;
    overflow-x: auto;
  }

  .barcode-box,
  .payment-panel {
    grid-template-columns: 1fr;
  }

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

  .register-shell {
    padding-bottom: 160px;
  }

  .register-head {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .register-cart {
    background: rgba(255, 255, 255, .97);
    border-radius: 20px 20px 0 0;
    bottom: 65px;
    box-shadow: 0 -14px 36px rgba(18, 84, 38, .18);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    left: 0;
    max-height: 176px;
    overflow-y: auto;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    top: auto;
    z-index: 18;
  }

  .register-cart h2,
  .cart-lines {
    display: none;
  }

  .register-cart .payment-panel {
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    margin: 0;
    padding: 6px;
  }

  .register-cart .payment-panel label:nth-child(2),
  .register-cart .payment-panel label:nth-child(3) {
    display: none;
  }

  .register-cart.show-payment-details .payment-panel label:nth-child(2),
  .register-cart.show-payment-details .payment-panel label:nth-child(3) {
    display: grid;
  }

  .register-cart.show-payment-details {
    max-height: min(58vh, 330px);
  }

  .cart-total {
    border-top: 0;
    min-width: 0;
    padding-top: 0;
  }

  .cart-total strong {
    font-size: 1.35rem;
  }

  .checkout-button {
    align-self: center;
    margin-top: 0;
    min-height: 48px;
    min-width: 118px;
    width: auto;
  }

  .checkout-actions {
    align-items: stretch;
    display: flex;
    gap: 8px;
  }

  .checkout-actions .btn,
  .checkout-actions .checkout-button {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

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

  .product-tile {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .qty-control {
    gap: 6px;
  }

  .qty-control button,
  .qty-control input {
    flex-basis: 46px;
    min-height: 48px;
    width: 46px;
  }

  .qty-control input {
    flex-basis: 64px;
    width: 64px;
  }

  .scanner-panel {
    grid-template-columns: 104px minmax(0, 1fr);
    padding: 10px;
  }

  .scanner-panel .barcode-video {
    max-height: 180px;
  }

  .scanner-panel .btn {
    min-height: 40px;
    padding: 8px 10px;
  }

  .camera-actions .btn,
  .camera-actions button {
    flex-basis: 120px;
    min-height: 42px;
  }

  .sales-grid span:nth-child(2),
  .sales-grid.head b:nth-child(2) {
    display: none;
  }

  .stock-count label {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .price-header {
    align-items: flex-start;
  }

  .price-header img {
    height: 64px;
    width: 64px;
  }

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

  .price-actions .btn {
    flex: 1;
  }
}

@media (max-width: 430px) {
  .navbar-brand span {
    font-size: .96rem;
  }

  .page {
    padding-left: 6px;
    padding-right: 6px;
  }

  .user-chip {
    display: none;
  }

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

  .action-hub,
  .step-list {
    grid-template-columns: 1fr;
  }

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

  .sales-grid.head {
    display: none;
  }

  .sales-grid input {
    min-width: 100%;
  }

  .register-shell {
    padding-bottom: 152px;
  }

  .register-main {
    padding: 10px;
  }

  .scanner-panel {
    grid-template-columns: 1fr;
  }

  .scanner-panel .barcode-video {
    max-height: 200px;
  }

  .cash-camera video {
    min-height: 210px;
  }

  .category-chips button {
    font-size: .82rem;
    min-height: 38px;
    padding: 8px 10px;
  }

  .product-tile {
    border-radius: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .product-tile strong {
    font-size: .96rem;
  }

  .register-cart {
    border-radius: 16px 16px 0 0;
    bottom: 62px;
    max-height: 168px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .register-cart .payment-panel {
    grid-template-columns: 1fr;
    padding: 7px;
  }

  .cart-total strong {
    font-size: 1.18rem;
  }

  .checkout-button {
    min-width: 104px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .checkout-actions .btn,
  .checkout-actions .checkout-button {
    font-size: .9rem;
  }

  .checkout-actions {
    gap: 6px;
  }

  .qty-control {
    gap: 5px;
  }

  .qty-control button {
    flex-basis: 42px;
    min-height: 44px;
    width: 42px;
  }

  .qty-control input {
    flex-basis: 56px;
    min-height: 44px;
    width: 56px;
  }

  table {
    min-width: 560px;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  .app-navbar,
  .bottom-nav,
  .no-print,
  .flash {
    display: none !important;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .price-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    padding: 0;
  }

  .price-table {
    font-size: 12px;
  }

  .price-table tr {
    break-inside: avoid;
  }
}
