:root {
  --app-bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #edf6f5;
  --ink: #172522;
  --muted: #62706d;
  --line: #d7e1df;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #2563eb;
  --warning: #b45309;
  --danger: #b42318;
  --sidebar: #172b2a;
  --sidebar-soft: #223c3a;
  --coral: #d94f64;
  --shadow: 0 10px 28px rgba(22, 52, 47, 0.07);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--app-bg);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  text-decoration: none;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
}

.form-control,
.form-select,
.btn {
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.18rem rgba(15, 118, 110, 0.16);
}

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

.app-sidebar {
  height: 100vh;
  overflow-y: auto;
  scrollbar-color: #50716d var(--sidebar);
  scrollbar-width: thin;
  background: var(--sidebar);
  color: #eef7f5;
  padding: 20px 16px 28px;
  position: sticky;
  top: 0;
  min-height: 100vh;
  border-inline-start: 4px solid var(--primary);
}

.mobile-nav-toggle,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}

.app-sidebar .brand {
  min-height: 58px;
  padding: 0 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--coral);
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(217, 79, 100, 0.24);
}

.brand strong,
.auth-brand h1 {
  display: block;
  margin: 0;
  font-size: 1rem;
}

.brand small,
.auth-brand p,
.topbar-kicker {
  display: block;
  margin: 2px 0 0;
  color: #aebdcc;
  font-size: 0.82rem;
}

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.side-nav-link,
.side-nav-muted {
  display: block;
  border-radius: 8px;
  padding: 9px 11px;
}

.side-nav-link {
  position: relative;
  color: #e8f2f0;
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.side-nav-link:hover {
  color: #ffffff;
  background: var(--sidebar-soft);
  border-color: rgba(255, 255, 255, 0.09);
}

.side-nav-link.is-active {
  color: #0c5f58;
  background: #ecfdf8;
  border-color: #a7e8dc;
  box-shadow: 0 7px 18px rgba(4, 17, 15, 0.18);
  font-weight: 700;
}

.side-nav-link.is-active::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: -1px;
  width: 4px;
  border-radius: 4px;
  background: var(--coral);
}

.side-nav-alert-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-alert-indicator {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffcf70;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.side-nav-alert-link.has-live-alert {
  border-color: rgba(255, 207, 112, 0.8);
}

.side-nav-section {
  margin: 17px 8px 5px;
  padding-top: 12px;
  color: #8fded3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.side-nav-muted {
  color: #b9c7d5;
  background: rgba(255, 255, 255, 0.04);
}

.app-main {
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 16px rgba(31, 57, 52, 0.04);
}

.app-topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

.topbar-kicker {
  color: var(--primary);
  font-weight: 700;
}

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

.user-chip {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #f5faf9;
  color: var(--ink);
  font-size: 0.88rem;
}

.app-content {
  padding: 24px 28px 36px;
}

.toolbar-band,
.panel,
.metric-card,
.auth-card,
.state-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar-band {
  border-inline-start: 4px solid var(--accent);
  padding: 16px;
  margin-bottom: 18px;
}

.filters-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: end;
  gap: 12px;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto auto auto;
  align-items: end;
  gap: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid var(--primary);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(22, 52, 47, 0.1);
}

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

.metric-card strong {
  font-size: 1.8rem;
  line-height: 1;
}

.metric-card.accent {
  border-top-color: var(--accent);
}

.metric-card.warning {
  border-top-color: var(--warning);
}

.metric-card.danger {
  border-top-color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
  margin-top: 18px;
}

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

.details-grid,
.profile-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}

.panel > .details-grid,
.panel > .profile-data-grid {
  padding: 18px;
}

