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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #1c2128;
  --border: #30363d;
  --border-light: #3d444d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #f0883e;
  --accent-red: #f85149;
  --accent-purple: #a371f7;
  --accent-cyan: #39d5ff;
}

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

/* Header */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.auto-refresh {
  background: var(--accent-green);
  color: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Cron Health Indicator */
.cron-health {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-right: 1rem;
}

.cron-health.healthy {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.cron-health.unhealthy {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
  animation: pulse-alert 1s infinite;
}

@keyframes pulse-alert {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.cron-health .health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  min-width: 320px;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--accent-blue);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  flex: 1;
  font-size: 0.9rem;
}

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

/* ===== LIVE STATUS PANEL ===== */
.live-status {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a2332 100%);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* WIS Mini Meter */
.wis-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wis-gauge-mini {
  position: relative;
  width: 36px;
  height: 36px;
}

.wis-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.wis-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 3;
}

.wis-ring-fill {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease, stroke 0.5s ease;
}

.wis-ring-fill.wis-low { stroke: var(--accent-green); filter: drop-shadow(0 0 3px var(--accent-green)); }
.wis-ring-fill.wis-med { stroke: #d29922; filter: drop-shadow(0 0 3px #d29922); }
.wis-ring-fill.wis-high { stroke: var(--accent-orange); filter: drop-shadow(0 0 4px var(--accent-orange)); }
.wis-ring-fill.wis-extreme { stroke: var(--accent-red); filter: drop-shadow(0 0 6px var(--accent-red)); }
.wis-ring-fill.wis-critical { stroke: var(--accent-purple); filter: drop-shadow(0 0 8px var(--accent-purple)); }

.wis-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
}

