/* Radar — Dashboard Styles
   Dark theme, sleek operator dashboard */

/* ========================================================================
   Reset & Base
   ======================================================================== */

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

:root {
  /* Surfaces */
  --bg-root: #0a0a0f;
  --bg-panel: #111118;
  --bg-card: #161622;
  --bg-card-hover: #1c1c2b;
  --bg-elevated: #1e1e2e;
  --bg-input: #0e0e16;

  /* Borders */
  --border-subtle: #1e1e2e;
  --border-default: #282840;
  --border-focus: #00d4aa;

  /* Accent */
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-hover: #00eabb;
  --accent-text: #00d4aa;

  /* Text */
  --text-primary: #e4e4e7;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --text-inverse: #0a0a0f;

  /* Status */
  --status-online: #22c55e;
  --status-idle: #f59e0b;
  --status-offline: #6b7280;
  --status-error: #ef4444;

  /* Source badges */
  --badge-paid: #3b82f6;
  --badge-search: #06b6d4;
  --badge-social: #8b5cf6;
  --badge-direct: #6b7280;
  --badge-referral: #f97316;
  --badge-email: #f59e0b;

  /* Sizing */
  --nav-height: 56px;
  --stats-height: 48px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-default: 200ms ease;
  --transition-slow: 350ms ease;

  /* Aliases (used by fraud/cluster/alert styles) */
  --border: var(--border-subtle);
  --border-faint: rgba(255, 255, 255, 0.05);
  --text-muted: var(--text-tertiary);
  --bg-hover: var(--bg-card-hover);
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ========================================================================
   Scrollbar
   ======================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ========================================================================
   Navigation Bar
   ======================================================================== */

.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(17, 17, 24, 0.85);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 24px;
}

.nav-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-inverse);
}

.nav-brand-text {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-site-selector {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 160px;
}

.nav-site-selector:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.nav-online-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--status-online);
}

.nav-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.nav-stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.nav-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ws-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-offline);
  transition: background var(--transition-default);
}

.ws-indicator.connected {
  background: var(--status-online);
}

.ws-indicator.connecting {
  background: var(--status-idle);
  animation: pulse-dot 1.5s infinite;
}

/* ========================================================================
   Stats Bar
   ======================================================================== */

.stats-bar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  height: var(--stats-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 32px;
  z-index: 99;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.stat-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

/* ========================================================================
   Main Layout
   ======================================================================== */

.dashboard-main {
  padding-top: calc(var(--nav-height) + var(--stats-height));
  display: flex;
  height: 100vh;
}

.panel-visitors {
  flex: 0 0 60%;
  max-width: 60%;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-activity {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.panel-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* ========================================================================
   Visitor List & Rows
   ======================================================================== */

.visitor-list {
  list-style: none;
}

.visitor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid transparent;
  position: relative;
}

.visitor-row:hover {
  background: var(--bg-card-hover);
}

.visitor-row.is-new {
  animation: slide-in 0.4s ease-out;
}

.visitor-row.is-leaving {
  animation: fade-out 0.6s ease-out forwards;
}

.visitor-row-status {
  flex-shrink: 0;
}

.visitor-row-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visitor-row-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.visitor-row-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.visitor-row-page {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-mono);
}

.visitor-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.visitor-row-time {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.visit-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-dim);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.device-icon {
  font-size: 14px;
  color: var(--text-tertiary);
  width: 18px;
  text-align: center;
}

.country-flag {
  font-size: 15px;
  line-height: 1;
}

/* ========================================================================
   Activity Feed
   ======================================================================== */

.activity-feed {
  list-style: none;
}

.activity-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
  animation: feed-in 0.3s ease-out;
}

.activity-item:hover {
  background: var(--bg-card);
}

.activity-item-clickable {
  cursor: pointer;
}

.activity-item-clickable:hover {
  background: var(--bg-card-hover);
}

.activity-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.activity-type-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-type-dot.type-session_start {
  background: var(--status-online);
}

.activity-type-dot.type-pageview {
  background: var(--badge-search);
}

.activity-type-dot.type-session_end {
  background: var(--status-offline);
}

.activity-type-dot.type-scroll_depth {
  background: var(--badge-social);
}

.activity-type-dot.type-heartbeat {
  background: var(--border-default);
}

.activity-type-dot.type-visibility_change {
  background: var(--badge-email);
}

.activity-type-dot.type-click {
  background: var(--badge-referral);
}

.activity-type-dot.type-form_interact {
  background: var(--badge-paid);
}

.activity-type-dot.type-form_submit {
  background: var(--accent);
}

.activity-type-dot.type-funnel {
  background: #a855f7;
}

.activity-item-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-item-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.activity-item-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.activity-scroll-lock {
  position: sticky;
  bottom: 0;
  padding: 6px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  background: linear-gradient(to top, var(--bg-root) 60%, transparent);
  cursor: pointer;
}

