:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273549;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --prio: #ef4444;
  --late: #b91c1c;
  --normal: #3b82f6;
  --sent: #22c55e;
  --border: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 18px;
  margin: 0;
}

header .sub {
  color: var(--muted);
  font-size: 13px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  margin-left: 16px;
}
nav a:hover { color: var(--text); }

main {
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

select, button, input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

button {
  cursor: pointer;
}
button:hover { background: #324156; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.card .num { font-size: 28px; font-weight: 700; }
.card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge-PRIO { background: rgba(239,68,68,.15); color: var(--prio); border: 1px solid var(--prio); }
.badge-LATE { background: rgba(185,28,28,.25); color: #fecaca; border: 1px solid var(--late); }
.badge-NORMAL { background: rgba(59,130,246,.15); color: var(--normal); border: 1px solid var(--normal); }
.badge-SENT { background: rgba(34,197,94,.15); color: var(--sent); border: 1px solid var(--sent); }

.countdown { font-variant-numeric: tabular-nums; color: var(--muted); }
.countdown.warn { color: #fbbf24; }
.countdown.overdue { color: var(--late); font-weight: 700; }

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.setup-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.setup-box .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.setup-box input { flex: 1; min-width: 160px; }

.screen-list { display: flex; flex-direction: column; gap: 8px; }
.screen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.dot-online { background: var(--sent); }
.dot-offline { background: var(--late); }
