/* TinySIEM shared design tokens and nav component */

/* ── SEVERITY TOKENS ── */
:root {
  --severity-critical: #ef4444;
  --severity-high:     #f97316;
  --severity-medium:   #eab308;
  --severity-low:      #3b82f6;
  --severity-critical-bg: rgba(239,68,68,.12);
  --severity-high-bg:     rgba(249,115,22,.12);
  --severity-medium-bg:   rgba(234,179,8,.12);
  --severity-low-bg:      rgba(59,130,246,.12);

  --radius: 6px;
}

/* ── LAYOUT ── */
.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TOP NAV ── */
.top-nav {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 24px;
  flex-shrink: 0;
}

.top-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -.3px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.top-nav-link {
  padding: 6px 12px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 13px;
  white-space: nowrap;
  transition: background .12s, color .12s;
}

.top-nav-link:hover { background: var(--surface3); color: var(--text); }

.top-nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

/* ── PROFILE DROPDOWN ── */
.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  z-index: 100;
  padding: 4px;
}

.profile-dropdown.show { display: block; }

.profile-dropdown-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.profile-dropdown-name { font-size: 13px; font-weight: 600; color: var(--text); }
.profile-dropdown-role { font-size: 11px; color: var(--text-dim); }

.profile-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 10px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 4px;
  font-size: 12.5px;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
}

.profile-dropdown-item:hover { background: var(--surface3); color: var(--text); }

.profile-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── SETTINGS TABS ── */
.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
  overflow-x: auto;
}

.settings-tab {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}

.settings-tab:hover { color: var(--text); }

.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

.topbar-search { flex: 1; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.stat-card.critical { border-left-color: var(--severity-critical); }
.stat-card.high     { border-left-color: var(--severity-high); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.stat-card.critical .stat-value { color: var(--severity-critical); }
.stat-card.high .stat-value     { color: var(--severity-high); }

/* ── SEVERITY BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.badge.critical { background: var(--severity-critical-bg); color: var(--severity-critical); }
.badge.high     { background: var(--severity-high-bg);     color: var(--severity-high); }
.badge.medium   { background: var(--severity-medium-bg);   color: var(--severity-medium); }
.badge.low      { background: var(--severity-low-bg);      color: var(--severity-low); }

/* ── SEVERITY DOTS (for facet bars) ── */
.dot-critical { background: var(--severity-critical) !important; }
.dot-high     { background: var(--severity-high) !important; }
.dot-medium   { background: var(--severity-medium) !important; }
.dot-low      { background: var(--severity-low) !important; }