/* ========================================================================
   Status Dot
   ======================================================================== */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--status-online);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  animation: pulse-dot 2s infinite;
}

.status-dot.idle {
  background: var(--status-idle);
}

.status-dot.offline {
  background: var(--status-offline);
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

/* ========================================================================
   Badges
   ======================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-paid {
  background: rgba(59, 130, 246, 0.15);
  color: var(--badge-paid);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-search {
  background: rgba(6, 182, 212, 0.12);
  color: var(--badge-search);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-social {
  background: rgba(139, 92, 246, 0.12);
  color: var(--badge-social);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-direct {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(107, 114, 128, 0.25);
}

.badge-referral {
  background: rgba(249, 115, 22, 0.12);
  color: var(--badge-referral);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.badge-email {
  background: rgba(245, 158, 11, 0.12);
  color: var(--badge-email);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ========================================================================
   Visitor Detail Panel
   ======================================================================== */

.visitor-detail {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-root);
  z-index: 50;
  overflow-y: auto;
  animation: slide-up 0.25s ease-out;
}

.visitor-detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.visitor-detail-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visitor-detail-id {
  font-size: 16px;
  font-weight: 600;
}

.visitor-detail-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.visitor-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 24px;
}

.detail-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.detail-section.full-width {
  grid-column: 1 / -1;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-field {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.detail-field-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.detail-field-value {
  font-size: 13px;
  color: var(--text-primary);
  text-align: right;
  font-weight: 500;
}

.detail-field-value.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.detail-field-value .vpn-flag {
  color: var(--status-error);
  font-weight: 600;
}

/* ========================================================================
   Related Visitors
   ======================================================================== */

.detail-count {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: normal;
  margin-left: 6px;
}

.related-visitors-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.related-visitor-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.related-visitor-row:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.related-visitor-row .mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  min-width: 100px;
}

.related-visitor-row .fraud-badge {
  margin-left: auto;
}

/* ========================================================================
   Session Timeline
   ======================================================================== */

.session-timeline {
  list-style: none;
}

.session-timeline-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.session-timeline-item:hover {
  border-color: var(--border-default);
}

.session-chevron {
  font-size: 12px;
  color: var(--text-tertiary);
  width: 12px;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.session-timeline-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.session-timeline-header:hover {
  background: var(--bg-card);
}

.session-timeline-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.session-timeline-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.session-timeline-events {
  border-top: 1px solid var(--border-subtle);
  padding: 8px 0;
  background: var(--bg-root);
}

.session-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 28px;
  font-size: 12px;
  color: var(--text-secondary);
}

.session-event-time {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  min-width: 52px;
}

.session-event-url {
  font-family: var(--font-mono);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================================================
   Flags & Tags
   ======================================================================== */

.flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.flag-btn:hover {
  border-color: var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.flag-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-text);
}

.flag-btn.flag-fraud.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--status-error);
  color: var(--status-error);
}

.flag-btn.flag-vip.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--badge-email);
  color: var(--badge-email);
}

.flag-btn.flag-competitor.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--badge-social);
  color: var(--badge-social);
}

.flag-btn.flag-bot.active {
  background: rgba(107, 114, 128, 0.2);
  border-color: var(--text-tertiary);
  color: var(--text-secondary);
}

.flags-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tags-input-row {
  display: flex;
  gap: 6px;
}

.tags-input-row input {
  flex: 1;
  font-size: 13px;
}

.tags-input-row button {
  padding: 6px 14px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.tags-input-row button:hover {
  background: var(--accent-hover);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--bg-elevated);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px;
}

.tag-pill-remove {
  font-size: 14px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.tag-pill-remove:hover {
  color: var(--status-error);
}

.notes-area {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.notes-save-btn {
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.notes-save-btn:hover {
  background: var(--accent-hover);
}

/* ========================================================================
   Filter Bar (Sessions page)
   ======================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  font-size: 13px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.filter-bar select {
  min-width: 130px;
}

.filter-bar input[type="date"] {
  width: 140px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.filter-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
}

.filter-apply-btn {
  padding: 6px 16px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.filter-apply-btn:hover {
  background: var(--accent-hover);
}

.filter-reset-btn {
  padding: 6px 12px;
  color: var(--text-tertiary);
  font-size: 13px;
  transition: color var(--transition-fast);
}

.filter-reset-btn:hover {
  color: var(--text-primary);
}

/* Sessions table */
.sessions-table {
  width: 100%;
  border-collapse: collapse;
}

.sessions-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-panel);
}

.sessions-table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.sessions-table tr {
  transition: background var(--transition-fast);
}

.sessions-table tbody tr:hover {
  background: var(--bg-card);
  cursor: pointer;
}

.sessions-table .cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.pagination-btn {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 0 8px;
}

/* ========================================================================
   Login Page
   ======================================================================== */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-inverse);
}

