/* ============================================
   HOMITSKI LABS — Command Center v3
   Purple brand, mission control aesthetic
   Connected systems, AI co-pilot
   ============================================ */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --bg-input: #0f1729;
  --border: #2a3550;
  --border-light: #354160;
  --accent: #8B5CF6;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --accent-hover: #a78bfa;
  --accent-dim: #6D28D9;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-cyan: #0099ff;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: all 0.2s ease;
}

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

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

/* ===== AUTH ===== */
#auth-screen {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(ellipse at center, #1a1040 0%, #0a0e17 70%);
}
.auth-container {
  text-align: center; padding: 3rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 400px; margin: 1rem;
}
.auth-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: 4px; color: var(--accent); margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; letter-spacing: 1px; }
.pin-input {
  width: 100%; padding: 1rem; font-size: 1.5rem; text-align: center; letter-spacing: 12px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); outline: none; transition: var(--transition);
}
.pin-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.pin-input::placeholder { letter-spacing: 4px; font-size: 1rem; }
.auth-btn {
  width: 100%; padding: 0.9rem; margin-top: 1.2rem; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: var(--transition); letter-spacing: 1px;
}
.auth-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.auth-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.8rem; min-height: 1.2rem; }

/* ===== DASHBOARD ===== */
#dashboard { display: none; min-height: 100vh; }

