/* ─── SIDEBAR ─── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: calc(100vh / 1.2);
  box-shadow: var(--shadow-sm);
}

.logo {
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #06d6a0, #4e7cff);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav {
  flex: 1;
  padding: 16px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: rgba(5,150,105,0.08);
  color: var(--accent);
  border-color: rgba(5,150,105,0.2);
}

.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-bottom {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  display: flex; flex-direction: column; gap: 5px;
}

.sb-row {
  display: flex; align-items: center; gap: 6px; min-height: 16px;
}
.sb-icon { font-size: 10px; width: 12px; text-align: center; opacity: .5; }
.sb-label { font-weight: 700; text-transform: uppercase; letter-spacing: .5px; min-width: 44px; }
.sb-value { margin-left: auto; text-align: right; white-space: nowrap; }
.sb-value--ok { color: var(--accent2); font-weight: 700; }
.sb-value--off { color: var(--text3); opacity: .5; }
.sb-value--muted { color: var(--text3); opacity: .4; }
.sb-divider { border-top: 1px solid var(--border); margin: 3px 0; opacity: .5; }
.sb-row--version { justify-content: center; padding-top: 2px; }

/* ─── TOPBAR ─── */
.topbar {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-title span { color: var(--accent); }

.topbar-actions { display: flex; gap: 10px; align-items: center; position: relative; }

/* ─── USER MENU ─── */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  color: var(--text);
}
.user-btn:hover { border-color: var(--border2); }

.user-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--accent), #0066ff);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #000;
}

.role-badge-sm {
  font-family: var(--mono); font-size: 9px; padding: 2px 6px;
  border-radius: 4px; letter-spacing: 1px;
}
.role-admin { background: rgba(255,59,92,0.1); color: var(--danger); border: 1px solid rgba(255,59,92,0.2); }
.role-auditor { background: rgba(5,150,105,0.1); color: var(--accent); border: 1px solid rgba(5,150,105,0.2); }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none;
  z-index: 50;
}
.user-dropdown.open { display: block; }

.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dropdown-name { font-size: 13px; font-weight: 700; }
.dropdown-username { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-top: 2px; }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 13px; cursor: pointer;
  color: var(--text2);
  transition: background 0.1s;
}
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(255,59,92,0.06); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-section { padding: 6px 16px 2px; font-family: var(--mono); font-size: 9px;
                    letter-spacing: 1.5px; color: var(--text3); text-transform: uppercase; }

/* ─── ALERTS BELL ─── */
.alerts-bell {
  position: relative; cursor: pointer; padding: 8px 10px;
  border-radius: 8px; transition: background .15s;
  border: 1px solid var(--border);
}
.alerts-bell:hover { background: var(--surface2); }
.bell-icon { font-size: 18px; }
.alerts-badge {
  position: absolute; top: 0; right: 0; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 800;
  font-family: var(--mono); border-radius: 8px; display: flex;
  align-items: center; justify-content: center; padding: 0 4px;
  line-height: 1;
}
.alerts-dropdown {
  position: absolute; top: 100%; right: 0; width: 380px; max-height: 480px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18); z-index: 200;
  display: flex; flex-direction: column; overflow: hidden;
}
.alerts-dropdown.hidden { display: none !important; }
.alerts-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 13px;
}
.alerts-list { flex: 1; overflow-y: auto; max-height: 340px; }
.alerts-empty { padding: 32px; text-align: center; color: var(--text3); font-size: 13px; }
.alerts-dropdown-footer {
  display: flex; justify-content: space-between; padding: 10px 16px;
  border-top: 1px solid var(--border); font-size: 11px;
}
.alerts-dropdown-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

.alert-item {
  display: flex; gap: 10px; padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.alert-item:hover { background: var(--surface2); }
.alert-item--seen { opacity: 0.6; }
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-sev--critical .alert-icon { color: var(--danger); }
.alert-sev--warning .alert-icon { color: var(--warn); }
.alert-sev--info .alert-icon { color: var(--accent); }
.alert-body { flex: 1; min-width: 0; }
.alert-message { font-size: 12px; line-height: 1.4; }
.alert-meta { font-size: 10px; color: var(--text3); font-family: var(--mono); margin-top: 4px; }
.alert-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  flex-shrink: 0; margin-top: 6px;
}