.login-brand-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: var(--status-error);
  font-size: 13px;
  margin-bottom: 16px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}

.login-submit {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition-fast);
  margin-top: 4px;
}

.login-submit:hover {
  background: var(--accent-hover);
}

/* ========================================================================
   Modal
   ======================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease-out;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slide-up 0.2s ease-out;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.modal-btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.modal-btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}

.modal-btn-primary:hover {
  background: var(--accent-hover);
}

/* ========================================================================
   Toast
   ======================================================================== */

.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.toast.toast-exit {
  animation: toast-out 0.25s ease-in forwards;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
  line-height: 1.4;
}

/* ========================================================================
   Empty State
   ======================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  text-align: center;
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.empty-state-hint {
  font-size: 12px;
}

/* ========================================================================
   Animations
   ======================================================================== */

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    max-height: 60px;
  }
  to {
    opacity: 0;
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ========================================================================
   Responsive (desktop-first, minimal mobile adjustments)
   ======================================================================== */

@media (max-width: 1024px) {
  .dashboard-main {
    flex-direction: column;
  }

  .panel-visitors {
    flex: none;
    max-width: 100%;
    height: 55vh;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .panel-activity {
    height: 45vh;
  }

  .visitor-detail-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 16px;
    overflow-x: auto;
  }

  .nav-stat {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .visitor-row-page {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Fraud Dashboard
   --------------------------------------------------------------------------- */

/* Fraud alert banner (live dashboard) */
.fraud-alert-banner {
  display: block;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.fraud-alert-banner:hover {
  opacity: 0.85;
}

.fraud-alert-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
}

.fraud-alert-warning {
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
  border-bottom: 1px solid rgba(234, 179, 8, 0.2);
}

/* Fraud badges */
.fraud-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.fraud-suspicious {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.fraud-likely_fraud {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.fraud-confirmed_fraud {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Quality score badges */
.quality-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.quality-bounce {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

.quality-low {
  background: rgba(234, 179, 8, 0.12);
  color: #eab308;
}

.quality-medium {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.quality-high {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.quality-very_high {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

/* Intent tier badges */
.intent-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.intent-browsing {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

.intent-interested {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.intent-considering {
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.intent-high_intent {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.intent-converting {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: intent-pulse 2s ease-in-out infinite;
}

.intent-converted {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

@keyframes intent-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Classification badges */
.class-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.class-buyer { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.class-hot_lead { background: rgba(249, 115, 22, 0.15); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); animation: intent-pulse 2s ease-in-out infinite; }
.class-researcher { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.class-price_checker { background: rgba(234, 179, 8, 0.12); color: #eab308; }
.class-competitor { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.class-bot { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.class-fraud { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.class-returning_lead { background: rgba(168, 85, 247, 0.12); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.25); }
.class-casual { background: rgba(107, 114, 128, 0.1); color: #9ca3af; }

/* Cluster badge */
.cluster-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 0.65rem; font-weight: 500; background: rgba(6, 182, 212, 0.1); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.2); cursor: pointer; }

/* Alert severity badges */
.alert-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.alert-info { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.alert-warning { background: rgba(234, 179, 8, 0.12); color: #eab308; }
.alert-critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Funnel chart */
.funnel-chart { margin: 1rem 0; }
.funnel-step { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.funnel-bar { height: 28px; background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15)); border-radius: 4px; min-width: 4px; transition: width 0.3s ease; }
.funnel-label { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; min-width: 120px; }
.funnel-value { font-size: 0.8rem; color: var(--text-primary); font-weight: 600; min-width: 40px; text-align: right; }
.funnel-pct { font-size: 0.7rem; color: var(--text-muted); min-width: 50px; }

/* Sparkline */
.sparkline { display: inline-block; vertical-align: middle; }
.sparkline rect { fill: rgba(59, 130, 246, 0.4); }
.sparkline rect:last-child { fill: rgba(59, 130, 246, 0.8); }

/* Export button */
.btn-export { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.btn-export:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--text-muted); }

/* Stats bar */
.fraud-stats-bar {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 16px 0;
}

.fraud-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px;
  background: var(--bg-card);
}

.fraud-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.fraud-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.fraud-stat-danger {
  color: #ef4444;
}

.fraud-stat-warning {
  color: #eab308;
}

/* Layout */
.fraud-page {
  padding: 0 16px 24px;
}

.fraud-sections {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-top: 12px;
}

.fraud-main {
  min-width: 0;
}

.fraud-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.fraud-section-header h2,
.fraud-section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fraud-section-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Fraud table specifics */
.fraud-table th,
.fraud-table td {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.fraud-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.fraud-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.fraud-tier-confirmed {
  border-left: 3px solid #ef4444;
}

.fraud-tier-likely {
  border-left: 3px solid #f97316;
}

.fraud-tier-suspicious {
  border-left: 3px solid #eab308;
}

.fraud-visitor-link {
  color: var(--accent);
  text-decoration: none;
}

.fraud-visitor-link:hover {
  text-decoration: underline;
}

.fraud-fp-cell {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.fraud-rules-cell {
  max-width: 200px;
}

.fraud-rule-pill {
  display: inline-block;
  padding: 1px 6px;
  margin: 1px 2px;
  border-radius: 3px;
  font-size: 0.68rem;
  background: var(--bg-hover);
  color: var(--text-secondary);
  white-space: nowrap;
}
.fraud-rule-positive {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

/* Fingerprint copy button */
.fp-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 0 0 4px;
  opacity: 0.4;
  transition: opacity 0.15s;
  vertical-align: middle;
}
.fp-copy-btn:hover {
  opacity: 1;
}
.fraud-fp-cell {
  white-space: nowrap;
}

/* Filter IP input */
.filter-ip-input {
  max-width: 160px;
}

/* IP exclusion sidebar */
.fraud-sidebar {
  min-width: 0;
}

.fraud-exclusion-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  position: sticky;
  top: calc(var(--nav-height) + 16px);
}

.fraud-exclusion-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}

.fraud-copy-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.fraud-copy-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.fraud-exclusion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.fraud-exclusion-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fraud-exclusion-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-faint, rgba(255,255,255,0.05));
  color: var(--text-secondary);
}

/* Toast */
.toast {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  animation: fadeInUp 0.2s ease;
}

.toast-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive fraud */
@media (max-width: 1024px) {
  .fraud-sections {
    grid-template-columns: 1fr;
  }

  .fraud-exclusion-panel {
    position: static;
  }

  .fraud-stats-bar {
    flex-wrap: wrap;
  }

  .fraud-stat {
    flex: 1 1 30%;
  }
}

/* ========================================================================
   Page Layout (Clusters, Alerts, and other full-page views)
   ======================================================================== */

.page-header {
  padding: 28px 24px 0;
  margin-top: var(--nav-height);
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 24px 24px 10px;
  margin: 0;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--accent-text);
}

.text-muted {
  color: var(--text-tertiary);
}

/* ========================================================================
   Data Table (shared by Clusters, Alerts, etc.)
   ======================================================================== */

.table-container {
  padding: 0 24px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-card);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 3px;
}

.data-table .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
  display: table-cell;
}

/* ========================================================================
   Visitor & Pagination Links
   ======================================================================== */

.visitor-link {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 500;
}

.visitor-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.pagination-link {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* ========================================================================
   Small Buttons
   ======================================================================== */

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sm:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* ========================================================================
   Fraud-clean badge (for zero/low fraud scores)
   ======================================================================== */

.fraud-clean {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ========================================================================
   Filter bar adjustments for full-page views
   ======================================================================== */

.page-header + .filter-bar {
  margin: 16px 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* Fix fraud-stats-bar spacing on non-fraud pages */
.page-header + .fraud-stats-bar,
.page-header ~ .fraud-stats-bar {
  margin: 16px 24px 0;
  border-color: var(--border-subtle);
  background: var(--border-subtle);
}

/* ========================================================================
   Phase 4: Identity badges
   ======================================================================== */

.identity-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.identity-returning { background: rgba(128, 128, 128, 0.15); color: #999; border-color: rgba(128, 128, 128, 0.3); }
.identity-company { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.identity-soft { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border-color: rgba(6, 182, 212, 0.3); }
.identity-lead { background: rgba(249, 115, 22, 0.15); color: #fb923c; border-color: rgba(249, 115, 22, 0.3); }
.identity-customer { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }

/* Company badge (inline in visitor rows) */
.company-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Small action buttons */
.btn-small {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-small:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.btn-small.btn-accent {
  background: var(--accent-dim);
  color: var(--accent-text);
  border-color: var(--accent);
}
.btn-small.btn-accent:hover {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ========================================================================
   Stat cards · cards · danger button
   Used by the Blocks, Digest and Fingerprint Defence pages. These classes
   were referenced by those pages but never defined, which left their KPI
   cards and panels unstyled (the "broken formatting"). Defined here to match
   the dark-theme token system and the 24px horizontal gutter used by
   .page-header / .table-container / .section-title.
   ======================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 24px 4px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.stat-card .stat-value {
  font-size: 24px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 16px 24px 0;
}

.card h3 {
  color: var(--text-primary);
}

.btn-danger {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.30);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.20);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}

/* Moldovan actor highlight — subtle red left border + tinted background */
.moldovan-row {
  background: rgba(220, 38, 38, 0.08) !important;
  border-left: 3px solid #dc2626;
}
.moldovan-row:hover {
  background: rgba(220, 38, 38, 0.14) !important;
}
