/* ====================================
   Content Agent System - Dark Premium Theme
   Design System + All Components
   ==================================== */

/* ---- CSS Variables (Design Tokens) ---- */
:root {
  /* Colors - Deep Navy Dark Theme */
  --bg-primary: #060a18;
  --bg-secondary: #0d1229;
  --bg-card: #111738;
  --bg-card-hover: #161d45;
  --bg-input: #0d1229;
  --bg-surface: #1a2150;

  /* Accent Gradient */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.3);

  /* Content Group Colors */
  --color-viral: #f43f5e;
  --color-story: #f59e0b;
  --color-education: #06b6d4;
  --color-proof: #10b981;
  --color-conversion: #8b5cf6;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #a5b4fc;

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Borders */
  --border: rgba(99, 102, 241, 0.12);
  --border-hover: rgba(99, 102, 241, 0.3);
  --border-active: rgba(99, 102, 241, 0.5);

  /* Glassmorphism */
  --glass-bg: rgba(17, 23, 56, 0.7);
  --glass-border: rgba(99, 102, 241, 0.15);
  --glass-blur: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Sizing */
  --sidebar-width: 260px;
  --header-height: 70px;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

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

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.logo-container {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 8px rgba(99, 102, 241, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.logo-container:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), 0 0 15px rgba(99, 102, 241, 0.45);
  border-color: rgba(99, 102, 241, 0.5);
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #f1f5f9, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 14px 6px;
  font-weight: 600;
}

.nav-section-shared {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-section-project {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  background: rgba(99, 102, 241, 0.03);
  margin-left: -10px;
  margin-right: -10px;
  padding-left: 24px;
  padding-right: 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-project-item {
  transition: opacity 0.2s ease;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
  color: var(--accent-light);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(to bottom, var(--accent), #a855f7);
  border-radius: 0 3px 3px 0;
}

.nav-item i, .nav-item .nav-emoji {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-slow);
}

/* ---- Collapsed Sidebar States ---- */
body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}
body.sidebar-collapsed .main-content {
  margin-left: 0;
}

.main-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  backdrop-filter: blur(var(--glass-blur));
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.main-body {
  flex: 1;
  padding: 28px 32px;
}

/* ---- Section Pages ---- */
.section-page {
  display: none;
  animation: fadeSlideIn 0.35s ease;
}

.section-page.active {
  display: block;
}

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

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
}

/* Glass Card */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-normal);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.pink { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* ---- Agent Cards ---- */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--agent-color, var(--accent));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.agent-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.agent-card:hover::before {
  opacity: 1;
}

.agent-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  position: relative;
}

.agent-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.agent-status.ready { background: var(--success); }
.agent-status.no-key { background: var(--warning); }
.agent-status.disabled { background: var(--text-muted); }

.agent-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.agent-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.agent-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-accent);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.agent-tag.provider {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.15);
}

/* ---- Workflow Pipeline ---- */
.workflow-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 24px 0;
  overflow-x: auto;
  margin-bottom: 24px;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  position: relative;
}

.pipeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 26px;
  right: -32px;
  width: 64px;
  height: 2px;
  background: var(--border);
}

.pipeline-step.completed:not(:last-child)::after {
  background: linear-gradient(90deg, var(--success), var(--success));
}

.pipeline-step.running:not(:last-child)::after {
  background: linear-gradient(90deg, var(--accent), var(--border));
  animation: pulseLine 1.5s infinite;
}

@keyframes pulseLine {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.pipeline-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  transition: all var(--transition-normal);
}

.pipeline-step.completed .pipeline-icon {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.pipeline-step.running .pipeline-icon {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
  animation: pulse 2s infinite;
}

.pipeline-step.failed .pipeline-icon {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.pipeline-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.pipeline-step.completed .pipeline-label { color: var(--success); }
.pipeline-step.running .pipeline-label { color: var(--accent-light); font-weight: 600; }

.pipeline-duration {
  font-size: 10px;
  color: var(--text-muted);
}

/* ---- Content Matrix Table ---- */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.matrix-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}

.matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  vertical-align: top;
}

.matrix-table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

.content-group-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.content-group-badge.viral { background: rgba(244, 63, 94, 0.15); color: var(--color-viral); }
.content-group-badge.story { background: rgba(245, 158, 11, 0.15); color: var(--color-story); }
.content-group-badge.education { background: rgba(6, 182, 212, 0.15); color: var(--color-education); }
.content-group-badge.proof { background: rgba(16, 185, 129, 0.15); color: var(--color-proof); }
.content-group-badge.conversion { background: rgba(139, 92, 246, 0.15); color: var(--color-conversion); }

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

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

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

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
}

