:root {
  --bg: #0b0f14;
  --surface: #141b24;
  --border: #243044;
  --text: #e8edf5;
  --muted: #8b9cb3;
  --accent: #3d9cff;
  --accent-hover: #5aadff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.header nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--muted);
  max-width: 36rem;
  margin: 0 auto 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #041018;
  border-radius: 6px;
  font-weight: 600;
}

.btn:hover {
  background: var(--accent-hover);
  color: #041018;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.profile {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.profile img {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.5rem;
  margin: 1rem 0 0;
}

.grid dt {
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

.row-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.row-user img {
  border-radius: 4px;
}

.flashes .flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0 0 0.5rem;
}

.flash-ok {
  background: #0d3320;
  border: 1px solid #1f6b45;
}

.flash-error {
  background: #3a1212;
  border: 1px solid #8b3030;
}

.dash-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.dash-header .portrait {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0;
}

.stat {
  font-size: 0.9rem;
  color: var(--muted);
}

.stat strong {
  color: var(--text);
}

.small {
  font-size: 0.85rem;
}

.notice {
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: #041018;
  border-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel canvas {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.skill-groups {
  margin-top: 1rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.skill-group summary {
  cursor: pointer;
  font-weight: 600;
}

table.compact {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.inline-form {
  display: inline-block;
  margin-top: 0.5rem;
}

button.btn {
  border: none;
  cursor: pointer;
}

.pos {
  color: #5dffa0;
}

.neg {
  color: #ff7b7b;
}

.queue-list {
  padding-left: 1.25rem;
  color: var(--muted);
}

.sync-running {
  color: #ffd166;
}

.risk-high, .risk-badge.risk-high {
  color: #ff7b7b;
}

.risk-low, .risk-badge.risk-low {
  color: #5dffa0;
}

.risk-badge {
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--surface);
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  border-left: 4px solid var(--muted);
}

.alert-card.severity-high {
  border-left-color: #ff7b7b;
}

.alert-card.severity-medium {
  border-left-color: #ffd166;
}

.alert-card.severity-low {
  border-left-color: #8b9cb3;
}

.alert-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
