@import url('https://fonts.googleapis.com/css2?family=Bangers&display=swap');

/* Zero Dashboard - Comic Book Edition */

:root {
  --bg-primary: #FFF8E7;
  --bg-secondary: #FFF3D4;
  --bg-tertiary: #FFE8B0;
  --text-primary: #1a1a1a;
  --text-secondary: #444444;
  --text-muted: #888888;
  --border-color: #1a1a1a;
  --accent: #D32F2F;
  --accent-light: #FF5252;
  --success: #2E7D32;
  --warning: #F9A825;
  --danger: #C62828;
  --shadow-sm: 2px 2px 0px rgba(0,0,0,0.15);
  --shadow-md: 4px 4px 0px rgba(0,0,0,0.2);
  --shadow-lg: 6px 6px 0px rgba(0,0,0,0.25);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --ink-border: 3px solid #1a1a1a;
  --panel-shadow: 4px 4px 0px #1a1a1a;
  --comic-blue: #1565C0;
  --comic-purple: #6A1B9A;
  --comic-yellow: #F9A825;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16162a;
  --bg-tertiary: #252545;
  --text-primary: #f5f5f5;
  --text-secondary: #b0b0b0;
  --text-muted: #757575;
  --border-color: #444;
  --accent: #FF5252;
  --accent-light: #FF8A80;
  --shadow-sm: 2px 2px 0px rgba(0,0,0,0.4);
  --shadow-md: 4px 4px 0px rgba(0,0,0,0.5);
  --shadow-lg: 6px 6px 0px rgba(0,0,0,0.6);
  --ink-border: 3px solid #444;
  --panel-shadow: 4px 4px 0px #000;
  --comic-blue: #42A5F5;
  --comic-purple: #CE93D8;
  --comic-yellow: #FFD54F;
}

/* 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: var(--ink-border);
  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: 1.5px;
  font-family: 'Bangers', cursive;
}

.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;
  font-weight: 700;
  box-shadow: var(--panel-shadow);
}

.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;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.header-left {
  flex: 0 0 auto;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  line-height: 1.2;
  font-family: 'Bangers', cursive;
  white-space: nowrap;
}

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

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
  width: 100%;
  text-align: left;
  flex-shrink: 0;
  margin-left: 0;
}

.header-right .theme-toggle,
.header-right .server-load-btn {
  margin-right: 0;
}

.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: 24px;
  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: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

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

.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: 280px;
  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: 6px 12px;
  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: 6px;
  margin-bottom: 2px;
}

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

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

.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: 11px;
  color: var(--text-muted);
}

.activity-status {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  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: 4px 12px;
  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: 11px;
  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: 4px;
  padding: 4px 8px;
  background: var(--card-hover);
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

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

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

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

.activity-message {
  display: flex;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.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: 6px 10px;
  border-radius: var(--radius-md);
  flex: 1;
}

/* System event activity items - compact single-line display */
.activity-item.user_login,
.activity-item.login_failed,
.activity-item.user_logout,
.activity-item.agent_task_created,
.activity-item.agent_task_completed,
.activity-item.personal_task_created,
.activity-item.personal_task_toggled,
.activity-item.bills_updated,
.activity-item.payment_received,
.activity-item.skill_executed {
  padding: 4px 12px;
}
.activity-item.user_login .activity-meta,
.activity-item.login_failed .activity-meta,
.activity-item.user_logout .activity-meta {
  margin-bottom: 0;
}
.activity-event {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
}

.activity-event .event-message {
  color: var(--text-primary);
  flex: 1;
}

.activity-event .event-agent {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* 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: 1.5px;
  font-family: 'Bangers', cursive;
}

.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: var(--ink-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s ease;
  box-shadow: var(--panel-shadow);
}

.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;
  font-family: 'Bangers', cursive;
  letter-spacing: 1.5px;
}

.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-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.tasks-filter-group {
  display: flex;
  align-items: center;
}

.tasks-filter-search {
  flex: 1 1 240px;
  min-width: 200px;
}

.tasks-filter-group input,
.tasks-filter-group select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.tasks-filter-group input:focus,
.tasks-filter-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

#taskFiltersClear.btn {
  height: 36px;
  font-size: 12px;
  padding: 0 14px;
}

.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-agent-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.task-agent-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #1a1a1a;
  background: #222;
}

.task-agent-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
}

.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);
}

