:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --text: #102235;
  --muted: #607487;
  --line: #d6dfeb;
  --line-soft: #e7edf5;
  --table-head: #f3f7fc;
  --table-row: #ffffff;
  --primary: #0f67b4;
  --primary-dark: #0b5595;
  --success: #0f8a59;
  --danger: #b13a30;
  --topbar-bg: #0f1d2d;
  --topbar-border: #1f3247;
  --topbar-text: #e7eef9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 520px at 0% -5%, #dce8f8 0%, transparent 70%),
    radial-gradient(1000px 520px at 100% 0%, #e9f1fb 0%, transparent 68%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--text);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  color: var(--topbar-text);
  box-shadow: 0 8px 24px rgba(10, 20, 34, 0.16);
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-store {
  color: #b8c8de;
  font-size: 14px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 0;
  font-size: 2em;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--topbar-text);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.topbar-brand:hover {
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 18px;
  margin-top: 20px;
  box-shadow: 0 8px 20px rgba(24, 46, 75, 0.05);
}

.login-card {
  width: min(460px, 100%);
  margin-inline: auto;
  margin-top: 72px;
}

h1 {
  margin: 0 0 16px;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input,
button {
  font: inherit;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

button {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: #dce8f6;
  color: #153454;
}

.button-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
}

.button-link.secondary {
  background: #dce8f6;
  color: #153454;
}

.topbar-logout {
  background: transparent;
  border: 1px solid #3a516b;
  color: var(--topbar-text);
  padding: 7px 12px;
}

.topbar-logout:hover {
  background: #1a2e45;
}

.table-shell {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: #f9fbfe;
}

table.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table.modern-table th,
table.modern-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  vertical-align: middle;
  background: var(--table-row);
}

table.modern-table thead th {
  background: var(--table-head);
  color: #7a8b9c;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

table.modern-table tbody tr:last-child td {
  border-bottom: 0;
}

table.modern-table tbody tr:hover td {
  background: #f9fcff;
}

.actions-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  display: grid;
  gap: 10px;
}

.section-head h2 {
  margin: 0;
}

.section-actions {
  margin-top: 12px;
}

.cell-check {
  width: 64px;
}

.cell-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending {
  background: #eef2f7;
  color: #324354;
}

.status-ready {
  background: #dbf4e7;
  color: var(--success);
}

.status-picked-up {
  background: #e5eef7;
  color: #2f4e6b;
}

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

.flash {
  background: #ecf5ff;
  border: 1px solid #c6ddf8;
  border-radius: 10px;
  padding: 10px 12px;
}

.muted {
  color: var(--muted);
}

.order-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.order-link:hover {
  text-decoration: underline;
}

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

.payload-view {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
}

.item-variant {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 21, 37, 0.48);
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.confirm-modal {
  width: min(560px, 92vw);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 42px rgba(7, 18, 33, 0.28);
}

.confirm-modal h3 {
  margin: 0 0 12px;
}

.confirm-table-shell {
  margin-top: 6px;
}

.confirm-table th,
.confirm-table td {
  font-size: 13px;
  padding: 10px 12px;
}

.confirm-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 900px) {
  .topbar-right {
    gap: 8px;
  }

  .topbar-store {
    font-size: 12px;
  }

  table.modern-table,
  table.modern-table thead,
  table.modern-table tbody,
  table.modern-table th,
  table.modern-table td,
  table.modern-table tr {
    display: block;
  }

  table.modern-table thead {
    display: none;
  }

  table.modern-table tr {
    border-bottom: 1px solid var(--line-soft);
    padding: 8px 0;
  }

  table.modern-table td {
    border: 0;
    padding: 6px 10px;
  }

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

  .order-action-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .confirm-actions {
    justify-content: stretch;
  }
}