.details-grid > div,
.profile-data-grid > div {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.details-grid dt,
.profile-data-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.details-grid dd,
.profile-data-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.details-grid-wide,
.profile-data-wide {
  grid-column: 1 / -1;
}

.panel {
  overflow: hidden;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}

.panel-body {
  padding: 18px;
}

.split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.split-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.table {
  margin-bottom: 0;
}

.table th {
  color: var(--muted);
  font-weight: 700;
  background: #f4f8f7;
}

.data-table td,
.data-table th {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 120ms ease;
}

.data-table tbody tr:hover {
  background: #f6fbfa;
}

.table-actions {
  width: 1%;
  white-space: nowrap;
}

.empty-state {
  margin: 10px;
  padding: 28px 18px;
  color: var(--muted);
  border-inline-start: 4px solid #9ccfc8;
  background: #f7fbfa;
  border-radius: 6px;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-state p {
  margin: 0;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.required-marker {
  color: var(--danger);
  font-weight: 800;
}

.validation-summary-valid {
  display: none;
}

.validation-summary-errors {
  display: block;
}

.status-badge {
  white-space: nowrap;
}

.audit-values {
  max-width: 100%;
  max-height: 32rem;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.setup-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  list-style: none;
}

.setup-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.setup-list span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.pager-bar,
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
  color: var(--muted);
}

.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.company-logo-panel {
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.company-logo-content {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 18px;
}

.company-logo-preview {
  width: 180px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #9bb9b4;
  border-radius: 8px;
  background: #f5faf9;
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 800;
}

.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-logo-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.company-logo-actions .form-label {
  grid-column: 1 / -1;
  margin-bottom: -4px;
}

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

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

.form-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-top: 30px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.compact-panel .panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-message {
  padding: 14px 18px 0;
}

.panel-actions {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.permission-matrix-wrap {
  max-height: 68vh;
}

.permission-matrix {
  min-width: 1200px;
}

.permission-matrix th,
.permission-matrix td {
  text-align: center;
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 190px;
  text-align: right;
  background: var(--surface);
}

.permission-matrix thead th:first-child {
  background: #f8fafc;
}

.permission-matrix th span,
.permission-matrix td strong,
.permission-matrix td small {
  display: block;
}

.permission-matrix th small,
.permission-matrix td small {
  color: var(--muted);
  font-size: 0.75rem;
}

.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 16px;
  min-height: calc(100vh - 140px);
}

.pos-shell > * {
  min-width: 0;
}

.pos-search-panel,
.pos-cart-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.pos-cart-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.pos-results,
.pos-cart-lines {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pos-cart-lines {
  flex: 1;
  padding: 14px;
  align-content: start;
}

.pos-result-row,
.pos-cart-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.pos-result-row:hover {
  border-color: #9ccfc8;
  background: #f7fcfb;
}

.pos-cart-line {
  cursor: pointer;
}

.pos-cart-line.is-selected {
  border-color: var(--primary);
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.pos-result-row span,
.pos-result-row small,
.pos-cart-line span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.pos-result-actions,
.pos-cart-line > div:last-child {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 8px;
  min-width: 96px;
}

.pos-cart-line-main {
  flex: 1 1 auto;
  min-width: 0;
}

.pos-cart-line-actions {
  align-self: stretch;
}

.pos-line-quantity {
  max-width: 150px;
}

.pos-line-compliance {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 10px;
  border-inline-start: 3px solid #b7791f;
  border-radius: 4px;
  background: #fffaf0;
}

.pos-line-compliance.text-success {
  border-inline-start-color: #198754;
  background: #f0fff4;
}

.pos-line-compliance .form-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.pos-line-compliance textarea {
  width: 100%;
  resize: vertical;
}

.controlled-policy-notice {
  display: grid;
  gap: 4px;
  margin: 0;
}

.controlled-policy-notice > span {
  overflow-wrap: anywhere;
}

.substitution-summary dd,
.controlled-dispense-reason {
  overflow-wrap: anywhere;
}

.controlled-dispense-reason {
  min-width: 220px;
  white-space: normal;
}

.pos-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 16px;
  background: #f8fafc;
}

.pos-total strong {
  font-size: 1.6rem;
}

.pos-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: #fff;
}

.pos-quick-actions .btn {
  min-height: 44px;
  font-weight: 800;
}

.pos-quick-actions kbd {
  margin-inline-start: 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  padding: 1px 5px;
  background: rgba(15, 23, 42, 0.18);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
}

.pos-quick-actions .btn-outline-primary kbd {
  border-color: rgba(15, 118, 110, 0.25);
  background: #f0fdfa;
}

.pos-adjustments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  background: #fff;
}

.pos-adjustments span {
  min-width: 90px;
  color: var(--muted);
  font-weight: 700;
  text-align: end;
}

.pos-checkout {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px;
}

.pos-validation-summary {
  margin: 12px 16px 0;
}

.pos-payment-list {
  display: grid;
}

.pos-payment-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.pos-payment-row:first-child {
  border-top: 0;
}

.pos-payment-field {
  min-width: 0;
}

.pos-payment-method-field {
  grid-column: span 4;
}

.pos-payment-amount-field {
  grid-column: span 2;
}

.pos-payment-reference-field {
  grid-column: span 3;
}

.pos-payment-code-field,
.pos-payment-units-field {
  grid-column: span 3;
}

.pos-payment-action {
  grid-column: span 1;
  display: flex;
  align-items: end;
  justify-content: end;
}

.pos-payment-action .btn {
  width: 42px;
  min-width: 42px;
  min-height: 38px;
  padding-inline: 8px;
}

.pos-payment-row .form-label {
  min-height: 1.5em;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.pos-payment-row .form-control,
.pos-payment-row .form-select {
  width: 100%;
  min-width: 0;
}

.pos-payment-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}

.pos-payment-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pos-message {
  min-height: 22px;
  font-size: 0.9rem;
}

.auth-page {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  overflow-x: hidden;
  background: #eef4f6;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  min-width: 0;
  padding: 28px;
  box-sizing: border-box;
}

.auth-brand {
  margin-bottom: 24px;
  min-width: 0;
  color: var(--ink);
}

.auth-brand > div {
  min-width: 0;
}

.auth-brand p {
  color: var(--muted);
}

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

.shifts-grid {
  align-items: start;
}

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

.shift-close-input {
  width: 8rem;
  min-width: 7rem;
}

.validation-summary ul {
  margin-bottom: 0;
}

.state-panel {
  width: min(100%, 620px);
  margin: 70px auto;
  padding: 34px;
  text-align: center;
}

.state-code {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--danger);
  font-weight: 800;
  font-size: 2rem;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.36);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

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

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

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    z-index: 1050;
    top: 0;
    right: 0;
    width: min(86vw, 320px);
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    border-inline-start: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(105%);
    transition: transform 180ms ease, visibility 0s linear 180ms;
    box-shadow: -18px 0 42px rgba(15, 35, 55, 0.25);
  }

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

  .side-nav-section {
    grid-column: 1 / -1;
  }

  .app-sidebar .brand {
    padding-inline-end: 38px;
  }

  .mobile-nav-toggle,
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 1.45rem;
    line-height: 1;
  }

  .sidebar-close {
    position: absolute;
    top: 18px;
    left: 14px;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 1040;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.52);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .app-sidebar {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .app-topbar {
    align-items: center;
    padding: 14px 18px;
  }

  .app-topbar > div:first-of-type {
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .app-content {
    padding: 18px;
  }

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

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

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

  .split-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .form-switch-row {
    padding-top: 0;
  }

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

  .company-logo-content {
    grid-template-columns: 160px minmax(0, 1fr);
    align-items: center;
  }

  .company-logo-preview {
    width: 160px;
  }

  .company-logo-content > form:last-child {
    grid-column: 2;
  }
}

@media (max-width: 575.98px) {
  .company-logo-content,
  .company-logo-actions {
    grid-template-columns: 1fr;
  }

  .company-logo-preview,
  .company-logo-content > form:last-child,
  .company-logo-actions .form-label {
    grid-column: 1;
  }

  .company-logo-preview {
    width: 100%;
  }

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

  .pos-checkout {
    padding: 12px;
  }

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

  .pos-quick-actions .btn {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .pos-quick-actions .btn:last-child {
    grid-column: 1 / -1;
  }

  .pos-result-row,
  .pos-cart-line {
    flex-direction: column;
  }

  .pos-result-actions,
  .pos-cart-line > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-items: initial;
    min-width: 0;
  }

  .pos-line-quantity {
    max-width: none;
  }

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

  .pos-payment-method-field,
  .pos-payment-amount-field,
  .pos-payment-reference-field,
  .pos-payment-code-field,
  .pos-payment-units-field,
  .pos-payment-action {
    grid-column: 1;
  }

  .pos-payment-action {
    justify-content: end;
  }

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

  .summary-grid,
  .details-grid,
  .profile-data-grid {
    grid-template-columns: 1fr;
  }

  .pagination-bar,
  .pager-bar {
    justify-content: space-between;
  }

  .pagination-bar > span,
  .pager-bar > span {
    order: -1;
    flex-basis: 100%;
    text-align: center;
  }
}

.settings-toggle-grid {
  display: grid;
  gap: 10px 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

@media (max-width: 560px) {
  .app-topbar {
    align-items: flex-start;
  }

  .topbar-actions .user-chip {
    max-width: 135px;
  }

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

  .auth-page {
    padding: 16px;
  }

  .auth-card {
    padding: 20px 18px;
  }

  .auth-brand h1,
  .auth-brand p {
    overflow-wrap: anywhere;
  }
}
