:root {
  --navy: #10223c;
  --ink: #172033;
  --muted: #607085;
  --teal: #18a999;
  --teal-dark: #0c756f;
  --orange: #ff8a2a;
  --yellow: #ffc857;
  --paper: #fff8eb;
  --surface: #f6fafb;
  --line: #dce5e8;
  --white: #ffffff;
  --danger: #d64242;
  --shadow: 0 18px 48px rgba(17, 35, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(24, 169, 153, 0.42);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(16px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--navy);
  font-weight: 900;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.brand span {
  white-space: nowrap;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.top-nav a {
  padding: 8px 4px;
}

.top-nav a:hover {
  color: var(--teal-dark);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.82rem;
}

.sync-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
}

main {
  padding: 24px clamp(14px, 4vw, 56px) 44px;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
  gap: 22px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.32), rgba(24, 169, 153, 0.16)),
    var(--paper);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  color: var(--navy);
  font-size: clamp(2.35rem, 4vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  color: var(--navy);
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.quick-order,
.panel,
.metric-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.quick-order {
  padding: 22px;
}

.form-head,
.panel-head,
.order-main,
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-head output {
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-weight: 900;
  text-align: center;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

textarea {
  resize: vertical;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 16px;
}

.toggle-row label {
  display: inline-flex;
  grid-template-columns: auto;
  align-items: center;
  color: var(--ink);
}

.toggle-row input {
  width: auto;
  min-height: 0;
}

button,
.primary,
.ghost {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--white);
  color: var(--navy);
  font-weight: 900;
}

.primary {
  border-color: transparent;
  background: var(--orange);
  color: #201305;
}

.primary:hover {
  background: #ff9d49;
}

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

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-strip article {
  padding: 18px;
}

.metric-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
}

.ops-layout,
.grid-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

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

.panel {
  padding: 20px;
  overflow: hidden;
}

.panel.wide {
  min-width: 0;
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head.compact {
  align-items: flex-start;
}

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

.segmented button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segmented button.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 6px 18px rgba(17, 35, 61, 0.08);
}

.order-list,
.courier-list,
.restaurant-list,
.log-list {
  display: grid;
  gap: 12px;
}

.order-card,
.courier-card,
.restaurant-list article,
.log-list article,
.finance-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.order-card {
  padding: 15px;
}

.order-main p,
.courier-card p,
.restaurant-list p,
.log-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.order-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.order-meta strong {
  color: var(--navy);
}

.route-line {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.order-actions,
.courier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e8f7f5;
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.created {
  background: #fff3d9;
  color: #8b5700;
}

.status.offered,
.status.accepted,
.status.busy {
  background: #e9f0ff;
  color: #3152a2;
}

.status.delivered,
.status.online {
  background: #e8f7f5;
  color: var(--teal-dark);
}

.status.cancelled,
.status.blocked {
  background: #ffe8e8;
  color: var(--danger);
}

.status.unavailable {
  background: #eceff3;
  color: var(--muted);
}

.courier-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.courier-card.is-blocked {
  opacity: 0.72;
}

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

.finance-grid article {
  padding: 16px;
}

.finance-grid span,
.finance-grid small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.finance-grid strong {
  display: block;
  margin: 5px 0;
  color: var(--navy);
  font-size: 1.45rem;
}

.price-table {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.restaurant-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.restaurant-list span {
  color: var(--teal-dark);
  font-weight: 900;
}

.log-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.log-list article {
  padding: 13px;
}

.log-list span {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.log-list small {
  display: block;
  color: var(--muted);
}

.log-list a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--teal-dark);
  font-weight: 900;
}

.empty {
  margin: 0;
  color: var(--muted);
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(17, 35, 61, 0.28);
}

dialog::backdrop {
  background: rgba(16, 34, 60, 0.42);
}

#proof-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

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

.dialog-head h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.35rem;
}

.app-footer {
  margin-top: 24px;
  padding: 22px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 980px) {
  .app-header,
  .workspace-hero,
  .ops-layout,
  .grid-section {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sync-pill {
    width: fit-content;
  }

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

@media (max-width: 680px) {
  main {
    padding-inline: 12px;
  }

  .app-header {
    gap: 12px;
  }

  .brand span {
    white-space: normal;
  }

  .field-grid,
  .metric-strip,
  .finance-grid {
    grid-template-columns: 1fr;
  }

  .form-head,
  .panel-head,
  .order-main,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .order-meta {
    justify-items: start;
  }
}
