/* NHI Security Console — Global Styles + Dark Mode */
:root {
  --color-bg: #ffffff;
  --color-bg2: #f9fafb;
  --color-surface: #f3f4f6;
  --color-border: #e5e7eb;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-accent: #2563eb;
  --color-danger: #dc2626;
  --color-success: #059669;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #38bdf8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-bg2: #1e293b;
    --color-surface: #334155;
    --color-border: #475569;
    --color-text: #f1f5f9;
    --color-muted: #94a3b8;
    --color-accent: #60a5fa;
    --color-danger: #f87171;
    --color-success: #34d399;
    --sidebar-bg: #020617;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

/* Responsive layout */
.nhi-shell {
  display: flex;
  min-height: 100vh;
}

.nhi-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.nhi-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--color-bg);
  min-width: 0;
}

.nav-link {
  display: block;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--sidebar-active);
  border-left-color: var(--sidebar-active);
  background: rgba(56, 189, 248, 0.08);
  font-weight: 600;
}

/* Tables */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; padding: 6px 10px; background: var(--color-bg2); border-bottom: 1px solid var(--color-border); font-weight: 600; font-size: 13px; }
td { padding: 6px 10px; border-bottom: 1px solid var(--color-surface); font-size: 13px; }

/* Cards */
.card {
  background: var(--color-bg2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px;
}

/* Responsive: collapse sidebar to top bar on narrow screens */
@media (max-width: 768px) {
  .nhi-shell { flex-direction: column; }
  .nhi-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 0;
  }
  .nhi-main { padding: 16px; }
  .nav-link {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 14px;
  }
  .nav-link.active { border-left: none; border-bottom-color: var(--sidebar-active); }
}
