:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-2: #eef2ea;
  --surface-3: #e3e9dd;
  --ink: #18211d;
  --muted: #66726a;
  --line: #d7dfd3;
  --brand: #0f6b4f;
  --brand-2: #164f63;
  --accent: #d18b2f;
  --danger: #b63f3f;
  --warning: #b7791f;
  --success: #147d56;
  --shadow: 0 18px 50px rgba(23, 39, 30, 0.12);
  --radius: 8px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 107, 79, 0.07), transparent 260px),
    var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #10211c;
  color: #f7fbf8;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #2fc58b, #0f6b4f);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  margin-bottom: 12px;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
  margin: 0 0 5px;
  letter-spacing: 0;
}

.brand p {
  display: none;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav-icon,
.button-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-weight: 800;
}

.nav-icon {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-card {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.sidebar-card strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.sidebar-logout {
  width: 100%;
  margin-top: 10px;
}

.login-screen {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(15, 107, 79, 0.13), transparent 330px),
    var(--bg);
}

.login-panel {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 26px;
}

.login-panel p {
  display: none;
}

.main {
  min-width: 0;
  padding: 18px;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.topbar h2 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.12;
}

.topbar p {
  display: none;
}

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

.status-pill {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.dot.warning {
  background: var(--warning);
}

.dot.danger {
  background: var(--danger);
}

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

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

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

.pos-mode-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 14px;
}

.mode-switch-button {
  cursor: pointer;
}

.mode-caret {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin-left: 2px;
}

.stat {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 24px rgba(23, 39, 30, 0.06);
}

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

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.05;
}

.pos-grid {
  grid-template-columns: minmax(270px, 0.9fr) minmax(340px, 1.2fr) minmax(310px, 0.9fr);
  align-items: start;
}

.court-pos-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(23, 39, 30, 0.07);
  overflow: hidden;
}

.nested-panel {
  box-shadow: none;
  background: #fff;
}

.panel-header {
  padding: 14px 14px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.panel-title {
  margin: 0;
  font-size: 17px;
}

.panel-subtitle {
  display: none;
}

.panel-body {
  padding: 14px;
}

.section-stack {
  display: grid;
  gap: 14px;
}

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

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #33413a;
  font-size: 12px;
  font-weight: 700;
}

.field-label {
  color: #33413a;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(15, 107, 79, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 107, 79, 0.12);
}

.scan-form {
  margin-top: 12px;
}

.scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.scan-item-summary {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.scan-item-summary span {
  color: var(--muted);
  font-size: 12px;
}

.import-toolbar {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  gap: 3px;
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 3px 10px rgba(23, 39, 30, 0.08);
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
}

.btn.full-width {
  width: 100%;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn.primary {
  background: var(--brand);
  color: #fff;
}

.btn.secondary {
  background: var(--brand-2);
  color: #fff;
}

.btn.warning {
  background: #f3dfbd;
  color: #6f4313;
}

.btn.danger {
  background: #f4d7d7;
  color: #7d2222;
}

.btn.ghost {
  border-color: var(--line);
  background: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  color: var(--muted);
}

.icon-btn:hover {
  color: var(--ink);
  border-color: #b9c6b5;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-auto-rows: minmax(104px, auto);
}

.product-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.product-card:hover {
  border-color: rgba(15, 107, 79, 0.45);
  box-shadow: 0 10px 20px rgba(23, 39, 30, 0.07);
}

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

.catalog-shell {
  display: grid;
  gap: 10px;
}

.catalog-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.catalog-count {
  min-width: 116px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

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

.court-card {
  min-height: 190px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  color: var(--ink);
  display: grid;
  gap: 12px;
  text-align: left;
}

.court-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 79, 0.12);
}

.court-card.active {
  background: #e8f3ff;
  border-color: #367fbd;
}

.court-card.expired {
  background: #fff3f3;
  border-color: rgba(182, 63, 63, 0.72);
}

.court-card-top,
.court-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.court-card-top strong {
  display: block;
  font-size: 18px;
}

.court-card-top span:not(.badge) {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.court-card-bottom {
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.court-card-bottom strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.court-visual {
  min-height: 92px;
  border-radius: 7px;
  border: 2px solid currentColor;
  color: #94a19a;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(180deg, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px));
}

.court-card.active .court-visual {
  color: #367fbd;
  background-color: rgba(54, 127, 189, 0.08);
}

.court-card.expired .court-visual {
  color: var(--danger);
  background-color: rgba(182, 63, 63, 0.08);
}

.court-visual span {
  position: absolute;
  top: 15%;
  bottom: 15%;
  width: 28%;
  border: 1px solid currentColor;
}

.court-visual span:first-child {
  left: 0;
  border-left: 0;
}

.court-visual span:last-child {
  right: 0;
  border-right: 0;
}

.countdown.compact {
  font-size: 22px;
}

.session-alert {
  border: 1px solid rgba(182, 63, 63, 0.35);
  border-radius: var(--radius);
  background: #fff4f4;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.session-alert span {
  color: var(--muted);
  font-size: 13px;
}

.product-card strong,
.line-title {
  display: block;
  line-height: 1.25;
}

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

.small {
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.price {
  color: var(--brand);
  font-weight: 800;
}

.cart-list {
  display: grid;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  padding-right: 2px;
}

.cart-line,
.active-line {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.cart-line-main,
.active-line-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-weight: 800;
}

.total-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
}

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

.total-row.grand {
  font-size: 22px;
  font-weight: 900;
}

.empty-state {
  min-height: 150px;
  border: 1px dashed #c5d0c0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.empty-state.compact {
  min-height: 54px;
  padding: 10px;
}

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

.cash-summary > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
}

.denom-grid,
.access-grid,
.payment-grid,
.payment-add-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payment-add-row {
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) auto;
  align-items: end;
}

.denom-row,
.check-row,
.payment-row {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.denom-row input {
  width: 92px;
  min-height: 32px;
  text-align: right;
}

.payment-row input {
  width: 132px;
  min-height: 32px;
  text-align: right;
}

.payment-entry-list {
  display: grid;
  gap: 8px;
}

.payment-entry-row {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto 36px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.promo-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.promo-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.promo-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.voucher-chip {
  min-height: 38px;
  border: 1px solid #c9d9cf;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voucher-chip span {
  color: var(--muted);
  font-size: 12px;
}

.promo-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

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

.mode-picker-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  display: grid;
  gap: 4px;
  text-align: left;
}

.mode-picker-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mode-picker-option:disabled {
  cursor: default;
  background: var(--surface-2);
  border-color: var(--brand);
  opacity: 1;
}

.payment-delta {
  color: var(--muted);
}

.payment-delta.success {
  color: var(--success);
}

.payment-delta.warning {
  color: #8a560f;
}

.payment-delta.danger {
  color: var(--danger);
}

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

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

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

.timer-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.timer-card.expired {
  border-color: rgba(182, 63, 63, 0.48);
  background: #fff8f8;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  color: var(--brand-2);
}

.countdown.expired {
  color: var(--danger);
}

.badge {
  min-height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  background: #d7f0e5;
  color: #0c6041;
}

.badge.warning {
  background: #f5e5c9;
  color: #73470f;
}

.badge.danger {
  background: #f5d7d7;
  color: #842626;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 14px 0;
}

.tab-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  border-color: rgba(15, 107, 79, 0.5);
  background: rgba(15, 107, 79, 0.1);
  color: var(--brand);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: #33413a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

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

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 18, 15, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(520px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.modal-header h3 {
  margin: 0;
}

.receipt-modal {
  width: min(calc(var(--receipt-width, 72mm) + 32px), 100%);
}

.receipt {
  box-sizing: border-box;
  width: var(--receipt-width, 72mm);
  max-width: 100%;
  padding: var(--receipt-padding, 2mm);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: var(--receipt-font-size, 11px);
  line-height: 1.25;
  color: #000;
}

.receipt-title {
  text-align: center;
  border-bottom: 1px dashed #999;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.receipt-title h4 {
  margin: 0 0 5px;
  font-size: 1.25em;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}

.receipt-line span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-line strong {
  white-space: nowrap;
}

.receipt-logo {
  display: block;
  max-width: 42mm;
  max-height: 18mm;
  object-fit: contain;
  margin: 0 auto 5px;
}

.receipt-total {
  border-top: 1px dashed #999;
  margin-top: 10px;
  padding-top: 10px;
  font-weight: 900;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
}

.toast {
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px;
}

.toast.danger {
  border-left-color: var(--danger);
}

.toast strong {
  display: block;
  margin-bottom: 3px;
}

.toast p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.search-bar {
  min-width: min(100%, 300px);
}

.receipt-logo-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.receipt-logo-preview img {
  max-width: 120px;
  max-height: 64px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  background: #fff;
}

.receipt-preview-panel {
  align-items: start;
}

.receipt-preview-shell {
  max-width: 100%;
  overflow: auto;
  border: 1px dashed #b8c8bd;
  border-radius: 7px;
  background: #f8faf7;
  padding: 10px;
}

.receipt-preview-shell .receipt {
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 39, 30, 0.08);
}

.receipt-only {
  display: none;
}

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

  .cart-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .sidebar-card {
    margin-top: 0;
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-grid,
  .report-summary,
  .pos-grid,
  .court-pos-grid,
  .timer-grid {
    grid-template-columns: 1fr;
  }

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

  .catalog-grid.compact,
  .court-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 12px;
  }

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

  .cash-summary,
  .denom-grid,
  .access-grid,
  .payment-grid,
  .payment-add-row {
    grid-template-columns: 1fr;
  }

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

  .total-row.grand {
    font-size: 18px;
  }
}

@media print {
  @page {
    size: var(--receipt-page-width, 76mm) var(--receipt-page-height, 297mm);
    margin: 0;
  }

  body {
    background: #fff;
  }

  .app-shell,
  .toast-root,
  .modal-header .icon-btn,
  .modal-header,
  .receipt-actions {
    display: none !important;
  }

  .modal-backdrop {
    position: static;
    padding: 0;
    background: #fff;
    display: block;
  }

  .modal,
  .modal.receipt-modal {
    width: var(--receipt-width, 72mm);
    max-height: none;
    box-shadow: none;
    border-radius: 0;
  }

  .receipt {
    width: var(--receipt-width, 72mm);
    padding: var(--receipt-padding, 2mm);
    font-size: var(--receipt-font-size, 11px);
    color: #000;
  }
}
