:root {
  --bg: #1B1B1F;
  --bg-card: #26262B;
  --bg-elevated: #2C2C32;
  --bg-input: #1A1A20;
  --border: #37373D;
  --text: #F2F2F2;
  --text-secondary: #A0A0A8;
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --installed: #16A34A;
  --installed-bg: #0E2A1B;
  --busy: #F59E0B;
  --busy-bg: #3A2A0E;
  --danger: #EF4444;
  --danger-bg: #2A1414;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
  margin: 0;
}
nav {
  background: #202024; border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; gap: 8px; align-items: center;
}
nav .brand { color: #fff; font-weight: 700; margin-right: 16px; }
nav a {
  color: var(--text-secondary); text-decoration: none;
  padding: 6px 14px; border-radius: 4px; font-size: 13px;
}
nav a:hover { background: var(--bg-elevated); color: var(--text); }
nav a.active { background: var(--bg-elevated); color: var(--text); }
nav .spacer { flex: 1; }
nav a.logout { color: var(--text-secondary); }

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

h1 { margin: 0 0 24px 0; font-size: 26px; font-weight: 600; }
h2 {
  margin: 0 0 12px 0; font-size: 12px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 20px; margin-bottom: 16px;
}

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .col { flex: 1; min-width: 200px; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; color: var(--text-secondary); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 8px; border-bottom: 1px solid var(--border);
  font-weight: 600;
}
td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elevated); }

.btn {
  display: inline-block; padding: 8px 16px;
  border-radius: 4px; border: none; cursor: pointer;
  font-size: 13px; font-family: inherit; text-decoration: none;
  font-weight: 500;
}
.btn-primary  { background: var(--accent);    color: white; }
.btn-primary:hover  { background: var(--accent-hover); }
.btn-success  { background: var(--installed); color: white; }
.btn-danger   { background: var(--danger);    color: white; }
.btn-secondary { background: var(--bg-elevated); color: var(--text); }
.btn-secondary:hover { background: #3A3A40; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=date], input[type=datetime-local],
input[type=number], select, textarea {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); padding: 8px 10px;
  border-radius: 4px; font-family: inherit; font-size: 13px;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
}
label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.field { margin-bottom: 16px; }
.field input[type=checkbox] { width: auto; margin-right: 8px; }

.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.flash.error   { background: var(--danger-bg);    color: #FCA5A5; border: 1px solid var(--danger); }
.flash.success { background: var(--installed-bg); color: #6EE7B7; border: 1px solid var(--installed); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; color: white; line-height: 1.5;
}
.badge-success { background: var(--installed); }
.badge-danger  { background: var(--danger); }
.badge-warning { background: var(--busy); }
.badge-secondary { background: var(--bg-elevated); color: var(--text-secondary); }

.muted { color: var(--text-secondary); }

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

code {
  background: var(--bg-input); padding: 2px 6px; border-radius: 3px;
  font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px;
  color: #C5E1A5;
}
pre {
  background: var(--bg-input); padding: 12px; border-radius: 4px;
  font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px;
  overflow: auto; white-space: pre-wrap; word-break: break-all;
}

.kpi { font-size: 36px; font-weight: 700; line-height: 1; }
.kpi-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; font-weight: 600; }

ol, ul { margin: 0; padding-left: 20px; }
li { margin-bottom: 4px; }

details summary { cursor: pointer; padding: 4px 0; }
details[open] { background: var(--bg-elevated); padding: 8px; border-radius: 4px; margin: 4px 0; }

a { color: var(--accent); }
a:hover { text-decoration: underline; }
