/* Mission Control — Dark Neon Theme with Sidebar Layout */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #13111C;
  --card-bg: #1E1B28;
  --card-border: rgba(255,255,255,0.06);
  --text: #FFFFFF;
  --text-muted: #8B8B8B;
  --text-dim: #5A5A6A;
  --sidebar-bg: #0D0B14;

  --pink: #E9429D;
  --blue: #4A90E2;
  --cyan: #00D4FF;
  --gold: #D48D1D;
  --lime: #39FF14;
  --purple: #9B59B6;
  --orange: #D48D1D;
  --red: #E74C3C;

  --pink-glow: rgba(233, 66, 157, 0.35);
  --blue-glow: rgba(74, 144, 226, 0.35);
  --cyan-glow: rgba(0, 212, 255, 0.35);

  --radius: 12px;
  --radius-sm: 10px;
}

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

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

/* ===== APP SHELL ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.sidebar-logo-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  z-index: -1;
}

.sidebar-logo-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-logo-text {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-left: 48px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.nav-link.active {
  background: rgba(233, 66, 157, 0.1);
  color: var(--pink);
  border-left: 3px solid var(--pink);
  padding-left: 9px;
}

.nav-link .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link .nav-label { flex: 1; }

/* Nav Group (collapsible parent) */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.nav-group-label:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.nav-group.open .nav-group-label {
  color: var(--text);
}

.nav-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.nav-group.open .nav-chevron {
  transform: rotate(90deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
}

.nav-group.open .nav-submenu {
  display: flex;
}

.nav-sublink {
  padding: 8px 12px;
  font-size: 0.78rem;
}

.nav-sublink.active {
  background: rgba(233, 66, 157, 0.08);
  color: var(--pink);
  border-left: 2px solid var(--pink);
  padding-left: 10px;
}

/* Sidebar Server Status */
.sidebar-server {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.server-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.server-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.server-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-metric-name {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.server-metric-val {
  font-size: 0.68rem;
  font-weight: 700;
}

.server-metric-val.cpu { color: var(--pink); }
.server-metric-val.ram { color: var(--cyan); }
.server-metric-val.disk { color: var(--text-muted); }

.server-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.server-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.server-bar-fill.cpu { background: var(--pink); }
.server-bar-fill.ram { background: var(--cyan); }

.server-uptime {
  margin-top: 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Content Header */
.content-header {
  padding: 16px 28px 14px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}

.content-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.content-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
}

.content-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--lime);
}

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

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

.content-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Content Area */
.content-area {
  padding: 24px 28px;
  flex: 1;
}

/* ===== METRICS ROW (Index) ===== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  border: 1px solid var(--card-border);
  border-top: 3px solid transparent;
}

.metric-card:nth-child(1) { border-top-color: var(--pink); }
.metric-card:nth-child(2) { border-top-color: var(--blue); }
.metric-card:nth-child(3) { border-top-color: var(--cyan); }
.metric-card:nth-child(4) { border-top-color: var(--gold); }

.metric-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.metric-sub {
  font-size: 0.7rem;
  color: var(--lime);
  font-weight: 600;
}

/* ===== DATA VIZ ROW ===== */
.viz-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.viz-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--card-border);
}

.viz-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.viz-header-bar {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--gold);
}

.viz-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
  padding-top: 10px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.bar-wrap {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 32px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--gold), #A06A10);
  min-height: 6px;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.bar-score {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
}

/* Donut Chart */
.donut-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-chart {
  width: 120px;
  height: 120px;
  position: relative;
  flex-shrink: 0;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  inset: 26px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.donut-center-val {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.donut-center-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.legend-pct {
  font-size: 0.7rem;
  color: var(--text);
  font-weight: 700;
  margin-left: auto;
  padding-left: 14px;
}

/* ===== TRENDING ROW ===== */
.trending-row { margin-bottom: 20px; }

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

.section-icon { font-size: 0.95rem; }

.section-bar {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--purple);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.trending-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trending-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
}

.trending-pill:hover {
  border-color: rgba(155, 89, 182, 0.4);
  box-shadow: 0 0 10px rgba(155, 89, 182, 0.15);
}

.trend-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(155, 89, 182, 0.2);
  color: var(--purple);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== CONCEPTS ROW ===== */
.concepts-row { margin-bottom: 20px; }

.concepts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.concept-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.concept-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.concept-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
}

.concept-body { padding: 14px; }

