/* ============================================
   ANALYZEVISITOR - Design System
   Warm, elegant, light theme
   ============================================ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ============================================
   CSS Variables - Design Tokens
   ============================================ */
:root {
  /* Colors - Warm cream & sand palette */
  --bg-base: #faf8f5;
  --bg-surface: #ffffff;
  --bg-elevated: #f5f2ed;
  --bg-hover: #ede9e3;
  --bg-sidebar: #f8f6f2;
  
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.15);
  
  --text-primary: #1a1816;
  --text-secondary: #5c5650;
  --text-muted: #8c857c;
  
  /* Accent colors - Warm earth tones */
  --accent-primary: #c17f59;
  --accent-primary-hover: #a86b48;
  --accent-gradient: linear-gradient(135deg, #d4956e 0%, #c17f59 50%, #a86b48 100%);
  
  --success: #5d8a66;
  --success-bg: rgba(93, 138, 102, 0.1);
  --warning: #c9a227;
  --warning-bg: rgba(201, 162, 39, 0.1);
  --danger: #c25d5d;
  --danger-bg: rgba(194, 93, 93, 0.1);
  --info: #5d7f8a;
  --info-bg: rgba(93, 127, 138, 0.1);
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Typography */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono: 'IBM Plex Mono', monospace;
  
  /* Shadows - Softer, warmer */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.08);
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================
   Layout
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-mark {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  color: white;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* Navigation */
.nav {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-5);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-base);
  position: relative;
  margin-bottom: 2px;
}

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