/* 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;
  border: var(--ink-border);
  box-shadow: 8px 8px 0px rgba(0,0,0,0.3);
}

.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;
  font-family: 'Bangers', cursive;
  letter-spacing: 1.5px;
}

.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: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.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);
}

/* Export Modal */
.export-summary {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.export-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.export-quality {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid #1a1a1a;
  background: var(--bg-secondary);
}

.export-quality-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
}

.export-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-chip {
  border: 2px solid #1a1a1a;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.export-chip:hover {
  background: var(--border-color);
}

.export-chip.active {
  background: var(--accent);
  color: #fff;
}

.export-lossless {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border-color);
  background: var(--bg-tertiary);
}

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

.export-quality-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* 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;
}

.team-card {
  cursor: pointer;
}

.team-card:hover {
  background: var(--bg-tertiary);
}

.team-card:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

.team-agent-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--border-color);
}

.team-agent-avatar {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  border: 3px solid #1a1a1a;
  object-fit: cover;
  background: var(--bg-tertiary);
  box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
}

.team-agent-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-agent-name {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 1.5px;
}

.team-agent-role {
  font-size: 13px;
  color: var(--text-secondary);
}

.team-agent-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.team-agent-details {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.team-agent-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  font-size: 12px;
}

.team-agent-detail-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}

.team-agent-detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

.team-agent-section {
  margin-top: 14px;
}

.team-agent-section-title {
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.team-agent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-agent-tag {
  padding: 4px 10px;
  border: 2px solid var(--border-color);
  border-radius: 999px;
  font-size: 11px;
  background: var(--bg-secondary);
  font-family: 'Patrick Hand', cursive;
}

.team-agent-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.team-agent-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.team-agent-metric {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.1);
}

.team-agent-metric-value {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 1px;
}

.team-agent-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.team-agent-metric.tone-blue .team-agent-metric-value {
  color: var(--comic-blue);
}

.team-agent-metric.tone-success .team-agent-metric-value {
  color: var(--success);
}

.team-agent-metric.tone-accent .team-agent-metric-value {
  color: var(--accent);
}

.team-agent-metric.tone-gold .team-agent-metric-value {
  color: var(--comic-yellow);
}

@media (max-width: 640px) {
  .team-agent-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-agent-metrics {
    grid-template-columns: 1fr;
  }
}

.team-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.team-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a1a1a;
  background: var(--bg-tertiary);
  display: block;
}

.team-avatar-name {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, -100%);
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  z-index: 3;
}

.team-avatar:hover .team-avatar-name,
.team-avatar:focus-within .team-avatar-name {
  opacity: 1;
  transform: translate(-50%, -120%);
}

.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;
}

/* Gallery Hover Overlay */
.gallery-item {
  position: relative;
  overflow: hidden;
}

.gallery-item .hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  pointer-events: none;
}

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

.gallery-btn {
  font-family: 'Bangers', cursive;
  font-size: 14px;
  padding: 6px 12px;
  border: 2px solid #1a1a2e; /* Ink border */
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 110px;
  transition: transform 0.1s;
  box-shadow: 3px 3px 0px #1a1a2e;
}

.gallery-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px #1a1a2e;
}

.gallery-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0px #1a1a2e;
}

.btn-download { background: #1565C0; color: white; }
.btn-remove-bg { background: #F9A825; color: #1a1a2e; }
.btn-reimagine { background: #FFF8E7; color: #1a1a2e; }
.btn-favorite { background: #FFD54F; color: #1a1a2e; }
.btn-delete { background: #D32F2F; color: white; }

/* Reimagine Input styling */
.reimagine-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  padding: 10px;
  background: #FFF8E7;
  border: 2px solid #1a1a2e;
  border-radius: 6px;
  box-shadow: 4px 4px 0px #1a1a2e;
}

.reimagine-input {
  width: 100%;
  padding: 6px;
  font-family: 'Inter', sans-serif;
  border: 2px solid #1a1a2e;
  border-radius: 4px;
  font-size: 13px;
}

.reimagine-actions {
  display: flex;
  gap: 5px;
}

.btn-reimagine-go {
  background: #2E7D32;
  color: white;
  flex: 1;
}

.btn-reimagine-cancel {
  background: #757575;
  color: white;
  flex: 1;
}

/* 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: var(--ink-border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.2s ease;
  box-shadow: var(--panel-shadow);
}

.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;
}

.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); }
}

/* =====================================================
   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);
  }
}

/* ===== 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;
}

.system-stats-status {
  margin: 6px 0 16px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  min-height: 16px;
}

.system-stats-status.error {
  color: #d32f2f;
}

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

.stat-card {
  background: var(--bg-primary);
  border: var(--ink-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
  box-shadow: var(--panel-shadow);
}

.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);
  font-family: 'Bangers', cursive;
  letter-spacing: 1.5px;
}

.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"] .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 */
.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);
}

.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;
  }
}

