/* Zero Dashboard - Clean & Minimal */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --text-primary: #1a1a1a;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --border-color: #e8eaed;
  --accent: #1a1a1a;
  --accent-light: #333333;
  --success: #34a853;
  --warning: #fbbc04;
  --danger: #ea4335;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #121212;
  --bg-tertiary: #2d2d2d;
  --text-primary: #f5f5f5;
  --text-secondary: #b0b0b0;
  --text-muted: #757575;
  --border-color: #333333;
  --accent: #ffffff;
  --accent-light: #e0e0e0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 16px;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* Hide icons based on theme */
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--bg-tertiary);
  padding: 4px;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

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

.nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 12px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  font-size: 14px;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-indicator.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Main Content */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 40px 60px 60px;
  min-height: 100vh;
  width: calc(100vw - 240px);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.header-left {
  flex: 1;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.5;
}

.header-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 40px;
}

.datetime {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

/* Voice Section */
.voice-section {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 48px 60px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  width: 100%;
}

.voice-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.voice-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
}

.voice-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: var(--bg-tertiary);
  padding: 16px;
  position: relative;
  z-index: 2;
}

.voice-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  transition: all 0.3s ease;
}

.ring-1 { width: 140px; height: 140px; }
.ring-2 { width: 170px; height: 170px; }
.ring-3 { width: 200px; height: 200px; }

.voice-avatar.listening .ring,
.voice-avatar.speaking .ring {
  animation: pulse-ring 1.5s ease-out infinite;
}

.voice-avatar.listening .ring-1 { animation-delay: 0s; }
.voice-avatar.listening .ring-2 { animation-delay: 0.3s; }
.voice-avatar.listening .ring-3 { animation-delay: 0.6s; }

.voice-avatar.speaking .ring {
  border-color: var(--success);
}

@keyframes pulse-ring {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.voice-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.voice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.voice-btn svg {
  width: 24px;
  height: 24px;
}

.voice-btn:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.voice-btn.listening {
  background: var(--danger);
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(234, 67, 53, 0); }
}

.voice-status {
  color: var(--text-muted);
  font-size: 14px;
}

.voice-transcript,
.voice-response {
  margin-top: 20px;
  padding: 16px 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  width: 100%;
  display: none;
  word-wrap: break-word;
}

.voice-transcript.active,
.voice-response.active {
  display: block;
}

.voice-transcript {
  color: var(--text-secondary);
  font-style: italic;
}

.voice-response {
  color: var(--text-primary);
  font-weight: 500;
}