.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-xl {
  padding: 18px 40px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Big Action Button */
.btn-action-hero {
  background: linear-gradient(135deg, var(--accent), #7c3aed, #a855f7);
  color: white;
  padding: 20px 48px;
  font-size: 17px;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-normal);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-action-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  border-radius: inherit;
}

.btn-action-hero:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.btn-action-hero:active {
  transform: translateY(0) scale(0.98);
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

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

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-surface);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  min-width: 280px;
  max-width: 420px;
}

.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast.info { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.toast.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

.empty-state i, .empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
}

/* ---- Workflow Log ---- */
.workflow-log {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.8;
}

.log-entry {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.04);
}

.log-time {
  color: var(--text-muted);
  white-space: nowrap;
}

.log-agent {
  font-weight: 600;
  min-width: 100px;
}

.log-msg {
  color: var(--text-secondary);
}

/* ---- Content Script Viewer ---- */
.script-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.script-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.script-header:hover {
  background: rgba(99, 102, 241, 0.04);
}

.script-header .day-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-right: 14px;
}

.script-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.script-body.expanded {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

.script-section {
  margin-bottom: 16px;
}

.script-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.script-section-content {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ---- Provider Cards ---- */
.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.provider-logo {
  font-size: 28px;
  margin-bottom: 12px;
}

.provider-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.provider-status {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}

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

.provider-status.not-connected {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ---- Ratio Bar Chart ---- */
.ratio-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.ratio-label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 90px;
}

.ratio-track {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.ratio-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.ratio-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
}

/* ---- Login Screen Glassmorphic Styling ---- */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
}

.login-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.15) 0%, rgba(6, 10, 24, 0.95) 70%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(17, 23, 56, 0.75);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: loginCardFadeIn 0.4s ease-out;
}

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

.login-logo {
  margin-bottom: 16px;
  filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.4));
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

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

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.login-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(13, 18, 41, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.login-field input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.login-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 12px;
  text-align: left;
}

.login-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-fast);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.login-footer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Sidebar User Info Widget */
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.user-avatar {
  font-size: 20px;
  line-height: 1;
}

.user-meta {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  color: var(--accent-light);
  font-weight: 600;
  text-transform: uppercase;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Project Selection Gateway & Rich Cards ---- */
.project-gateway-header {
  text-align: center;
  padding: 10px 0 35px 0;
}

.gateway-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.gateway-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.gateway-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

.project-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Clickable Brand Frame Card */
.project-select-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.project-select-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.25);
}

/* Card Top Cover Banner */
.project-select-cover {
  height: 90px;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 0 16px;
}

.project-select-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
}

.project-select-lang-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  z-index: 2;
}

/* Avatar Floating Ring */
.project-select-avatar-wrap {
  position: relative;
  margin-top: -36px;
  margin-left: 20px;
  z-index: 3;
  width: 72px;
  height: 72px;
}

.project-select-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  background: var(--bg-surface);
}

.project-select-avatar-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
}

.project-select-body {
  padding: 16px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-select-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.project-select-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-select-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.project-select-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 38px;
}

.project-select-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-select-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-select-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-select-meta-item {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-select-enter-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.project-select-card:hover .project-select-enter-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  transform: translateX(2px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .main-body { padding: 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .workflow-pipeline { flex-wrap: wrap; }
}

/* ---- Pill tabs ---- */
.pill-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.pill-tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  font-family: inherit;
}

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

.pill-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ---- Loading spinner ---- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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

/* ---- Workflow History Item ---- */
.workflow-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.workflow-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

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

/* ---- Knowledge Base: Category Groups & File Items ---- */
.kb-category-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.kb-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.12);
  border-radius: var(--radius-sm);
}

.kb-category-icon {
  font-size: 15px;
}

.kb-category-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kb-category-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 8px;
  border-radius: 10px;
}

.kb-category-files {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 6px;
}

.knowledge-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.knowledge-file-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.knowledge-file-item.active {
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-light);
  border-left-color: var(--accent-light);
}

.kb-file-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.kb-file-name {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

/* ---- Skills Library Card ---- */
.skill-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.skill-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.skill-card.active {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.06);
}

.skill-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

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

.skill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.skill-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-light);
  background: rgba(129, 140, 248, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skill-card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 5px 0 0 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workflow-status-dot.completed { background: var(--success); }
.workflow-status-dot.running { background: var(--accent); animation: pulse 2s infinite; }
.workflow-status-dot.failed { background: var(--danger); }
.workflow-status-dot.pending { background: var(--text-muted); }

/* ---- Section Header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Pillar tag ---- */
.pillar-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-accent);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================================
   PREMIUM AGENT EXTENSION: TABS, BRAND AUDIT, AND STORYBOARDS
   ======================================================== */

