/* ============================================================
   EVERFLOW WORK TRACKER — Brand-aligned Dashboard CSS
   Brand: Purple (#4007AD), Yellow (#FFDF6B), Dark Purple (#260A72)
   Font: Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Everflow Brand */
  --ef-dark-purple: #260A72;
  --ef-purple: #4007AD;
  --ef-purple-light: #7C4DFF;
  --ef-yellow: #FFDF6B;
  --ef-yellow-hover: #FFD740;
  --ef-grey-1: #B1B9C4;
  --ef-grey-2: #C7CCD5;
  --ef-grey-3: #E8EAEE;
  --ef-white: #FFFFFF;
  --ef-bg: #F4F5F7;
  --ef-text: #1A2138;
  --ef-text-muted: #5A6578;
  --ef-text-light: #8B95A5;

  /* Gradients */
  --ef-gradient-dark: linear-gradient(135deg, #25095B, #4007AD, #7C4DFF);
  --ef-gradient-smooth: linear-gradient(135deg, #4006AD, #8A3AFF);
  --ef-gradient-sidebar: linear-gradient(180deg, #1A0654 0%, #260A72 40%, #320D8F 100%);

  /* Status Colors */
  --status-done: #10B981;
  --status-done-bg: #ECFDF5;
  --status-progress: #F59E0B;
  --status-progress-bg: #FFFBEB;
  --status-blocked: #EF4444;
  --status-blocked-bg: #FEF2F2;
  --status-review: #3B82F6;
  --status-review-bg: #EFF6FF;
  --status-hold: #8B5CF6;
  --status-hold-bg: #F5F3FF;
  --status-backlog: #6B7280;
  --status-backlog-bg: #F3F4F6;
  --status-notstarted: #9CA3AF;
  --status-notstarted-bg: #F9FAFB;

  /* Layout */
  --sidebar-w: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(38, 10, 114, 0.06), 0 1px 2px rgba(38, 10, 114, 0.04);
  --shadow-md: 0 4px 16px rgba(38, 10, 114, 0.08);
  --shadow-lg: 0 8px 32px rgba(38, 10, 114, 0.12);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--ef-bg);
  color: var(--ef-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ef-purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--ef-gradient-sidebar);
  color: #fff;
  padding: 20px 14px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.main {
  margin-left: var(--sidebar-w);
  padding: 28px 36px 60px;
  min-height: 100vh;
  position: relative;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px; padding: 0 6px;
}
.sidebar-logo img { height: 28px; width: auto; }
.sidebar-date {
  font-size: 11px; color: rgba(255,255,255,0.4);
  padding: 0 6px; margin-bottom: 20px;
}
.nav-section { margin-bottom: 16px; }
.nav-section-title {
  font-size: 9px; text-transform: uppercase;
  letter-spacing: 1.5px; color: rgba(255,255,255,0.3);
  padding: 0 8px; margin-bottom: 6px; font-weight: 600;
}

.nav-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: rgba(255,255,255,0.7);
  cursor: pointer; transition: all 0.15s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-tab.active {
  background: rgba(255, 223, 107, 0.12);
  color: var(--ef-yellow);
  font-weight: 600;
}
.nav-tab .icon { font-size: 16px; width: 20px; text-align: center; }
.nav-tab .badge {
  margin-left: auto; background: rgba(255,255,255,0.15);
  padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 600;
}
.nav-tab.active .badge { background: rgba(255,223,107,0.2); color: var(--ef-yellow); }

.sidebar-btn {
  display: block; width: 100%; padding: 9px 12px; margin-bottom: 6px;
  border: none; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  text-align: center; transition: all 0.15s;
  font-family: inherit;
}
.sidebar-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-yellow { background: var(--ef-yellow); color: var(--ef-dark-purple); }
.btn-purple { background: var(--ef-purple); color: #fff; }
.btn-purple-outline {
  background: transparent; color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-purple-outline:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
.sidebar-footer {
  margin-top: auto; font-size: 10px;
  color: rgba(255,255,255,0.25); padding-top: 16px;
}

/* External nav links */
.nav-external {
  text-decoration: none !important;
}
.nav-external:hover {
  background: rgba(255,255,255,0.05) !important;
  color: rgba(255,255,255,0.85) !important;
}
.nav-external .external-arrow {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.35;
  transition: opacity 0.15s;
}
.nav-external:hover .external-arrow {
  opacity: 0.7;
}

/* Iframe container for sub-apps */
#iframe-container {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--ef-bg);
}
#iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--ef-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(38, 10, 114, 0.04);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.card-header h2 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-header .icon { font-size: 18px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--ef-white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(38, 10, 114, 0.04);
  border-left: 4px solid var(--ef-purple);
}
.stat-card .stat-value {
  font-size: 28px; font-weight: 800;
  color: var(--ef-dark-purple);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 12px; color: var(--ef-text-muted);
  font-weight: 500; margin-top: 2px;
}
.stat-card.done { border-left-color: var(--status-done); }
.stat-card.done .stat-value { color: var(--status-done); }
.stat-card.progress { border-left-color: var(--status-progress); }
.stat-card.progress .stat-value { color: var(--status-progress); }
.stat-card.blocked { border-left-color: var(--status-blocked); }
.stat-card.blocked .stat-value { color: var(--status-blocked); }
.stat-card.review { border-left-color: var(--status-review); }
.stat-card.week { border-left-color: var(--ef-yellow); }
.stat-card.week .stat-value { color: var(--ef-dark-purple); }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.status-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.status-badge.done { background: var(--status-done-bg); color: #065F46; }
.status-badge.done .dot { background: var(--status-done); }
.status-badge.in-progress { background: var(--status-progress-bg); color: #92400E; }
.status-badge.in-progress .dot { background: var(--status-progress); }
.status-badge.blocked { background: var(--status-blocked-bg); color: #991B1B; }
.status-badge.blocked .dot { background: var(--status-blocked); }
.status-badge.in-review { background: var(--status-review-bg); color: #1E40AF; }
.status-badge.in-review .dot { background: var(--status-review); }
.status-badge.on-hold { background: var(--status-hold-bg); color: #5B21B6; }
.status-badge.on-hold .dot { background: var(--status-hold); }
.status-badge.backlog { background: var(--status-backlog-bg); color: #374151; }
.status-badge.backlog .dot { background: var(--status-backlog); }
.status-badge.not-started { background: var(--status-notstarted-bg); color: #4B5563; }
.status-badge.not-started .dot { background: var(--status-notstarted); }

/* ============================================================
   TAB CONTENT
   ============================================================ */
.tab-content { display: none; }
.tab-content.active { display: block; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--ef-dark-purple); }

/* ============================================================
   TASK TABLE
   ============================================================ */
.task-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.task-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ef-text-muted); padding: 10px 14px;
  border-bottom: 2px solid var(--ef-grey-3);
}
.task-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--ef-grey-3);
  font-size: 13px; vertical-align: middle;
}
.task-table tr:hover td { background: rgba(64, 7, 173, 0.02); }
.task-table .task-name { font-weight: 500; max-width: 300px; }
.task-table .task-category {
  font-size: 12px; color: var(--ef-text-muted);
}
.task-table .task-notes {
  font-size: 12px; color: var(--ef-text-light);
  max-width: 300px; white-space: pre-wrap; word-break: break-word;
}
.task-table .task-notes.collapsed {
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Status select dropdown in table */
.status-select {
  appearance: none; -webkit-appearance: none;
  padding: 4px 24px 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--ef-grey-2);
  background: var(--ef-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%235A6578' stroke-width='1.5'/%3E%3C/svg%3E") right 8px center no-repeat;
  cursor: pointer; font-family: inherit;
}
.status-select:focus { outline: none; border-color: var(--ef-purple); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--ef-grey-2); background: var(--ef-white);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.filter-btn:hover { border-color: var(--ef-purple); color: var(--ef-purple); }
.filter-btn.active {
  background: var(--ef-purple); color: #fff; border-color: var(--ef-purple);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ef-purple); color: #fff; }
.btn-primary:hover { background: #5017C7; }
.btn-accent { background: var(--ef-yellow); color: var(--ef-dark-purple); }
.btn-accent:hover { background: var(--ef-yellow-hover); }
.btn-outline {
  background: transparent; color: var(--ef-purple);
  border: 1px solid var(--ef-purple);
}
.btn-outline:hover { background: rgba(64, 7, 173, 0.05); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-ghost {
  background: transparent; color: var(--ef-text-muted);
  padding: 5px 10px;
}
.btn-ghost:hover { color: var(--ef-purple); background: rgba(64, 7, 173, 0.05); }
.btn-danger { background: var(--status-blocked); color: #fff; }
.btn-success { background: var(--status-done); color: #fff; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 6, 84, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--ef-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%; max-width: 520px;
  padding: 28px;
  position: relative;
  max-height: 80vh; overflow-y: auto;
}
.modal h3 {
  font-size: 18px; font-weight: 700;
  color: var(--ef-dark-purple); margin-bottom: 20px;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ef-text-muted); margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--ef-grey-2);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--ef-purple);
  box-shadow: 0 0 0 3px rgba(64, 7, 173, 0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ef-dark-purple); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left: 4px solid var(--status-done); }
.toast.error { border-left: 4px solid var(--status-blocked); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   GOALS SECTION
   ============================================================ */
.goal-card {
  background: var(--ef-white); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border: 1px solid rgba(38, 10, 114, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.goal-card.clickable:hover {
  border-color: var(--ef-purple);
  box-shadow: 0 4px 16px rgba(64, 7, 173, 0.12);
}
.goal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.goal-title { font-size: 14px; font-weight: 700; color: var(--ef-dark-purple); }
.goal-progress-pct { font-size: 20px; font-weight: 800; color: var(--ef-purple); }
.progress-bar {
  height: 8px; background: var(--ef-grey-3); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--ef-gradient-smooth); border-radius: 4px;
  transition: width 0.5s ease;
}

/* Drag-to-reorder */
tr.dragging { opacity: 0.4; background: var(--ef-grey-3); }
tr[draggable="true"]:hover .drag-handle { opacity: 1; }
.drag-handle {
  opacity: 0.3; cursor: grab; font-size: 14px; margin-right: 6px;
  display: inline-block; vertical-align: middle;
}

/* Video pipeline */
.video-pipeline { display: flex; flex-direction: column; gap: 6px; }
.video-item {
  padding: 8px 12px; border-radius: 6px;
  background: var(--ef-grey-3); transition: background 0.15s;
}
.video-item:hover { background: rgba(64, 7, 173, 0.04); }

/* Bulk action bar */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--ef-dark-purple); color: white;
  padding: 10px 16px; border-radius: var(--radius);
  margin-bottom: 12px; font-size: 13px; font-weight: 500;
}
.bulk-bar .btn { font-size: 12px; }

/* Goal Detail Modal */
.goal-detail-header { display: flex; align-items: center; justify-content: space-between; }
.goal-items-list { display: flex; flex-direction: column; gap: 4px; }
.goal-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; transition: background 0.15s;
}
.goal-item:hover { background: var(--ef-grey-3); }
.goal-item.done { opacity: 0.65; }
.goal-item.done div:first-of-type { text-decoration: line-through; }
.goal-item.in-progress { background: rgba(245, 158, 11, 0.06); }
.goal-item-icon { font-size: 18px; flex-shrink: 0; }
.modal-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 24px; cursor: pointer; color: var(--ef-grey-1); line-height: 1;
}
.modal-close:hover { color: var(--ef-dark-purple); }

/* ============================================================
   IDEAS TAB
   ============================================================ */
.ideas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.idea-card {
  background: var(--ef-white); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  border: 1px solid rgba(38, 10, 114, 0.04);
  border-left: 4px solid var(--ef-grey-2);
  transition: all 0.2s;
}
.idea-card:hover { box-shadow: var(--shadow-md); border-left-color: var(--ef-purple); }
.idea-card.pinned { border-left-color: var(--ef-yellow); }
.idea-card .idea-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.idea-card .idea-body {
  font-size: 13px; color: var(--ef-text-muted);
  margin-bottom: 10px; white-space: pre-wrap; word-break: break-word;
}
.idea-card .idea-body.long-note {
  display: -webkit-box; -webkit-line-clamp: 5;
  -webkit-box-orient: vertical; overflow: hidden;
  cursor: pointer;
}
.idea-card .idea-body.long-note.expanded {
  display: block; -webkit-line-clamp: unset;
}
.idea-card .idea-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.idea-tag {
  padding: 2px 8px; border-radius: 10px; font-size: 10px;
  font-weight: 600; background: rgba(64, 7, 173, 0.08);
  color: var(--ef-purple);
}
.idea-card .idea-actions {
  display: flex; gap: 6px; justify-content: flex-end;
}
.idea-card .idea-project {
  font-size: 11px; color: var(--ef-text-light); margin-bottom: 8px;
}
.idea-card.converted {
  opacity: 0.6; border-left-color: var(--status-done);
}

/* ============================================================
   PROJECTS TAB
   ============================================================ */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--ef-white); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border: 1px solid rgba(38, 10, 114, 0.04);
  cursor: pointer; transition: all 0.2s;
  position: relative;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: rgba(64, 7, 173, 0.15); }
.project-card.pinned { border-color: var(--ef-purple); border-width: 2px; }
.project-card .project-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.project-card .project-stats {
  display: flex; gap: 12px; font-size: 12px; color: var(--ef-text-muted);
  flex-wrap: wrap;
}
.project-card .project-stats span { display: flex; align-items: center; gap: 4px; }
.project-card.paused { opacity: 0.7; }
.project-card.done { opacity: 0.5; }
.project-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 6px; flex-shrink: 0;
}
.project-status-dot.active { background: var(--status-done); }
.project-status-dot.paused { background: var(--status-progress); }
.project-status-dot.done { background: var(--ef-grey-1); }
.project-status-dot.blocked { background: var(--status-blocked); }
.project-status-dot.idle { background: #F59E0B; }
.project-status-dot.stale { background: #EF4444; }

/* Health badges */
.health-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.health-badge.active { background: #ECFDF5; color: #059669; }
.health-badge.idle { background: #FFFBEB; color: #D97706; }
.health-badge.stale { background: #FEF2F2; color: #DC2626; }
.health-badge.blocked { background: #FEF2F2; color: #DC2626; }
.health-badge.paused { background: #F5F3FF; color: #7C3AED; }
.health-badge.done { background: #F3F4F6; color: #6B7280; }

/* Project notes preview */
.project-notes-preview {
  font-size: 11px; color: var(--ef-text-muted); margin-top: 6px;
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  font-style: italic;
}

/* Project links inline */
.project-links-row {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.project-link-chip {
  font-size: 10px; padding: 2px 8px; border-radius: 6px;
  background: var(--ef-bg); color: var(--ef-purple); font-weight: 600;
  text-decoration: none; transition: background 0.15s;
  white-space: nowrap;
}
.project-link-chip:hover { background: #EDE9FE; text-decoration: none; }

/* Project Detail Slide-out Panel */
.project-detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.project-detail-overlay.open { opacity: 1; pointer-events: auto; }

.project-detail-panel {
  position: fixed; top: 0; right: -560px; bottom: 0;
  width: 560px; max-width: 90vw; background: var(--ef-white);
  z-index: 201; box-shadow: -8px 0 32px rgba(38,10,114,0.15);
  display: flex; flex-direction: column;
  transition: right 0.25s ease;
}
.project-detail-panel.open { right: 0; }

.project-detail-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px; border-bottom: 1px solid var(--ef-grey-3);
  background: var(--ef-bg);
}

.pd-notes-input {
  width: 100%; border: 1px solid transparent; border-radius: 6px;
  padding: 8px; font-family: inherit;
  transition: border-color 0.15s;
}
.pd-notes-input:hover { border-color: var(--ef-grey-2); }
.pd-notes-input:focus { border-color: var(--ef-purple); outline: none; }

/* Pulse chips */
.pulse-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: var(--ef-white); border: 1px solid var(--ef-grey-3);
}
.pulse-chip .pulse-count {
  font-size: 14px; font-weight: 800; color: var(--ef-purple);
}
.pulse-chip.has-activity { border-color: var(--status-done); background: #ECFDF5; }
.pulse-chip.no-activity { opacity: 0.5; }

/* ============================================================
   CALENDAR
   ============================================================ */
.calendar-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.calendar-header .month-title { font-size: 18px; font-weight: 700; color: var(--ef-dark-purple); }
.calendar-nav-btn {
  background: var(--ef-white); border: 1px solid var(--ef-grey-2);
  border-radius: var(--radius-sm); padding: 6px 12px;
  cursor: pointer; font-size: 14px; transition: all 0.15s;
}
.calendar-nav-btn:hover { border-color: var(--ef-purple); color: var(--ef-purple); }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--ef-grey-3); border-radius: var(--radius);
  overflow: hidden;
}
.calendar-day-header {
  background: var(--ef-dark-purple); color: rgba(255,255,255,0.8);
  padding: 8px; text-align: center; font-size: 11px;
  font-weight: 600; text-transform: uppercase;
}
.calendar-day {
  background: var(--ef-white); min-height: 90px; padding: 8px;
  cursor: pointer; transition: background 0.15s;
}
.calendar-day:hover { background: rgba(64, 7, 173, 0.02); }
.calendar-day.today { background: rgba(255, 223, 107, 0.1); }
.calendar-day.selected { background: rgba(64, 7, 173, 0.05); outline: 2px solid var(--ef-purple); outline-offset: -2px; }
.calendar-day.empty { background: var(--ef-bg); }
.calendar-day.special-purple { background: rgba(64, 7, 173, 0.08); border-left: 3px solid var(--ef-purple); }
.calendar-day.special-purple .day-num { color: var(--ef-purple); font-weight: 800; }
.calendar-day.special-red { background: rgba(239, 68, 68, 0.06); border-left: 3px solid #EF4444; }
.calendar-day.special-red .day-num { color: #EF4444; font-weight: 800; }
.calendar-day .day-num {
  font-size: 12px; font-weight: 600; color: var(--ef-text-muted); margin-bottom: 4px;
}
.calendar-day.today .day-num {
  background: var(--ef-purple); color: #fff; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.calendar-pill {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 4px; font-size: 10px;
  margin-bottom: 2px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis;
}
.calendar-pill .pill-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.calendar-more {
  font-size: 10px; color: var(--ef-text-light); font-weight: 600;
  padding: 2px 4px; cursor: pointer;
}
.calendar-more:hover { color: var(--ef-purple); }

/* Calendar panel collapsible groups */
.cal-collapsed { display: none !important; }
.cal-collapsed + .cal-chevron { transform: rotate(-90deg); }

/* Calendar side panel */
.calendar-layout { display: flex; gap: 24px; }
.calendar-main { flex: 1 1 0; min-width: 0; }
.calendar-panel {
  flex: 0 0 320px; position: sticky; top: 28px; max-height: calc(100vh - 56px);
  overflow-y: auto; overflow-x: hidden; word-wrap: break-word;
}
@media (max-width: 1200px) {
  .calendar-layout { flex-direction: column; }
  .calendar-panel { position: static; max-height: none; }
}

/* ============================================================
   JIRA SECTION
   ============================================================ */
.jira-card {
  background: var(--ef-white); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 10px;
  border: 1px solid rgba(38, 10, 114, 0.04);
  display: flex; align-items: flex-start; gap: 14px;
}
.jira-key {
  font-size: 12px; font-weight: 700; color: var(--ef-purple);
  white-space: nowrap;
}
.jira-summary { font-size: 13px; font-weight: 500; flex: 1; }
.jira-age {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; white-space: nowrap;
}
.jira-age.fresh { background: var(--status-done-bg); color: #065F46; }
.jira-age.stale { background: var(--status-progress-bg); color: #92400E; }
.jira-age.old { background: var(--status-blocked-bg); color: #991B1B; }
.jira-cache-badge {
  font-size: 10px; color: var(--ef-text-light); font-style: italic;
}

/* ============================================================
   INSIGHTS
   ============================================================ */
.insight-section { margin-bottom: 24px; }
.insight-section h3 {
  font-size: 14px; font-weight: 700; color: var(--ef-dark-purple);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.standup-block { padding: 16px; background: var(--ef-bg); border-radius: var(--radius-sm); }
.standup-block h4 { font-size: 12px; font-weight: 700; color: var(--ef-purple); margin-bottom: 6px; }
.standup-block ul { list-style: none; padding: 0; }
.standup-block li { font-size: 13px; padding: 3px 0; color: var(--ef-text); }
.standup-block li::before { content: "· "; color: var(--ef-grey-1); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-input {
  width: 100%; padding: 10px 14px 10px 36px;
  border: 1px solid var(--ef-grey-2); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B1B9C4' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.search-input:focus {
  outline: none; border-color: var(--ef-purple);
  box-shadow: 0 0 0 3px rgba(64, 7, 173, 0.1);
}

/* ============================================================
   LOADING / EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--ef-text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--ef-text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--ef-grey-2); border-top-color: var(--ef-purple);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
  align-items: flex-start;
}
.kanban-column {
  min-width: 260px;
  max-width: 300px;
  flex: 1;
  background: var(--ef-bg);
  border-radius: var(--radius);
  border: 1px solid var(--ef-grey-3);
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--col-color, var(--ef-grey-2));
  background: var(--ef-white);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-col-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--col-color);
  flex-shrink: 0;
}
.kanban-col-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ef-text);
}
.kanban-col-count {
  margin-left: auto;
  background: var(--col-color);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  min-width: 20px; text-align: center;
}
.kanban-col-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.kanban-col-body.drag-over {
  background: rgba(64, 7, 173, 0.04);
  border-radius: 0 0 var(--radius) var(--radius);
}
.kanban-card {
  background: var(--ef-white);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(38, 10, 114, 0.06);
  border: 1px solid rgba(38, 10, 114, 0.04);
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}
.kanban-card .kc-title {
  font-size: 13px; font-weight: 600;
  color: var(--ef-text); line-height: 1.4;
  margin-bottom: 8px;
}
.kanban-card .kc-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.kanban-card .kc-chip {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  white-space: nowrap;
}
.kanban-card .kc-category {
  background: rgba(64, 7, 173, 0.08);
  color: var(--ef-purple);
}
.kanban-card .kc-project {
  background: rgba(59, 130, 246, 0.08);
  color: #2563EB;
}
.kanban-card .kc-actions {
  position: absolute; top: 8px; right: 8px;
  display: none; gap: 2px;
}
.kanban-card:hover .kc-actions { display: flex; }
.kanban-card .kc-actions button {
  background: var(--ef-white);
  border: 1px solid var(--ef-grey-3);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}
.kanban-card .kc-actions button:hover {
  background: var(--ef-grey-3);
}
.kanban-card .kc-notes {
  font-size: 11px; color: var(--ef-text-light);
  margin-top: 6px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Spinner for iframe loading */
@keyframes spin { to { transform: rotate(360deg); } }

/* Sidebar mini goals */
.sidebar-goal {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}
.sidebar-goal-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-goal-bar {
  width: 50px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  flex-shrink: 0;
}
.sidebar-goal-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--ef-yellow);
  transition: width 0.3s;
}
.sidebar-goal-pct {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ============================================================
   APPS HUB
   ============================================================ */
.app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--ef-border);
  background: var(--ef-card-bg);
  transition: all 0.15s ease;
  cursor: pointer;
  color: inherit;
}
.app-card:hover {
  border-color: var(--ef-purple);
  box-shadow: 0 2px 12px rgba(64, 7, 173, 0.1);
  transform: translateY(-1px);
}
.app-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(64, 7, 173, 0.06);
}
.app-info { flex: 1; min-width: 0; }
.app-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ef-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-desc {
  font-size: 11px;
  color: var(--ef-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.app-badge.live { background: rgba(74, 190, 130, 0.12); color: #2d7a50; }
.app-badge.merging { background: rgba(255, 223, 107, 0.2); color: #8a6d00; }
.app-badge.archive { background: rgba(177, 185, 196, 0.15); color: #6b7280; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { width: 0; padding: 0; overflow: hidden; }
  .main { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ideas-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