.nav-item.active {
  background: rgba(193, 127, 89, 0.12);
  color: var(--accent-primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 1;
}

/* User Profile */
.user-profile {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: white;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.page-header {
  padding: var(--space-5) var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-actions {
  display: flex;
  gap: var(--space-3);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: var(--space-8);
  max-width: 1400px;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-6);
}

/* ============================================
   Metric Cards
   ============================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.metric-change.positive { color: var(--success); }
.metric-change.negative { color: var(--danger); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

/* ============================================
   Form Elements
   ============================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(193, 127, 89, 0.12);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Toggle */
.toggle {
  width: 44px;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.toggle.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle.active::after {
  left: 22px;
}

/* ============================================
   Tables & Lists
   ============================================ */
.data-table {
  width: 100%;
}

.table-header {
  display: grid;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-elevated);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.table-row {
  display: grid;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  transition: background var(--transition-fast);
}

.table-row:hover {
  background: var(--bg-elevated);
}

.table-row:last-child {
  border-bottom: none;
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

.badge-live {
  background: var(--success-bg);
  color: var(--success);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  margin-right: var(--space-2);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================
   Live Indicator
   ============================================ */
.live-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(93, 138, 102, 0.6);
    opacity: 1;
  }
  50% { 
    box-shadow: 0 0 0 6px rgba(93, 138, 102, 0);
    opacity: 0.8;
  }
}

/* ============================================
   Charts Container
   ============================================ */
.chart-container {
  position: relative;
  height: 280px;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg-base);
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.login-logo .logo-mark {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.login-logo .logo-text {
  font-size: 26px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.login-btn {
  width: 100%;
  padding: var(--space-4);
  font-size: 15px;
  font-weight: 600;
  margin-top: var(--space-2);
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid rgba(194, 93, 93, 0.2);
  color: var(--danger);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
  display: none;
}

.login-error.show {
  display: block;
}

/* ============================================
   Live Banner (Dashboard)
   ============================================ */
.live-banner {
  background: linear-gradient(135deg, rgba(93, 138, 102, 0.08) 0%, rgba(193, 127, 89, 0.08) 100%);
  border: 1px solid rgba(93, 138, 102, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.live-hero {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.live-pulse-ring {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-pulse-ring::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--success);
  border-radius: 50%;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.7; }
  75%, 100% { transform: scale(1.4); opacity: 0; }
}

.live-pulse-ring .inner-dot {
  width: 28px;
  height: 28px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(93, 138, 102, 0.4);
}

.live-count {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 400;
  color: var(--success);
  line-height: 1;
}

.live-label {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.live-sparkline {
  width: 300px;
  height: 72px;
}

/* ============================================
   Session Feed
   ============================================ */
.session-feed {
  max-height: 380px;
  overflow-y: auto;
}

.session-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  margin-bottom: var(--space-3);
  transition: all var(--transition-base);
}

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

.session-item.new {
  animation: slide-in 0.4s ease;
  background: rgba(93, 138, 102, 0.1);
  border: 1px solid rgba(93, 138, 102, 0.2);
}

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

.session-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  color: white;
}

.session-info {
  flex: 1;
  min-width: 0;
}

.session-location {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.session-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.session-meta {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ============================================
   API Keys Page
   ============================================ */
.api-key-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
}

.key-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.key-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: var(--space-1);
}

.key-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.key-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.key-badge.live {
  background: var(--success-bg);
  color: var(--success);
}

.key-badge.test {
  background: var(--warning-bg);
  color: var(--warning);
}

.key-value-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.key-value {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.key-value code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-primary);
  word-break: break-all;
}

.key-actions {
  display: flex;
  gap: var(--space-2);
}

.key-permissions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.permission-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* ============================================
   Plan Card (Settings - Billing)
   ============================================ */
.plan-card {
  background: linear-gradient(135deg, rgba(193, 127, 89, 0.08) 0%, rgba(212, 149, 110, 0.08) 100%);
  border: 1px solid rgba(193, 127, 89, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
}

.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.plan-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.plan-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
}

.plan-price {
  text-align: right;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  color: var(--accent-primary);
}

.price-period {
  font-size: 15px;
  color: var(--text-muted);
}

.plan-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.plan-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--text-secondary);
}

.plan-feature svg {
  flex-shrink: 0;
}

.plan-actions {
  display: flex;
  gap: var(--space-4);
}

/* Usage Meters */
.usage-meter {
  margin-bottom: var(--space-4);
}

.usage-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: var(--space-2);
}

.usage-labels span:first-child {
  color: var(--text-secondary);
}

.usage-labels span:last-child {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.usage-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Payment Card */
.payment-card-display {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

.card-number {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 1px;
}

.card-expiry {
  font-size: 12px;
  color: var(--text-muted);
}

/* Invoice History */
.invoice-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.invoice-row:last-child {
  border-bottom: none;
}

.invoice-info {
  flex: 1;
}

.invoice-date {
  font-weight: 500;
  font-size: 14px;
}

.invoice-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.invoice-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
}

.invoice-status {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.invoice-status.paid {
  background: var(--success-bg);
  color: var(--success);
}

/* ============================================
   Alerts Page
   ============================================ */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.config-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.config-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.config-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.config-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.config-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.config-body {
  padding: var(--space-6);
}

.form-row {
  display: flex;
  gap: var(--space-4);
}

/* Alert Rules */
.alert-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.alert-rule:last-child {
  margin-bottom: 0;
}

.rule-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  display: block;
}

.rule-condition {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Recent Alerts */
.recent-alert {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.recent-alert.critical {
  background: rgba(194, 93, 93, 0.06);
}

.recent-alert.warning {
  background: rgba(201, 162, 39, 0.06);
}

.recent-alert.resolved {
  background: rgba(93, 138, 102, 0.06);
}

.alert-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-alert.critical .alert-status-indicator {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.recent-alert.warning .alert-status-indicator {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.recent-alert.resolved .alert-status-indicator {
  background: var(--success);
}

.alert-details {
  flex: 1;
}

.alert-message {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
}

.alert-timestamp {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   Settings Page
   ============================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-8);
}

.settings-nav {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-card);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: rgba(193, 127, 89, 0.12);
  color: var(--accent-primary);
}

.settings-section {
  margin-bottom: var(--space-10);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* Team Members */
.team-member {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.member-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.member-email {
  font-size: 12px;
  color: var(--text-muted);
}

.role-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.admin {
  background: rgba(193, 127, 89, 0.15);
  color: var(--accent-primary);
}

.role-badge.developer {
  background: rgba(93, 127, 138, 0.15);
  color: var(--info);
}

/* Integration Toggle Row */
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.integration-info {
  flex: 1;
}

.integration-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
}

.integration-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   Page Breakdown (Dashboard)
   ============================================ */
.page-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.page-row:last-child {
  border-bottom: none;
}

.page-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.page-path {
  font-family: var(--font-mono);
  font-size: 13px;
}

.page-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
}

.page-bar {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.page-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-layout {
    grid-template-columns: 1fr;
  }
}
