:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --paper: #ffffff;
  --surface: #f4f7fb;
  --brand: #16745f;
  --brand-dark: #0f5848;
  --accent: #b83228;
  --warn: #b7791f;
  --ok: #16745f;
  --shadow: 0 10px 28px rgba(20, 35, 60, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(22, 116, 95, 0.08), rgba(244, 247, 251, 0) 260px),
    var(--surface);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.clock {
  min-width: 104px;
  padding: 9px 10px;
  border: 1px solid rgba(22, 116, 95, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.clock span,
.clock strong {
  display: block;
}

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

.clock strong {
  font-size: 23px;
  line-height: 1.1;
}

.status-strip {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(183, 121, 31, 0.34);
  border-radius: 8px;
  background: #fff8e9;
}

.status-strip strong,
.status-strip span {
  display: block;
}

.status-strip strong {
  font-size: 15px;
}

.status-strip span {
  margin-top: 3px;
  color: #6f4b13;
  font-size: 13px;
  line-height: 1.45;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--warn);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.summary-grid article {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.summary-grid span,
.summary-grid strong {
  display: block;
}

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

.summary-grid strong {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 10px;
  padding: 12px 0;
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(12px);
}

.search-box {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.search-box span {
  color: var(--muted);
  font-size: 23px;
  text-align: center;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eef5;
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(20, 35, 60, 0.12);
  font-weight: 700;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.order-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.order-code {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.customer-name {
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.2;
}

.badge {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9f6f1;
  color: var(--ok);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.badge.pending {
  background: #fff1e3;
  color: #a24d12;
}

.order-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

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

.items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.items span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef3f7;
  color: #344054;
  font-size: 12px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
  margin-top: 14px;
}

.primary-action,
.secondary-action,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
}

.primary-action {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.primary-action:disabled {
  background: #b8c3c0;
  color: #f7fbfa;
  cursor: default;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
}

.delivery-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

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

.section-heading h2 {
  font-size: 17px;
}

.icon-button {
  width: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-size: 20px;
}

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

.log-list li {
  padding: 10px;
  border-radius: 8px;
  background: #f6f8fb;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  padding: 20px;
  border: 1px dashed #bdc7d4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 26px;
  }

  .toolbar {
    grid-template-columns: 1fr 360px;
    align-items: center;
  }

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

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

  .summary-grid article {
    padding: 10px 8px;
  }

  .summary-grid span {
    font-size: 12px;
  }

  .summary-grid strong {
    font-size: 24px;
  }

  .order-meta {
    grid-template-columns: 1fr;
  }

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