/* =====================================================
   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; }
}

/* 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); }
}

/* 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%;
  }
}

/* ============================================
   COMIC BOOK THEME ADDITIONS
   ============================================ */

.comic-panel {
  border: var(--ink-border);
  box-shadow: var(--panel-shadow);
  background-image: radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 4px 4px;
  position: relative;
  transition: all 0.3s ease;
}

.comic-panel:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0px #1a1a1a;
  background-position: 2px 2px;
  background-image: radial-gradient(circle, rgba(0,0,0,0.1) 1px, transparent 1px);
}

.comic-burst {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--warning);
  color: #1a1a1a;
  font-family: 'Bangers', cursive;
  font-size: 14px;
  padding: 8px 16px;
  border: 2px solid #1a1a1a;
  transform: rotate(-3deg);
  box-shadow: 2px 2px 0px #1a1a1a;
}

.speech-bubble {
  position: relative;
  background: var(--bg-primary);
  border: 3px solid #1a1a1a;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--panel-shadow);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 30px;
  border-width: 15px 10px 0;
  border-style: solid;
  border-color: #1a1a1a transparent transparent;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 32px;
  border-width: 12px 8px 0;
  border-style: solid;
  border-color: var(--bg-primary) transparent transparent;
  z-index: 1;
}

.comic-title {
  font-family: 'Bangers', cursive;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.halftone-bg {
  background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 4px 4px;
}

.action-text {
  font-family: 'Bangers', cursive;
  color: var(--accent);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Comic scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); border-left: 2px solid var(--border-color); }
::-webkit-scrollbar-thumb { background: var(--accent); border: 2px solid #1a1a1a; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }

/* Skills HUD (restored after Pixel nuked it) */
.skills-hud {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

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

.skill-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skill-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border: 2px solid #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.3s ease;
}

.agent-level-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--comic-yellow);
  color: #1a1a1a;
  font-family: 'Bangers', cursive;
  font-size: 10px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a1a1a;
  border-radius: 2px;
  z-index: 2;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

/* Agent card XP bar */
.agent-xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.agent-xp-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}
.agent-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--comic-yellow), #F9A825);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.agent-xp-label {
  font-family: 'Bangers', cursive;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--comic-yellow);
  white-space: nowrap;
}

/* Agent card footer stats */
.agent-card-footer {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  justify-content: space-between;
}
.agent-stat {
  font-family: 'Bangers', cursive;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.agent-stat-val {
  color: var(--comic-blue);
  margin-right: 2px;
}
.agent-stat-xp .agent-stat-val {
  color: var(--comic-yellow);
}

/* Agent Action Shot Cards */
.agent-action-shot {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.agent-action-shot > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.agent-action-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-action-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.agent-action-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}
.agent-action-info {
  flex: 1;
  min-width: 0;
}
.agent-action-name {
  font-family: 'Bangers', cursive;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
}
.agent-action-role {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}
.agent-action-overlay .agent-level-badge {
  position: static;
  flex-shrink: 0;
}
.team-card:has(.agent-action-shot) {
  padding: 0;
  overflow: hidden;
}
.team-card:has(.agent-action-shot) .agent-card-footer {
  padding: 6px 12px 8px;
  margin-top: 0;
}

/* Agent detail modal - full skills breakdown */
.agent-skills-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.agent-skill-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-skill-info {
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.agent-skill-name {
  font-family: 'Bangers', cursive;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}
.agent-skill-level {
  font-family: 'Bangers', cursive;
  font-size: 10px;
  color: var(--comic-yellow);
  background: rgba(249, 168, 37, 0.15);
  padding: 1px 4px;
  border-radius: 2px;
  border: 1px solid var(--comic-yellow);
}
.agent-skill-bar-full {
  flex: 1;
  height: 10px;
  background: var(--bg-tertiary);
  border: 2px solid #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}
.agent-skill-progress-full {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.4s ease;
}
.agent-skill-xp {
  font-family: 'Bangers', cursive;
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 55px;
  text-align: right;
}

/* XP Manage button */
.xp-manage-btn {
  background: var(--comic-yellow);
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  font-family: 'Bangers', cursive;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 4px 12px;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  transition: transform 0.1s;
}
.xp-manage-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px rgba(0,0,0,0.3);
}

/* XP Dialog overlay */
.xp-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.xp-dialog {
  width: 380px;
  max-width: 90vw;
  padding: 20px;
  background: var(--bg-primary);
}
.xp-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}
.xp-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xp-field label {
  font-family: 'Bangers', cursive;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}
.xp-select {
  width: 100%;
  padding: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 2px;
  font-family: inherit;
  font-size: 13px;
}
.xp-amount-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.xp-preset-btn {
  padding: 6px 10px;
  border: 2px solid #1a1a1a;
  border-radius: 2px;
  font-family: 'Bangers', cursive;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.15);
}
.xp-preset-btn.xp-deduct {
  background: #D32F2F;
  color: white;
}
.xp-preset-btn.xp-award {
  background: #4caf50;
  color: white;
}
.xp-input {
  width: 70px;
  padding: 6px 8px;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 2px;
  font-family: 'Bangers', cursive;
  font-size: 14px;
}
.xp-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.xp-btn {
  padding: 8px 20px;
  border: 2px solid #1a1a1a;
  border-radius: 2px;
  font-family: 'Bangers', cursive;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}