/* Live Activity Feed */
.activity-section {
  margin-bottom: 48px;
  width: 100%;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.activity-header .section-title {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

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

.live-indicator.connected {
  background: var(--success);
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

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

.connection-status {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.connection-status.connected {
  color: var(--success);
}

.btn-clear-activity {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-activity:hover {
  background: #fce8e6;
  border-color: var(--danger);
  color: var(--danger);
}

.activity-feed {
  max-height: 400px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.activity-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.activity-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.activity-empty p {
  font-size: 14px;
}

.activity-item {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  animation: slide-in 0.3s ease;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item.new {
  background: linear-gradient(to right, rgba(52, 168, 83, 0.05), transparent);
}

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

.activity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.activity-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-platform .platform-icon {
  font-size: 16px;
}

.activity-platform.telegram .platform-icon { color: #0088cc; }
.activity-platform.dashboard .platform-icon { color: var(--accent); }
.activity-platform.api .platform-icon { color: #6c5ce7; }

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

.activity-status {
  margin-left: auto;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.activity-status.processing {
  background: #fef7e0;
  color: #b06000;
}

.activity-status.complete {
  background: #e6f4ea;
  color: var(--success);
}

.activity-status.error {
  background: #fce8e6;
  color: var(--danger);
}

.activity-status.running {
  background: #e3f2fd;
  color: #1976d2;
}

/* Tool call activities */
.activity-item.tool_call,
.activity-item.tool_result {
  padding: 12px 24px;
  background: rgba(108, 92, 231, 0.03);
}

.activity-tool {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.tool-name {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #6c5ce7;
}

.tool-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.tool-status.running {
  background: #e3f2fd;
  color: #1976d2;
}

.tool-status.complete {
  background: #e6f4ea;
  color: var(--success);
}

.tool-args,
.tool-result {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--card-hover);
  border-radius: 6px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.tools-used {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.tools-used::before {
  content: '⚡ ';
}

.activity-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-message {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.activity-message .label {
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 40px;
}

.activity-message .content {
  color: var(--text-primary);
  word-break: break-word;
}

.activity-message.user .label {
  color: var(--accent);
}

.activity-message.zero .label {
  color: var(--success);
}

.activity-message.zero .content {
  background: var(--bg-tertiary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  flex: 1;
}

/* Scrollbar styling for activity feed */
.activity-feed::-webkit-scrollbar {
  width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.activity-feed::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.activity-feed::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
  margin-bottom: 48px;
  width: 100%;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.action-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.action-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
}

/* Projects Section */
.projects-section {
  margin-bottom: 48px;
  width: 100%;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

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

.project-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.project-type {
  font-size: 12px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-notes {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  padding-left: 20px;
  margin: 0;
}

.project-notes li {
  margin-bottom: 8px;
}

.project-notes li:last-child {
  margin-bottom: 0;
}

/* Tasks Section */
.tasks-section {
  margin-bottom: 48px;
  width: 100%;
}

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

.btn-add {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--accent-light);
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  width: 100%;
}

.task-item:hover {
  border-color: var(--accent);
}

.task-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox.checked::after {
  content: '✓';
  color: white;
  font-weight: bold;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-meta {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

.task-priority {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-priority.high {
  background: #fce8e6;
  color: var(--danger);
}

.task-priority.medium {
  background: #fef7e0;
  color: #b06000;
}

.task-priority.low {
  background: #e6f4ea;
  color: var(--success);
}

.task-delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  opacity: 0;
  flex-shrink: 0;
}

.task-item:hover .task-delete {
  opacity: 1;
}

.task-delete:hover {
  background: #fce8e6;
  color: var(--danger);
}

/* Task Manager (Agent Tasks) */
.task-manager-section {
  margin-bottom: 48px;
}

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

.task-manager-updated {
  font-size: 13px;
  color: var(--text-muted);
}

.task-filter-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  margin-bottom: 18px;
}

.task-filter-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-filter-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.task-filter-tab.active {
  background: var(--accent);
  color: #fff;
}

.task-manager-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.task-manager-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.task-manager-table th,
.task-manager-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.task-manager-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-secondary);
}

.task-manager-table tbody tr:hover {
  background: var(--bg-secondary);
}

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

.task-cell-session {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-cell-description {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.task-status-icon {
  font-size: 11px;
  line-height: 1;
}

.task-status-badge.running {
  background: #e6f4ea;
  border-color: #c8e6c9;
  color: #1f7a3f;
}

.task-status-badge.completed {
  background: #e8f0fe;
  border-color: #c6dafc;
  color: #185abc;
}

.task-status-badge.failed {
  background: #fce8e6;
  border-color: #f5c7c3;
  color: #b3261e;
}

.task-status-badge.unknown {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.task-view-log-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-view-log-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

/* Task Requester Avatar Styles */
.task-cell-requester {
  width: 140px;
}

.task-requester-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-requester-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
}

.task-requester-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.task-manager-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 28px 16px !important;
}

.task-log-modal-body {
  padding-top: 12px;
}

.task-log-content {
  margin: 0;
  white-space: pre-wrap;
  max-height: 60vh;
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-tertiary);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px 24px;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

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

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

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

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

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 24px;
    width: 100%;
  }

  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-title {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .page-title {
    font-size: 24px;
  }

  .voice-section {
    padding: 24px;
  }

  .voice-avatar {
    width: 80px;
    height: 80px;
  }

  .ring-1 { width: 100px; height: 100px; }
  .ring-2 { width: 120px; height: 120px; }
  .ring-3 { width: 140px; height: 140px; }

  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* Agents Section */
.agents-section {
  margin-bottom: 48px;
  width: 100%;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  width: 100%;
}

@media (max-width: 1200px) {
  .agents-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .agents-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.agent-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.agent-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.agent-avatar {
  position: relative;
  width: 80px;
  height: 80px;
}

.agent-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  background: var(--bg-tertiary);
}

.agent-status-indicator {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  background: var(--text-muted);
}

.agent-status-indicator.online {
  background: var(--success);
  animation: agent-pulse 2s ease-in-out infinite;
}

.agent-status-indicator.offline {
  background: var(--text-muted);
}

.agent-info {
  text-align: center;
}

.agent-emoji {
  font-size: 40px;
  margin-bottom: 12px;
}

.agent-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.agent-specialty {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2px;
}

.agent-brain {
  font-size: 11px;
  color: var(--text-muted);
}

.agent-theme {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
}

.agent-status.online {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.agent-status.offline {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.agent-status.running {
  background: #e6f4ea;
  color: var(--success);
}

.agent-status.stopped {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.agent-status.online .agent-status-dot,
.agent-status.running .agent-status-dot {
  animation: agent-pulse 2s ease-in-out infinite;
}

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

.agent-controls {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.agent-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agent-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.agent-btn.start {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.agent-btn.start:hover {
  background: #2e9348;
}

.agent-btn.stop {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.agent-btn.stop:hover {
  background: #d73527;
}

/* Projects Filter */
.projects-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* GitHub Project Card Enhancements */
.project-card.github {
  position: relative;
}

.project-card .project-visibility {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.project-card .project-visibility.public {
  background: #e6f4ea;
  color: var(--success);
}

.project-card .project-visibility.private {
  background: #fef7e0;
  color: #b06000;
}

.project-card .project-language {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.project-card .language-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.project-card .language-dot.typescript { background: #3178c6; }
.project-card .language-dot.javascript { background: #f1e05a; }
.project-card .language-dot.html { background: #e34c26; }
.project-card .language-dot.go { background: #00add8; }
.project-card .language-dot.python { background: #3572a5; }

.project-card .project-updated {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.project-card .project-link {
  margin-top: 12px;
}

.project-card .project-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.project-card .project-link a:hover {
  text-decoration: underline;
}

@media (max-width: 1400px) {
  .agents-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .agents-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tools Section */
.tools-section {
  margin-top: 24px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.tool-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.tool-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tool-status.connected {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.tool-status.disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* =====================================================
   NOTES SECTION - Printable Daily Notes
   ===================================================== */

.notes-section {
  padding: 0;
}

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

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

.note-selector {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
}

.note-selector:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-print {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-print:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.note-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  min-height: 600px;
}

.note-paper {
  background: #fffef5;
  width: 100%;
  max-width: 800px;
  min-height: 500px;
  padding: 48px;
  border-radius: 4px;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.08),
    0 4px 12px rgba(0,0,0,0.05);
  position: relative;
}

/* Lined paper effect */
.note-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 80px;
  width: 1px;
  height: 100%;
  background: rgba(255, 100, 100, 0.3);
}

.note-content {
  font-family: 'Patrick Hand', cursive;
  font-size: 22px;
  line-height: 2;
  color: #2c3e50;
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 43px,
      #e8e8e8 43px,
      #e8e8e8 44px
    );
  background-position: 0 8px;
  min-height: 400px;
}

.note-content h2,
.note-content h3 {
  font-family: 'Patrick Hand', cursive;
  font-weight: 400;
  margin: 16px 0 8px 0;
  color: #1a1a1a;
}

.note-content h2 {
  font-size: 28px;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
}

.note-content h3 {
  font-size: 24px;
  color: #2980b9;
}

.note-content p {
  margin: 0 0 0 0;
}

.note-content ul,
.note-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.note-content li {
  margin: 4px 0;
}

.note-content blockquote {
  border-left: 3px solid #3498db;
  padding-left: 16px;
  margin: 16px 0;
  font-style: italic;
  color: #34495e;
}

.note-content strong {
  color: #c0392b;
}

.note-content em {
  color: #8e44ad;
}

.note-content code {
  font-family: 'Patrick Hand', cursive;
  background: rgba(0,0,0,0.05);
  padding: 2px 6px;
  border-radius: 3px;
}

.note-content hr {
  border: none;
  border-top: 1px dashed #bdc3c7;
  margin: 24px 0;
}

.note-placeholder {
  text-align: center;
  color: #95a5a6;
  padding-top: 100px;
  font-style: italic;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
  /* Hide everything except the note */
  body * {
    visibility: hidden;
  }

  .note-paper,
  .note-paper * {
    visibility: visible;
  }

  .note-paper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    padding: 0.5in;
    box-shadow: none;
    border-radius: 0;
    background: white;
  }

  /* Remove the red margin line for printing */
  .note-paper::before {
    display: none;
  }

  .note-content {
    font-size: 18pt;
    line-height: 1.6;
    background-image: none;
  }

  .note-content h2 {
    font-size: 24pt;
    margin-top: 0;
  }

  .note-content h3 {
    font-size: 20pt;
  }

  .note-content blockquote {
    border-left-width: 2px;
    padding-left: 12px;
  }

  /* Page settings */
  @page {
    margin: 0.5in;
    size: letter portrait;
  }
}

/* =====================================================
   GALLERY & IMAGE GENERATION
   ===================================================== */

.gallery-section {
  padding: 0;
}

/* Image Generator */
.image-generator {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.image-generator h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.generator-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.generator-input {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.generator-input textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  background: var(--bg-secondary);
}

.generator-input textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-generate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-generate.loading {
  background: var(--text-muted);
}

.model-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.model-badge {
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Generation Results */
.generation-results {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.generation-results h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

.result-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.result-card.loading {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card.error {
  border: 1px solid var(--danger);
}

.result-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.result-card img:hover {
  transform: scale(1.02);
}

.result-card-info {
  padding: 12px;
}

.result-card-model {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.result-card-provider {
  font-size: 11px;
  color: var(--text-muted);
}

.result-card-error {
  padding: 16px;
  color: var(--danger);
  font-size: 13px;
}

/* Gallery Container */
.gallery-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.gallery-header h3 {
  font-size: 18px;
  margin: 0;
}

.gallery-filters {
  display: flex;
  gap: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tertiary);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.gallery-empty svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

/* Image Edit Modal */
.modal-lg {
  max-width: 900px;
}

.image-edit-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

@media (max-width: 768px) {
  .image-edit-body {
    grid-template-columns: 1fr;
  }
}

.edit-preview {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.edit-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
}

.edit-tools h4 {
  font-size: 16px;
  margin-bottom: 16px;
}

.edit-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.reimagine-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reimagine-section textarea {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  resize: none;
}

.edit-info {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.edit-info p {
  font-size: 13px;
  margin: 8px 0;
  color: var(--text-secondary);
}

.edit-info strong {
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

/* Loading spinner for images */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Toast notifications */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =====================================================
   VAULT STYLES
   ===================================================== */

.vault-view {
  padding: 24px;
  max-width: 1200px;
}

.vault-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.vault-stat {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 28px;
  text-align: center;
  flex: 1;
}

.vault-stat .stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  display: block;
}

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

.vault-add-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}

.vault-add-form h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row .input-field {
  flex: 1;
}

.form-row .key-input {
  flex: 3;
}

.btn-icon {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--border-color);
}

.vault-services,
.vault-projects {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.vault-services h3,
.vault-projects h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.service-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

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

.service-name {
  font-weight: 600;
  font-size: 15px;
  text-transform: capitalize;
}

.service-count {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

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

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.key-item:last-child {
  border-bottom: none;
}

.key-info {
  flex: 1;
}

.key-name {
  font-weight: 500;
  color: var(--text-primary);
}

.key-project {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.key-preview {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.key-actions {
  display: flex;
  gap: 6px;
}

.key-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.key-action-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.key-action-btn.danger:hover {
  background: var(--danger);
  color: white;
}

.projects-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.project-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.project-tag:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.project-tag .project-key-count {
  background: var(--bg-tertiary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}

.project-tag:hover .project-key-count {
  background: rgba(255,255,255,0.2);
}

.empty-vault {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.empty-vault svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.copy-feedback {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  animation: fadeInUp 0.3s ease;
  z-index: 1000;
}

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

/* =====================================================
   KEY SECURITY STYLES
   ===================================================== */

.key-security-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}

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

.security-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.security-header h3 svg {
  stroke: var(--accent);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.security-status-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.security-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: all 0.2s;
}

.security-card.safe {
  border-left: 4px solid var(--success);
}

.security-card.warning {
  border-left: 4px solid var(--warning);
}

.security-card.danger {
  border-left: 4px solid var(--danger);
}

.security-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.security-card.safe .security-card-icon {
  background: rgba(52, 168, 83, 0.12);
}

.security-card.safe .security-card-icon svg {
  stroke: var(--success);
}

.security-card.warning .security-card-icon {
  background: rgba(251, 188, 4, 0.12);
}

.security-card.warning .security-card-icon svg {
  stroke: var(--warning);
}

.security-card.danger .security-card-icon {
  background: rgba(234, 67, 53, 0.12);
}

.security-card.danger .security-card-icon svg {
  stroke: var(--danger);
}

.security-card-info {
  display: flex;
  flex-direction: column;
}

.security-card-count {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.security-card.safe .security-card-count {
  color: var(--success);
}

.security-card.warning .security-card-count {
  color: var(--warning);
}

.security-card.danger .security-card-count {
  color: var(--danger);
}

.security-card-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Exposed Keys Section */
.exposed-keys-section {
  background: rgba(234, 67, 53, 0.08);
  border: 1px solid rgba(234, 67, 53, 0.3);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.exposed-keys-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 8px;
}

.exposed-keys-warning {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.exposed-keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exposed-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.exposed-key-info {
  flex: 1;
}

.exposed-key-service {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-transform: capitalize;
}

.exposed-key-file {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Consolas', monospace;
  margin-top: 2px;
}

.exposed-key-preview {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--danger);
  background: rgba(234, 67, 53, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 12px;
}

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

.rotate-btn:hover {
  background: #c62828;
  transform: translateY(-1px);
}

.rotate-btn svg {
  width: 14px;
  height: 14px;
}

/* File Permissions Section */
.file-permissions-section {
  margin-bottom: 24px;
}

.file-permissions-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.file-permissions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.permission-file {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--text-primary);
  flex: 1;
}

.permission-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.permission-status.safe {
  background: rgba(52, 168, 83, 0.12);
  color: var(--success);
}

.permission-status.warning {
  background: rgba(251, 188, 4, 0.12);
  color: #b38600;
}

.permission-status.danger {
  background: rgba(234, 67, 53, 0.12);
  color: var(--danger);
}

.permission-status svg {
  width: 14px;
  height: 14px;
}

/* Rotation URLs Section */
.rotation-urls-section {
  margin-top: 20px;
}

.rotation-urls-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.rotation-urls-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.rotation-urls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.rotation-url-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.rotation-url-item:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rotation-url-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

.rotation-url-item .service-name {
  flex: 1;
  text-transform: capitalize;
}

.rotation-url-item .external-icon {
  opacity: 0.5;
}

.rotation-url-item:hover .external-icon {
  opacity: 1;
}

/* Scanning animation */
.scanning {
  position: relative;
  overflow: hidden;
}

.scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: scan 1.5s infinite;
}

@keyframes scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Spin animation for scan button */
.security-header .spin {
  animation: keySpin 1s linear infinite;
}

@keyframes keySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .security-status-cards {
    grid-template-columns: 1fr;
  }

  .rotation-urls-grid {
    grid-template-columns: 1fr;
  }

  .exposed-key-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .exposed-key-preview {
    margin-right: 0;
    margin-bottom: 8px;
  }
}

/* ===== TERMINAL STYLES ===== */
.terminal-view {
  padding: 0;
  height: calc(100vh - 100px);
}

.terminal-container {
  background: #0d1117;
  border-radius: var(--radius-md);
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #30363d;
  overflow: hidden;
}

.terminal-header {
  background: #161b22;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #30363d;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #58a6ff;
}

.terminal-icon {
  font-size: 18px;
}

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

.terminal-cwd {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: #8b949e;
  background: #0d1117;
  padding: 4px 8px;
  border-radius: 4px;
}

.terminal-btn {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.terminal-btn:hover {
  background: #30363d;
  border-color: #8b949e;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-output::-webkit-scrollbar {
  width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
  background: #0d1117;
}

.terminal-output::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

.terminal-welcome {
  color: #8b949e;
  margin-bottom: 16px;
  white-space: pre;
}

.terminal-command-line {
  margin-bottom: 8px;
}

.terminal-cmd {
  color: #58a6ff;
}

.terminal-stdout {
  color: #c9d1d9;
  margin-left: 0;
}

.terminal-stderr {
  color: #f85149;
}

.terminal-exit-code {
  color: #8b949e;
  font-size: 12px;
  opacity: 0.7;
}

.terminal-exit-code.error {
  color: #f85149;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #161b22;
  border-top: 1px solid #30363d;
  gap: 8px;
}

.terminal-prompt {
  color: #3fb950;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #c9d1d9;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  outline: none;
  caret-color: #3fb950;
}

.terminal-input::placeholder {
  color: #484f58;
}

.terminal-loading {
  display: inline-block;
  color: #f0883e;
}

.terminal-loading::after {
  content: '...';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* ===== AGENT MONITOR STYLES ===== */
.agent-monitor-view {
  padding: 24px;
}

.monitor-section {
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-header .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.section-header .section-title svg {
  color: var(--accent);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.monitor-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  min-height: 500px;
}

@media (max-width: 900px) {
  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

.monitor-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.process-count {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.processes-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.no-processes {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  height: 100%;
  min-height: 200px;
}

.no-processes svg {
  margin-bottom: 12px;
  opacity: 0.4;
}

.no-processes p {
  margin: 0 0 4px 0;
  font-weight: 500;
  color: var(--text-secondary);
}

.no-processes .hint {
  font-size: 12px;
  opacity: 0.7;
}

.process-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.process-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.process-card.active {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.process-card.running {
  border-left: 3px solid var(--success);
}

.process-card.stopped {
  border-left: 3px solid var(--text-muted);
  opacity: 0.6;
}

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

.process-name {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.process-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.process-status.running {
  background: rgba(52, 168, 83, 0.15);
  color: var(--success);
}

.process-status.stopped {
  background: rgba(154, 160, 166, 0.15);
  color: var(--text-muted);
}

.process-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.process-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.process-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.process-actions .btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
}

/* Output Panel */
.output-panel {
  display: flex;
  flex-direction: column;
}

.output-panel .panel-header {
  flex-wrap: wrap;
  gap: 12px;
}

.output-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.process-selector {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 12px;
  min-width: 180px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover:not(:disabled) {
  background: #d32f2f;
}

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

.output-terminal {
  flex: 1;
  background: #0d1117;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  color: #c9d1d9;
  overflow-y: auto;
  min-height: 400px;
}

.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #484f58;
  text-align: center;
  height: 100%;
  min-height: 300px;
  gap: 12px;
}

.output-placeholder svg {
  opacity: 0.3;
}

.output-placeholder p {
  margin: 0;
  font-size: 13px;
}

.output-terminal::-webkit-scrollbar {
  width: 8px;
}

.output-terminal::-webkit-scrollbar-track {
  background: #0d1117;
}

.output-terminal::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.output-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 1px 0;
}

.output-line.stdout {
  color: #c9d1d9;
}

.output-line.stderr {
  color: #f85149;
}

.output-line.system {
  color: #8b949e;
  font-style: italic;
}

.output-line.tool-use {
  color: #58a6ff;
}

.output-line.tool-result {
  color: #3fb950;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* System Stats Widget */
.system-stats-section {
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
}

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

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

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

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.stat-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s ease;
}

.stat-bar-fill.cpu {
  background: linear-gradient(90deg, #34a853, #fbbc04, #ea4335);
  background-size: 200% 100%;
}

.stat-bar-fill.memory {
  background: linear-gradient(90deg, #4285f4, #8e44ad);
}

.stat-bar-fill.disk {
  background: linear-gradient(90deg, #00bcd4, #009688);
}

/* Dynamic color based on usage */
.stat-bar-fill.low { background: #34a853 !important; }
.stat-bar-fill.medium { background: #fbbc04 !important; }
.stat-bar-fill.high { background: #ea4335 !important; }

.uptime-card {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.uptime-card .stat-value {
  font-size: 16px;
  color: var(--success);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Additional Tweaks */
[data-theme="dark"] .logo-img {
  filter: invert(1);
}

[data-theme="dark"] .voice-avatar img {
  filter: invert(1);
}

[data-theme="dark"] .action-card:hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
  background: var(--bg-tertiary);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .modal-content {
  background: var(--bg-primary);
}

[data-theme="dark"] .terminal-container {
  background: #0d0d0d;
}

[data-theme="dark"] .project-card,
[data-theme="dark"] .agent-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .stat-card {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

[data-theme="dark"] .activity-item {
  background: var(--bg-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .note-paper {
  background: var(--bg-primary);
}

[data-theme="dark"] ::selection {
  background: #4a90d9;
  color: #fff;
}

/* Weather Widget - Modern Card Design with AI Background */
.weather-widget {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.9) 0%, rgba(0, 242, 254, 0.85) 100%);
  border-radius: 24px;
  padding: 28px 32px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  color: #fff;
  box-shadow:
    0 8px 32px rgba(79, 172, 254, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  min-height: 200px;
}

/* AI-Generated Weather Background */
.weather-ai-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  transition: opacity 1s ease-in-out, background-image 1s ease-in-out;
  opacity: 0;
}

.weather-ai-bg.loaded {
  opacity: 1;
}

.weather-ai-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Ensure all weather content is above the background */
.weather-main,
.weather-details,
.weather-ai-insights,
.weather-forecast,
.weather-refresh {
  position: relative;
  z-index: 2;
}

/* Enhanced text shadows for readability over image */
.weather-widget.has-ai-bg .temp-value,
.weather-widget.has-ai-bg .weather-condition {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}

.weather-widget.has-ai-bg .weather-details {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 12px;
  backdrop-filter: blur(5px);
}

/* Loading state for weather background */
.weather-ai-bg.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: weatherSpin 1s linear infinite;
}

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

.weather-widget::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.weather-widget::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .weather-widget {
  background: linear-gradient(135deg, rgba(30, 60, 114, 0.95) 0%, rgba(42, 82, 152, 0.9) 100%);
  box-shadow: 
    0 8px 32px rgba(30, 60, 114, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.weather-icon {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  animation: weatherPulse 3s ease-in-out infinite;
}

@keyframes weatherPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

.weather-temp {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.temp-value {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  font-family: 'Inter', sans-serif;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: -2px;
}

.temp-unit {
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
  opacity: 0.85;
}

.weather-condition {
  font-size: 18px;
  font-weight: 600;
  opacity: 0.95;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  position: relative;
  z-index: 1;
  align-self: center;
}

.weather-detail {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  min-width: 100px;
}

.weather-detail:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 4px;
  letter-spacing: 1px;
  font-weight: 500;
}

.detail-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

@media (max-width: 768px) {
  .weather-widget {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 20px;
    border-radius: 20px;
  }

  .weather-main {
    flex-direction: column;
    gap: 12px;
    justify-content: center;
  }

  .weather-details {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
  }

  .weather-detail {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .temp-value {
    font-size: 52px;
  }

  .weather-icon {
    font-size: 56px;
  }

  .weather-condition {
    margin-top: 8px;
  }
}

/* Weather Location (small inline version) */
.weather-location-small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

.weather-location-small svg {
  opacity: 0.7;
}

/* AI Weather Insights */
.weather-ai-insights {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-insights-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 12px;
  opacity: 0.85;
}

.ai-tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.ai-tip:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(4px);
}

.ai-tip.loading {
  opacity: 0.6;
  animation: tipPulse 1.5s ease-in-out infinite;
}

@keyframes tipPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.tip-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.tip-text {
  flex: 1;
  font-weight: 500;
}

/* 5-Day Forecast */
.weather-forecast {
  grid-column: 1 / -1;
  margin-top: 16px;
}

.forecast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 12px;
  opacity: 0.85;
}

.forecast-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: inherit;
  transition: all 0.2s ease;
}

.forecast-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.forecast-toggle svg {
  display: block;
  transition: transform 0.3s ease;
}

.forecast-toggle.collapsed svg {
  transform: rotate(-90deg);
}

.forecast-days {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
  max-height: 200px;
}

.forecast-days.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.forecast-day:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.forecast-day-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 6px;
}

.forecast-day-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.forecast-day-temps {
  display: flex;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.forecast-high {
  opacity: 1;
}

.forecast-low {
  opacity: 0.6;
}

.forecast-rain {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.8;
}

.forecast-rain svg {
  width: 12px;
  height: 12px;
}

/* Weather Refresh Button */
.weather-refresh {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.weather-refresh:hover {
  background: rgba(255, 255, 255, 0.25);
  opacity: 1;
  transform: rotate(180deg);
}

.weather-refresh.loading {
  animation: spin 1s linear infinite;
  pointer-events: none;
}

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

/* Responsive weather widget adjustments */
@media (max-width: 768px) {
  .weather-ai-insights {
    padding: 12px;
  }

  .ai-tip {
    padding: 8px 10px;
    font-size: 13px;
  }

  .forecast-days {
    grid-template-columns: repeat(3, 1fr);
  }

  .forecast-day:nth-child(n+4) {
    display: none;
  }

  .weather-forecast {
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .weather-ai-insights {
    margin-top: 12px;
  }

  .ai-tips-list {
    gap: 8px;
  }

  .forecast-days {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .forecast-day {
    padding: 10px 6px;
  }

  .forecast-day-icon {
    font-size: 24px;
  }

  .forecast-day-temps {
    font-size: 12px;
  }
}

/* =====================================================
   TRAVEL ASSISTANT WIDGET
   ===================================================== */

.travel-widget {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  border-radius: 24px;
  padding: 28px 32px;
  margin-bottom: 24px;
  color: #fff;
  box-shadow:
    0 8px 32px rgba(102, 126, 234, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.travel-widget::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.travel-widget::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .travel-widget {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.95) 0%, rgba(107, 33, 168, 0.9) 100%);
  box-shadow:
    0 8px 32px rgba(67, 56, 202, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.travel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.travel-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.travel-title {
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.travel-input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.travel-input-row input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.travel-input-row input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.travel-input-row input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.travel-input-row button {
  padding: 14px 28px;
  background: #fff;
  color: #667eea;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.travel-input-row button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.travel-input-row button:active {
  transform: translateY(0);
}

.travel-input-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.travel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
}

.travel-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: travelSpin 1s linear infinite;
}

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

.travel-results {
  position: relative;
  z-index: 1;
  animation: slideIn 0.3s ease;
}

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

.travel-destination {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.travel-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.travel-stat:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.travel-route {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.route-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-step:last-child {
  border-bottom: none;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-instruction {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  padding-top: 4px;
}

.travel-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(234, 67, 53, 0.2);
  border-radius: 8px;
  font-size: 14px;
}

.error-icon {
  font-size: 20px;
}

.error-message {
  flex: 1;
}

@media (max-width: 768px) {
  .travel-widget {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .travel-input-row {
    flex-direction: column;
  }

  .travel-input-row button {
    width: 100%;
  }

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

  .travel-stat {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .stat-icon {
    margin-bottom: 0;
  }
}

/* =====================================================
   SERVER LOAD BUTTON & MODAL
   ===================================================== */

.server-load-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
  position: relative;
}

.server-load-btn:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.server-load-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
}

.load-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-primary);
  transition: background 0.3s ease;
}

.load-indicator.warning {
  background: var(--warning);
}

.load-indicator.danger {
  background: var(--danger);
  animation: pulse-danger 1s ease-in-out infinite;
}

@keyframes pulse-danger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Notification Bell */
.notification-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
  position: relative;
}

.notification-bell:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.notification-bell svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

.notification-bell.has-tasks {
  animation: bellShake 0.5s ease-in-out;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(10deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(5deg); }
}

/* Logout Button */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.logout-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  transition: all 0.3s ease;
}

.logout-btn:hover svg {
  stroke: #ef4444;
}

/* Settings Button */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
}

.settings-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.settings-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  transition: all 0.3s ease;
}

.settings-btn:hover svg {
  stroke: #3b82f6;
  transform: rotate(90deg);
}

/* Task Dropdown */
.task-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
}

.task-section {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.task-section:last-child {
  border-bottom: none;
}

.task-section h4 {
  margin: 0 0 10px 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  margin-bottom: 8px;
}

.task-item:last-child {
  margin-bottom: 0;
}

.task-item.agent-running {
  border-left: 3px solid var(--success);
}

.task-item.feature-request {
  border-left: 3px solid var(--warning);
}

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

.task-icon.spinning {
  animation: spin 1s linear infinite;
}

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

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

.task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-log-btn {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.task-log-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.no-tasks {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Log Modal */
.log-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.log-modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.log-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-primary);
}

.log-header button {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
}

.log-header button:hover {
  background: var(--danger);
  color: white;
}

.log-content {
  flex: 1;
  overflow: auto;
  padding: 20px;
  margin: 0;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Server Load Modal */
.modal-md {
  max-width: 700px;
}

.server-load-body {
  padding: 8px 0;
}

.server-load-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .server-load-grid {
    grid-template-columns: 1fr;
  }
}

.load-metric-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.load-metric-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

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

.metric-icon svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

.cpu-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.memory-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.disk-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.load-icon { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.network-icon { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.uptime-icon { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.uptime-icon svg { stroke: #333; }

.metric-details {
  flex: 1;
  min-width: 0;
}

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

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.3s ease;
}

.metric-bar-fill.cpu { background: linear-gradient(90deg, #667eea, #764ba2); }
.metric-bar-fill.memory { background: linear-gradient(90deg, #f093fb, #f5576c); }
.metric-bar-fill.disk { background: linear-gradient(90deg, #4facfe, #00f2fe); }

.metric-bar-fill.low { background: var(--success); }
.metric-bar-fill.medium { background: var(--warning); }
.metric-bar-fill.high { background: var(--danger); }

.metric-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

/* Process Summary */
.process-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.process-summary h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.process-stats {
  display: flex;
  gap: 32px;
}

.process-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.process-stat .stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.process-stat .stat-num.running {
  color: var(--success);
}

.process-stat .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Server Load Footer */
.server-load-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

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

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =====================================================
   SKILLS VIEW STYLES
   ===================================================== */

.skills-view .view-header {
  margin-bottom: 24px;
}

.skills-view .view-header h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 4px;
}

.skills-view .view-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Skills Stats */
.skills-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.skills-stat {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.skills-stat .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

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

.skills-stat.ready .stat-value {
  color: var(--success);
}

.skills-stat.missing .stat-value {
  color: var(--warning);
}

.skills-stat.custom .stat-value {
  color: #6366f1;
}

/* Skills Filter */
.skills-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.skills-filter .filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

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

.skills-filter .filter-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.skills-filter #createSkillBtn {
  margin-left: auto;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.skill-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.skill-emoji {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

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

.skill-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-source {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-triggers {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.skill-triggers .triggers-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.skill-card.slash-command {
  border-left: 3px solid var(--accent);
}

.skill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  width: fit-content;
}

.skill-status.ready {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success);
}

.skill-status.missing {
  background: rgba(251, 188, 4, 0.1);
  color: var(--warning);
}

.skill-status.custom {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.skill-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Skill Toggle Switch */
.skill-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
}

.skill-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-muted);
  transition: 0.3s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.skill-toggle input:checked + .toggle-slider {
  background-color: var(--success);
}

.skill-toggle input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.skill-toggle:hover .toggle-slider {
  opacity: 0.85;
}

/* Skill Card Footer */
.skill-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.skill-run-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--bg-primary);
  background: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.skill-card:hover .skill-run-btn {
  opacity: 1;
}

.skill-run-btn:hover:not(:disabled) {
  background: var(--accent-hover, #6366f1);
}

.skill-run-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4 !important;
}

.skill-run-btn.loading {
  opacity: 0.7;
}

.skill-view-details {
  font-size: 12px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.skill-card:hover .skill-view-details {
  opacity: 1;
}

/* Disabled Skill Card */
.skill-card.disabled {
  opacity: 0.5;
  background: var(--bg-tertiary);
}

.skill-card.disabled:hover {
  transform: none;
  box-shadow: none;
}

.skill-card.disabled .skill-view-details {
  color: var(--text-muted);
}

/* Skill Detail Modal */
.skill-detail-body {
  max-height: 60vh;
  overflow-y: auto;
}

.skill-detail-body pre {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}

/* Skill Builder Modal */
.skill-builder-body {
  padding: 0;
}

.skill-builder-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-builder-form .form-row {
  display: flex;
  gap: 12px;
}

.skill-builder-form .emoji-input {
  width: 60px;
  text-align: center;
  font-size: 20px;
}

.skill-textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 300px;
}

.skill-template-hint {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: var(--radius-sm);
}

/* Skills loading state */
.skills-loading {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
}

.skills-loading svg {
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.alert-success {
  background: rgba(52, 168, 83, 0.1);
  border: 1px solid rgba(52, 168, 83, 0.2);
  color: #34a853;
}

/* Change Password Modal */
#changePasswordModal .modal-content {
  max-width: 450px;
}

#changePasswordModal .form-group:last-of-type {
  margin-bottom: 0;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid #34a853;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  font-size: 14px;
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .skills-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .skills-filter {
    flex-wrap: wrap;
  }
  
  .skills-filter #createSkillBtn {
    margin-left: 0;
    width: 100%;
  }
}

/* =====================================================
   PROFILE PICTURE & AVATAR SETTINGS
   ===================================================== */

.settings-body {
  padding: 24px;
}

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

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.settings-section-title svg {
  color: var(--accent);
}

.settings-divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

/* Avatar Preview */
.profile-picture-container {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.avatar-preview-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid var(--border-color);
  transition: all 0.2s ease;
}

.avatar-preview-wrapper:hover {
  border-color: var(--accent);
}

.avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar-preview-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-change-hint {
  color: white;
  font-size: 13px;
  font-weight: 500;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avatar-actions .btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
}

.avatar-help-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  width: 100%;
}

/* Avatar Generation Section */
.avatar-generation-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  animation: slide-down 0.3s ease;
}

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

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

.generation-header h5 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.btn-close-generation {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-close-generation:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.style-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.style-preset {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-preset:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.style-preset.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#avatarStyleInput {
  margin-bottom: 12px;
  font-size: 14px;
}

.btn-generate-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  margin-bottom: 16px;
}

/* Generated Avatars Grid */
.generated-avatars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.generated-avatar-option {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.generated-avatar-option:hover {
  border-color: var(--accent);
}

.generated-avatar-option.selected {
  border-color: var(--success);
}

.generated-avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generated-avatar-option .select-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(52, 168, 83, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.generated-avatar-option.selected .select-overlay {
  opacity: 1;
}

.select-overlay span {
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.generation-status {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.generation-status.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 640px) {
  .profile-picture-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .generated-avatars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .avatar-actions {
    width: 100%;
    flex-direction: row;
  }
  
  .avatar-actions .btn {
    flex: 1;
  }
}