/* ---- Nested Card Tabs ---- */
.script-tabs {
  display: flex;
  gap: 4px;
  background: rgba(6, 10, 24, 0.5);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.script-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.script-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.script-tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.script-tab-panel {
  display: none;
}

.script-tab-panel.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

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

/* ---- Brand Audit Dashboard Card ---- */
.brand-audit-card {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.05), rgba(17, 23, 56, 0.8));
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 25px rgba(20, 184, 166, 0.05);
}

.brand-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(20, 184, 166, 0.15);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.brand-audit-title {
  font-size: 15px;
  font-weight: 700;
  color: #2dd4bf;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-audit-score {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.brand-audit-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.brand-audit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.brand-audit-meta-item {
  background: rgba(6, 10, 24, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(20, 184, 166, 0.08);
}

.brand-audit-meta-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #14b8a6;
  font-weight: 700;
  margin-bottom: 4px;
}

.brand-audit-meta-val {
  font-size: 12.5px;
  color: var(--text-primary);
}

/* Before/After Wording Comparison Claims */
.claims-modify-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.claim-modify-item {
  background: rgba(17, 23, 56, 0.5);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.claim-modify-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.claim-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.claim-wording {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
}

.claim-wording.original {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  text-decoration: line-through rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.claim-wording.suggested {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.1);
  font-weight: 500;
}

.claim-reason {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ---- Editor Storyboarding Timeline ---- */
.editor-storyboard-container {
  padding: 4px;
}

.editor-storyboard-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  background: rgba(6, 10, 24, 0.3);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.editor-concept-box, .editor-music-box {
  font-size: 12.5px;
}

.editor-meta-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent-light);
  font-weight: 700;
  margin-bottom: 4px;
}

.editor-meta-val {
  color: var(--text-primary);
  line-height: 1.5;
}

/* Storyboard timeline list */
.storyboard-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 16px;
  margin-left: 8px;
  border-left: 2px solid var(--border);
}

.timeline-scene {
  position: relative;
  background: rgba(6, 10, 24, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: all var(--transition-fast);
}

.timeline-scene:hover {
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.02);
}

.timeline-scene::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -23px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  transition: all var(--transition-fast);
}

.timeline-scene:hover::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.scene-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.scene-section {
  font-size: 12.5px;
  line-height: 1.5;
}

.scene-label {
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.scene-val {
  color: var(--text-secondary);
}

.scene-val strong {
  color: var(--text-primary);
}

.editor-export-box {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(244, 63, 94, 0.04);
  border: 1px solid rgba(244, 63, 94, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #fda4af;
}

/* ====================================
   Sơ đồ tổ chức phân cấp (Org Chart)
   ==================================== */
.org-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 10px;
}

.org-level {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(13, 18, 41, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  transition: all var(--transition-normal);
}

.org-level:hover {
  background: rgba(13, 18, 41, 0.6);
  border-color: rgba(99, 102, 241, 0.15);
}

.org-level-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-accent);
  margin-bottom: 16px;
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  text-transform: uppercase;
}

.org-nodes-center {
  display: flex;
  justify-content: center;
  width: 100%;
}

.org-nodes-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  width: 100%;
}

.org-connector-vertical {
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  opacity: 0.5;
}

/* Overrides theo cấp bậc */
.level-1 .agent-card {
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.25);
}

.level-1 .agent-card:hover {
  box-shadow: 0 4px 30px rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.5);
}

.level-2 {
  border-color: rgba(99, 102, 241, 0.15);
}

.level-3 {
  border-color: rgba(16, 185, 129, 0.1);
}

/* ====================================
   Projects Management Styling
   ==================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

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

.project-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f1f5f9, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-card-lang {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.project-card-lang.th {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.project-card-lang.vi {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.project-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-card-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-accent);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.project-card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
  margin-top: auto;
}

/* ====================================
   Tokyo Light (Antigravity Light Theme) Overrides
   ==================================== */