.concept-rank-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(233, 66, 157, 0.15);
  color: var(--pink);
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.concept-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.concept-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.score-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--gold);
  flex-shrink: 0;
}

.concept-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(74, 144, 226, 0.15);
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.concept-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== TASKS PAGE ===== */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--pink), #C0357A);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 14px var(--pink-glow);
  transition: all 0.2s;
}

.btn-primary:hover {
  box-shadow: 0 0 22px var(--pink-glow), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.btn-primary svg { width: 13px; height: 13px; }

/* Task Filters */
.task-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-chip:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.filter-chip.active-todo { border-color: var(--pink); color: var(--pink); background: rgba(233,66,157,0.1); }
.filter-chip.active-inprogress { border-color: var(--blue); color: var(--blue); background: rgba(74,144,226,0.1); }
.filter-chip.active-done { border-color: var(--lime); color: var(--lime); background: rgba(57,255,20,0.08); }
.filter-chip.active-all { border-color: rgba(255,255,255,0.2); color: var(--text); background: rgba(255,255,255,0.04); }

/* Task Cards */
.task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.task-card-top {
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.task-card-top.todo { background: linear-gradient(90deg, var(--pink), transparent); }
.task-card-top.in-progress { background: linear-gradient(90deg, var(--blue), transparent); }
.task-card-top.done { background: linear-gradient(90deg, rgba(57,255,20,0.6), transparent); }

.task-card-body { padding: 14px; }

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

.task-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}

.task-card-title.done-task { text-decoration: line-through; opacity: 0.5; }

.status-badge {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.todo { background: rgba(233,66,157,0.15); color: var(--pink); }
.status-badge.in-progress { background: rgba(74,144,226,0.15); color: var(--blue); }
.status-badge.done { background: rgba(57,255,20,0.1); color: var(--lime); }

.task-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-item svg { width: 11px; height: 11px; opacity: 0.7; }

.priority-badge {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-badge.low { background: rgba(139,139,139,0.15); color: var(--text-muted); }
.priority-badge.medium { background: rgba(74,144,226,0.15); color: var(--blue); }
.priority-badge.high { background: rgba(212,141,29,0.15); color: var(--gold); }
.priority-badge.urgent { background: rgba(233,66,157,0.15); color: var(--pink); }

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

.btn-ghost {
  flex: 1;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  text-align: center;
}

.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); border-color: rgba(255,255,255,0.15); }
.btn-ghost.danger:hover { border-color: rgba(231,76,60,0.4); color: var(--red); background: rgba(231,76,60,0.08); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ===== AGENTS PAGE ===== */
.agents-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.summary-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.summary-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.summary-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.summary-sub {
  font-size: 0.72rem;
  color: var(--lime);
  font-weight: 600;
  margin-top: 2px;
}

.agents-viz-row {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  margin-bottom: 20px;
  align-items: start;
}

.agents-list-panel { min-width: 0; }

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s;
}

.legend-item:hover { background: rgba(255,255,255,0.06); }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-name {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-count {
  font-size: 0.73rem;
  color: var(--text);
  font-weight: 700;
}

.legend-pct {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.agent-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.agent-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}

.avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.1);
}

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

.agent-status-dot.active { background: var(--lime); }
.agent-status-dot.idle { background: var(--text-muted); }

.agent-info-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.agent-info-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.agent-workload-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  margin-bottom: 10px;
  gap: 1px;
}

.agent-workload-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.agent-workload-segment.todo { background: var(--pink); }
.agent-workload-segment.active { background: var(--blue); }
.agent-workload-segment.done { background: var(--lime); }

.agent-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workload-badge {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(233,66,157,0.12);
  color: var(--pink);
}

.btn-view-tasks {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(233,66,157,0.3);
  background: rgba(233,66,157,0.08);
  color: var(--pink);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-view-tasks:hover {
  background: rgba(233,66,157,0.15);
  box-shadow: 0 0 12px rgba(233,66,157,0.2);
}

.slideout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.slideout-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

.slideout-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: var(--card-bg);
  border-left: 1px solid var(--card-border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

.slideout-panel.open {
  transform: translateX(0);
}

.slideout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.slideout-header h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.slideout-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}

.slideout-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.slideout-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slideout-body::-webkit-scrollbar { width: 4px; }
.slideout-body::-webkit-scrollbar-track { background: transparent; }
.slideout-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.task-row {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: border-color 0.15s;
}

.task-row:hover { border-color: rgba(255,255,255,0.1); }

.task-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.task-row-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}

