/* ==========================================================================
   AEGIS — Design System (Hub Central do Vini)
   Mix próprio entre Linear (disciplina de luminância/tipografia) e Sentry
   (densidade de dados/pulso de cor). Não é clone de nenhum dos dois.
   ========================================================================== */

:root {
  /* Superfícies */
  --bg-void: #0a0a0f;
  --bg-panel: #121218;
  --bg-surface: rgba(255,255,255,0.03);
  --bg-surface-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.05);

  /* Texto */
  --text-primary: #f2f1f7;
  --text-secondary: #a8a6b8;
  --text-muted: #65637a;

  /* Acento */
  --accent-primary: #8b5cf6;
  --accent-glow: #a78bfa;
  --accent-pulse: #d946ef;

  /* Status */
  --status-ok: #4ade80;
  --status-warn: #facc15;
  --status-error: #f87171;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv01","ss03";
  font-weight: 400;
  display: flex;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border-subtle); }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(155deg, var(--accent-primary), var(--accent-pulse)); flex-shrink: 0; }
.logo-text { font-weight: 600; font-size: 15px; letter-spacing: -0.2px; }
.logo-sub { font-size: 10px; color: var(--text-muted); letter-spacing: 0.4px; text-transform: uppercase; margin-top: 1px; }

.nav-section-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 510; padding: 0 8px; margin: 18px 0 8px 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 510; color: var(--text-secondary); text-decoration: none; margin-bottom: 2px; cursor: pointer; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.nav-item.active { background: rgba(139,92,246,0.12); color: var(--text-primary); }
.nav-item.active .nav-icon { color: var(--accent-glow); }
.nav-icon { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.dot-ok { background: var(--status-ok); box-shadow: 0 0 6px rgba(74,222,128,0.6); }
.dot-warn { background: var(--status-warn); box-shadow: 0 0 6px rgba(250,204,21,0.6); }
.dot-error { background: var(--status-error); box-shadow: 0 0 6px rgba(248,113,113,0.6); }

.sidebar-footer { margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--border-subtle); font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; flex-shrink: 0; }
.topbar-title { font-size: 16px; font-weight: 590; letter-spacing: -0.2px; }
.system-health { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-secondary); font-weight: 510; }
.system-health .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-ok); box-shadow: 0 0 6px rgba(74,222,128,0.6); }
.system-health.warn .status-dot { background: var(--status-warn); box-shadow: 0 0 6px rgba(250,204,21,0.6); }
.system-health.error .status-dot { background: var(--status-error); box-shadow: 0 0 6px rgba(248,113,113,0.6); }

.content { padding: 32px; overflow-y: auto; }
.content-header { margin-bottom: 24px; }
.content-header h1 { font-size: 22px; font-weight: 590; letter-spacing: -0.3px; margin-bottom: 4px; }
.content-header p { font-size: 13.5px; color: var(--text-muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card { position: relative; background: var(--bg-surface); border: 1px solid var(--border); border-left: 2px solid var(--border); border-radius: var(--radius-md); padding: 16px; overflow: hidden; transition: background .15s, border-color .15s, transform .15s; cursor: pointer; }
.card:hover { background: var(--bg-surface-hover); border-color: rgba(255,255,255,0.14); transform: translateY(-1px); }
.card.ok { border-left-color: var(--status-ok); }
.card.warn { border-left-color: var(--status-warn); }
.card.error { border-left-color: var(--status-error); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.card-icon { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: rgba(139,92,246,0.12); color: var(--accent-glow); font-size: 14px; }
.badge { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; padding: 3px 7px; border-radius: 20px; }
.badge.ok { background: rgba(74,222,128,0.12); color: var(--status-ok); }
.badge.warn { background: rgba(250,204,21,0.12); color: var(--status-warn); }
.badge.error { background: rgba(248,113,113,0.12); color: var(--status-error); }

.card h3 { font-size: 14px; font-weight: 590; margin-bottom: 4px; letter-spacing: -0.1px; }
.card p { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-bottom: 12px; min-height: 34px; }

.metrics-row { display: flex; gap: 14px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); margin-bottom: 12px; flex-wrap: wrap; }
.metrics-row b { color: var(--text-primary); font-weight: 500; }

.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 10.5px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.card-footer .open-link { font-family: 'Inter', sans-serif; color: var(--accent-glow); font-weight: 510; font-size: 12px; }

.section-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 510; margin: 28px 0 12px 0; }
.section-title:first-of-type { margin-top: 0; }

.activity-feed { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.activity-text { color: var(--text-secondary); flex: 1; }
.activity-text b { color: var(--text-primary); font-weight: 510; }
.activity-time { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--text-muted); }

/* ---------- Botões (reuso em dashboards internos) ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 510; background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--text-primary); cursor: pointer; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--bg-surface-hover); box-shadow: 0 0 0 1px rgba(139,92,246,0.3); }
.btn-primary { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.btn-primary:hover { background: var(--accent-glow); box-shadow: 0 0 12px rgba(167,139,250,0.4); }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
}