body.tokyo-light {
  /* Colors - Tokyo Light Theme */
  --bg-primary: #e1e2e7;
  --bg-secondary: #d5d6db;
  --bg-card: #e9eafd;
  --bg-card-hover: #e0e1fc;
  --bg-input: #ffffff;
  --bg-surface: #f0f1fc;

  /* Accent Gradient */
  --accent: #3760bf;
  --accent-light: #4c7df4;
  --accent-dark: #244693;
  --accent-glow: rgba(55, 96, 191, 0.15);

  /* Content Group Colors */
  --color-viral: #f52a65;
  --color-story: #8c6c3e;
  --color-education: #0f8096;
  --color-proof: #587539;
  --color-conversion: #7847c5;

  /* Text */
  --text-primary: #1f2335;
  --text-secondary: #383e56;
  --text-muted: #565f89;
  --text-accent: #3760bf;

  /* Status */
  --success: #587539;
  --warning: #8c6c3e;
  --danger: #f52a65;
  --info: #0f8096;

  /* Borders */
  --border: rgba(55, 96, 191, 0.15);
  --border-hover: rgba(55, 96, 191, 0.3);
  --border-active: rgba(55, 96, 191, 0.5);

  /* Glassmorphism */
  --glass-bg: rgba(233, 234, 253, 0.7);
  --glass-border: rgba(55, 96, 191, 0.2);
  --glass-blur: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(55, 96, 191, 0.08);
  --shadow-lg: 0 8px 40px rgba(55, 96, 191, 0.12);
  --shadow-glow: 0 0 30px rgba(55, 96, 191, 0.08);
}

