:root {
  color-scheme: dark;
  --bg: #101317;
  --panel: #171c22;
  --panel-2: #1e242c;
  --line: #303946;
  --text: #f3f6f8;
  --muted: #9faab7;
  --accent: #2fb8a6;
  --blue: #4b8dff;
  --amber: #f0b84a;
  --red: #ef6262;
  --green: #58c783;
  --violet: #a989ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar,
.section-head,
.context-bar,
.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 8px 0 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

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

.status-strip,
.context-bar,
.tabs {
  flex-wrap: wrap;
}

.status,
.context-bar span,
.tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--text);
}

.status.online {
  border-color: rgba(88, 199, 131, .45);
}

.status.warn {
  border-color: rgba(240, 184, 74, .55);
}

.context-bar {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.tabs {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.tab {
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #07110f;
  font-weight: 800;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  margin-bottom: 16px;
}

.primary,
.panel button,
.station button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #07110f;
  font-weight: 800;
  cursor: pointer;
}

input {
  width: min(440px, 100%);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--panel);
  color: var(--text);
}

.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.table-card,
.panel,
.station,
.metric,
.integration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-card {
  min-height: 142px;
  padding: 14px;
  border-left: 5px solid var(--line);
}

.table-card.waiting_for_kitchen {
  border-left-color: var(--amber);
}

.table-card.delayed {
  border-left-color: var(--red);
}

.table-card.payment_ready {
  border-left-color: var(--violet);
}

.table-card.empty {
  border-left-color: var(--line);
}

.table-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.table-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.panel {
  padding: 14px;
}

.stack {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-2);
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(47, 184, 166, .16);
  color: #8ce4d7;
  font-size: 12px;
}

.badge.urgent,
.badge.high,
.badge.blocked {
  background: rgba(239, 98, 98, .16);
  color: #ffaaaa;
}

.badge.action,
.badge.medium,
.badge.degraded {
  background: rgba(240, 184, 74, .16);
  color: #ffd98a;
}

.product-grid,
.station-grid,
.metric-grid,
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.product {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-2);
}

.product span,
.metric span,
.station span {
  color: var(--muted);
}

.station,
.metric,
.integration-card {
  padding: 14px;
}

.station {
  display: grid;
  gap: 10px;
}

.station.urgent {
  border-color: rgba(239, 98, 98, .7);
}

.station.warn {
  border-color: rgba(240, 184, 74, .7);
}

.station.ok {
  border-color: rgba(88, 199, 131, .55);
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

pre {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  color: #d6dee8;
}

@media (max-width: 820px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }
}
