:root {
  color-scheme: light;
  --ink: #182326;
  --ink-muted: #5d6b6f;
  --canvas: #f2f3ed;
  --surface: #ffffff;
  --line: #d5dcda;
  --teal: #137064;
  --teal-dark: #0f514b;
  --amber: #e7a92e;
  --amber-soft: #fff0c9;
  --red: #bd3b32;
  --red-soft: #ffe4df;
  --green-soft: #dff4e9;
  --shadow: 0 12px 28px rgba(24, 35, 38, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
}

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

button {
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(19, 112, 100, 0.32);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 740;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  line-height: 1.35;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #becac7;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

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

.primary,
.scan-strip button,
.auth-form button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 760;
}

.primary:hover,
.scan-strip button:hover,
.auth-form button:hover {
  background: var(--teal-dark);
}

.primary.large,
.auth-form .large {
  min-height: 48px;
  font-size: 15px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid #aebfba;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.button-count {
  position: absolute;
  top: -8px;
  right: -7px;
  min-width: 17px;
  padding: 2px 4px;
  border-radius: 10px;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-weight: 750;
}

.button-count:empty {
  display: none;
}

.text-button {
  padding: 3px 0;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.muted,
small {
  color: var(--ink-muted);
  font-size: 12px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.application-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid #31474a;
  color: #fff;
  background: var(--ink);
}

.topbar-title,
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.topbar-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-icon {
  width: 35px;
  height: 35px;
}

.connection {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.connection.online {
  color: #173f36;
  background: #bcebd2;
}

.connection.offline {
  color: #593600;
  background: #ffdc82;
}

.profile-button {
  max-width: 180px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid #6e8587;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  min-height: calc(100vh - 62px);
  grid-template-columns: 205px minmax(0, 1fr);
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: #e7ece9;
}

.nav-button {
  min-height: 39px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  color: #4a5a5d;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.nav-button:hover {
  color: var(--teal-dark);
  background: #d7e2dd;
}

.nav-button.active {
  color: #fff;
  background: var(--teal);
}

.content {
  width: min(1440px, 100%);
  padding: clamp(18px, 3vw, 38px);
}

.page-heading {
  display: flex;
  min-height: 50px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  min-height: 104px;
  padding: 17px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 3px 8px rgba(24, 35, 38, 0.04);
}

.metric.amber {
  border-left-color: var(--amber);
}

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

.metric span {
  display: block;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
}

.split-section,
.checkout-layout,
.return-layout,
.inventory-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 20px;
  align-items: start;
}

.work-panel,
.checkout-panel,
.status-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 3px 8px rgba(24, 35, 38, 0.04);
}

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

.status-panel {
  border-left: 5px solid var(--amber);
}

.status-panel h2 {
  margin-bottom: 15px;
}

.status-panel dl {
  display: grid;
  gap: 11px;
  margin: 0;
}

.status-panel dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.status-panel dt {
  color: var(--ink-muted);
  font-size: 13px;
}

.status-panel dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.status-warning {
  margin-top: 13px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

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

.checkout-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(120px, 0.7fr) minmax(150px, 1.5fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.checkout-row:hover {
  border-color: #7faea6;
  background: #f4fbf8;
}

.checkout-person {
  font-size: 14px;
  font-weight: 800;
}

.checkout-items {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-pill {
  max-width: 110px;
  padding: 5px 7px;
  border-radius: 5px;
  color: #4a3913;
  background: var(--amber-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.due-pill.overdue {
  color: #6d1e18;
  background: var(--red-soft);
}

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

.scan-strip input {
  min-width: 0;
}

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

.item-card {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.item-card h3 {
  margin-top: 7px;
}

.item-card p {
  min-height: 35px;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.35;
}

.item-kind {
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.item-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.item-card-bottom strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.cart-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.cart-row span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 12px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quantity-control button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid #aec0bb;
  border-radius: 5px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 17px;
}

.quantity-control b {
  min-width: 20px;
  text-align: center;
}

.quantity-control .remove-button {
  margin-left: 4px;
  border-color: #e6aaa5;
  color: var(--red);
}

.empty-cart,
.empty-state {
  padding: 22px 14px;
  border: 1px dashed #b8c5c1;
  border-radius: 6px;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

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

.checkout-panel form,
.settings-form {
  display: grid;
  gap: 12px;
}

.customer-device {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customer-device summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.customer-device .inline-grid {
  margin-bottom: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -4px;
}

.preset-row button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #afc2bd;
  border-radius: 5px;
  color: var(--teal-dark);
  background: #f7fcfa;
  font-size: 12px;
  font-weight: 750;
}

.return-items {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.return-items > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.return-items span {
  color: var(--teal-dark);
  font-weight: 800;
}

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

.inventory-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.inventory-table th {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inventory-table td strong,
.inventory-table td small {
  display: block;
}

.inventory-table td small {
  margin-top: 3px;
}

.stock {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 5px;
  font-weight: 800;
}

.stock.available {
  color: #135139;
  background: var(--green-soft);
}

.stock.out {
  color: #6d1e18;
  background: var(--red-soft);
}

.activity-panel {
  max-width: 900px;
}

.activity-list {
  display: grid;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.activity-row strong,
.activity-row span {
  display: block;
}

.activity-row span,
.activity-row time {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
}

.settings-layout {
  grid-template-columns: minmax(0, 520px) minmax(270px, 360px);
}

.staff-settings {
  margin-top: 20px;
}

.staff-list {
  display: grid;
}

.staff-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.staff-row strong,
.staff-row span {
  display: block;
}

.staff-row span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 12px;
}

.staff-row b {
  color: var(--teal-dark);
  font-size: 12px;
  text-transform: capitalize;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.auth-panel {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--teal);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-icon {
  width: 60px;
  height: 60px;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-kicker {
  color: var(--ink-muted);
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(19, 31, 34, 0.72);
}

.scanner-modal {
  width: min(100%, 640px);
  padding: 16px;
  border: 1px solid #395153;
  border-radius: 7px;
  color: #fff;
  background: #172326;
  box-shadow: var(--shadow);
}

.scanner-modal video {
  display: block;
  width: 100%;
  max-height: min(65vh, 480px);
  margin: 10px 0;
  border: 1px solid #617b78;
  border-radius: 6px;
  background: #081114;
  object-fit: cover;
}

.scanner-modal .section-heading {
  margin-bottom: 8px;
}

.scanner-message {
  margin: 8px 0 12px;
  color: #d6e7e1;
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 15px;
  border-left: 5px solid var(--teal);
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

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

.toast.danger {
  border-left-color: #ff756c;
}

@media (max-width: 1000px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .checkout-layout,
  .return-layout,
  .inventory-layout,
  .split-section,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 25px;
  }

  .topbar {
    min-height: 58px;
    padding: 9px 13px;
  }

  .topbar-title strong {
    max-width: 130px;
  }

  .connection {
    display: none;
  }

  .profile-button {
    display: none;
  }

  .workspace {
    display: block;
  }

  .navigation {
    position: sticky;
    z-index: 8;
    top: 58px;
    flex-direction: row;
    overflow-x: auto;
    padding: 7px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }

  .nav-button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .content {
    padding: 17px 13px 28px;
  }

  .page-heading {
    align-items: flex-end;
    margin-bottom: 18px;
  }

  .page-actions .primary {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .metric {
    min-height: 84px;
    padding: 13px;
  }

  .metric strong {
    font-size: 26px;
  }

  .checkout-row {
    grid-template-columns: 1fr auto;
  }

  .checkout-items {
    display: none;
  }

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

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

  .item-card {
    min-height: 145px;
  }

  .item-card h3 {
    font-size: 14px;
  }

  .item-card p {
    font-size: 11px;
  }

  .auth-panel {
    padding: 23px 18px;
  }
}

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

  .metric-grid {
    gap: 8px;
  }

  .metric {
    border-left-width: 4px;
  }
}
