:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #171a21;
  --accent: #4caf7d;
  --danger: #e2574c;
  --text: #f1f3f5;
  --muted: #8a919e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, sans-serif;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
}

.status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px 16px;
  text-align: center;
  font-size: 14px;
  background: var(--muted);
  color: #000;
  transition: background 0.2s ease;
}

.status.connected {
  background: var(--accent);
  color: #fff;
}

.status.error {
  background: var(--danger);
  color: #fff;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 32px;
  margin-bottom: 16px;
}

.client {
  font-size: 28px;
  font-weight: 600;
}

.cash-id {
  font-size: 14px;
  color: var(--muted);
}

.cart {
  flex: 1;
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
}

th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 8px;
  border-bottom: 1px solid #2a2f3a;
}

td {
  padding: 10px 8px;
  border-bottom: 1px solid #22262f;
}

td:nth-child(2), td:nth-child(3), td:nth-child(4),
th:nth-child(2), th:nth-child(3), th:nth-child(4) {
  text-align: right;
}

.empty-state {
  display: none;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 20px;
}

.discounts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discount-row {
  display: flex;
  justify-content: space-between;
  color: var(--accent);
  font-size: 16px;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--panel);
  border-radius: 12px;
  font-size: 32px;
  font-weight: 700;
}
