:root {
  --delivery: #9b3a34;
  --delivery-dark: #772c28;
}

.delivery-page {
  background:
    radial-gradient(circle at 5% 0%, rgba(155, 58, 52, 0.12), transparent 30rem),
    var(--bg);
}

.delivery-page .eyebrow { color: var(--delivery); }
.delivery-page .primary { background: var(--delivery); box-shadow: 0 8px 18px rgba(155, 58, 52, 0.2); }
.delivery-page .primary:hover { background: var(--delivery-dark); }
.delivery-page input:focus,
.delivery-page select:focus { border-color: var(--delivery); box-shadow: 0 0 0 3px rgba(155, 58, 52, 0.13); }
.delivery-page .secondary, .delivery-page .nav-button { color: var(--delivery); background: #f8e9e7; }

.delivery-mark { background: var(--delivery); box-shadow: 0 10px 24px rgba(155, 58, 52, 0.26); }

.device-mode {
  padding: 7px 10px;
  border: 1px solid rgba(155, 58, 52, 0.18);
  border-radius: 999px;
  color: var(--delivery);
  background: #fff7f6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  padding: 9px 15px;
  border-radius: 11px;
  font-weight: 800;
  text-decoration: none;
}

.delivery-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 13px;
  align-items: end;
  margin-top: 20px;
}

.delivery-form label span { color: var(--muted); font-size: 13px; }
.delivery-form select {
  width: 100%;
  min-height: 48px;
  padding: 10px 38px 10px 13px;
  border: 1px solid #c9d8d2;
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: white;
  font: inherit;
}
.delivery-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.delivery-actions button { flex: 0 1 220px; }
.danger-soft { color: #a2262d; background: #fcebed; }
.delivery-page .actions { flex-wrap: wrap; }

.delivery-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat-card.rose { --accent: #b84a60; }
.stat-card.teal { --accent: #258d91; }
.delivery-table { min-width: 1260px; }
.delivery-table td { font-size: 14px; white-space: nowrap; }

@media (min-width: 1101px) {
  .delivery-page .content { width: min(1480px, calc(100% - 40px)); }
  .delivery-page .panel { padding: 24px; }
  .delivery-page .delivery-table-wrap { overflow-x: auto; }
  .delivery-page .delivery-table thead { display: table-header-group; }
  .delivery-page .delivery-table tbody { display: table-row-group; }
  .delivery-page .delivery-table tr { display: table-row; }
  .delivery-page .delivery-table th,
  .delivery-page .delivery-table td { display: table-cell; }
}

@media (max-width: 1100px) {
  .delivery-form { grid-template-columns: repeat(3, 1fr); }
  .delivery-summary { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px), (max-width: 1100px) and (pointer: coarse) {
  .delivery-page .topbar { padding: 10px 12px; }
  .delivery-page .brand-row { min-width: 0; }
  .delivery-page .brand-row h1 { font-size: 16px; white-space: nowrap; }
  .delivery-page .brand-row .eyebrow { display: none; }
  .delivery-page .brand-mark.small { width: 40px; height: 40px; flex: 0 0 40px; }
  .delivery-page .top-actions { gap: 4px; }
  .delivery-page .top-actions .sync-status { display: none; }
  .delivery-page .top-actions button,
  .delivery-page .top-actions .nav-button { min-height: 38px; padding: 7px 9px; font-size: 11px; }
  .delivery-page .device-mode { padding: 6px 8px; font-size: 9px; }

  .delivery-page .content { width: calc(100% - 16px); margin-top: 8px; }
  .delivery-page .panel { padding: 14px; border-radius: 15px; }
  .delivery-page .section-heading { align-items: flex-start; }
  .delivery-page .section-heading h2 { font-size: 18px; }
  .delivery-page .delivery-form { grid-template-columns: 1fr; gap: 11px; }
  .delivery-page .delivery-form input,
  .delivery-page .delivery-form select { min-height: 52px; font-size: 16px; }
  .delivery-page .delivery-actions { grid-column: auto; flex-direction: column; }
  .delivery-page .delivery-actions button { flex-basis: auto; width: 100%; min-height: 50px; }

  .delivery-page .delivery-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .delivery-page .stat-card { min-height: 92px; padding: 13px; border-radius: 13px; }
  .delivery-page .stat-card strong { font-size: 20px; overflow-wrap: anywhere; }

  .delivery-page .toolbar { align-items: stretch; flex-direction: column; }
  .delivery-page .toolbar-controls { align-items: stretch; flex-wrap: wrap; width: 100%; }
  .delivery-page .toolbar-controls .compact-label { flex: 1 1 100%; }
  .delivery-page .toolbar-controls button { flex: 1 1 calc(50% - 6px); }

  .delivery-page .delivery-table-wrap { overflow: visible; border: 0; }
  .delivery-page .delivery-table,
  .delivery-page .delivery-table thead,
  .delivery-page .delivery-table tbody,
  .delivery-page .delivery-table tr,
  .delivery-page .delivery-table th,
  .delivery-page .delivery-table td { display: block; min-width: 0; }
  .delivery-page .delivery-table thead { display: none; }
  .delivery-page .delivery-table tbody { display: grid; gap: 11px; }
  .delivery-page .delivery-table tbody tr {
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white !important;
    box-shadow: 0 6px 18px rgba(48, 31, 30, 0.05);
  }
  .delivery-page .delivery-table td {
    display: grid;
    grid-template-columns: minmax(105px, 42%) 1fr;
    gap: 10px;
    padding: 8px 2px;
    border-bottom: 1px dashed var(--line);
    text-align: right;
    white-space: normal;
  }
  .delivery-page .delivery-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
  }
  .delivery-page .delivery-table td:last-child { border-bottom: 0; }
  .delivery-page .delivery-table .table-button { width: 100%; }
}

@media (max-width:768px), (max-width:1100px) and (pointer:coarse) {
 .delivery-page .topbar {flex-wrap:wrap;}
 .delivery-page .top-actions {width:100%;display:flex;flex-wrap:wrap;}
 .delivery-page .top-actions .nav-button {flex:1;justify-content:center;}
}