.wis-label-group {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.wis-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wis-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* DOS Mini */
.dos-mini {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(88, 166, 255, 0.08);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(88, 166, 255, 0.15);
}

.dos-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.dos-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dos-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.current-task-placeholder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.task-label {
  color: var(--text-muted);
}

.task-text {
  color: var(--text-secondary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-elapsed {
  color: var(--accent-blue);
  font-family: 'SF Mono', monospace;
  font-size: 0.75rem;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.quick-stats {
  display: flex;
  gap: 1.5rem;
}

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

.quick-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.quick-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Tabs */
.tabs {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.25rem;
  padding: 0 2rem;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  position: relative;
}

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

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-blue);
}

.tab-icon {
  font-size: 1rem;
}

.tab-badge {
  background: var(--accent-blue);
  color: var(--bg-primary);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
}

.tab-badge.hidden {
  display: none;
}

.tab-section.hidden {
  display: none;
}

/* ===== DASHBOARD TAB ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-left, .dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-badge {
  background: var(--accent-blue);
  color: var(--bg-primary);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.card-link {
  font-size: 0.75rem;
  color: var(--accent-blue);
  text-decoration: none;
}

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

.empty-state-mini {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* What's Next Queue */
.whats-next-list {
  max-height: 300px;
  overflow-y: auto;
}

.next-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.next-item:hover {
  background: var(--bg-tertiary);
}

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

.next-item.imminent {
  background: rgba(63, 185, 80, 0.08);
}

.next-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.next-countdown {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-green);
}

.next-countdown.soon {
  color: var(--accent-orange);
  animation: pulse-glow 1s infinite;
}

.next-actual {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.next-info {
  flex: 1;
}

.next-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.next-schedule {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.next-run-btn {
  padding: 0.35rem 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.next-run-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--bg-primary);
}

/* Daily Digest */
.daily-digest {
  padding: 1.25rem;
}

.digest-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.digest-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.digest-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.digest-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.digest-highlights {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.digest-highlight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.85rem;
}

.digest-highlight-icon {
  font-size: 1rem;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-action-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.qa-icon {
  font-size: 1.5rem;
}

.qa-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Action Items */
.action-items-list {
  max-height: 250px;
  overflow-y: auto;
}

.action-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

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

.priority-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}

.priority-urgent { background: var(--accent-red); color: white; }
.priority-high { background: var(--accent-orange); color: var(--bg-primary); }
.priority-medium { background: var(--accent-blue); color: var(--bg-primary); }
.priority-low { background: var(--text-secondary); color: var(--bg-primary); }

.action-item-content { flex: 1; min-width: 0; }
.action-item-title { font-weight: 600; font-size: 0.85rem; }
.action-item-desc { font-size: 0.75rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.action-item-buttons {
  display: flex;
  gap: 0.35rem;
}

.action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.action-btn:hover { background: var(--border); color: var(--text-primary); }
.action-btn-done:hover { background: var(--accent-green); border-color: var(--accent-green); color: white; }
.action-btn-dismiss:hover { background: var(--accent-red); border-color: var(--accent-red); color: white; }
.action-btn-todoist:hover { background: var(--accent-blue); border-color: var(--accent-blue); color: var(--bg-primary); }

/* Recent Activity */
.recent-activity {
  max-height: 300px;
  overflow-y: auto;
}

.recent-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.recent-icon {
  font-size: 1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

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

.recent-desc {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ===== TIMELINE TAB ===== */
.timeline-layout {
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.timeline-filter {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.timeline-filter:hover {
  background: var(--border);
  color: var(--text-primary);
}

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

.timeline-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.timeline-stats {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

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

.timeline-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.timeline-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.timeline-container {
  position: relative;
  padding-left: 30px;
}

.timeline-line {
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--border) 20%, var(--border));
}

.timeline-now-marker {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
}

.now-badge {
  background: var(--accent-red);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: block;
}

.timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
  transition: border-color 0.15s;
}

.timeline-item:hover {
  border-color: var(--border-light);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
}

.timeline-item.past::before {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

.timeline-icon {
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 10px;
  flex-shrink: 0;
}

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

.timeline-desc {
  font-size: 0.9rem;
  font-weight: 500;
}

.timeline-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.timeline-type {
  font-family: 'SF Mono', monospace;
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.timeline-tokens {
  color: var(--accent-blue);
  font-weight: 500;
}

/* ===== SESSIONS TAB ===== */
.sessions-layout {
  padding: 1.5rem 2rem;
}

.sessions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sessions-header h2 {
  font-size: 1.25rem;
}

.sessions-controls {
  display: flex;
  gap: 0.75rem;
}

.btn-primary {
  background: var(--accent-blue);
  color: var(--bg-primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.session-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
}

.session-card:hover {
  border-color: var(--accent-blue);
}

.session-card.active {
  border-color: var(--accent-green);
  background: rgba(63, 185, 80, 0.05);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.session-type {
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.session-type-main { background: var(--accent-green); color: var(--bg-primary); }
.session-type-subagent { background: var(--accent-purple); color: white; }
.session-type-cron { background: var(--accent-orange); color: var(--bg-primary); }

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

.session-status-indicator.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.session-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.session-task {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.session-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.session-stat-value {
  color: var(--text-secondary);
}

.session-detail {
  position: fixed;
  top: 0;
  right: 0;
  width: 450px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease;
}

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

.session-detail.hidden {
  display: none;
}

.session-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.close-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.session-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

/* ===== REPORTS TAB ===== */
.filters {
  background: var(--bg-secondary);
  padding: 0.75rem 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}

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

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

.filter-divider {
  width: 1px;
  background: var(--border);
  margin: 0 0.5rem;
}

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

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

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

.filter-btn-back.hidden {
  display: none;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
}

/* Meeting group sections */
.meeting-group-section {
  padding: 0 2rem;
  margin-bottom: 1.5rem;
}

.meeting-group-title {
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.meeting-group-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: normal;
}

/* Action Items Panel (Reports) */
.action-items-panel {
  padding: 1.5rem 2rem 0;
  transition: all 0.2s ease;
}

.action-items-panel.empty {
  display: none;
}

.action-items-panel .card {
  background: var(--bg-card);
}

.action-items-list {
  display: flex;
  flex-direction: column;
}

.action-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: background 0.15s ease;
}

.action-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 0.35rem;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}

.priority-urgent { color: var(--accent-red); background: var(--accent-red); }
.priority-high { color: var(--accent-orange); background: var(--accent-orange); }
.priority-normal { color: var(--accent-blue); background: var(--accent-blue); }
.priority-low { color: var(--text-muted); background: var(--text-muted); }

.action-item-body {
  flex: 1;
  min-width: 0;
}

.action-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.action-item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.action-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.action-item-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.action-item-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.action-item-btn:hover {
  background: var(--border);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.action-item-done:hover {
  background: rgba(63, 185, 80, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.4);
}

.action-item-todoist:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.4);
}

.action-item-dismiss:hover {
  background: rgba(248, 81, 73, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
  box-shadow: 0 0 8px rgba(248, 81, 73, 0.4);
}

.report-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.report-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.type-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.type-triage { background: var(--accent-red); color: white; }
.type-intel { background: var(--accent-blue); color: var(--bg-primary); }
.type-research { background: var(--accent-purple); color: white; }
.type-daily { background: var(--accent-green); color: var(--bg-primary); }
.type-weekly { background: var(--accent-orange); color: var(--bg-primary); }
.type-weather { background: #39d353; color: var(--bg-primary); }
.type-other { background: var(--text-secondary); color: var(--bg-primary); }

.report-card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.report-card .date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.report-card .summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.history-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent-blue);
  text-decoration: none;
}

.archived-card {
  opacity: 0.7;
  border-style: dashed;
}

.archived-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.3rem;
  background: var(--border);
  color: var(--text-secondary);
  border-radius: 3px;
  margin-left: 0.5rem;
}

.view-header {
  grid-column: 1 / -1;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ===== CALENDAR/SCHEDULE TAB ===== */
.schedule-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  min-height: calc(100vh - 160px);
}

.schedule-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

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

.sidebar-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.jobs-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

.jobs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.job-item {
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.25rem;
}

.job-item:hover {
  background: var(--bg-tertiary);
}

.job-item.active {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid var(--accent-blue);
}

.job-name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.job-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.job-status-dot.error {
  background: var(--accent-red);
}

.job-status-dot.running {
  background: var(--accent-blue);
  animation: pulse 1s infinite;
}

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

.job-item.running {
  border-left: 2px solid var(--accent-blue);
}

.job-schedule {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.job-countdown {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

.job-countdown.soon {
  color: var(--accent-green);
  font-weight: 600;
}

.job-countdown.past {
  color: var(--accent-orange);
  animation: pulse 1s infinite;
}

.job-item.up-next {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 8px;
}

.schedule-main {
  padding: 1.5rem;
  overflow-x: auto;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.calendar-header h3 {
  font-size: 1rem;
}

.calendar-range {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Calendar Filters */
.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.cal-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.15s;
  opacity: 0.4;
}

.cal-filter-btn.active {
  opacity: 1;
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.cal-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Calendar Grid */
.schedule-main {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible;
  position: relative;
}

.cal-time-col {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.cal-day-header {
  background: var(--bg-tertiary);
  padding: 0.4rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.cal-day-header.today {
  background: rgba(88, 166, 255, 0.12);
}

.cal-day-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-day-num {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.cal-day-num.today-num {
  background: var(--accent-blue);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-time-label {
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: right;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.cal-time-label.current-hour {
  color: var(--accent-blue);
  font-weight: 700;
}

.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 40px;
}

.cal-cell:nth-child(8n+1) { border-right: 1px solid var(--border); }
.cal-cell.today-col { background: rgba(88, 166, 255, 0.03); }
.cal-cell.current-cell { background: rgba(88, 166, 255, 0.08); }

/* Calendar Events */
.cal-event {
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 18px;
}

.cal-event:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 5;
}

.cal-event-name {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.cal-event-time {
  font-size: 0.55rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cal-event-stacked {
  padding: 1px 4px;
  min-height: 16px;
}

.cal-event-stacked .cal-event-name {
  font-size: 0.55rem;
}

/* Now Indicator */
.now-indicator {
  position: absolute;
  height: 2px;
  background: var(--accent-red);
  z-index: 20;
  pointer-events: none;
}

.now-dot {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-red);
}

.job-detail {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  z-index: 100;
  animation: slideUp 0.2s ease;
  max-height: 60vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.job-detail.hidden {
  display: none;
}

.job-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.job-detail-header h3 {
  font-size: 1rem;
}

.job-detail-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.job-detail-close {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-detail-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.job-detail-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.job-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.job-detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.job-detail-value {
  font-size: 0.9rem;
}

/* ===== SEARCH TAB ===== */
.search-page {
  padding: 1.5rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.search-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-filter {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.search-filter:hover {
  background: var(--border);
  color: var(--text-primary);
}

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

.search-results-header {
  margin-bottom: 1rem;
}

.search-results-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.search-results-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-query {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.search-group {
  margin-bottom: 1rem;
}

.search-group h3 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-group h3 span {
  background: var(--bg-tertiary);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.search-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

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

.search-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.search-snippet {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.search-snippet mark {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent-blue);
  padding: 0 0.15rem;
  border-radius: 2px;
}

/* ===== MODALS ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  overflow-y: auto;
  z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  position: relative;
  margin: 2rem 0;
}

.modal-sm {
  max-width: 500px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

#modal-body {
  padding: 1.5rem;
}

#modal-body h1 { font-size: 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
#modal-body h2 { font-size: 1.2rem; margin: 1.25rem 0 0.5rem; color: var(--accent-blue); }
#modal-body h3 { font-size: 1rem; margin: 1rem 0 0.35rem; }
#modal-body p { margin-bottom: 0.75rem; }
#modal-body ul, #modal-body ol { margin-left: 1.25rem; margin-bottom: 0.75rem; }
#modal-body li { margin-bottom: 0.35rem; }
#modal-body a { color: var(--accent-blue); text-decoration: none; }
#modal-body a:hover { text-decoration: underline; }
#modal-body blockquote { border-left: 3px solid var(--border); padding-left: 1rem; color: var(--text-secondary); margin: 0.75rem 0; }
#modal-body code { background: var(--bg-tertiary); padding: 0.15rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
#modal-body pre { background: var(--bg-tertiary); padding: 0.75rem; border-radius: 6px; overflow-x: auto; margin: 0.75rem 0; }

.modal-body-inner {
  padding: 1.5rem;
}

.modal-body-inner h2 {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

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

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-green);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-error { background: var(--accent-red); }

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

/* ===== REPLIES TAB ===== */
.replies-layout {
  padding: 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.replies-header {
  margin-bottom: 1.5rem;
}

.replies-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.replies-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reply-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.reply-to {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reply-type-badge {
  font-size: 1.25rem;
}

.reply-recipient {
  font-weight: 600;
  font-size: 1rem;
}

.reply-context {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.reply-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reply-message {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.reply-actions {
  display: flex;
  gap: 0.75rem;
}

.reply-actions .btn-primary {
  flex: 1;
}

.pending-replies-preview {
  max-height: 200px;
  overflow-y: auto;
}

.preview-reply-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

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

.preview-reply-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-reply-name {
  font-weight: 500;
  font-size: 0.85rem;
}

.preview-reply-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== MEMORY TAB ===== */
.memory-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 160px);
}

.memory-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.memory-files-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.memory-file-item {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.25rem;
  transition: background 0.15s;
}

.memory-file-item:hover {
  background: var(--bg-tertiary);
}

.memory-file-item.active {
  background: rgba(88, 166, 255, 0.15);
  border: 1px solid var(--accent-blue);
}

.memory-file-name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.memory-file-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.memory-editor {
  display: flex;
  flex-direction: column;
}

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

.editor-header h3 {
  font-size: 1rem;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.editor-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.editor-status.modified {
  color: var(--accent-orange);
}

.editor-content {
  flex: 1;
  background: var(--bg-primary);
  border: none;
  color: var(--text-primary);
  padding: 1.5rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: none;
  outline: none;
}

.editor-content:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* ===== SESSIONS TAB IMPROVEMENTS ===== */
.sessions-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  min-height: calc(100vh - 220px);
}

.sessions-list-panel {
  overflow-y: auto;
}

.transcript-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.transcript-panel.hidden {
  display: none;
}

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

.transcript-header h3 {
  font-size: 0.95rem;
}

.transcript-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.transcript-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}

.transcript-entry {
  padding: 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.transcript-entry.user {
  background: rgba(88, 166, 255, 0.1);
  border-left: 3px solid var(--accent-blue);
}

.transcript-entry.assistant {
  background: rgba(163, 113, 247, 0.1);
  border-left: 3px solid var(--accent-purple);
}

.transcript-entry.tool {
  background: rgba(240, 136, 62, 0.1);
  border-left: 3px solid var(--accent-orange);
  font-size: 0.75rem;
}

.transcript-role {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.transcript-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== JOB HISTORY ===== */
.job-history {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.job-history.hidden {
  display: none;
}

.job-history h4 {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.job-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border-radius: 6px;
  font-size: 0.8rem;
}

.history-time {
  color: var(--text-secondary);
}

.history-status {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.history-status.ok {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.history-status.error {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
}

.history-duration {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== WEATHER GLANCE (Dashboard) ===== */
.weather-glance {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
}

.wis-glance {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wis-glance-score {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.wis-glance-label, .dos-glance-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dos-glance {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dos-glance-score {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.glance-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.dos-glance-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dos-glance-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.dos-meta-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  min-width: 40px;
}

.dos-meta-value {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== WEATHER TAB ===== */
.weather-layout {
  padding: 1.5rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.weather-top {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

/* WIS Gauge */
.wis-card {
  overflow: visible;
}

.wis-gauge-container {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1.5rem 0.5rem;
}

.wis-gauge {
  position: relative;
  width: 260px;
}

.wis-gauge-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(88, 166, 255, 0.15));
}

.wis-arc-path {
  transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.wis-needle {
  transform-origin: 100px 110px;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.wis-score-display {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.wis-score-number {
  font-size: 2.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px currentColor;
  transition: color 0.5s;
}

.wis-score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wis-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* WIS Components */
.wis-components {
  padding: 1rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.wis-component {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wis-comp-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 70px;
  text-transform: capitalize;
}

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

.wis-comp-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px currentColor;
}

.wis-comp-value {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* DOS Chart */
.dos-card {
  overflow: visible;
}

.dos-chart {
  padding: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  min-height: 280px;
}

.dos-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dos-bar-wrapper {
  width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.dos-bar {
  width: 70%;
  border-radius: 6px 6px 2px 2px;
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 4px;
}

.dos-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 12px currentColor;
  opacity: 0.4;
}

.dos-bar-score {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.dos-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.dos-day.today .dos-day-name {
  color: var(--accent-blue);
  text-shadow: 0 0 8px var(--accent-blue);
}

.dos-day-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.dos-day-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.25rem;
}

.dos-meta-tag {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
}

.dos-meta-tag.video-yes { background: rgba(63,185,80,0.2); color: var(--accent-green); }
.dos-meta-tag.video-probably { background: rgba(240,136,62,0.2); color: var(--accent-orange); }
.dos-meta-tag.video-maybe { background: rgba(139,148,158,0.2); color: var(--text-secondary); }
.dos-meta-tag.live { background: rgba(248,81,73,0.2); color: var(--accent-red); }

.dos-hazard-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
}

.hazard-winter { background: rgba(57,213,255,0.2); color: var(--accent-cyan); }
.hazard-severe { background: rgba(248,81,73,0.2); color: var(--accent-red); }
.hazard-tropical { background: rgba(163,113,247,0.2); color: var(--accent-purple); }
.hazard-flood { background: rgba(88,166,255,0.2); color: var(--accent-blue); }
.hazard-none { background: rgba(110,118,129,0.15); color: var(--text-muted); }

/* ===== YOUTUBE TAB ===== */
.youtube-layout {
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Live Banner */
.yt-live-banner {
  background: linear-gradient(135deg, rgba(248,81,73,0.15), rgba(248,81,73,0.05));
  border: 1px solid rgba(248,81,73,0.4);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { border-color: rgba(248,81,73,0.4); }
  50% { border-color: rgba(248,81,73,0.8); }
}

.yt-live-banner.hidden { display: none; }

.live-pulse {
  width: 12px;
  height: 12px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-glow 1s infinite;
  box-shadow: 0 0 12px var(--accent-red);
}

.live-text {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent-red);
}

.live-title {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.live-watch-btn {
  background: var(--accent-red);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: filter 0.15s;
}

.live-watch-btn:hover { filter: brightness(1.2); }

/* Hero Stats */
.yt-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem;
}

.yt-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.yt-hero-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: 0 0 15px rgba(57,213,255,0.3);
}

.yt-hero-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* Sub Race Bars */
.yt-race-bars {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.yt-race-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.yt-race-name {
  font-size: 0.8rem;
  font-weight: 500;
  min-width: 140px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yt-race-name.rhy {
  color: var(--accent-cyan);
  font-weight: 700;
}

.yt-race-bar-bg {
  flex: 1;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.yt-race-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
}

.yt-race-bar-fill.rhy {
  background: linear-gradient(90deg, rgba(57,213,255,0.3), rgba(57,213,255,0.6));
  box-shadow: 0 0 12px rgba(57,213,255,0.3);
}

.yt-race-bar-fill.competitor {
  background: linear-gradient(90deg, rgba(139,148,158,0.2), rgba(139,148,158,0.4));
}

.yt-race-subs {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
  text-align: right;
}

/* Recent Streams */
.yt-streams-list {
  padding: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.yt-stream-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.yt-stream-item:hover { background: var(--bg-tertiary); }

.yt-stream-thumb {
  width: 120px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-tertiary);
}

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

.yt-stream-title {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.25rem;
}

.yt-stream-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
}

.yt-stream-views { color: var(--accent-cyan); font-weight: 600; }

/* Mobile */
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .weather-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }
  .schedule-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }
  .job-detail-body {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  header { padding: 0.5rem 1rem; }
  .tabs { padding: 0 1rem; overflow-x: auto; }
  .tab-label { display: none; }
  .dashboard-grid { padding: 1rem; }
  .timeline-layout { padding: 1rem; }
  .sessions-layout { padding: 1rem; }
  .reports-grid { padding: 1rem; }
  .filters { padding: 0.5rem 1rem; }
  .search-bar { min-width: auto; flex: 1; }
  .live-status { flex-direction: column; gap: 0.75rem; }
  .status-left { flex-direction: column; gap: 0.5rem; }
  .digest-stats { grid-template-columns: repeat(2, 1fr); }
  .job-detail-body { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

/* ===== AGENT SELECTOR ===== */
.agent-selector {
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}
.agent-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.agent-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.agent-tab-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.agent-tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.agent-tab-btn .agent-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.agent-status-dot.online { background: #3fb950; }
.agent-status-dot.offline { background: #f85149; }
.agent-status-dot.unknown { background: #6e7681; }

/* ===== FLEET PAGE ===== */
.fleet-layout { padding: 1.5rem; }
.fleet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.fleet-header h2 { font-size: 1.3rem; }
.fleet-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.fleet-agent-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.15s;
}
.fleet-agent-card:hover { border-color: var(--accent); }
.fleet-agent-card.offline { opacity: 0.6; }
.fleet-agent-header {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
}
.fleet-agent-emoji { font-size: 1.8rem; }
.fleet-agent-info { flex: 1; }
.fleet-agent-name { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.fleet-agent-role { font-size: 0.8rem; color: var(--text-muted); }
.fleet-agent-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.fleet-agent-badge.online { background: #3fb95020; color: #3fb950; }
.fleet-agent-badge.offline { background: #f8514920; color: #f85149; }
.fleet-agent-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.fleet-agent-stat {
  display: flex; flex-direction: column;
}
.fleet-stat-value { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.fleet-stat-label { font-size: 0.75rem; color: var(--text-muted); }

.fleet-timeline-card { margin-bottom: 1.5rem; }
.fleet-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0;
}
.fleet-timeline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 28px;
}
.fleet-timeline-hour {
  width: 50px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.fleet-timeline-bar {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: center;
  min-height: 22px;
}
.fleet-timeline-event {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  cursor: default;
}

.fleet-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fleet-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.fleet-alert.warning { background: #f0883e20; border: 1px solid #f0883e40; color: #f0883e; }
.fleet-alert.error { background: #f8514920; border: 1px solid #f8514940; color: #f85149; }

/* ===== COMPACT AGENT PILLS (v12) ===== */
.agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.agent-pill:hover { border-color: var(--accent); color: var(--text-primary); }
.agent-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.agent-pill .agent-status-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
/* Pills row: tight and horizontal */
#agent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.agent-selector { padding: 0.5rem 1.5rem 0.25rem; margin-bottom: 0; }

/* ===== FLEET HEALTH SUMMARY ===== */
.fleet-health-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
}

/* ===== CRON RUN STATS (Dashboard) ===== */
.cron-quick-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.cron-quick-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.8rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  min-width: 60px;
}
.cron-quick-stat.has-errors { background: #f8514915; border: 1px solid #f8514940; }
.cq-val { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.cq-label { font-size: 0.7rem; color: var(--text-muted); }
.cron-recent-runs { display: flex; flex-direction: column; gap: 0.25rem; }
.cron-run-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}
.cron-run-row:last-child { border-bottom: none; }
.cr-status { font-size: 0.8rem; width: 14px; flex-shrink: 0; }
.cr-status.ok { color: #3fb950; }
.cr-status.err { color: #f85149; }
.cr-name { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-time { color: var(--text-muted); font-size: 0.72rem; }
.cr-dur { color: var(--text-muted); font-size: 0.72rem; }
.cron-stats-card .card-header h3 { font-size: 0.9rem; }

/* Service Health Card */
.service-health-list { padding: 4px 0; }
.sh-summary { font-size: 12px; font-weight: 600; padding: 4px 0 8px; }
.sh-all-good { color: #3fb950; }
.sh-has-issues { color: #f0883e; }
.sh-rows { display: flex; flex-direction: column; gap: 5px; }
.sh-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sh-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sh-dot-green { background: #3fb950; }
.sh-dot-yellow { background: #d29922; }
.sh-dot-red { background: #f85149; }
.sh-name { flex: 1; color: #c9d1d9; font-family: monospace; font-size: 11px; }
.sh-age { color: #8b949e; font-size: 11px; }
.sh-pid { color: #6e7681; font-size: 10px; }
.sh-type { color: #58a6ff; font-size: 10px; border: 1px solid #1f6feb; border-radius: 3px; padding: 0 3px; }
