:root {
  --bg: #121212;
  --panel: #1b1b1b;
  --panel-light: #242424;
  --text: #e8e8e8;
  --muted: #a7a7a7;
  --accent: #8f8f8f;
  --warning: #d1a545;
  --danger: #d46a6a;
  --border: #333333;
  --link: #d6d6d6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #141414;
  border-bottom: 1px solid var(--border);
}

.brand a {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
}

nav a:hover {
  color: var(--text);
  background: #242424;
  text-decoration: none;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
}

.footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 28px 40px;
  color: var(--muted);
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .24);
}

.card {
  padding: 24px;
}

.card-label {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.card-value {
  font-size: 44px;
  font-weight: 700;
  margin-top: 10px;
}

.panel {
  padding: 20px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.grid-two {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: rgba(255,255,255,.035);
}

tr:hover td {
  background: rgba(255,255,255,.045);
}

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

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #3a3a3a;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status.online, .status.checked_in {
  background: rgba(37, 139, 79, .22);
  color: #9bd6b2;
}

.status.enrolled {
  background: rgba(145, 114, 52, .24);
  color: #d6bd7a;
}

.path {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  word-break: break-all;
}

.details {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 14px;
}

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

.details dd {
  margin: 0;
  word-break: break-word;
}

ul {
  margin-top: 0;
}

@media (max-width: 850px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
  }

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

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

.notice {
  padding: 14px 16px;
  border: 1px solid #3a3a3a;
  background: #202020;
  color: #dcdcdc;
  border-radius: 12px;
  margin-bottom: 24px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.actions h2 {
  width: 100%;
  margin-bottom: 0;
}

.actions form {
  margin: 0;
}

button {
  border: 1px solid #555;
  background: #2a2a2a;
  color: #f0f0f0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: #3a3a3a;
}

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

.status.offline, .status.failed, .status.cancelled {
  background: rgba(150, 54, 54, .24);
  color: #e7a3a3;
}

.status.never_checked_in, .status.queued, .status.sent, .status.update_started {
  background: rgba(145, 114, 52, .24);
  color: #d6bd7a;
}

.status.completed, .status.completed_with_detections {
  background: rgba(37, 139, 79, .22);
  color: #9bd6b2;
}

.good { color: #9bd6b2; }
.warn { color: #d6bd7a; }
.bad { color: #e7a3a3; }

.notice.success {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
}

.notice.danger, .notice.error {
  border-color: rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
}

.notice.warning {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .12);
  color: #fde68a;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.button, .button-link {
  display: inline-block;
  border: 1px solid #555;
  background: #2a2a2a;
  color: #f0f0f0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
}


.button:hover, .button-link:hover {
  background: #3a3a3a;
  text-decoration: none;
}

.button-row.compact {
  width: auto;
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.link-button:hover { color: var(--link); }

.narrow { max-width: 520px; }

label {
  display: block;
  color: var(--muted);
  margin: 12px 0 6px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  background: #141414;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

textarea { resize: vertical; }

.code-editor {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.custom-command {
  width: 100%;
  margin-top: 12px !important;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

pre, .json-block {
  max-width: 760px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  background: rgba(0,0,0,.18);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
}

.json-block {
  max-width: none;
  overflow-x: auto;
}

h4 {
  margin-bottom: 8px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  nav { flex-wrap: wrap; gap: 12px; }
}
