:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #262b36;
  --text: #e8e9ec;
  --muted: #8b909c;
  --accent: #4f8cff;
  --warn: #e0a648;
}

* { box-sizing: border-box; }

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

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 360px;
}

.login-card h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.subtitle { color: var(--muted); margin: 0 0 1.5rem; }

#login-form label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--muted); }
#login-form input {
  width: 100%;
  padding: 0.65rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #10131a;
  color: var(--text);
  font-size: 1rem;
}
#login-form button {
  width: 100%;
  padding: 0.65rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}
.error { color: #ff6b6b; margin-top: 0.75rem; }

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

.tab-rail {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  flex-shrink: 0;
}

.tab-rail-title { font-weight: 700; padding: 0.5rem 0.5rem 1rem; }

.tab {
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
.tab:disabled { color: var(--muted); cursor: not-allowed; }
.tab.active { background: rgba(79, 140, 255, 0.15); color: var(--accent); }

.logout {
  margin-top: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.content { flex: 1; padding: 1.5rem; overflow-x: auto; }

.actions-bar { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 2rem; flex-wrap: wrap; }
.actions-bar button {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
.run-status { color: var(--muted); font-size: 0.9rem; }

.history-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.history-table th, .history-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.history-table th { color: var(--muted); font-weight: 600; }

/* ── OPS-002 Wave 2: structural styles for the five tab views. ──────────
   Placeholder-level only — Wave 3 owns visual design. Everything reuses
   the existing variable palette; no new visual direction. */

.freshness { color: var(--muted); font-size: 0.85rem; margin: -0.5rem 0 1.25rem; }
.tab-meta { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 1rem; }
.muted { color: var(--muted); font-size: 0.85rem; }

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  max-width: 640px;
}

.stale-warning {
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0 1rem;
  font-size: 0.9rem;
  max-width: 640px;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.group summary { padding: 0.6rem 0.75rem; cursor: pointer; font-weight: 600; }
.group .count { color: var(--muted); font-weight: 400; margin-left: 0.35rem; }
.group .item-list { padding: 0 0.75rem 0.5rem; }

.item-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.item-list li { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.item-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.item-desc { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }

.filter-input {
  width: 100%;
  max-width: 360px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #10131a;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* Tables inside tabs scroll horizontally in their own wrapper — the page
   body never scrolls sideways (matches the history-table pattern). */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 360px;
}
.data-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .tab-rail {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tab-rail-title { display: none; }
  .logout { margin-top: 0; margin-left: auto; }
}
