:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --success: #067647;
  --success-bg: #ecfdf3;
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

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

.app-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 16px;
}

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

.eyebrow,
.order-number {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.9rem;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.12rem;
}

.primary-link,
.quiet-link,
.danger-link,
button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0 16px;
}

.quiet-link,
.danger-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: #e8eef3;
  color: var(--text);
  padding: 0 14px;
  text-decoration: none;
}

.danger-link {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
}

button {
  padding: 0 16px;
}

.primary-link:hover,
.quiet-link:hover,
button:hover {
  background: var(--brand-dark);
  color: #ffffff;
}

.panel,
.order-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.form-grid,
.search-form {
  display: grid;
  gap: 12px;
}

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

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

select:disabled {
  background: #eef1f5;
  color: #8a94a6;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.toolbar {
  padding: 16px 0;
}

.admin-toolbar {
  display: grid;
  gap: 10px;
}

.login-panel {
  max-width: 460px;
  margin: 0 auto;
}

.compact-form {
  grid-template-columns: 1fr;
}

.orders-list {
  display: grid;
  gap: 12px;
  padding-bottom: 32px;
}

.order-card,
.empty-state {
  padding: 16px;
}

.order-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-card-header h2 {
  margin-bottom: 0;
}

.status {
  flex: 0 0 auto;
  max-width: 48%;
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef4ff;
  color: #3538cd;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.status-delivered {
  background: var(--success-bg);
  color: var(--success);
}

.status-cancelled,
.status-returned {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-out_for_delivery {
  background: #fff6ed;
  color: #b54708;
}

.order-meta {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.order-meta p {
  display: grid;
  gap: 3px;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.4;
}

.order-meta strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.order-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.order-actions form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.order-actions form:last-child {
  grid-template-columns: 1fr;
}

.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.danger:hover {
  background: #fee4e2;
}

.alert {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

.alert-detail {
  display: block;
  margin-top: 4px;
  font-weight: 800;
}

.success {
  background: var(--success-bg);
  color: var(--success);
}

.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.empty-state {
  text-align: center;
}

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

@media (min-width: 680px) {
  .app-shell {
    padding: 24px;
  }

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

  .full,
  .form-grid button {
    grid-column: 1 / -1;
  }

  .search-form {
    grid-template-columns: 1fr 180px auto;
  }

  .admin-toolbar {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}
