@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0a0a0a;
  --bg-raised: #141414;
  --border: #262626;
  --text: #ededed;
  --text-muted: #8a8a8a;
  --accent: #ffffff;
  --accent-text: #0a0a0a;
  --danger: #e5484d;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.sidebar-brand, .login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  padding: 0 8px 20px;
}

.login-brand {
  justify-content: center;
  padding: 0 0 20px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}

.sidebar-nav a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-nav a:hover {
  background: var(--bg);
  color: var(--text);
}

.sidebar-nav a.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.sidebar-footer .inline-form button {
  padding: 9px 10px;
}

main {
  flex: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

p.subtitle {
  color: var(--text-muted);
  margin: 0 0 32px;
  font-size: 13px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="url"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus {
  outline: none;
  border-color: #4d4d4d;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

input::placeholder {
  color: #5a5a5a;
}

button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button:hover {
  opacity: 0.88;
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.inline-form button {
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font-size: 13px;
}

.inline-form button:hover {
  color: var(--text);
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
}

.login-wrap {
  max-width: 340px;
  margin: 15vh auto 0;
  width: 100%;
}

.login-card {
  margin-bottom: 0;
  padding: 28px 24px;
}

.login-card h1 {
  text-align: center;
}

.login-card p.subtitle {
  text-align: center;
}

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

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

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

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

code, .mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.token-reveal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.token-reveal .mono {
  display: block;
  margin-top: 8px;
  word-break: break-all;
  color: #a8f0a0;
}

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

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.stat-card-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 600;
}

.dashboard-grid {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.panel-wide {
  flex: 2;
  min-width: 0;
}

.panel-narrow {
  flex: 1;
  min-width: 0;
}

h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.panel-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 0 16px;
}

.share-bar {
  width: 80px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.share-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: 3px;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-list li:last-child {
  border-bottom: none;
}

.activity-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-client {
  font-size: 13px;
}

.activity-tool, .activity-time {
  color: var(--text-muted);
  font-size: 11px;
}

.note {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 20px;
}

.note code {
  color: var(--text);
}

.value-danger {
  color: var(--danger);
}

.histogram {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 160px;
  margin-top: 8px;
}

.histogram-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.histogram-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.histogram-fill {
  width: 100%;
  min-height: 2px;
  background: var(--text-muted);
  border-radius: 4px 4px 0 0;
}

.histogram-fill.slow {
  background: var(--danger);
}

.histogram-count {
  font-size: 12px;
  font-weight: 500;
}

.histogram-label {
  font-size: 10px;
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-healthy {
  background: rgba(70, 200, 120, 0.12);
  color: #4ac88a;
}

.pill-warning {
  background: rgba(230, 170, 50, 0.14);
  color: #e3a93a;
}

.pill-critical {
  background: rgba(229, 72, 77, 0.14);
  color: var(--danger);
}

.trend-chart {
  width: 100%;
  height: 140px;
  margin-top: 8px;
  display: block;
}

.trend-area {
  fill: rgba(237, 237, 237, 0.08);
  stroke: none;
}

.trend-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