.xp-btn-cancel {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.xp-btn-apply {
  background: var(--accent);
  color: white;
}

/* Card hover pop effect */
.stat-card:hover,
.project-card:hover,
.task-card:hover,
.tool-card:hover {
  transform: translateY(-3px) rotate(-0.5deg);
  box-shadow: 6px 6px 0px #1a1a1a;
  transition: all 0.15s ease;
}

/* Voice Picker Styles */
.voice-card {
  transition: all 0.15s ease;
}
.voice-card:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0px #1a1a1a;
}
#voiceGrid::-webkit-scrollbar {
  width: 6px;
}
#voiceGrid::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}
#voiceGrid::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
#voiceGrid::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =====================================================
   MEDIA CENTER & LIGHTBOX STYLES
   ===================================================== */

/* Media Tabs */
.media-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-tab:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.05);
}

.media-tab.active {
  background: var(--bg-primary);
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

[data-theme="dark"] .media-tab:hover {
  background: rgba(255,255,255,0.1);
}

/* Character Studio */
.character-studio-panel {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  box-shadow: 6px 6px 0px var(--border-color);
  border-radius: 12px;
}

.char-preview {
  position: relative;
}

.char-preview::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: -10px;
  bottom: -10px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  z-index: 0;
  pointer-events: none;
}

.char-preview > div {
  position: relative;
  z-index: 1;
}

/* Character Studio Multi-Select */
.char-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.char-select-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}

.char-select-card img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  object-fit: cover;
  flex-shrink: 0;
}

.char-select-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.char-select-name {
  font-size: 12px;
}

.char-select-role {
  font-size: 10px;
  color: var(--text-secondary);
}

.char-check {
  margin-left: auto;
  font-size: 14px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.char-select-card.selected {
  border-color: var(--accent);
  background: rgba(211,47,47,0.12);
  box-shadow: 3px 3px 0px rgba(211,47,47,0.15);
}

.char-select-card.selected .char-check {
  opacity: 1;
}

.char-select-card:hover {
  transform: translateY(-1px);
}

.char-select-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
}

#charPreviewImage.multi {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
  align-items: stretch;
  justify-items: stretch;
}

#charPreviewImage.multi img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

#charPreviewImage.single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Masonry Grid */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 200px;
  gap: 16px;
}

/* Lightbox Overlay */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: white;
  background: rgba(255,255,255,0.1);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev { left: 30px; }
.lightbox-nav.next { right: 30px; }

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 32px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-info-panel {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 12px 24px;
  border-radius: 30px;
  color: white;
  text-align: center;
  max-width: 80%;
  opacity: 0;
  transition: opacity 0.3s;
}

.lightbox-content:hover .lightbox-info-panel {
  opacity: 1;
}

.lb-details h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
}

.lb-details p {
  margin: 4px 0;
  font-size: 13px;
  color: #ddd;
  max-width: 600px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  margin-top: 4px;
}

