:root {
  color-scheme: light;
  --ink: #142039;
  --muted: #657086;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --line: #dce2ec;
  --blue: #0c3471;
  --blue-2: #1257a8;
  --red: #c82632;
  --green: #20784f;
  --shadow: 0 18px 45px rgba(13, 36, 76, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--blue);
  color: white;
  border-bottom: 5px solid var(--red);
}

.brand-mark {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 800;
}

.topbar h1 {
  margin: 2px 0 4px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.hours,
.eyebrow {
  margin: 0;
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar .eyebrow,
.topbar .hours {
  color: rgba(255, 255, 255, 0.86);
}

.icon-button,
.ghost-button,
.primary-button,
.service-card,
.qty-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  margin-left: auto;
  padding: 10px 15px;
  background: white;
  color: var(--blue);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.8fr);
  gap: 18px;
  padding: 18px;
}

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

.service-panel {
  min-height: 520px;
}

.work-panel,
.ready-panel,
.summary-panel {
  grid-column: span 1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  align-items: center;
}

h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.search-box {
  width: min(320px, 100%);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.topup-box,
.lookup-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.topup-box h3,
.lookup-box h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.topup-form {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 10px;
  align-items: end;
}

.inline-action {
  width: auto;
  min-height: 39px;
  margin-top: 0;
  padding: 10px 14px;
}

.service-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 14px;
  text-align: left;
  background: #f9fbff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.service-card:hover {
  border-color: var(--blue-2);
  transform: translateY(-1px);
}

.service-card strong {
  font-size: 16px;
}

.service-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-line input {
  max-width: 92px;
  padding: 8px;
}

.form-grid,
.task-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.cart-list,
.task-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-item,
.task-item,
.sale-line {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
}

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

.item-name,
.task-name {
  font-weight: 800;
}

.tracking-number {
  display: inline-block;
  width: fit-content;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #eaf4ee;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.ready-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eaf4ee;
  color: var(--green);
}

.ready-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ready-item {
  border-color: rgba(32, 120, 79, 0.35);
  background: #fbfffd;
}

.item-sub,
.task-sub {
  color: var(--muted);
  font-size: 12px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-button,
.ghost-button {
  min-height: 34px;
  padding: 7px 11px;
  background: #edf2f9;
  color: var(--blue);
  font-weight: 800;
}

.remove-button {
  background: #ffecef;
  color: var(--red);
}

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

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.grand {
  color: var(--ink);
  font-size: 22px;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-row div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.metric-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-row strong {
  font-size: 22px;
}

.receipt-preview {
  margin-top: 14px;
}

.flyer-reference {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.flyer-reference img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f8;
}

.flyer-reference figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.receipt {
  max-width: 340px;
  padding: 16px;
  background: white;
  color: #111;
  border: 1px solid var(--line);
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.receipt h3,
.receipt p {
  margin: 0 0 5px;
  text-align: center;
}

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

.receipt-detail {
  margin: -2px 0 5px;
  color: #444;
  font-size: 12px;
}

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

.lookup-result {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.45;
  background: white;
}

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

  .checkout-panel {
    order: -1;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: start;
    padding: 14px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .icon-button {
    align-self: center;
    padding: 9px 10px;
  }

  .app-shell {
    padding: 10px;
  }

  .section-head,
  .form-grid,
  .task-form,
  .metric-row,
  .topup-form,
  .lookup-form,
  .ready-toolbar {
    grid-template-columns: 1fr;
  }

  .ready-toolbar {
    display: grid;
  }

  .section-head {
    display: grid;
    align-items: stretch;
  }
}

@media print {
  body > :not(.print-zone) {
    display: none !important;
  }

  .print-zone {
    display: block;
  }
}