/* ===== TOP NAV ===== */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 2rem; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 1rem; }
.nav-logo { font-size: 1.1rem; font-weight: 800; letter-spacing: 3px; color: var(--accent); }
.nav-phase-badge {
  padding: 0.25rem 0.7rem; background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: 20px; font-size: 0.72rem; font-weight: 600; color: var(--accent);
}
.nav-right { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.nav-date { color: var(--text-secondary); font-size: 0.82rem; }
.nav-xp {
  display: flex; align-items: center; gap: 0.4rem; color: var(--accent-amber);
  font-weight: 700; font-size: 0.85rem;
}
.nav-streak { display: flex; align-items: center; gap: 0.3rem; color: var(--accent-amber); font-weight: 600; font-size: 0.85rem; }
.nav-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 0.35rem 0.7rem; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.78rem; transition: var(--transition);
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ===== TABS ===== */
.tab-nav {
  display: flex; gap: 0; padding: 0 2rem; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.tab-btn {
  padding: 0.8rem 1.2rem; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-muted);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; padding: 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }
.tab-panel.active { display: block; }

/* ===== SUB-TABS ===== */
.sub-tab-nav { display: flex; gap: 0.4rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.sub-tab-btn {
  padding: 0.45rem 1rem; border: 1px solid var(--border); background: none;
  color: var(--text-secondary); border-radius: 20px; font-size: 0.8rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.sub-tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.sub-tab-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.card-badge { font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 12px; font-weight: 600; }
.badge-green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-purple { background: var(--accent-glow); color: var(--accent); }
.badge-amber { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--accent-red); }

/* ===== GRIDS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ===== STATS ===== */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; text-align: center;
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 0.2rem; }

/* ===== HERO BRIEFING ===== */
.hero-briefing {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.5rem 2rem; margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(139,92,246,0.08) 0%, rgba(59,130,246,0.06) 50%, rgba(16,185,129,0.04) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.hero-briefing::before {
  content: ''; position: absolute; top: -50%; right: -10%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-left { flex: 1; }
.greeting { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.2rem; letter-spacing: -0.5px; }
.greeting-sub { color: var(--text-muted); font-size: 0.88rem; font-style: italic; }
.hero-stats { display: flex; gap: 1.5rem; }
.hero-stat { text-align: center; min-width: 70px; }
.hero-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.hero-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 0.15rem; }

/* Priority + XP Row */
.grid-priority-xp { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.card-priority { margin-bottom: 0; padding: 1.2rem 1.5rem; }
.card-xp { margin-bottom: 0; padding: 1.2rem 1.5rem; }
.xp-inline { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }

.priority-input {
  width: 100%; padding: 0.7rem 1rem; background: var(--bg-input); border: 2px solid var(--accent-dim);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 1.05rem;
  font-weight: 600; outline: none; transition: var(--transition);
}
.priority-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.priority-input::placeholder { color: var(--text-muted); font-weight: 400; }

/* XP Bar */
.xp-bar-container { margin: 1rem 0; }
.xp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.xp-level { font-weight: 700; color: var(--accent); font-size: 0.82rem; }
.xp-progress { font-size: 0.75rem; color: var(--text-muted); }
.xp-bar { height: 6px; background: var(--border); border-radius: 8px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-hover)); border-radius: 8px; transition: width 0.5s ease; }

/* Glass card effect */
.card-glass {
  background: linear-gradient(135deg, rgba(139,92,246,0.04) 0%, var(--bg-card) 100%);
  border-color: rgba(139,92,246,0.2);
}

/* Title icons */
.title-icon { margin-right: 0.3rem; }

/* ===== SMART ACTIONS ===== */
.suggestion {
  padding: 0.8rem 1rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 0.6rem; font-size: 0.85rem;
  color: var(--text-secondary); transition: var(--transition);
}
.suggestion:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
.suggestion-icon { font-size: 1.1rem; flex-shrink: 0; }
.suggestion-action {
  margin-left: auto; background: var(--accent); border: none;
  color: #fff; padding: 0.3rem 0.7rem; border-radius: 4px;
  font-size: 0.72rem; cursor: pointer; transition: var(--transition); font-weight: 600; flex-shrink: 0;
}
.suggestion-action:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ===== PIPELINE HEALTH ===== */
.pipeline-health-row {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.pipeline-health-row:last-child { border-bottom: none; }
.pipeline-health-label { font-size: 0.78rem; font-weight: 600; width: 50px; text-transform: uppercase; letter-spacing: 0.5px; }
.pipeline-health-bar { flex: 1; height: 20px; background: var(--border); border-radius: 4px; overflow: hidden; display: flex; }
.pipeline-health-seg {
  height: 100%; transition: width 0.5s ease; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.9);
}
.pipeline-health-count { font-size: 0.75rem; font-weight: 700; min-width: 28px; text-align: right; }

/* ===== ACTIVITY FEED ===== */
.activity-feed-item {
  display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0;
  border-bottom: 1px solid var(--border); font-size: 0.78rem;
}
.activity-feed-item:last-child { border-bottom: none; }
.activity-feed-icon { font-size: 0.9rem; flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border-radius: 50%; }
.activity-feed-text { flex: 1; color: var(--text-secondary); line-height: 1.4; }
.activity-feed-text strong { color: var(--text-primary); }
.activity-feed-time { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }

/* ===== TIMELINE ===== */
.timeline { display: flex; gap: 0; margin: 1rem 0; }
.timeline-phase {
  flex: 1; padding: 1rem; background: var(--bg-input); border: 1px solid var(--border);
  position: relative; transition: var(--transition);
}
.timeline-phase:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.timeline-phase:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.timeline-phase.current { background: var(--accent-glow); border-color: var(--accent); }
.timeline-phase.completed { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); }
.timeline-phase-num { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.2rem; }
.timeline-phase-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.15rem; }
.timeline-phase-sub { font-size: 0.75rem; color: var(--text-muted); }
.timeline-phase.current .timeline-phase-title { color: var(--accent); }
.phase-progress { height: 3px; background: var(--border); border-radius: 3px; margin-top: 0.6rem; overflow: hidden; }
.phase-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }

/* ===== BUTTONS ===== */
.btn {
  padding: 0.6rem 1.1rem; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 0.82rem;
  cursor: pointer; transition: var(--transition);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: none; }
