/* admin.css — the admin panel (P36). Theme variables come from shell.css;
   this file only lays out the panel. Tables over cards: this is an ops
   surface, density beats decoration. */

#adminView {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.adm-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.adm-head h1 { font-size: 18px; margin: 0; }
.adm-sub { flex: 1; color: var(--text-dim); font-size: 12px; }

.adm-head button,
.adm-tabs button,
.adm-actions button {
  font: inherit; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px;
}
.adm-head button:hover,
.adm-tabs button:hover,
.adm-actions button:hover { background: var(--bg); }

.adm-tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.adm-tabs button { border-radius: 8px 8px 0 0; border-bottom: none; }
.adm-tabs button.active {
  background: var(--surface);
  font-weight: 600;
  outline: 1px solid var(--border);
  outline-bottom: none;
}

.adm-body {
  padding: 16px 20px 48px;
  display: flex; flex-direction: column; gap: 16px;
}

.adm-sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.adm-sec h3 { margin: 0 0 12px; font-size: 14px; }
.adm-sec h4 { margin: 16px 0 8px; font-size: 12px; color: var(--text-dim); }

.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.adm-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.adm-stat-v { font-size: 22px; font-weight: 600; }
.adm-stat-k {
  color: var(--text-dim); font-size: 10px;
  text-transform: uppercase; letter-spacing: .06em; margin-top: 2px;
}
.adm-stat-s { color: var(--text-dim); font-size: 11px; margin-top: 6px; }

.adm-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.adm-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.adm-row:last-child { border-bottom: none; }
.adm-row span { color: var(--text-dim); }
.adm-row b { font-weight: 600; text-align: right; }

.adm-bar, .adm-meter {
  height: 6px; margin: 6px 0 2px;
  background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
}
.adm-bar i, .adm-meter i {
  display: block; height: 100%;
  background: var(--accent);
  transition: width .2s ease;
}

.adm-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.adm-toolbar input {
  flex: 1; max-width: 320px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font: inherit;
}

.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th {
  text-align: left; color: var(--text-dim);
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.adm-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table-users td { min-width: 110px; }
.adm-table-users td:first-child { min-width: 240px; }
.adm-email b { display: inline-block; }
.adm-dim { color: var(--text-dim); font-size: 11px; margin-top: 3px; }
.adm-bad { color: var(--danger); }

.adm-table select {
  font: inherit; font-size: 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 6px;
}

.adm-badge {
  display: inline-block; vertical-align: middle;
  font-size: 10px; line-height: 1.6;
  padding: 0 7px; margin-left: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-dim);
  text-transform: lowercase;
}
.adm-badge-ok { color: #1a7f37; border-color: rgba(26, 127, 55, .45); }
.adm-badge-warn { color: #9a6700; border-color: rgba(154, 103, 0, .45); }
.adm-badge-bad { color: var(--danger); border-color: rgba(179, 38, 30, .45); }
.adm-badge-accent { color: var(--accent); border-color: var(--accent); }

[data-theme='dark'] .adm-badge-ok { color: #5ddb7a; border-color: rgba(93, 219, 122, .4); }
[data-theme='dark'] .adm-badge-warn { color: #e3b341; border-color: rgba(227, 179, 65, .4); }
[data-theme='dark'] .adm-badge-bad { color: #ff8b80; border-color: rgba(255, 139, 128, .4); }
