/* App.css - Modern White Theme со Акцентни Бои */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #2563eb;       /* Син акцент */
  --secondary-color: #7c3aed;     /* Виолетов акцент */
  --accent-green: #10b981;        /* Зелен акцент */
  --accent-orange: #f59e0b;       /* Портокалов акцент */
  --accent-red: #ef4444;          /* Црвен акцент */
  --text-primary: #1f2937;        /* Темно сиво за текст */
  --text-secondary: #6b7280;      /* Средно сиво */
  --text-light: #9ca3af;          /* Светло сиво */
  --bg-primary: #ffffff;          /* Основна позадина */
  --bg-secondary: #f9fafb;        /* Секциска позадина */
  --bg-tertiary: #f3f4f6;         /* Позадина на картички */
  --border-color: #e5e7eb;        /* Граница */
  --border-hover: #d1d5db;        /* Граница при hover */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark mode ако сакаш опција */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #4b5563;
    --border-hover: #6b7280;
  }
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Main Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg-secondary);
}

.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Top Navigation - Поблиску до AI Assist */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

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

.logo-icon {
  font-size: 28px;
  color: var(--primary-color);
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.search-bar {
  position: relative;
  width: 320px;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

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

/* AI Assistant Button - Поблиску */
.ai-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.ai-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.ai-toggle-btn.active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}

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

.refresh-icon {
  font-size: 14px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

/* Statistics Grid со Графикони */
.stats-overview {
  margin-bottom: 32px;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.stats-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.stats-time {
  color: var(--text-light);
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 2fr;
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
}

.stat-card.online {
  border-color: var(--accent-green);
}

.stat-card.idle {
  border-color: var(--accent-orange);
}

.stat-card.offline {
  border-color: var(--accent-red);
}

.stat-main {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 600;
}

.trend-up {
  font-size: 12px;
}

.stat-badge {
  background: var(--secondary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* Interactive Charts Section */
.charts-section {
  margin-top: 32px;
  margin-bottom: 32px;
}

.charts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.charts-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.chart-container {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
}

.chart-container h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.chart-wrapper {
  height: 200px;
  position: relative;
}

/* Mini charts во sidebar */
.mini-charts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mini-chart {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
}

.mini-chart h5 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.mini-chart .chart-wrapper {
  height: 60px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

/* Filter Sidebar */
.filter-sidebar {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-color);
  height: fit-content;
  position: sticky;
  top: 24px;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tag {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  background: var(--bg-tertiary);
}

.filter-tag.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.filter-select {
  width: 100%;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}

.reset-filters-btn {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.reset-filters-btn:hover {
  background: var(--bg-tertiary);
}

.action-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.action-icon {
  font-size: 16px;
}

/* Content Area */
.content-area {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
}

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

.content-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.content-subtitle {
  color: var(--text-light);
  font-size: 13px;
  margin-top: 4px;
}

.sort-select {
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Devices Grid */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.device-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s;
}

.device-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.device-card.online {
  border-left: 4px solid var(--accent-green);
}

.device-card.idle {
  border-left: 4px solid var(--accent-orange);
}

.device-card.offline {
  border-left: 4px solid var(--accent-red);
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.device-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-primary);
}

.device-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.device-user {
  margin: 4px 0 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online .status-dot {
  background: var(--accent-green);
}

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

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

.device-info {
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.info-label {
  color: var(--text-secondary);
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.device-metrics {
  margin-bottom: 20px;
}

.metric {
  margin-bottom: 16px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.metric-value {
  color: var(--primary-color);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
}

.progress-fill.cpu {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.progress-fill.memory {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-orange));
}

.device-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
}

.sysmon-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--secondary-color);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* AI Assistant Sidebar - ПРВО ВО СРЕДИНА */
.ai-sidebar {
  position: fixed;
  top: 100px;
  right: 24px;
  width: 380px;
  height: calc(100vh - 140px);
  background: var(--bg-primary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: all 0.3s ease;
  transform: translateX(400px);
}

.ai-sidebar.open {
  transform: translateX(0);
}

.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  font-size: 24px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.ai-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  margin-top: 2px;
}

.close-ai {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-ai:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Chat Input Area - ВИСОКО ГОРЕ */
.chat-input-area {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.chat-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
  transition: all 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

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

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chat Messages */
.welcome-message {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.welcome-avatar {
  font-size: 32px;
  text-align: center;
  margin-bottom: 12px;
}

.welcome-content h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.welcome-content p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.welcome-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-question {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-question:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 90%;
  animation: fadeIn 0.3s ease;
}

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

.chat-message.question {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-message.question .message-avatar {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-message.question .message-content {
  align-items: flex-end;
}

.message-header {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.message-sender {
  font-weight: 600;
  color: var(--text-primary);
}

.message-context {
  color: var(--primary-color);
  font-weight: 500;
}

.message-text {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  border: 1px solid transparent;
}

.chat-message.question .message-text {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 16px 4px 16px 16px;
}

.chat-message.answer .message-text {
  background: var(--bg-tertiary);
  border-radius: 4px 16px 16px 16px;
  border: 1px solid var(--border-color);
}

.message-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 0;
}

.typing-indicator div {
  width: 8px;
  height: 8px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator div:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator div:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-primary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.modal-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: white;
}

.modal-subtitle {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.ip-badge,
.os-badge,
.status-badge {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.3);
}

.status-badge.idle {
  background: rgba(245, 158, 11, 0.3);
}

.status-badge.offline {
  background: rgba(239, 68, 68, 0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Quick Stats in Modal */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.quick-stat {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.quick-stat:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.stat-icon {
  font-size: 20px;
  color: var(--primary-color);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* Modal Tabs */
.modal-tabs {
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 4px;
}

.tab {
  padding: 14px 24px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

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

.tab.active {
  color: var(--primary-color);
  background: var(--bg-secondary);
  border-bottom: 3px solid var(--primary-color);
}

.tabs-content {
  padding: 20px;
}

/* Data Grid for Sysmon/Network */
.data-grid {
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 500px;
}

.grid-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
}

.grid-sidebar {
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  background: var(--bg-secondary);
}

.grid-content {
  overflow-y: auto;
  background: var(--bg-primary);
}

/* JSON Viewer */
.json-viewer {
  height: 100%;
  padding: 20px;
  background: var(--bg-primary);
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.json-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-json {
  padding: 6px 12px;
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.copy-json:hover {
  background: var(--secondary-color);
}

.json-content {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.5;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
    margin-bottom: 24px;
  }

  .ai-sidebar {
    width: 350px;
    right: 16px;
  }
}

@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .search-bar {
    width: 100%;
  }

  .nav-right {
    width: 100%;
    justify-content: space-between;
  }

  .ai-sidebar {
    width: 100%;
    height: 70vh;
    top: 30vh;
    right: 0;
    border-radius: 20px 20px 0 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .devices-grid {
    grid-template-columns: 1fr;
  }

  .grid-container {
    grid-template-columns: 1fr;
  }

  .grid-sidebar {
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 4px;
}

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

/* Loading States */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty States */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.5;
  color: var(--text-light);
}

.empty-state h3 {
  margin: 0 0 10px 0;
  color: var(--text-primary);
  font-weight: 600;
}

.empty-state p {
  margin-bottom: 20px;
}

.empty-action-btn {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.empty-action-btn:hover {
  background: var(--secondary-color);
}