/* Specific text gradient adjustments for Tokyo Light mode */
body.tokyo-light .logo-text {
  background: linear-gradient(135deg, #1f2335, #3760bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.tokyo-light .project-card-title {
  background: linear-gradient(135deg, #1f2335, #3760bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.tokyo-light .logo-sub {
  color: var(--text-muted);
}

/* Stat Icon Color Corrections for Tokyo Light */
body.tokyo-light .stat-icon.purple { background: rgba(120, 71, 197, 0.1); color: #7847c5; }
body.tokyo-light .stat-icon.blue { background: rgba(55, 96, 191, 0.1); color: #3760bf; }
body.tokyo-light .stat-icon.green { background: rgba(88, 117, 57, 0.1); color: #587539; }
body.tokyo-light .stat-icon.orange { background: rgba(140, 108, 62, 0.1); color: #8c6c3e; }
body.tokyo-light .stat-icon.pink { background: rgba(245, 42, 101, 0.1); color: #f52a65; }
body.tokyo-light .stat-icon.cyan { background: rgba(15, 128, 150, 0.1); color: #0f8096; }

/* General overrides to ensure nice aesthetics in light mode */
body.tokyo-light .card {
  box-shadow: 0 4px 12px rgba(55, 96, 191, 0.04);
}
body.tokyo-light .card:hover {
  box-shadow: var(--shadow-glow);
}
body.tokyo-light .sidebar {
  border-right: 1px solid var(--border);
}
body.tokyo-light .main-header {
  border-bottom: 1px solid var(--border);
}
body.tokyo-light .project-card-actions {
  border-top: 1px solid var(--border);
}
body.tokyo-light .nav-item:hover {
  background: rgba(55, 96, 191, 0.08);
}
body.tokyo-light .nav-item.active {
  background: linear-gradient(135deg, rgba(55, 96, 191, 0.15), rgba(120, 71, 197, 0.08));
  color: var(--accent);
}
body.tokyo-light .nav-item.active::before {
  background: linear-gradient(to bottom, var(--accent), #7847c5);
}
body.tokyo-light .workflow-log {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
body.tokyo-light .modal {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
body.tokyo-light .modal-header, 
body.tokyo-light .modal-footer {
  border-color: var(--border);
}
body.tokyo-light .modal-close {
  color: var(--text-muted);
}
body.tokyo-light .modal-close:hover {
  color: var(--text-primary);
}

/* ---- Compact Agent Card (Nested Lists) ---- */
.agent-card.compact {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  min-height: 64px !important;
  height: 64px !important;
  flex-shrink: 0 !important;
  border-radius: var(--radius-md) !important;
  background: rgba(17, 23, 56, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  transition: all var(--transition-fast) !important;
  margin-bottom: 2px !important;
}

.agent-card.compact:hover {
  background: rgba(22, 29, 69, 0.8) !important;
  border-color: var(--border-hover) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.18) !important;
}

/* Tokyo Light Theme Compact Cards Override */
body.tokyo-light .agent-card.compact {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(55, 96, 191, 0.1) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03) !important;
}

body.tokyo-light .agent-card.compact:hover {
  background: #ffffff !important;
  border-color: rgba(55, 96, 191, 0.3) !important;
  box-shadow: 0 5px 15px rgba(55, 96, 191, 0.15) !important;
}

/* Project Details Tabs styling */
.project-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.project-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.project-tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

body.tokyo-light .project-tab-btn.active {
  color: #3760bf;
  border-bottom-color: #3760bf;
}

.project-tab-content {
  display: none;
  animation: projectTabFadeIn 0.2s ease-in-out;
}

.project-tab-content.active {
  display: block;
}

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

.project-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.project-tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

body.tokyo-light .project-tool-card {
  background: #ffffff;
  border-color: rgba(55, 96, 191, 0.1);
}

body.tokyo-light .project-tool-card:hover {
  background: #f8fafc;
  border-color: rgba(55, 96, 191, 0.3);
}

/* ---- Sidebar Toggle Button ---- */
.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  outline: none;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--accent-light);
}

body.tokyo-light .sidebar-toggle-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

body.tokyo-light .sidebar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--accent);
}






/* ===== Đặt Phòng Họp: lịch cả tuần ===== */
.rb-wk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rb-wk-title { font-size: 14px; font-weight: 600; color: var(--text-primary); flex: 1 1 auto; }
.rb-wk-nav { display: flex; gap: 6px; }
.rb-wk-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.rb-wk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rb-lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.rb-lg-free { background: rgba(34, 197, 94, 0.25); border: 1px solid rgba(34, 197, 94, 0.6); }
.rb-lg-busy { background: #1d6fc2; }
.rb-lg-mine { background: #f59e0b; }
.rb-lg-sel { background: var(--accent); }
.rb-lg-past { background: rgba(148, 163, 184, 0.18); }
.rb-wk-empty { padding: 48px 0; text-align: center; color: var(--text-secondary); font-size: 13.5px; }
.rb-wk-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.rb-wk-wrap.rb-loading .rb-wk-scroll { opacity: 0.45; pointer-events: none; }
.rb-wk-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.rb-wk-days { background: var(--bg-card); border-bottom: 1px solid var(--border); }
.rb-wk-dayh { text-align: center; padding: 8px 0 7px; font-size: 12px; color: var(--text-secondary); border-left: 1px solid var(--border); line-height: 1.3; }
.rb-wk-dayh b { display: inline-block; min-width: 26px; padding: 1px 4px; font-size: 15px; font-weight: 600; color: var(--text-primary); border-radius: 13px; }
.rb-wk-dayh.rb-today b { background: var(--danger); color: #fff; }
.rb-wk-dayh.rb-seld { color: var(--accent-light); }
.rb-wk-dayh.rb-seld b { box-shadow: 0 0 0 2px var(--accent); }
.rb-wk-dayh small { display: block; font-size: 10.5px; color: var(--text-muted); }
.rb-wk-scroll { max-height: 520px; overflow-y: auto; transition: opacity .15s; }
.rb-wk-time { height: 26px; font-size: 11px; color: var(--text-muted); text-align: right; padding-right: 8px; transform: translateY(-7px); box-sizing: border-box; }
.rb-wk-col { border-left: 1px solid var(--border); }
.rb-wk-cell {
  display: block; width: 100%; height: 26px; box-sizing: border-box; padding: 0 5px; margin: 0; border: 0; border-top: 1px solid rgba(148, 163, 184, 0.08);
  font: inherit; font-size: 11px; line-height: 25px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
}
.rb-wk-cell.rb-f { background: rgba(34, 197, 94, 0.1); color: transparent; cursor: pointer; }
.rb-wk-cell.rb-f:hover { background: rgba(34, 197, 94, 0.28); color: var(--success); }
.rb-wk-cell.rb-f.rb-sel { background: var(--accent); color: #fff; cursor: pointer; }
.rb-wk-cell.rb-f.rb-pick { box-shadow: inset 0 0 0 2px var(--accent-light); }
.rb-wk-cell.rb-b { background: #1d6fc2; color: #e0f0ff; cursor: not-allowed; border-top-color: rgba(10, 30, 60, 0.5); border-radius: 3px; }
.rb-wk-cell.rb-m { background: #f59e0b; color: #3b2300; font-weight: 600; cursor: default; border-top-color: rgba(120, 53, 15, 0.45); border-radius: 3px; }
.rb-wk-cell.rb-p { background: rgba(148, 163, 184, 0.1); cursor: default; }
.rb-wk-cell.rb-x { background: repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.1) 0 6px, rgba(148, 163, 184, 0.04) 6px 12px); cursor: default; }
.rb-wk-meta { margin-top: 8px; font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.rb-wk-err { padding: 28px 12px; text-align: center; color: var(--danger); font-size: 13.5px; }

/* Nút hiện/ẩn mật khẩu (👁️ / 🙈) — bọc quanh ô <input type="password"> */
.pw-wrap { position: relative; width: 100%; }
.pw-wrap input { padding-right: 46px; }
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}
.pw-eye:hover, .pw-eye:focus-visible { opacity: 1; background: rgba(148, 163, 184, 0.15); outline: none; }