.lightbox-toolbar {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px;
  border-radius: 16px;
  display: flex;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.lb-tool-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.lb-tool-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-3px);
}

.lb-tool-btn.active {
  color: #FFD700; /* Gold for favorite */
}

.lb-tool-btn.active svg {
  fill: #FFD700;
}

.lb-tool-btn.delete:hover {
  background: rgba(211, 47, 47, 0.4);
  color: #ffcdd2;
}

.lb-tool-btn svg {
  width: 20px;
  height: 20px;
}

.lb-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.2);
  align-self: center;
  margin: 0 4px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Select Mode Styling */
.gallery-item.selecting {
  transform: scale(0.95);
  opacity: 0.7;
}

.gallery-item.selected {
  transform: scale(0.95);
  opacity: 1;
  outline: 3px solid var(--accent);
  box-shadow: 0 0 15px var(--accent);
}

.select-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.5);
  border: 2px solid white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.gallery-item:hover .select-overlay,
.gallery-item.selected .select-overlay {
  display: flex;
}

.gallery-item.selected .select-overlay {
  background: var(--accent);
  border-color: var(--accent);
}

.gallery-item.selected .select-overlay::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 14px;
}

/* Details Badges on Image Hover */
.img-badge-tl {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  font-size: 10px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.img-badge-tr {
  position: absolute;
  top: 8px;
  right: 8px;
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.gallery-item:hover .img-badge-tl,
.gallery-item:hover .img-badge-tr {
  opacity: 1;
}

/* =============================================
   SHOPPING LIST - Comic Book Edition
   ============================================= */

.shopping-section {
  max-width: 800px;
  margin: 0 auto;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--ink-border, #1a1a1a);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink-border, #1a1a1a);
  transition: all 0.2s ease;
}

.shopping-item:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 var(--ink-border, #1a1a1a);
}

.shopping-item.purchased {
  opacity: 0.5;
  border-color: var(--border-color);
  box-shadow: 2px 2px 0 var(--border-color);
}

.shopping-item.purchased .shopping-item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shopping-item-check {
  cursor: pointer;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shopping-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.shopping-item-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.shopping-item-icon-spinner {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 1s linear infinite;
}

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

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

.shopping-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.shopping-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.shopping-category-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  font-family: 'Bangers', cursive;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid var(--border-color);
}

.shopping-category-badge.produce { background: #4CAF50; color: #fff; border-color: #388E3C; }
.shopping-category-badge.dairy { background: #42A5F5; color: #fff; border-color: #1E88E5; }
.shopping-category-badge.meat { background: #EF5350; color: #fff; border-color: #D32F2F; }
.shopping-category-badge.bakery { background: #FFB74D; color: #1a1a1a; border-color: #FF9800; }
.shopping-category-badge.frozen { background: #80DEEA; color: #1a1a1a; border-color: #4DD0E1; }
.shopping-category-badge.drinks { background: #BA68C8; color: #fff; border-color: #9C27B0; }
.shopping-category-badge.snacks { background: #FFD54F; color: #1a1a1a; border-color: #FFC107; }
.shopping-category-badge.household { background: #78909C; color: #fff; border-color: #546E7A; }
.shopping-category-badge.personal { background: #F48FB1; color: #1a1a1a; border-color: #EC407A; }
.shopping-category-badge.other { background: var(--bg-tertiary); color: var(--text-secondary); }

.shopping-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.shopping-item-actions button {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.shopping-item-actions button:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

.shopping-item-actions button.delete-btn {
  color: var(--danger);
}

.shopping-item-actions button.delete-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.shopping-filters .filter-btn.active {
  background: var(--comic-blue, #1565C0);
  color: #fff;
  border-color: var(--comic-blue, #1565C0);
}

.shopping-purchased-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
}

.shopping-purchased-divider::before,
.shopping-purchased-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* =============================================
   CRON JOBS - Scheduled Tasks
   ============================================= */

.cron-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 3px solid var(--border-color);
}

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

.cron-header h3 {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--comic-yellow);
  margin: 0;
}

.cron-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cron-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'Patrick Hand', cursive;
  cursor: pointer;
  transition: all 0.2s;
}

.cron-filter-btn:hover {
  border-color: var(--comic-yellow);
  color: var(--comic-yellow);
}

.cron-filter-btn.active {
  background: var(--comic-yellow);
  color: #1a1a1a;
  border-color: var(--comic-yellow);
  font-weight: bold;
}

.cron-jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.cron-job-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cron-job-card:hover {
  border-color: var(--comic-blue);
  box-shadow: 3px 3px 0px rgba(0,0,0,0.3);
}

.cron-job-card.disabled {
  opacity: 0.5;
}

.cron-job-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.cron-job-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cron-job-icon.notifications { background: rgba(213, 47, 47, 0.2); }
.cron-job-icon.maintenance { background: rgba(21, 101, 192, 0.2); }
.cron-job-icon.monitoring { background: rgba(249, 168, 37, 0.2); }
.cron-job-icon.research { background: rgba(46, 125, 50, 0.2); }
.cron-job-icon.content { background: rgba(156, 39, 176, 0.2); }
.cron-job-icon.other { background: rgba(128, 128, 128, 0.2); }

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

.cron-job-name {
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cron-job-schedule {
  font-size: 11px;
  color: var(--comic-yellow);
  font-family: 'Patrick Hand', cursive;
  font-weight: bold;
}

.cron-job-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.cron-job-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cron-job-category {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
}

.cron-job-category.notifications { background: rgba(213, 47, 47, 0.15); color: #ef5350; }
.cron-job-category.maintenance { background: rgba(21, 101, 192, 0.15); color: #42a5f5; }
.cron-job-category.monitoring { background: rgba(249, 168, 37, 0.15); color: #ffca28; }
.cron-job-category.research { background: rgba(46, 125, 50, 0.15); color: #66bb6a; }
.cron-job-category.content { background: rgba(156, 39, 176, 0.15); color: #ab47bc; }
.cron-job-category.other { background: rgba(128, 128, 128, 0.15); color: #999; }

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

.cron-job-actions button {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.cron-job-actions button:hover {
  border-color: var(--comic-blue);
  color: var(--comic-blue);
}

.cron-job-actions button.delete-btn:hover {
  border-color: var(--comic-red);
  color: var(--comic-red);
}

.cron-job-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
}

.cron-job-toggle label {
  cursor: pointer;
}

.cron-job-toggle .toggle-slider {
  width: 34px;
  height: 18px;
  background: #444;
  border-radius: 9px;
  display: inline-block;
  position: relative;
  transition: background 0.2s;
}

.cron-job-toggle .toggle-slider::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #888;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}

.cron-job-toggle input:checked + .toggle-slider {
  background: var(--comic-blue);
}

.cron-job-toggle input:checked + .toggle-slider::after {
  transform: translateX(16px);
  background: white;
}

.cron-job-toggle input {
  display: none;
}

.cron-source-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === TASK DETAIL MODAL === */
.task-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}
.task-detail-overlay.visible, .task-detail-overlay.active { display: flex; }

.task-detail-modal {
  background: var(--bg-primary, #1a1a2e);
  border: 3px solid var(--border-color, #2a2a4a);
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: taskDetailIn 0.25s ease;
}

@keyframes taskDetailIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.task-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border-color, #2a2a4a);
}

.task-detail-agent {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--task-agent-color, #8b5cf6);
  object-fit: cover;
}

.task-detail-agent-name {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--task-agent-color, #8b5cf6);
}

.task-detail-status-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 2px;
}

.task-detail-close {
  background: none;
  border: none;
  color: var(--text-secondary, #888);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.task-detail-close:hover { color: #fff; }

.task-detail-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.task-detail-section {
  margin-bottom: 16px;
}

.task-detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted, #666);
  margin-bottom: 6px;
}

.task-detail-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary, #e0e0e0);
  white-space: pre-wrap;
  word-break: break-word;
}

.task-detail-error {
  font-size: 13px;
  line-height: 1.5;
  color: #EF5350;
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.3);
  border-radius: 8px;
  padding: 12px;
}

.task-detail-log {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #aaa);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color, #2a2a4a);
  border-radius: 8px;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

.task-detail-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted, #666);
  margin-top: 12px;
}

.task-detail-actions {
  padding: 16px 20px;
  border-top: 2px solid var(--border-color, #2a2a4a);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.task-detail-rerun {
  background: #8b5cf6;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-family: 'Bangers', cursive;
  font-size: 16px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}
.task-detail-rerun:hover { background: #7c3aed; transform: translateY(-1px); }
.task-detail-rerun:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* === AGENT POPUP NOTIFICATION === */
.agent-popup-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 260px;
  background: #1a1a2e;
  border: 2px solid var(--popup-color, #8b5cf6);
  border-radius: 20px;
  padding: 24px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 9999;
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.agent-popup-container.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  cursor: pointer;
}

.agent-popup-container.dismissing {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

.agent-popup-glow {
  position: absolute;
  top: -40px;
  left: -40px;
  right: -40px;
  bottom: -40px;
  border-radius: 50%;
  pointer-events: none;
  animation: popupGlowPulse 2s ease-in-out infinite;
}

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

.agent-popup-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--popup-color, #8b5cf6);
  box-shadow: 0 0 20px var(--popup-color, #8b5cf6), 0 0 40px color-mix(in srgb, var(--popup-color, #8b5cf6) 40%, transparent);
  overflow: hidden;
  margin-bottom: 10px;
  animation: avatarEntrance 0.5s ease 0.1s both;
}

@keyframes avatarEntrance {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.agent-popup-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-popup-name {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  color: var(--popup-color, #8b5cf6);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.agent-popup-msg {
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
}

.agent-popup-wave {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 20px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.agent-popup-wave.active { opacity: 1; }

.agent-popup-wave span {
  display: block;
  width: 4px;
  height: 6px;
  background: var(--popup-color, #8b5cf6);
  border-radius: 2px;
}

.agent-popup-wave.active span {
  animation: waveBar 0.8s ease-in-out infinite;
}

.agent-popup-wave span:nth-child(1) { animation-delay: 0s; }
.agent-popup-wave span:nth-child(2) { animation-delay: 0.1s; }
.agent-popup-wave span:nth-child(3) { animation-delay: 0.2s; }
.agent-popup-wave span:nth-child(4) { animation-delay: 0.3s; }
.agent-popup-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveBar {
  0%, 100% { height: 6px; }
  50% { height: 18px; }
}

/* ============================================================
   MEMORY DASHBOARD
   ============================================================ */

/* Memory View */
.memory-view {
  max-width: 1200px;
}

.memory-header {
  margin-bottom: 28px;
}

.memory-title-row {
  margin-bottom: 14px;
}

.memory-title {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  margin: 0;
}

.memory-title svg {
  stroke: var(--comic-purple);
}

.memory-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border: var(--ink-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.memory-search-bar svg {
  stroke: var(--text-muted);
  flex-shrink: 0;
}

.memory-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
}

.memory-search-bar input::placeholder {
  color: var(--text-muted);
}

/* Stats Row */
.memory-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.memory-stat-card {
  background: var(--bg-primary);
  border: var(--ink-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--panel-shadow);
}

.memory-stat-value {
  font-family: 'Bangers', cursive;
  font-size: 32px;
  letter-spacing: 2px;
  color: var(--comic-purple);
  line-height: 1;
}

.memory-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* Tabs */
.memory-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: var(--ink-border);
  padding-bottom: 0;
}

.memory-tab {
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 1.5px;
  padding: 10px 22px;
  background: var(--bg-tertiary);
  border: var(--ink-border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
  bottom: -2px;
}

.memory-tab:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.memory-tab.active {
  background: var(--bg-primary);
  color: var(--comic-purple);
  border-bottom-color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

/* Tab Content */
.memory-tab-content {
  background: var(--bg-primary);
  border: var(--ink-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 20px;
  min-height: 300px;
}

/* Platform Filters */
.memory-platform-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.platform-filter-btn {
  font-family: 'Bangers', cursive;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.platform-filter-btn.active {
  background: var(--comic-purple);
  color: #fff;
  border-color: var(--comic-purple);
}

/* Timeline */
.memory-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 300px);
  min-height: 500px;
  overflow-y: auto;
  padding-right: 6px;
}

.timeline-entry {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: visible;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timeline-entry:hover {
  transform: translateX(4px);
  box-shadow: var(--panel-shadow);
}

.timeline-platform-stripe {
  width: 7px;
  flex-shrink: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.timeline-content {
  padding: 20px 24px;
  flex: 1;
  min-width: 0;
}

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

.platform-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-agent {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.timeline-type-badge {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-type-badge.type-message { background: #E3F2FD; color: #1565C0; }
.timeline-type-badge.type-task_complete { background: #E8F5E9; color: #2E7D32; }
.timeline-type-badge.type-task_dispatch { background: #FFF3E0; color: #E65100; }
.timeline-type-badge.type-task_failed { background: #FFEBEE; color: #C62828; }
.timeline-type-badge.type-decision { background: #F3E5F5; color: #6A1B9A; }
.timeline-type-badge.type-session { background: #E0F7FA; color: #00695C; }

[data-theme="dark"] .timeline-type-badge.type-message { background: #1a2d44; color: #64B5F6; }
[data-theme="dark"] .timeline-type-badge.type-task_complete { background: #1a3324; color: #66BB6A; }
[data-theme="dark"] .timeline-type-badge.type-task_dispatch { background: #332a1a; color: #FFB74D; }
[data-theme="dark"] .timeline-type-badge.type-task_failed { background: #331a1a; color: #EF5350; }
[data-theme="dark"] .timeline-type-badge.type-decision { background: #2a1a33; color: #CE93D8; }
[data-theme="dark"] .timeline-type-badge.type-session { background: #1a332e; color: #4DB6AC; }

.timeline-time {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.timeline-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-word;
}

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

.topic-card {
  background: var(--bg-secondary);
  border: var(--ink-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.topic-card:hover {
  box-shadow: var(--panel-shadow);
}

.topic-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.topic-card-header:hover {
  background: var(--bg-tertiary);
}

.topic-icon {
  font-size: 24px;
  flex-shrink: 0;
}

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

.topic-title {
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

.topic-chevron {
  transition: transform 0.2s ease;
  stroke: var(--text-muted);
}

.topic-card.expanded .topic-chevron {
  transform: rotate(180deg);
}

.topic-content {
  padding: 0 16px 16px;
  border-top: 2px dashed var(--border-color);
  margin-top: 0;
}

.topic-content pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  margin: 12px 0 0;
}

/* Decisions */
.memory-decision-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.decision-tag-filter {
  font-family: 'Bangers', cursive;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 4px 12px;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.decision-tag-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.memory-decisions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.decision-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border-left: 5px solid var(--comic-purple);
}

.decision-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.5;
}

.decision-reason {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
}

.decision-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.decision-by {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.decision-tags {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.decision-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--comic-purple);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Active State */
.active-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.active-state-card {
  background: var(--bg-secondary);
  border: var(--ink-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.active-state-card.blockers {
  border-color: var(--danger);
  border-left: 5px solid var(--danger);
}

.active-state-card.session-card {
  grid-column: 1 / -1;
}

.active-state-heading {
  font-family: 'Bangers', cursive;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--comic-purple);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.active-state-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.active-state-list li {
  font-size: 13px;
  color: var(--text-primary);
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
  line-height: 1.5;
}

.active-state-list li:last-child {
  border-bottom: none;
}

.active-state-list li::before {
  content: '>';
  font-family: 'JetBrains Mono', monospace;
  color: var(--comic-purple);
  margin-right: 8px;
  font-weight: 700;
}

.memory-empty-item::before {
  content: '-' !important;
  color: var(--text-muted) !important;
}

.session-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.session-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.session-platform {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

.session-built {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.active-state-footer {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 16px;
  font-style: italic;
}

/* Shared Memory Utilities */
.memory-loading {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
}

.memory-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
}

.memory-highlight {
  background: var(--comic-yellow);
  color: #1a1a1a;
  padding: 0 2px;
  border-radius: 2px;
}

/* Screenshot Zone */
.screenshot-zone {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 8px;
}
.screenshot-zone:hover,
.screenshot-zone.dragover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 99,102,241), 0.08);
}
.screenshot-zone-text {
  color: var(--text-secondary);
  font-size: 13px;
}
.screenshot-zone.has-screenshot .screenshot-zone-text {
  display: none;
}
.screenshot-preview {
  position: relative;
  display: inline-block;
}
.screenshot-preview img {
  max-height: 150px;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.screenshot-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger, #ef4444);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.screenshot-remove:hover {
  background: #dc2626;
}
.screenshot-status {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  min-height: 16px;
}
.screenshot-status.analyzing {
  color: var(--accent);
}
.screenshot-status.done {
  color: var(--success, #22c55e);
}
.screenshot-status.error {
  color: var(--danger, #ef4444);
}

/* Responsive */
@media (max-width: 768px) {
  .memory-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .memory-tabs {
    flex-wrap: wrap;
  }
  .memory-topics-grid {
    grid-template-columns: 1fr;
  }
  .active-state-grid {
    grid-template-columns: 1fr;
  }
}
