:root {
  --bg: #10141c;
  --bg-2: #171d28;
  --card: #1d2533;
  --line: #2c3648;
  --text: #f4f1ea;
  --muted: #9aa6b8;
  --accent: #d4a017;
  --accent-2: #f0c14b;
  --ok: #3dcc8a;
  --bad: #ef6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(1200px 600px at 10% -10%, #243049 0%, var(--bg) 55%); color: var(--text); }
button, input, select { font: inherit; }
a { color: var(--accent-2); }

.screen { max-width: 1440px; margin: 0 auto; padding: 20px 20px 32px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; }
.hidden { display: none !important; }
.offscreen { position: absolute; left: -9999px; top: 0; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow { margin: 0; letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--accent-2); }
h1 { margin: 0; font-size: 28px; font-weight: 650; }
h2 { margin: 0; font-size: 20px; }
.hint { color: var(--muted); font-size: 14px; }

.login-card {
  width: min(420px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card label, .modal-card label { display: block; color: var(--muted); }
.login-card input, select, #scanInput {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  background: #121722;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tile {
  min-height: 160px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #232c3d, var(--card));
  border-radius: 22px;
  padding: 22px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.tile:hover { border-color: var(--accent); }
.tile h2 { margin-bottom: 8px; }
.tile p { margin: 0; color: var(--muted); }
.badge { display: inline-block; margin-top: 16px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: #2a3344; color: var(--muted); }
.badge.ok { background: rgba(61, 204, 138, 0.15); color: var(--ok); }
.badge.warn { background: rgba(240, 193, 75, 0.14); color: var(--accent-2); }

.status { padding: 8px 12px; border-radius: 999px; background: #1b2230; border: 1px solid var(--line); font-size: 13px; }
.status.ok { border-color: rgba(61, 204, 138, 0.4); color: var(--ok); }
.status.bad { border-color: rgba(239, 107, 107, 0.45); color: var(--bad); }

.ghost, .primary {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
}
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.primary { background: var(--accent); color: #16120a; font-weight: 700; }
.primary.wide { width: 100%; min-height: 52px; }
.primary:disabled, .ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.scan-box { margin-bottom: 12px; }
#scanInput { font-size: 22px; }

.banner { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; }
.banner.ok { background: rgba(61, 204, 138, 0.12); color: var(--ok); }
.banner.bad { background: rgba(239, 107, 107, 0.12); color: var(--bad); }

.board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 62vh; }
.pane {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
#pickedCount { font-size: 28px; color: var(--accent-2); }
.side-meta { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.supply-box { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.supply-box.empty-supply #pickedList { display: none; }
.supply-box:not(.empty-supply) #createSupplyBtn { display: none; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; max-height: 56vh; }
.order-card {
  background: #141a26;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.order-card:hover { border-color: var(--accent); }
.order-card small { color: var(--muted); }
.order-card.picked { border-color: rgba(61, 204, 138, 0.45); }
.flyer {
  position: fixed;
  z-index: 40;
  margin: 0;
  pointer-events: none;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(8, 10, 16, 0.72);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal-card.wide { width: min(720px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.history-list { list-style: none; margin: 12px 0; padding: 0; max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.history-list li { background: #141a26; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }

@media (max-width: 900px) {
  .grid, .board { grid-template-columns: 1fr; }
}