.btn-green { background: var(--accent-green); }
.btn-green:hover { background: #34d399; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #f87171; }

/* ===== TASKS ===== */
.task-categories { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.task-cat-btn {
  padding: 0.35rem 0.8rem; border: 1px solid var(--border); background: none;
  color: var(--text-secondary); border-radius: 20px; font-size: 0.75rem;
  cursor: pointer; transition: var(--transition);
}
.task-cat-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

.task-input-row { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; align-items: center; }
.task-input {
  flex: 1; padding: 0.6rem 0.8rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem; outline: none;
  transition: var(--transition);
}
.task-input:focus { border-color: var(--accent); }
.task-select {
  padding: 0.6rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.82rem; outline: none; cursor: pointer;
}
.task-list { list-style: none; }
.task-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem;
  border-bottom: 1px solid var(--border); transition: var(--transition);
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg-card-hover); }
.task-checkbox {
  width: 20px; height: 20px; border: 2px solid var(--border-light); border-radius: 50%;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.task-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.task-checkbox.checked::after { content: '\2713'; color: #fff; font-size: 0.7rem; font-weight: 800; }
.task-text { flex: 1; font-size: 0.88rem; }
.task-text.completed { text-decoration: line-through; color: var(--text-muted); }
.task-tag { font-size: 0.66rem; padding: 0.12rem 0.45rem; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.tag-outreach { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.tag-delivery { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.tag-learning { background: rgba(139,92,246,0.15); color: var(--accent); }
.tag-personal { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.tag-admin { background: rgba(100,116,139,0.15); color: var(--text-secondary); }
.tag-recurring { background: rgba(0,153,255,0.15); color: var(--accent-cyan); }
.tag-ai { background: rgba(139,92,246,0.25); color: var(--accent-hover); }
.tag-auto { background: rgba(245,158,11,0.2); color: var(--accent-amber); }
.task-meta { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.task-delete {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1rem; opacity: 0; transition: var(--transition); padding: 0.2rem;
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--danger); }
.task-progress { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.task-progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.task-progress-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.3s ease; }
.task-progress-text { font-size: 0.82rem; font-weight: 600; color: var(--accent); min-width: 36px; text-align: right; }

/* ===== KANBAN ===== */
.kanban-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.8rem; min-height: 350px; }
.kanban-column { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; min-height: 250px; }
.kanban-column-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.8rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--border);
}
.kanban-column-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); }
.kanban-count { font-size: 0.68rem; background: var(--border); color: var(--text-secondary); padding: 0.1rem 0.45rem; border-radius: 10px; }
.kanban-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.75rem; margin-bottom: 0.5rem; transition: var(--transition);
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.kanban-card.stale-warning { border-left: 3px solid var(--warning); }
.kanban-card.stale-danger { border-left: 3px solid var(--danger); }
.kanban-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }
.kanban-card-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.15rem; flex: 1; }
.kanban-card-score {
  font-size: 0.62rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 8px;
  min-width: 26px; text-align: center; flex-shrink: 0;
}
.score-high { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.score-mid { background: rgba(245,158,11,0.2); color: var(--accent-amber); }
.score-low { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.kanban-card-owner { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.kanban-card-phone { font-size: 0.72rem; color: var(--accent-cyan); margin-bottom: 0.15rem; }
.kanban-card-phone a { color: var(--accent-cyan); text-decoration: none; }
.kanban-card-note { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-date { font-size: 0.65rem; color: var(--text-muted); }
.kanban-card-actions { display: flex; gap: 0.2rem; }
.kanban-card-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.82rem; padding: 0.15rem; transition: var(--transition);
}
.kanban-card-btn:hover { color: var(--accent); }
.kanban-card-btn.delete-card:hover { color: var(--danger); }
.kanban-cards { max-height: 500px; overflow-y: auto; }

/* Bulk action bar */
.bulk-bar {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem;
  background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); margin-bottom: 1rem; flex-wrap: wrap;
}
.bulk-count { font-weight: 700; color: var(--accent); font-size: 0.85rem; }
.kanban-card-cb {
  width: 16px; height: 16px; border: 2px solid var(--border-light);
  border-radius: 3px; cursor: pointer; flex-shrink: 0; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.kanban-card-cb.checked { background: var(--accent); border-color: var(--accent); }
.kanban-card-cb.checked::after { content: '\2713'; color: #fff; font-size: 0.6rem; font-weight: 800; }

/* Locked overlay */
.kanban-locked-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10,14,23,0.85); border-radius: var(--radius); z-index: 10;
}
.kanban-locked-text { text-align: center; color: var(--text-muted); }
.kanban-locked-text h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

/* ===== OUTREACH TEMPLATES ===== */
.template-card {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem; margin-bottom: 0.8rem; position: relative;
}
.template-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.template-label { font-weight: 600; font-size: 0.9rem; }
.template-type { font-size: 0.68rem; padding: 0.12rem 0.5rem; border-radius: 10px; font-weight: 600; }
.type-sms { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.type-email { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.type-pitch { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.template-body {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.7;
  white-space: pre-wrap; padding: 0.8rem; background: var(--bg-primary);
  border-radius: 4px; margin-bottom: 0.5rem; max-height: 200px; overflow-y: auto;
}
.template-body .placeholder { color: var(--accent); font-weight: 600; }
.copy-btn {
  background: var(--accent); color: #fff; border: none; padding: 0.35rem 0.8rem;
  border-radius: 4px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.copy-btn:hover { background: var(--accent-hover); }
.copy-btn.copied { background: var(--accent-green); }

/* ===== FUNNEL ===== */
.funnel { display: flex; flex-direction: column; gap: 0; margin: 1rem 0; }
.funnel-stage { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem; }
.funnel-bar-wrap { flex: 1; }
.funnel-bar { height: 32px; border-radius: 4px; display: flex; align-items: center; padding: 0 0.8rem; transition: width 0.5s ease; }
.funnel-bar-label { font-size: 0.78rem; font-weight: 600; color: #fff; z-index: 1; }
.funnel-stage-name { width: 80px; font-size: 0.78rem; color: var(--text-secondary); text-align: right; flex-shrink: 0; }
.funnel-stage-count { width: 40px; font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.funnel-stage-rate { font-size: 0.72rem; color: var(--text-muted); width: 60px; }

/* ===== REVENUE ===== */
.metric-row { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.metric-row:last-child { border-bottom: none; }
.metric-label { color: var(--text-secondary); font-size: 0.82rem; }
.metric-value { font-weight: 700; font-size: 0.95rem; }
.bar-chart { display: flex; align-items: flex-end; gap: 0.4rem; height: 160px; padding: 0.8rem 0; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 45px; background: var(--accent); border-radius: 4px 4px 0 0; transition: height 0.5s ease; min-height: 2px; }
.bar-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.3rem; }
.bar-value { font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 0.2rem; font-weight: 600; }

/* ===== BOOKS ===== */
.book-list { list-style: none; }
.book-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; border-bottom: 1px solid var(--border); transition: var(--transition); }
.book-item:last-child { border-bottom: none; }
.book-item:hover { background: var(--bg-card-hover); }
.book-checkbox {
  width: 22px; height: 22px; border: 2px solid var(--border-light); border-radius: 4px;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.book-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.book-checkbox.checked::after { content: '\2713'; color: #fff; font-size: 0.75rem; font-weight: 800; }
.book-info { flex: 1; }
.book-title { font-weight: 600; font-size: 0.92rem; }
.book-title.completed { text-decoration: line-through; color: var(--text-muted); }
.book-author { font-size: 0.75rem; color: var(--text-muted); }
.book-why { font-size: 0.75rem; color: var(--accent); font-style: italic; }

/* ===== SKILLS ===== */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.skill-item { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; }
.skill-name { font-weight: 600; font-size: 0.82rem; margin-bottom: 0.4rem; }
.skill-bar { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.skill-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.skill-level { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.3rem; display: flex; justify-content: space-between; align-items: center; }

/* ===== COUNTERS ===== */
.dev-counter {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 0.6rem;
}
.dev-counter-label { flex: 1; font-size: 0.85rem; }
.dev-counter-value { font-size: 1.4rem; font-weight: 800; color: var(--accent); min-width: 36px; text-align: center; }
.dev-counter-btns { display: flex; gap: 0.2rem; }
.dev-counter-btn {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  width: 26px; height: 26px; border-radius: 4px; cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.dev-counter-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== NOTES / JOURNAL ===== */
.notes-textarea {
  width: 100%; min-height: 150px; padding: 0.8rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 0.85rem; line-height: 1.7; outline: none; resize: vertical;
  transition: var(--transition);
}
.notes-textarea:focus { border-color: var(--accent); }

.journal-entry { padding: 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.journal-entry-date { font-size: 0.72rem; color: var(--accent); font-weight: 600; margin-bottom: 0.3rem; }
.journal-entry-text { color: var(--text-secondary); white-space: pre-wrap; }

/* ===== STRATEGY ===== */
.strat-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.strat-table th { text-align: left; padding: 0.6rem; border-bottom: 2px solid var(--accent); color: var(--accent); }
.strat-table td { padding: 0.6rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.strat-table tr:last-child td { border-bottom: none; }
.strat-metric { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.strat-metric:last-child { border-bottom: none; }
.strat-metric-label { font-size: 0.82rem; color: var(--text-secondary); }
.strat-metric-value { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.strat-metric-bar { flex: 1; margin: 0 1rem; height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.strat-metric-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.5s ease; }
.strat-phase { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.8rem; }
.strat-phase.active { border-color: var(--accent); background: var(--accent-glow); }
.strat-phase-num { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.strat-phase-title { font-weight: 700; font-size: 0.95rem; margin: 0.2rem 0; }
.strat-phase.active .strat-phase-title { color: var(--accent); }
.strat-phase-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }
.strat-section-title { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin: 1rem 0 0.5rem; }
.strat-list { padding-left: 1.2rem; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.8; }

/* ===== AI CHAT PANEL ===== */
.ai-chat-toggle {
  position: fixed; bottom: 2rem; right: 2rem; width: 50px; height: 50px;
  border-radius: 50%; background: var(--accent); color: #fff; border: none;
  font-weight: 800; font-size: 0.85rem; cursor: pointer; z-index: 200;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4); transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.ai-chat-toggle:hover { transform: scale(1.1); background: var(--accent-hover); }

.ai-chat-panel {
  position: fixed; top: 0; right: -420px; width: 400px; height: 100vh;
  background: var(--bg-secondary); border-left: 1px solid var(--border);
  z-index: 300; display: flex; flex-direction: column; transition: right 0.3s ease;
}
.ai-chat-panel.open { right: 0; }

.ai-chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
}
.ai-chat-title { font-weight: 700; color: var(--accent); font-size: 0.95rem; }
.ai-chat-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }
.ai-chat-close:hover { color: var(--text-primary); }

.ai-chat-messages { flex: 1; overflow-y: auto; padding: 1rem; }
.ai-msg { margin-bottom: 1rem; padding: 0.8rem; border-radius: var(--radius-sm); font-size: 0.85rem; line-height: 1.6; white-space: pre-wrap; }
.ai-msg.user { background: var(--accent-glow); border: 1px solid var(--accent); margin-left: 2rem; }
.ai-msg.assistant { background: var(--bg-card); border: 1px solid var(--border); margin-right: 2rem; }
.ai-msg.system { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.3); color: var(--accent-green); font-size: 0.78rem; text-align: center; }
.ai-msg.loading { color: var(--text-muted); font-style: italic; }

.ai-chat-input-area { padding: 0.8rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; align-items: flex-end; }
.ai-chat-input {
  flex: 1; padding: 0.6rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit;
  font-size: 0.85rem; resize: none; outline: none; max-height: 120px;
}
.ai-chat-input:focus { border-color: var(--accent); }

/* Activity timeline */
.activity-timeline { max-height: 200px; overflow-y: auto; margin-top: 0.8rem; }
.activity-entry { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.activity-entry:last-child { border-bottom: none; }
.activity-type-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 0.1rem; }
.activity-info { flex: 1; }
.activity-date { color: var(--text-muted); font-size: 0.68rem; }
.activity-summary { color: var(--text-secondary); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; width: 90%; max-width: 500px; box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.modal-field { margin-bottom: 0.8rem; }
.modal-field label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-field input, .modal-field textarea, .modal-field select {
  width: 100%; padding: 0.6rem; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem; outline: none;
}
.modal-field textarea { min-height: 60px; resize: vertical; font-family: inherit; }
.modal-field input:focus, .modal-field textarea:focus { border-color: var(--accent); }
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .top-nav { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .tab-nav { padding: 0 0.5rem; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
  .tab-btn { padding: 0.6rem 0.8rem; font-size: 0.75rem; scroll-snap-align: start; white-space: nowrap; }
  .tab-panel { padding: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-priority-xp { grid-template-columns: 1fr; }
  .hero-briefing { flex-direction: column; gap: 1rem; padding: 1.2rem; }
  .hero-stats { gap: 1rem; flex-wrap: wrap; }
  .kanban-board { grid-template-columns: 1fr; }
  .timeline { flex-direction: column; }
  .timeline-phase:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .timeline-phase:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .nav-date { display: none; }
  .ai-chat-panel { width: 100%; right: -100%; }
  .card { padding: 0.8rem; }
  .card-header { margin-bottom: 0.4rem; }
  /* Smart Actions mobile */
  .suggestion { padding: 0.6rem 0.75rem; }
  .suggestion-top { flex-wrap: wrap; }
  .suggestion-text { font-size: 0.82rem; }
  .suggestion-desc { padding-left: 1.4rem; font-size: 0.75rem; }
  .suggestion-action { margin-left: 0; margin-top: 0.3rem; width: 100%; text-align: center; padding: 0.4rem; }
  /* Tasks mobile */
  .task-item { flex-direction: column; align-items: flex-start; gap: 0.3rem; padding: 0.6rem 0.5rem; }
  .task-row { width: 100%; }
  .task-text { font-size: 0.84rem; }
  .task-description { padding-left: 1.4rem; margin-left: 0.5rem; font-size: 0.75rem; }
  .task-meta { font-size: 0.62rem; }
  .task-delete { opacity: 0.5; }
  .task-cal-btn { opacity: 0.7; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .task-input-row { flex-direction: column; }
  .modal-row { grid-template-columns: 1fr; }
  .suggestion-desc { padding-left: 0; }
  .suggestion-action { font-size: 0.75rem; }
  .task-description { padding-left: 0.5rem; margin-left: 0; }
  .task-row { gap: 0.3rem; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.25s ease; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ===== UTILITY ===== */
.text-green { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }
.text-amber { color: var(--accent-amber); }
.text-red { color: var(--danger); }
.text-purple { color: var(--accent); }
.text-cyan { color: var(--accent-cyan); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 0.82rem; }
.hidden { display: none !important; }

/* ===== CALENDAR / SCHEDULE ===== */
.schedule-item {
  display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--border); transition: var(--transition);
}
.schedule-item:last-child { border-bottom: none; }
.schedule-item:hover { background: var(--bg-card-hover); border-radius: var(--radius-sm); }
.schedule-time {
  font-size: 0.78rem; font-weight: 600; color: var(--accent-blue);
  min-width: 65px; padding-top: 0.1rem; white-space: nowrap;
}
.schedule-allday {
  font-size: 0.72rem; font-weight: 600; color: var(--accent-amber);
  min-width: 65px; padding-top: 0.1rem;
}
.schedule-details { flex: 1; min-width: 0; }
.schedule-title { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); }
.schedule-duration { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.schedule-now { border-left: 2px solid var(--accent-green); padding-left: 0.6rem; }
.sync-stale { color: var(--accent-amber); }
.sync-very-stale { color: var(--danger); }

/* ===== TASK DESCRIPTIONS ===== */
.task-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.task-description {
  font-size: 0.78rem; color: var(--text-muted); padding: 0.3rem 0 0.2rem 1.8rem;
  line-height: 1.5; border-left: 2px solid var(--border); margin-left: 1.1rem;
}
.task-cal-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.15rem 0.35rem; font-size: 0.72rem; cursor: pointer; opacity: 0.5;
  transition: var(--transition); line-height: 1;
}
.task-cal-btn:hover { opacity: 1; border-color: var(--accent-blue); }
.task-cal-btn.queued { opacity: 1; border-color: var(--accent-blue); background: rgba(59,130,246,0.15); }

/* ===== AI SUGGESTION DESCRIPTIONS ===== */
.suggestion-top { display: flex; align-items: center; gap: 0.5rem; }
.suggestion-text { flex: 1; }
.suggestion-desc {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem;
  padding-left: 2rem; line-height: 1.5;
}

/* ===== CHAT ACTION BLOCKS ===== */
.chat-action-block {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.6rem; margin-top: 0.5rem;
}
.chat-action-header { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; }
.chat-task-preview { max-height: 200px; overflow-y: auto; }
.chat-task-item { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.chat-task-item:last-child { border-bottom: none; }
.chat-task-item strong { font-size: 0.82rem; }
.chat-action-btns { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.ai-msg.assistant { white-space: pre-wrap; word-wrap: break-word; }