.task-row-title.done-task {
  text-decoration: line-through;
  opacity: 0.45;
}

.task-row-badges {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-row-meta .meta-item { font-size: 0.68rem; }

/* ===== CALENDAR PAGE ===== */
.calendar-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.calendar-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 20px;
}

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

.calendar-month-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.calendar-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}

.calendar-nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }

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

.calendar-day-name {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  gap: 3px;
  position: relative;
}

.calendar-day:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { background: rgba(233,66,157,0.15); color: var(--pink); }
.calendar-day.has-task::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink);
  position: absolute;
  bottom: 4px;
}

.calendar-day.has-task.done::after { background: var(--lime); }
.calendar-day.has-task.in-progress::after { background: var(--blue); }

/* Deadlines Sidebar */
.deadlines-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 20px;
}

.deadlines-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.deadline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.deadline-date {
  min-width: 36px;
  text-align: center;
}

.deadline-day {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  display: block;
  line-height: 1;
}

.deadline-month {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.deadline-info { flex: 1; }

.deadline-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  display: block;
}

.deadline-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.deadline-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.deadline-tag.todo { background: rgba(233,66,157,0.15); color: var(--pink); }
.deadline-tag.in-progress { background: rgba(74,144,226,0.15); color: var(--blue); }
.deadline-tag.done { background: rgba(57,255,20,0.1); color: var(--lime); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

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

.modal-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}

.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.modal-body { padding: 18px; }

.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.2s;
}

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

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B8B8B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

.form-select option { background: var(--card-bg); }
.form-textarea { resize: vertical; min-height: 76px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--card-border);
  justify-content: flex-end;
}

.btn-cancel {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-cancel:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.btn-save {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--pink), #C0357A);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 12px var(--pink-glow);
  transition: all 0.2s;
}

.btn-save:hover { box-shadow: 0 0 18px var(--pink-glow); transform: translateY(-1px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .calendar-container { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .viz-row { grid-template-columns: 1fr; }
  .concepts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .content-area { padding: 16px; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 1.8rem; }
  .task-cards { grid-template-columns: 1fr; }
  .agents-grid { grid-template-columns: 1fr; }
  .agents-summary-row { grid-template-columns: 1fr; }
  .agents-viz-row { grid-template-columns: 1fr; }
  .slideout-panel { width: 100%; }
}

/* Profile Slideout */
.slideout-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slideout-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.slideout-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.slideout-tab {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.slideout-tab.active {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

.slideout-tab:not(.active):hover {
  border-color: var(--pink);
  color: var(--text);
}

.profile-body {
  padding: 16px 20px !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
}

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

.profile-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
}

.profile-edit-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.profile-edit-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.profile-section-view {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.profile-section-edit textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 10px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.profile-section-edit textarea:focus {
  outline: none;
  border-color: var(--pink);
}

.profile-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-save {
  background: var(--pink);
  border: none;
  color: #fff;
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-save:hover { opacity: 0.85; }

.btn-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-cancel:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--text);
}

/* Profiles Subsection */
.profiles-subsection {
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 40px 40px;
}

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

.subsection-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.subsection-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.subsection-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  margin: 0;
}

.subsection-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0 36px;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-card:hover {
  border-color: var(--pink);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-card-emoji {
  font-size: 2rem;
  line-height: 1;
}

.profile-card-identity {
  flex: 1;
}

.profile-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.profile-card-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-card-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-card-status.active {
  background: rgba(57, 255, 20, 0.12);
  color: var(--lime);
}

.profile-card-status.idle {
  background: rgba(255, 165, 0, 0.12);
  color: #ffa500;
}

.profile-card-soul {
  margin-bottom: 14px;
}

.profile-card-soul-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-card-section {
  margin-bottom: 12px;
}

.profile-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink);
  display: block;
  margin-bottom: 6px;
}

.traits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-pill {
  font-size: 0.72rem;
  background: rgba(233, 66, 157, 0.12);
  color: var(--pink);
  border: 1px solid rgba(233, 66, 157, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.trait-pill.empty {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}

.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  font-size: 0.72rem;
  background: rgba(74, 144, 226, 0.12);
  color: var(--blue);
  border: 1px solid rgba(74, 144, 226, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.skill-tag.empty {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}

.profile-card-role-text {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.profile-card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.btn-view-profile {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-view-profile:hover {
  border-color: var(--pink);
  color: var(--pink);
}
