/* Mission Control V2 - Dark Theme Layout */
:root {
  --v2-bg: #0d1117;
  --v2-sidebar: #161b22;
  --v2-card: #1c2333;
  --v2-card-border: #30363d;
  --v2-accent: #2ea043;
  --v2-accent-hover: #3fb950;
  --v2-text: #e6edf3;
  --v2-text-secondary: #8b949e;
  --v2-text-muted: #484f58;
  --v2-sidebar-width: 220px;
  --v2-sidebar-collapsed: 60px;
  --v2-topbar-height: 56px;
  --v2-activity-width: 280px;
  --v2-orange: #d29922;
  --v2-red: #f85149;
  --v2-blue: #58a6ff;
  --v2-purple: #bc8cff;
}

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

/* V1 → V2 CSS variable compatibility layer */
/* Maps old v1 variable names to v2 equivalents so existing pages render correctly */
body.v2 {
  --bg: #0d1117;
  --card-bg: #1c2333;
  --card-border: #30363d;
  --fg: #e6edf3;
  --text: #e6edf3;
  --text-color: #e6edf3;
  --text-dim: #484f58;
  --muted: #8b949e;
  --accent: #2ea043;
  --accent-hover: #3fb950;
  --success: #2ea043;
  --error: #f85149;
  --warning: #d29922;
  --info: #58a6ff;
  --btn-primary-bg: #2ea043;
  --btn-primary-text: #fff;
}

/* V1 component styles for compatibility */
body.v2 .btn {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--card-bg); color: var(--fg); cursor: pointer; font-size: 0.82rem;
  transition: all 0.15s; font-family: inherit;
}
body.v2 .btn:hover { background: rgba(255,255,255,0.06); }
body.v2 .btn-primary { background: var(--v2-accent); color: #fff; border-color: var(--v2-accent); }
body.v2 .btn-primary:hover { background: var(--v2-accent-hover); }
body.v2 .btn-secondary { background: var(--card-bg); color: var(--muted); }
body.v2 .btn-sm { padding: 4px 10px; font-size: 0.78rem; }
body.v2 .card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 10px; overflow: hidden;
}
body.v2 .card-header {
  padding: 14px 16px; border-bottom: 1px solid var(--card-border);
  font-weight: 600; font-size: 0.9rem;
}
body.v2 .card-body { padding: 16px; }
body.v2 .pill {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--card-border);
  background: var(--card-bg); color: var(--muted); cursor: pointer; font-size: 0.78rem;
  font-family: inherit; transition: all 0.15s;
}
body.v2 .pill.active { background: var(--v2-accent); color: #fff; border-color: var(--v2-accent); }
body.v2 .pill:hover:not(.active) { background: rgba(255,255,255,0.06); }
body.v2 .page-header h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
body.v2 .page-header .subtitle { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
body.v2 .loading { text-align: center; padding: 40px; color: var(--muted); }
body.v2 .empty { text-align: center; padding: 40px; color: var(--text-dim); }
body.v2 .error { text-align: center; padding: 20px; color: var(--error); }
body.v2 input, body.v2 textarea, body.v2 select {
  font-family: inherit;
}
body.v2 .settings-panel { }
body.v2 .form-group label { font-size: 0.78rem; color: var(--muted); display: block; margin-bottom: 4px; }
body.v2 .modal {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px;
}
body.v2 .label-color { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
body.v2 .label-color.software { background: #58a6ff; }
body.v2 .label-color.safeteam { background: #2ea043; }
body.v2 .label-color.family { background: #bc8cff; }
body.v2 .label-color.alerts { background: #f85149; }
body.v2 .label-color.other { background: #8b949e; }
body.v2 .label-dropdown { position: relative; display: inline-block; }
body.v2 .label-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 8px;
  padding: 4px 0; min-width: 140px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
body.v2 .label-dropdown:hover .label-menu { display: block; }
body.v2 .label-menu-item {
  padding: 6px 12px; cursor: pointer; font-size: 0.8rem; color: var(--fg);
  display: flex; align-items: center;
}
body.v2 .label-menu-item:hover { background: rgba(255,255,255,0.06); }

/* ── Email Page Styles ── */
body.v2 .email-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--v2-card);
  border: 1px solid var(--v2-card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 6px;
}
body.v2 .email-row:hover {
  border-color: var(--v2-accent);
  background: rgba(46,160,67,0.03);
}
body.v2 .email-row.unread {
  border-left: 3px solid var(--v2-accent);
}
body.v2 .email-row.unread .email-from,
body.v2 .email-row.unread .email-subject {
  font-weight: 600;
}
body.v2 .email-row.active {
  border-color: var(--v2-accent);
  background: rgba(46,160,67,0.06);
}
body.v2 .email-checkbox {
  flex-shrink: 0;
  padding-top: 2px;
}
body.v2 .email-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--v2-accent);
}
body.v2 .email-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
body.v2 .email-from {
  font-size: 0.88rem;
  color: var(--v2-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
body.v2 .email-subject {
  font-size: 0.82rem;
  color: var(--v2-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
body.v2 .email-snippet {
  font-size: 0.75rem;
  color: var(--v2-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.v2 .email-meta {
  flex-shrink: 0;
  text-align: right;
  min-width: 80px;
}
body.v2 .email-date {
  font-size: 0.72rem;
  color: var(--v2-text-muted);
  white-space: nowrap;
  margin-bottom: 4px;
}
body.v2 .email-labels {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
body.v2 .email-label {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--v2-text-secondary);
  border: 1px solid var(--v2-card-border);
}
body.v2 .email-label.UNREAD {
  background: rgba(46,160,67,0.15);
  color: var(--v2-accent);
  border-color: rgba(46,160,67,0.3);
}

/* Email preview card */
body.v2 #email-preview-card {
  margin-top: 16px;
  background: var(--v2-card);
  border: 1px solid var(--v2-card-border);
  border-radius: 10px;
}
body.v2 .email-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
body.v2 #email-preview-subject {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
}
body.v2 .email-preview-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
body.v2 .email-preview-meta {
  font-size: 0.82rem;
  color: var(--v2-text-secondary);
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--v2-card-border);
  line-height: 1.6;
}
body.v2 .email-preview-body {
  font-size: 0.85rem;
  color: var(--v2-text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}
body.v2 .email-preview-body a {
  color: var(--v2-blue);
  word-break: break-all;
}

/* Email quick actions bar */
body.v2 .email-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--v2-card);
  border: 1px solid var(--v2-card-border);
  border-radius: 10px;
  margin-bottom: 12px;
}

/* Compose modal override */
body.v2 .compose-container {
  background: var(--v2-sidebar);
  border: 1px solid var(--v2-card-border);
  border-radius: 12px;
}
body.v2 .compose-header {
  border-bottom-color: var(--v2-card-border);
}
body.v2 .compose-footer {
  border-top-color: var(--v2-card-border);
}
body.v2 .compose-field input,
body.v2 .compose-field textarea {
  background: var(--v2-bg) !important;
  border-color: var(--v2-card-border) !important;
  color: var(--v2-text) !important;
}
body.v2 .compose-field input:focus,
body.v2 .compose-field textarea:focus {
  border-color: var(--v2-accent) !important;
}
body.v2 .compose-close { color: var(--v2-text-secondary); }
body.v2 .compose-close:hover { color: var(--v2-text); }
body.v2 .compose-status { color: var(--v2-text-secondary); }
body.v2 .compose-status.success { color: var(--v2-accent); }
body.v2 .compose-status.error { color: var(--v2-red); }

/* Email header layout fix */
body.v2 .email-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
body.v2 .email-header-actions select {
  padding: 4px 8px;
  background: var(--v2-card);
  border: 1px solid var(--v2-card-border);
  color: var(--v2-text-secondary);
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

/* Light mode email overrides */
body.v2.v2-light .email-row { background: #ffffff; border-color: #d1d9e0; }
body.v2.v2-light .email-row:hover { background: rgba(26,127,55,0.03); border-color: #1a7f37; }
body.v2.v2-light .email-row.unread { border-left-color: #1a7f37; }
body.v2.v2-light .email-label { background: rgba(0,0,0,0.04); border-color: #d1d9e0; }
body.v2.v2-light .compose-container { background: #ffffff; }
body.v2.v2-light .email-quick-actions { background: #ffffff; border-color: #d1d9e0; }

body.v2 {
  font-family: -apple-system, system-ui, 'Segoe UI', sans-serif;
  background: var(--v2-bg);
  color: var(--v2-text);
  overflow: hidden;
  height: 100vh;
}

/* ── Top Bar ── */
.v2-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--v2-topbar-height);
  background: var(--v2-sidebar);
  border-bottom: 1px solid var(--v2-card-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}
.v2-topbar-left { display: flex; align-items: center; gap: 16px; }
.v2-topbar-title {
  font-size: 1.15rem; font-weight: 700; white-space: nowrap;
  background: linear-gradient(135deg, var(--v2-accent), var(--v2-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.v2-sidebar-toggle {
  background: none; border: none; color: var(--v2-text-secondary);
  font-size: 1.3rem; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
}
.v2-sidebar-toggle:hover { background: rgba(255,255,255,0.06); }

.v2-topbar-center { flex: 1; max-width: 480px; margin: 0 24px; }
.v2-search {
  width: 100%; padding: 8px 14px; border-radius: 8px;
  background: var(--v2-bg); border: 1px solid var(--v2-card-border);
  color: var(--v2-text); font-size: 0.875rem; outline: none;
  transition: border-color 0.15s; box-sizing: border-box;
}
.v2-search:focus { border-color: var(--v2-accent); }
.v2-search::placeholder { color: var(--v2-text-muted); }

.v2-topbar-right { display: flex; align-items: center; gap: 10px; }
.v2-topbar-btn {
  background: none; border: 1px solid var(--v2-card-border); color: var(--v2-text-secondary);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 0.8rem;
  transition: all 0.15s; white-space: nowrap;
}
.v2-topbar-btn:hover { background: rgba(255,255,255,0.06); color: var(--v2-text); }
.v2-topbar-btn.accent { border-color: var(--v2-accent); color: var(--v2-accent); }
.v2-topbar-btn.accent:hover { background: var(--v2-accent); color: #fff; }

.v2-city-switcher {
  background: var(--v2-bg); color: var(--v2-text-secondary); border: 1px solid var(--v2-card-border);
  border-radius: 8px; padding: 6px 10px; font-size: 0.8rem; cursor: pointer;
}

.v2-user-area {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--v2-card-border);
  border-radius: 8px; font-size: 0.82rem;
}
.v2-user-name { color: var(--v2-text); }
.v2-user-role {
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
  background: rgba(46,160,67,0.15); color: var(--v2-accent);
}

/* ── Sidebar ── */
.v2-sidebar {
  position: fixed; top: var(--v2-topbar-height); left: 0; bottom: 0;
  width: var(--v2-sidebar-width);
  background: var(--v2-sidebar);
  border-right: 1px solid var(--v2-card-border);
  overflow-y: auto; overflow-x: hidden;
  transition: width 0.25s ease;
  z-index: 90;
  padding: 8px 0;
}
.v2-sidebar::-webkit-scrollbar { width: 4px; }
.v2-sidebar::-webkit-scrollbar-thumb { background: var(--v2-card-border); border-radius: 2px; }

.v2-sidebar.collapsed { width: var(--v2-sidebar-collapsed); }
.v2-sidebar.collapsed .v2-nav-label { opacity: 0; width: 0; overflow: hidden; }
.v2-sidebar.collapsed .v2-nav-section-title { opacity: 0; height: 0; margin: 0; padding: 0; overflow: hidden; }
.v2-sidebar.collapsed .v2-nav-item { justify-content: center; padding: 10px 0; }
.v2-sidebar.collapsed .v2-nav-item .v2-nav-icon { margin: 0; }

.v2-sidebar-city-switcher { display: none; }
.v2-nav-section-title {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  color: var(--v2-text-muted); padding: 16px 16px 6px; letter-spacing: 0.05em;
  transition: opacity 0.2s;
}
.v2-nav-item {
  display: flex; align-items: center; gap: 0;
  padding: 8px 16px; margin: 1px 8px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s; position: relative;
  color: var(--v2-text-secondary); text-decoration: none;
  border-left: 3px solid transparent;
  margin-left: 0; padding-left: 13px;
}
.v2-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--v2-text); }
.v2-nav-item.active {
  background: rgba(46,160,67,0.08); color: var(--v2-text);
  border-left-color: var(--v2-accent);
}
.v2-nav-icon { font-size: 1.05rem; width: 28px; text-align: center; flex-shrink: 0; margin-right: 10px; }
.v2-nav-label { font-size: 0.82rem; white-space: nowrap; transition: opacity 0.2s; }

/* Expandable nav groups */
.v2-nav-group .v2-nav-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.v2-nav-group.open .v2-nav-children {
  max-height: 400px;
}
.v2-nav-parent {
  cursor: pointer;
}
.v2-nav-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s;
  color: var(--v2-text-muted);
}
.v2-nav-group.open .v2-nav-chevron {
  transform: rotate(90deg);
}
.v2-nav-child {
  padding-left: 36px !important;
  font-size: 0.82rem;
}

/* ── Main Content ── */
.v2-main {
  position: fixed;
  top: var(--v2-topbar-height);
  left: var(--v2-sidebar-width);
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  transition: left 0.25s ease, right 0.25s ease;
  background: var(--v2-bg);
}
.v2-main.sidebar-collapsed { left: var(--v2-sidebar-collapsed); }
.v2-main.activity-open { right: var(--v2-activity-width); }
.v2-main.activity-hidden { right: 0; }

/* ── Activity Panel ── */
.v2-activity {
  position: fixed;
  top: var(--v2-topbar-height);
  right: 0; bottom: 0;
  width: var(--v2-activity-width);
  background: var(--v2-sidebar);
  border-left: 1px solid var(--v2-card-border);
  overflow-y: auto;
  transition: width 0.25s ease, transform 0.25s ease;
  z-index: 90; padding: 16px;
}
.v2-activity.hidden { transform: translateX(100%); width: 0; padding: 0; overflow: hidden; }

.v2-activity-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.v2-activity-title { font-size: 0.85rem; font-weight: 600; color: var(--v2-text); }
.v2-activity-toggle {
  background: none; border: none; color: var(--v2-text-secondary);
  cursor: pointer; font-size: 1rem; padding: 2px;
}

.v2-activity-item {
  padding: 10px 0; border-bottom: 1px solid rgba(48,54,61,0.5);
  font-size: 0.78rem;
}
.v2-activity-item:last-child { border-bottom: none; }
.v2-activity-agent {
  font-weight: 600; font-size: 0.72rem; margin-bottom: 3px;
  display: inline-block; padding: 1px 6px; border-radius: 3px;
}
.v2-activity-agent.main { background: rgba(46,160,67,0.15); color: var(--v2-accent); }
.v2-activity-agent.research { background: rgba(88,166,255,0.15); color: var(--v2-blue); }
.v2-activity-agent.marketing { background: rgba(188,140,255,0.15); color: var(--v2-purple); }
.v2-activity-agent.admin { background: rgba(210,153,34,0.15); color: var(--v2-orange); }
.v2-activity-time { color: var(--v2-text-muted); font-size: 0.7rem; float: right; }
.v2-activity-text { color: var(--v2-text-secondary); margin-top: 4px; line-height: 1.4; }

/* ── Cards ── */
.v2-card {
  background: var(--v2-card);
  border: 1px solid var(--v2-card-border);
  border-radius: 8px;
  padding: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.v2-card:hover { border-color: #3d444d; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* ── Stats Bar ── */
.v2-stats-bar {
  display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.v2-stat-card {
  background: var(--v2-card); border: 1px solid var(--v2-card-border);
  border-radius: 8px; padding: 14px 20px; flex: 1; min-width: 140px;
}
.v2-stat-value { font-size: 1.5rem; font-weight: 700; }
.v2-stat-value.red { color: var(--v2-red); }
.v2-stat-value.orange { color: var(--v2-orange); }
.v2-stat-value.green { color: var(--v2-accent); }
.v2-stat-value.blue { color: var(--v2-blue); }
.v2-stat-label { font-size: 0.75rem; color: var(--v2-text-secondary); margin-top: 2px; }

/* ── Kanban Board ── */
.v2-kanban-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.v2-kanban-header h2 { font-size: 1.15rem; font-weight: 600; }
.v2-kanban-filters { display: flex; gap: 8px; align-items: center; }
.v2-filter-select {
  background: var(--v2-card); border: 1px solid var(--v2-card-border);
  color: var(--v2-text-secondary); padding: 6px 10px; border-radius: 6px;
  font-size: 0.78rem; cursor: pointer;
}

.v2-kanban {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  min-height: 400px;
}
.v2-kanban-column {
  background: rgba(22,27,34,0.5);
  border: 1px solid var(--v2-card-border);
  border-radius: 8px;
  padding: 12px;
  min-height: 300px;
}
.v2-kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--v2-card-border);
}
.v2-kanban-col-title { font-size: 0.82rem; font-weight: 600; }
.v2-kanban-col-count {
  font-size: 0.7rem; background: var(--v2-card-border); color: var(--v2-text-secondary);
  padding: 2px 8px; border-radius: 10px;
}

.v2-task-card {
  background: var(--v2-card);
  border: 1px solid var(--v2-card-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: border-color 0.15s, transform 0.1s;
}
.v2-task-card:hover { border-color: var(--v2-accent); transform: translateY(-1px); }
.v2-task-card.dragging { opacity: 0.5; }

.v2-task-title { font-size: 0.82rem; font-weight: 500; margin-bottom: 6px; }
.v2-task-desc { font-size: 0.72rem; color: var(--v2-text-secondary); margin-bottom: 8px; line-height: 1.4; }
.v2-task-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

.v2-badge {
  font-size: 0.65rem; padding: 2px 8px; border-radius: 10px; font-weight: 500;
}
.v2-badge.green { background: rgba(46,160,67,0.15); color: var(--v2-accent); }
.v2-badge.orange { background: rgba(210,153,34,0.15); color: var(--v2-orange); }
.v2-badge.red { background: rgba(248,81,73,0.15); color: var(--v2-red); }
.v2-badge.blue { background: rgba(88,166,255,0.15); color: var(--v2-blue); }
.v2-badge.purple { background: rgba(188,140,255,0.15); color: var(--v2-purple); }
.v2-badge.gray { background: rgba(139,148,158,0.15); color: var(--v2-text-secondary); }

.v2-task-agent { font-size: 0.68rem; color: var(--v2-text-muted); }
.v2-task-priority { font-size: 0.68rem; }

/* ── New Task Button ── */
.v2-btn {
  padding: 8px 16px; border-radius: 8px; border: none;
  font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.v2-btn-primary { background: var(--v2-accent); color: #fff; }
.v2-btn-primary:hover { background: var(--v2-accent-hover); }
.v2-btn-secondary { background: var(--v2-card); border: 1px solid var(--v2-card-border); color: var(--v2-text); }
.v2-btn-secondary:hover { background: rgba(255,255,255,0.06); }

/* ── Modal (v1 compat) ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay .modal-box {
  background: var(--v2-card, #161b22); color: var(--v2-text, #e6edf3);
  border-radius: 12px; padding: 24px; max-width: 90vw; max-height: 85vh;
  overflow-y: auto; border: 1px solid var(--v2-card-border, #30363d);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-overlay .modal-box h3 { margin: 0 0 16px; }
.modal-overlay .modal-box label { display: block; margin: 10px 0 4px; font-weight: 500; font-size: 0.9rem; }
.modal-overlay .modal-box input[type="text"],
.modal-overlay .modal-box input[type="email"],
.modal-overlay .modal-box select,
.modal-overlay .modal-box textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--v2-card-border, #30363d); background: var(--v2-bg, #0d1117); color: var(--v2-text, #e6edf3);
  font-size: 0.9rem; box-sizing: border-box;
}

/* ── Modal (v2) ── */
.v2-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.v2-modal-overlay.open { opacity: 1; pointer-events: auto; }
.v2-modal {
  background: var(--v2-sidebar); border: 1px solid var(--v2-card-border);
  border-radius: 12px; padding: 24px; width: 480px; max-width: 90vw;
  max-height: 80vh; overflow-y: auto;
}
.v2-modal h3 { font-size: 1rem; margin-bottom: 16px; }
.v2-modal-field { margin-bottom: 14px; }
.v2-modal-field label { display: block; font-size: 0.75rem; color: var(--v2-text-secondary); margin-bottom: 4px; }
.v2-modal-field input, .v2-modal-field textarea, .v2-modal-field select {
  width: 100%; padding: 8px 12px; background: var(--v2-bg); border: 1px solid var(--v2-card-border);
  border-radius: 6px; color: var(--v2-text); font-size: 0.85rem; outline: none;
  font-family: inherit;
}
.v2-modal-field textarea { resize: vertical; min-height: 80px; }
.v2-modal-field input:focus, .v2-modal-field textarea:focus, .v2-modal-field select:focus {
  border-color: var(--v2-accent);
}
.v2-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ── Light Theme ── */
body.v2.v2-light {
  --v2-bg: #f6f8fa;
  --v2-sidebar: #ffffff;
  --v2-card: #ffffff;
  --v2-card-border: #d1d9e0;
  --v2-accent: #1a7f37;
  --v2-accent-hover: #2da44e;
  --v2-text: #1f2328;
  --v2-text-secondary: #656d76;
  --v2-text-muted: #8b949e;
  --v2-orange: #bf8700;
  --v2-red: #cf222e;
  --v2-blue: #0969da;
  --v2-purple: #8250df;
  /* V1 compat overrides for light mode */
  --bg: #f6f8fa;
  --card-bg: #ffffff;
  --card-border: #d1d9e0;
  --fg: #1f2328;
  --text: #1f2328;
  --text-color: #1f2328;
  --text-dim: #8b949e;
  --muted: #656d76;
  --accent: #1a7f37;
  --success: #1a7f37;
  --error: #cf222e;
  --warning: #bf8700;
  --info: #0969da;
}

body.v2.v2-light .v2-topbar {
  background: #ffffff;
  border-bottom-color: #d1d9e0;
}

body.v2.v2-light .v2-sidebar {
  background: #ffffff;
  border-right-color: #d1d9e0;
}

body.v2.v2-light .v2-nav-item:hover {
  background: rgba(0,0,0,0.04);
}

body.v2.v2-light .v2-nav-item.active {
  background: rgba(26,127,55,0.08);
}

body.v2.v2-light .v2-search {
  background: #f6f8fa;
  border-color: #d1d9e0;
  color: #1f2328;
}

body.v2.v2-light .v2-activity {
  background: #ffffff;
  border-left-color: #d1d9e0;
}

body.v2.v2-light .v2-topbar-btn {
  border-color: #d1d9e0;
  color: #656d76;
}
body.v2.v2-light .v2-topbar-btn:hover {
  background: rgba(0,0,0,0.04);
  color: #1f2328;
}
body.v2.v2-light .v2-topbar-btn.accent {
  border-color: #1a7f37;
  color: #1a7f37;
}
body.v2.v2-light .v2-topbar-btn.accent:hover {
  background: #1a7f37;
  color: #fff;
}

body.v2.v2-light .v2-city-switcher {
  background: #f6f8fa;
  color: #656d76;
  border-color: #d1d9e0;
}

body.v2.v2-light .v2-user-area {
  background: rgba(0,0,0,0.03);
  border-color: #d1d9e0;
}

body.v2.v2-light .v2-card {
  background: #ffffff;
  border-color: #d1d9e0;
}
body.v2.v2-light .v2-card:hover {
  border-color: #b0b8c1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body.v2.v2-light .v2-modal {
  background: #ffffff;
  border-color: #d1d9e0;
}

body.v2.v2-light .v2-modal-field input,
body.v2.v2-light .v2-modal-field textarea,
body.v2.v2-light .v2-modal-field select {
  background: #f6f8fa;
  border-color: #d1d9e0;
  color: #1f2328;
}

/* V1 compat components in light mode */
body.v2.v2-light .btn {
  background: #ffffff;
  border-color: #d1d9e0;
  color: #1f2328;
}
body.v2.v2-light .btn:hover { background: #f6f8fa; }
body.v2.v2-light .btn-primary { background: #1a7f37; color: #fff; border-color: #1a7f37; }
body.v2.v2-light .btn-primary:hover { background: #2da44e; }
body.v2.v2-light .btn-secondary { background: #ffffff; color: #656d76; }

body.v2.v2-light .card {
  background: #ffffff;
  border-color: #d1d9e0;
}
body.v2.v2-light .card-header { border-bottom-color: #d1d9e0; }

body.v2.v2-light .pill {
  background: #ffffff;
  border-color: #d1d9e0;
  color: #656d76;
}
body.v2.v2-light .pill.active { background: #1a7f37; color: #fff; border-color: #1a7f37; }

body.v2.v2-light .modal {
  background: #ffffff;
  border-color: #d1d9e0;
}

body.v2.v2-light .label-menu {
  background: #ffffff;
  border-color: #d1d9e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
body.v2.v2-light .label-menu-item { color: #1f2328; }
body.v2.v2-light .label-menu-item:hover { background: #f6f8fa; }

body.v2.v2-light .compose-container {
  background: #ffffff;
  border-color: #d1d9e0;
}

/* ── Read-Only Masquerade Mode ── */
body.v2.v2-read-only input:not(.v2-search):not(#v2-otp-input):not([data-readonly-safe]),
body.v2.v2-read-only textarea,
body.v2.v2-read-only select:not(.v2-city-switcher):not(.v2-filter-select) {
  pointer-events: none;
  opacity: 0.5;
}
/* City tab restriction dimming */
.v2-nav-item.city-restricted { opacity: 0.3; position: relative; }
.v2-nav-item.city-restricted .v2-nav-label::after { content: ' 🔒'; font-size: 0.7em; }

body.v2.v2-read-only button:not(.v2-sidebar-toggle):not(.v2-topbar-btn):not(.v2-nav-item):not(#v2-lock-btn):not(.v2-activity-toggle):not(.v2-filter-select):not(.v2-filter-btn):not(.filter-btn):not([data-readonly-safe]) {
  pointer-events: none;
  opacity: 0.4;
}
body.v2.v2-read-only .v2-filter-btn,
body.v2.v2-read-only .filter-btn {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}
/* Allow safe interactions in read-only mode */
body.v2.v2-read-only [data-readonly-safe],
body.v2.v2-read-only [data-filter-value],
body.v2.v2-read-only [onclick*="toggleTodoDetails"],
body.v2.v2-read-only [onclick*="Toggle"],
body.v2.v2-read-only [onclick*="_setTodoFilter"],
body.v2.v2-read-only [onclick*="_switchTodoFilter"],
body.v2.v2-read-only [onclick*="_pursuePartnership"],
body.v2.v2-read-only [onclick*="_scanCardForPartner"],
body.v2.v2-read-only [onclick*="toggleMasqueradeLock"] {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}
body.v2.v2-read-only [onclick*="delete"],
body.v2.v2-read-only [onclick*="Delete"],
body.v2.v2-read-only [onclick*="save"],
body.v2.v2-read-only [onclick*="Save"],
body.v2.v2-read-only [onclick*="post"],
body.v2.v2-read-only [onclick*="Post"],
body.v2.v2-read-only [onclick*="add"],
body.v2.v2-read-only [onclick*="Add"],
body.v2.v2-read-only [onclick*="create"],
body.v2.v2-read-only [onclick*="Create"] {
  pointer-events: none !important;
  opacity: 0.3 !important;
}
body.v2.v2-read-only .v2-btn-primary {
  pointer-events: none;
  opacity: 0.3;
}

/* Read-only banner at bottom of main content */
body.v2.v2-read-only .v2-main::after {
  content: '🔒 Read-only mode — viewing as another city';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(210,153,34,0.15);
  color: var(--v2-orange);
  text-align: center;
  padding: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  border-top: 1px solid rgba(210,153,34,0.3);
  z-index: 50;
}

/* ── Pipeline Board ── */
.pipeline-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1rem 0;
  min-height: 400px;
}
.pipeline-column {
  min-width: 220px;
  max-width: 280px;
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--v2-card-border);
  background: var(--v2-card-bg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
}
.pipeline-col-header {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--v2-text-muted);
  border-bottom: 1px solid var(--v2-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pipeline-col-header .count {
  background: rgba(255,255,255,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
}
.pipeline-cards {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pipeline-card {
  background: var(--v2-bg);
  border: 1px solid var(--v2-card-border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font-size: 0.8rem;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pipeline-card:hover {
  border-color: var(--v2-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pipeline-card-church {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  color: var(--v2-text);
}
.pipeline-card-city {
  color: var(--v2-text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}
.pipeline-card-info {
  font-size: 0.75rem;
  color: var(--v2-text);
  line-height: 1.4;
}
.pipeline-card-info a { color: var(--v2-accent); text-decoration: none; }
.pipeline-card-info a:hover { text-decoration: underline; }
.pipeline-card-info a.email-link { color: var(--v2-accent); }
.pipeline-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.pipeline-move-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--v2-text-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background 0.15s;
}
.pipeline-move-btn:hover { background: rgba(255,255,255,0.15); color: var(--v2-text); }
.pipeline-card[draggable="true"] { cursor: grab; }
.pipeline-card.dragging { opacity: 0.4; transform: scale(0.95); }
.pipeline-column.drag-over { border: 2px dashed var(--v2-accent); background: rgba(139,92,246,0.05); }

/* Pipeline toolbar */
.pipeline-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Mobile pipeline: horizontal scroll */
@media (max-width: 640px) {
  .pipeline-board { min-height: 300px; }
  .pipeline-column { min-width: 200px; }
}

/* ── Responsive ── */

/* Tablet landscape */
@media (max-width: 1200px) {
  .v2-activity { display: none; }
  .v2-main, .v2-main.activity-open { right: 0; }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .v2-kanban { grid-template-columns: repeat(2, 1fr); }
  .v2-sidebar { width: var(--v2-sidebar-collapsed); }
  .v2-sidebar .v2-nav-label { opacity: 0; width: 0; overflow: hidden; }
  .v2-sidebar .v2-nav-section-title { opacity: 0; height: 0; margin: 0; padding: 0; overflow: hidden; }
  .v2-sidebar .v2-nav-item { justify-content: center; padding: 10px 0; }
  .v2-sidebar .v2-nav-item .v2-nav-icon { margin: 0; }
  .v2-main { left: var(--v2-sidebar-collapsed); }
  .v2-stats-bar { gap: 10px; }
  .v2-stat-card { min-width: 100px; padding: 10px 14px; }
  .v2-stat-value { font-size: 1.2rem; }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --v2-topbar-height: 48px;
  }
  
  /* Hide sidebar by default on mobile, show as overlay */
  .v2-sidebar {
    width: var(--v2-sidebar-width);
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .v2-sidebar.mobile-open {
    transform: translateX(0);
  }
  .v2-sidebar.mobile-open .v2-nav-label { opacity: 1; width: auto; }
  .v2-sidebar.mobile-open .v2-nav-section-title { opacity: 1; height: auto; margin: initial; padding: 16px 16px 6px; }
  .v2-sidebar.mobile-open .v2-nav-item { justify-content: flex-start; padding: 8px 16px; }
  .v2-sidebar.mobile-open .v2-nav-item .v2-nav-icon { margin-right: 10px; }
  
  /* Mobile overlay backdrop */
  .v2-sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }
  .v2-sidebar-backdrop.visible { display: block; }
  
  .v2-main {
    left: 0;
    padding: 16px 12px;
  }
  .v2-main.sidebar-collapsed { left: 0; }
  
  /* Top bar mobile */
  .v2-topbar { padding: 0 12px; }
  .v2-topbar-title { font-size: 0.95rem; }
  .v2-topbar-center { display: none; }
  .v2-topbar-right .v2-city-switcher { display: none; }
  .v2-topbar-right .v2-topbar-btn:not(.v2-mobile-menu) { display: none; }
  .v2-user-area { display: none; }
  .v2-sidebar-city-switcher { display: block; padding: 12px 16px; border-bottom: 1px solid var(--v2-card-border); }
  .v2-sidebar-city-switcher .v2-city-switcher { width: 100%; font-size: 0.85rem; padding: 8px 10px; }
  
  /* Stats bar horizontal scroll */
  .v2-stats-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
    margin-bottom: 16px;
  }
  .v2-stats-bar::-webkit-scrollbar { display: none; }
  .v2-stat-card { min-width: 110px; flex: 0 0 auto; padding: 10px 14px; }
  .v2-stat-value { font-size: 1.1rem; }
  .v2-stat-label { font-size: 0.68rem; }
  
  /* Kanban single column on mobile */
  .v2-kanban { grid-template-columns: 1fr; gap: 12px; }
  .v2-kanban-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .v2-kanban-filters { flex-wrap: wrap; }
  
  /* Task cards slightly larger touch targets */
  .v2-task-card { padding: 14px; }
  .v2-task-title { font-size: 0.88rem; }
  
  /* Modal full-width on mobile */
  .v2-modal { width: 95vw; max-height: 90vh; padding: 18px; border-radius: 10px; }
  
  /* General card adjustments */
  .v2-card { padding: 12px; }

}

/* Small mobile (iPhone SE etc) */
@media (max-width: 380px) {
  .v2-stat-card { min-width: 90px; padding: 8px 10px; }
  .v2-stat-value { font-size: 1rem; }
  .v2-topbar-title { font-size: 0.85rem; }
}

/* ===== Calendar V2 ===== */
.cal2 { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cal2-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--v2-card-border); flex-shrink: 0; }
.cal2-header-left { display: flex; align-items: center; gap: 8px; }
.cal2-header-right { display: flex; align-items: center; gap: 12px; }
.cal2-title { font-size: 1.25rem; font-weight: 600; color: var(--v2-text); margin: 0; padding-left: 8px; }
.cal2-btn { background: var(--v2-card); border: 1px solid var(--v2-card-border); color: var(--v2-text); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: background 0.15s; }
.cal2-btn:hover { background: var(--v2-card-border); }
.cal2-nav-btn { background: none; border: none; color: var(--v2-text-secondary); font-size: 1.4rem; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.cal2-nav-btn:hover { background: var(--v2-card); }
.cal2-today-btn { font-weight: 600; }
.cal2-settings-btn { font-size: 1.1rem; padding: 6px 10px; }
.cal2-view-toggle { display: flex; border: 1px solid var(--v2-card-border); border-radius: 6px; overflow: hidden; }
.cal2-view-btn { background: var(--v2-card); border: none; color: var(--v2-text-secondary); padding: 6px 14px; cursor: pointer; font-size: 0.8rem; border-right: 1px solid var(--v2-card-border); transition: all 0.15s; }
.cal2-view-btn:last-child { border-right: none; }
.cal2-view-btn.active { background: var(--v2-accent); color: #fff; }
.cal2-view-btn:hover:not(.active) { background: var(--v2-card-border); }

.cal2-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.cal2-sidebar { width: 200px; flex-shrink: 0; padding: 12px; border-right: 1px solid var(--v2-card-border); overflow-y: auto; }

/* Mini Calendar */
.cal2-mini-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal2-mini-title { font-size: 0.85rem; font-weight: 600; color: var(--v2-text); }
.cal2-mini-nav { background: none; border: none; color: var(--v2-text-secondary); cursor: pointer; font-size: 1.1rem; padding: 2px 6px; border-radius: 4px; }
.cal2-mini-nav:hover { background: var(--v2-card); }
.cal2-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.cal2-mini-dh { font-size: 0.65rem; color: var(--v2-text-muted); padding: 2px 0; }
.cal2-mini-cell { font-size: 0.75rem; padding: 3px 0; border-radius: 50%; }
.cal2-mini-day { color: var(--v2-text-secondary); cursor: pointer; }
.cal2-mini-day:hover { background: var(--v2-card-border); }
.cal2-mini-today { background: var(--v2-accent); color: #fff !important; font-weight: 700; }
.cal2-mini-selected { outline: 2px solid var(--v2-blue); }

/* Week/Day Grid */
.cal2-main { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.cal2-grid { display: flex; flex-direction: column; height: 100%; }
.cal2-grid-header { display: flex; border-bottom: 1px solid var(--v2-card-border); flex-shrink: 0; }
.cal2-grid-gutter { width: 56px; flex-shrink: 0; }
.cal2-grid-day-header { flex: 1; text-align: center; padding: 8px 0; }
.cal2-day-name { display: block; font-size: 0.7rem; color: var(--v2-text-secondary); text-transform: uppercase; }
.cal2-day-num { display: inline-block; font-size: 1.1rem; font-weight: 600; color: var(--v2-text); width: 32px; height: 32px; line-height: 32px; border-radius: 50%; }
.cal2-today-header .cal2-day-name { color: var(--v2-accent); }
.cal2-today-num { background: var(--v2-accent); color: #fff !important; }
.cal2-grid-body { display: flex; flex: 1; overflow-y: auto; position: relative; }
.cal2-grid-body .cal2-grid-gutter { padding-top: 0; }
.cal2-hour-label { height: 48px; font-size: 0.65rem; color: var(--v2-text-muted); text-align: right; padding-right: 8px; line-height: 1; position: relative; top: -6px; }
.cal2-day-col { flex: 1; position: relative; border-left: 1px solid var(--v2-card-border); }
.cal2-hour-slot { height: 48px; border-bottom: 1px solid rgba(48,54,61,0.4); cursor: pointer; }
.cal2-hour-slot:hover { background: rgba(46,160,67,0.06); }

/* Events */
.cal2-event-block { position: absolute; left: 2px; right: 4px; border-radius: 4px; padding: 2px 6px; overflow: hidden; cursor: pointer; z-index: 2; opacity: 0.92; font-size: 0.75rem; transition: opacity 0.15s; }
.cal2-event-block:hover { opacity: 1; }
.cal2-event-title { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal2-event-time { color: rgba(255,255,255,0.8); font-size: 0.65rem; }

/* Now line */
.cal2-now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--v2-red); z-index: 3; pointer-events: none; }
.cal2-now-line::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; background: var(--v2-red); border-radius: 50%; }

/* Month View */
.cal2-month-table { width: 100%; border-collapse: collapse; flex: 1; table-layout: fixed; }
.cal2-month-table th { padding: 8px 0; font-size: 0.75rem; color: var(--v2-text-secondary); text-transform: uppercase; font-weight: 600; text-align: center; border-bottom: 1px solid var(--v2-card-border); }
.cal2-month-table td { border: 1px solid var(--v2-card-border); padding: 4px 6px; vertical-align: top; cursor: pointer; height: 90px; overflow: hidden; }
.cal2-month-table td:hover { background: var(--v2-card); }
.cal2-month-table td.cal2-month-empty { opacity: 0.3; }
.cal2-month-table td.cal2-month-today { background: rgba(46,160,67,0.08); }
.cal2-month-date { font-size: 0.82rem; color: var(--v2-text-secondary); margin-bottom: 4px; font-weight: 500; }
.cal2-month-today .cal2-month-date { color: var(--v2-accent); font-weight: 700; }
.cal2-month-event { font-size: 0.68rem; color: #fff; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; display: block; }
.cal2-month-more { font-size: 0.65rem; color: var(--v2-text-secondary); padding: 1px 4px; }

/* Popups & Panels */
.cal2-popup, .cal2-settings-panel, .cal2-create-panel { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); }
.cal2-popup-inner, .cal2-settings-inner { background: var(--v2-card); border: 1px solid var(--v2-card-border); border-radius: 12px; padding: 24px; max-width: 480px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; }
.cal2-popup-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--v2-text-secondary); font-size: 1.4rem; cursor: pointer; }
.cal2-popup-close:hover { color: var(--v2-text); }
.cal2-popup-inner h3 { margin: 0 0 12px; color: var(--v2-text); }
.cal2-popup-row { color: var(--v2-text-secondary); font-size: 0.85rem; margin-bottom: 6px; }
.cal2-popup-row:empty { display: none; }

.cal2-settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal2-settings-header h3 { margin: 0; color: var(--v2-text); }
.cal2-input { width: 100%; background: var(--v2-bg); border: 1px solid var(--v2-card-border); color: var(--v2-text); padding: 8px 10px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 8px; box-sizing: border-box; }
.cal2-input:focus { outline: none; border-color: var(--v2-accent); }
.cal2-color-input { width: 40px; height: 36px; border: none; cursor: pointer; background: none; }

/* ICS items */
.cal2-ics-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--v2-card-border); }
.cal2-ics-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cal2-ics-info { flex: 1; min-width: 0; }
.cal2-ics-name { font-weight: 600; color: var(--v2-text); font-size: 0.85rem; }
.cal2-ics-url { font-size: 0.7rem; color: var(--v2-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal2-ics-meta { font-size: 0.7rem; color: var(--v2-text-secondary); }
.cal2-ics-error { font-size: 0.7rem; color: var(--v2-red); }
.cal2-ics-add { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--v2-card-border); }
.cal2-ics-add h4 { margin: 0 0 10px; color: var(--v2-text); font-size: 0.9rem; }
.cal2-ics-add-row { display: flex; align-items: center; gap: 8px; }
.cal2-ics-add-row .cal2-btn { flex-shrink: 0; }
.cal2-ics-refresh, .cal2-ics-delete { padding: 4px 8px; font-size: 0.85rem; }

/* Light mode */
body.v2.v2-light .cal2-hour-slot { border-bottom-color: rgba(0,0,0,0.08); }
body.v2.v2-light .cal2-event-block { opacity: 0.95; }

/* Responsive */
@media (max-width: 768px) {
  .cal2-sidebar { display: none; }
  .cal2-grid-gutter { width: 40px; }
  .cal2-hour-label { font-size: 0.6rem; }
}

/* ===== Contacts V2 ===== */
.cv2-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.cv2-title { font-size: 1.3rem; font-weight: 700; margin: 0; }
.cv2-subtitle { color: var(--v2-text-secondary); font-size: 0.82rem; margin-top: 2px; }
.cv2-header-actions { display: flex; gap: 8px; }
.cv2-search-bar { margin-bottom: 16px; }
.cv2-search-bar .v2-search { width: 100%; }

/* Call Logs Section */
.cv2-call-logs-section { margin-bottom: 20px; }
.cv2-call-logs-header {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--v2-text);
}
.cv2-call-log-entry {
  padding: 10px 0; border-top: 1px solid var(--v2-card-border);
}
.cv2-call-log-top {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.cv2-call-log-info { font-size: 0.82rem; color: var(--v2-text); }
/* ── Filter Buttons (legacy .filter-btn used on Documents, Content, etc.) ── */
.filter-btn {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--v2-border);
  background: transparent; color: var(--v2-text-secondary); cursor: pointer;
  font-size: 0.82rem; font-family: inherit; transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--v2-accent); color: var(--v2-text); background: rgba(255,255,255,0.04); }
.filter-btn.active { background: var(--v2-accent); border-color: var(--v2-accent); color: #000; font-weight: 500; }

.cv2-call-log-type { color: var(--v2-blue); font-weight: 500; }
.cv2-call-lead-badge { background: var(--v2-blue-bg, #e8f0fe); color: var(--v2-blue); padding: 1px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.cv2-call-log-notes { font-size: 0.78rem; color: var(--v2-text-secondary); margin-top: 4px; }

/* Contacts Grid */
.cv2-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 1100px) { .cv2-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .cv2-grid { grid-template-columns: 1fr; }
  .cv2-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .cv2-header-actions { width: 100%; display: flex; gap: 8px; }
  .cv2-header-actions .v2-btn { flex: 1; text-align: center; font-size: 0.78rem; padding: 10px 8px; white-space: nowrap; }
  .cv2-search-bar { margin-bottom: 12px; }
  .cv2-search-bar .v2-search { font-size: 16px; padding: 10px 12px; box-sizing: border-box; width: 100%; }
  .cv2-call-logs-section { font-size: 0.82rem; }
  .cv2-call-logs-header { font-size: 0.85rem; padding: 10px 14px; }
  .cv2-contact-card { padding: 14px; }
  .cv2-card-top { flex-wrap: wrap; gap: 10px; }
  .cv2-card-avatar { width: 36px; height: 36px; font-size: 0.85rem; }
  /* Modal mobile fix */
  .v2-modal { width: 95vw !important; max-width: 95vw !important; padding: 16px; }
  .v2-modal input, .v2-modal textarea, .v2-modal select { font-size: 16px; }
}

/* Global mobile box-sizing fix */
@media (max-width: 640px) {
  #v2-page-content { overflow-x: hidden; max-width: 100%; }
  #v2-page-content * { max-width: 100%; box-sizing: border-box; }
  .v2-card { padding: 14px; overflow: hidden; }
}

/* Contact Card */
.cv2-contact-card {
  position: relative; padding: 20px !important;
  transition: border-color 0.2s;
}
.cv2-contact-card:hover { border-color: var(--v2-accent) !important; }

/* Card Actions — top-right, visible on hover */
.cv2-card-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.cv2-contact-card:hover .cv2-card-actions { opacity: 1; }
/* Touch devices (Tesla browser, phones) don't have reliable hover — keep actions visible */
@media (hover: none) {
  .cv2-card-actions { opacity: 1; }
}
.cv2-action-btn {
  background: none; border: 1px solid transparent; cursor: pointer;
  font-size: 0.9rem; padding: 4px 6px; border-radius: 6px;
  transition: background 0.15s;
}
.cv2-action-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--v2-card-border); }
.cv2-action-danger:hover { background: rgba(248,81,73,0.15); }

/* Card Top (Avatar + Name) */
.cv2-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cv2-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: #fff; flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.cv2-card-identity { min-width: 0; }
.cv2-card-name { font-weight: 600; font-size: 0.95rem; color: var(--v2-text); }
.cv2-card-company { font-size: 0.78rem; color: var(--v2-text-secondary); margin-top: 2px; }

/* Card Details */
.cv2-card-details { margin-bottom: 10px; }
.cv2-detail-row {
  font-size: 0.8rem; color: var(--v2-text-secondary); padding: 2px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cv2-card-notes {
  font-size: 0.78rem; color: var(--v2-text-muted); margin-bottom: 10px;
  line-height: 1.5; white-space: pre-wrap;
}

/* Collapsible Details / Activity / Attachments */
.cv2-details { margin-top: 8px; }
.cv2-details-toggle {
  font-size: 0.78rem; color: var(--v2-text-secondary); cursor: pointer;
  padding: 4px 0; list-style: none;
}
.cv2-details-toggle::-webkit-details-marker { display: none; }
.cv2-details-toggle::before { content: '▸ '; }
.cv2-details[open] .cv2-details-toggle::before { content: '▾ '; }
.cv2-details-body { padding: 8px 0 0 4px; }
.cv2-activity-entry {
  font-size: 0.75rem; color: var(--v2-text-secondary); padding: 3px 0;
  border-left: 2px solid var(--v2-card-border); padding-left: 10px; margin-bottom: 4px;
}
.cv2-attachment-item { padding: 6px 0; }
.cv2-attachment-name { font-size: 0.78rem; color: var(--v2-text); }
.cv2-attachment-meta { font-size: 0.7rem; color: var(--v2-text-muted); }
.cv2-file-link { color: var(--v2-blue); font-size: 0.75rem; text-decoration: none; }
.cv2-file-link:hover { text-decoration: underline; }

/* Participant Chips */
.cv2-participant-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cv2-p-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(46,160,67,0.12); color: var(--v2-accent); border: 1px solid rgba(46,160,67,0.3);
  border-radius: 16px; padding: 4px 10px; font-size: 0.78rem;
}
.cv2-p-tag-remove { background: none; border: none; color: var(--v2-text-muted); cursor: pointer; font-size: 1rem; padding: 0 2px; }
.cv2-p-tag-remove:hover { color: var(--v2-red); }
.cv2-participant-add-row { display: flex; gap: 6px; align-items: center; }
.cv2-p-input { flex: 1; padding: 7px 10px; background: var(--v2-bg); border: 1px solid var(--v2-card-border); border-radius: 6px; color: var(--v2-text); font-size: 0.82rem; font-family: inherit; }
.cv2-p-input:focus { border-color: var(--v2-accent); outline: none; }
.cv2-p-email { flex: 1.5; }
.cv2-participant-suggest { margin-top: 4px; }
.cv2-suggest-item { padding: 6px 10px; font-size: 0.82rem; cursor: pointer; border-radius: 4px; color: var(--v2-text); }
.cv2-suggest-item:hover { background: rgba(255,255,255,0.06); }
.cv2-suggest-empty { padding: 6px 10px; font-size: 0.78rem; color: var(--v2-text-muted); }
.cv2-participant-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cv2-chip {
  padding: 5px 12px; border-radius: 16px; border: 1px solid var(--v2-card-border);
  background: var(--v2-card); color: var(--v2-text-secondary); cursor: pointer;
  font-size: 0.78rem; transition: all 0.15s;
}
.cv2-chip:hover { border-color: var(--v2-accent); }
.cv2-chip-selected {
  background: rgba(46,160,67,0.2); border-color: var(--v2-accent); color: var(--v2-accent);
}

/* Light mode overrides */
body.v2.v2-light .cv2-contact-card:hover { border-color: var(--v2-accent) !important; }
body.v2.v2-light .cv2-action-btn { color: #111; }
body.v2.v2-light .cv2-action-btn:hover { background: rgba(0,0,0,0.06); }
body.v2.v2-light .cv2-chip { background: #f6f8fa; }
body.v2.v2-light .cv2-chip-selected { background: rgba(26,127,55,0.12); }

/* ===== Research V2 ===== */
.rv2-container { max-width: 100%; }
.rv2-header { margin-bottom: 20px; }
.rv2-title { font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--v2-text); }
.rv2-subtitle { color: var(--v2-text-secondary); font-size: 0.82rem; margin-top: 4px; }
.rv2-section { margin-bottom: 20px; min-width: 0; }
.rv2-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.rv2-section-title { margin: 0; color: var(--v2-text); font-size: 1rem; font-weight: 600; }
.rv2-manage-btn { font-size: 0.75rem; padding: 4px 10px; }
.rv2-hidden { display: none !important; }
.rv2-field { margin-bottom: 16px; }
.rv2-label { font-size: 0.75rem; color: var(--v2-text-secondary); display: block; margin-bottom: 6px; }
.rv2-hint { font-size: 0.7rem; color: var(--v2-text-muted); margin-bottom: 6px; }
.rv2-input { width: 100%; padding: 8px 12px; background: var(--v2-bg); border: 1px solid var(--v2-card-border); color: var(--v2-text); border-radius: 6px; font-size: 0.85rem; font-family: inherit; box-sizing: border-box; outline: none; }
.rv2-input:focus { border-color: var(--v2-accent); }
.rv2-textarea { resize: vertical; }
.rv2-mono { font-family: monospace; font-size: 0.8rem; }
.rv2-desc { color: var(--v2-text-secondary); font-size: 0.8rem; margin: 0 0 12px 0; }
.rv2-import-name-row { margin-bottom: 8px; }
.rv2-dispatch { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.rv2-status { font-size: 0.78rem; color: var(--v2-text-secondary); }
.rv2-success { color: var(--v2-accent); }
.rv2-error { color: var(--v2-red); }
.rv2-muted { color: var(--v2-text-muted); font-size: 0.8rem; }
.rv2-loading { text-align: center; padding: 40px; color: var(--v2-text-secondary); }
.rv2-empty { color: var(--v2-text-muted); font-size: 0.82rem; text-align: center; padding: 24px; }

/* Type picker */
.rv2-type-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.rv2-type-btn { padding: 10px 16px; border-radius: 8px; border: 2px solid var(--v2-card-border); background: var(--v2-bg); color: var(--v2-text); cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; transition: all 0.2s; font-family: inherit; }
.rv2-type-btn:hover { border-color: var(--v2-accent); }
.rv2-type-selected { border-color: var(--v2-accent) !important; background: rgba(46,160,67,0.1); }
.rv2-type-icon { font-size: 1.2rem; }
.rv2-type-name { font-size: 0.85rem; }

/* Project cards */
.rv2-projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rv2-project-card { cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.rv2-project-card:hover { border-color: var(--v2-accent); transform: translateY(-1px); }
.rv2-project-name { font-weight: 600; font-size: 0.95rem; color: var(--v2-text); margin-bottom: 8px; }
.rv2-project-meta { display: flex; gap: 12px; align-items: center; font-size: 0.78rem; color: var(--v2-text-secondary); flex-wrap: wrap; }

/* Project detail view */
.rv2-back-btn { margin-bottom: 12px; }
.rv2-detail-title { font-size: 1.15rem; font-weight: 700; color: var(--v2-text); margin-bottom: 4px; }
.rv2-detail-meta { color: var(--v2-text-secondary); font-size: 0.82rem; margin-bottom: 16px; }
.rv2-leads-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rv2-select-all { font-size: 0.82rem; color: var(--v2-text-secondary); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rv2-checkbox { accent-color: var(--v2-accent); }

/* Leads table */
.rv2-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--v2-card-border); }
.rv2-table { width: 100%; border-collapse: collapse; background: var(--v2-card); font-size: 0.82rem; }
.rv2-table th, .rv2-table td { white-space: nowrap; padding: 10px 8px; }
.rv2-table thead { background: var(--v2-bg); }
.rv2-table th { text-align: left; color: var(--v2-text-secondary); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--v2-card-border); }
.rv2-th-check { width: 40px; }
.rv2-table td { border-bottom: 1px solid var(--v2-card-border); color: var(--v2-text); }
.rv2-table tr:last-child td { border-bottom: none; }
.rv2-table tr:hover { background: rgba(255,255,255,0.02); }
.rv2-row-pipeline { text-decoration: line-through; opacity: 0.45; }
.rv2-link { color: var(--v2-blue); text-decoration: none; }
.rv2-link:hover { text-decoration: underline; }
.rv2-link-accent { color: var(--v2-accent); text-decoration: none; }
.rv2-link-accent:hover { text-decoration: underline; }
.rv2-priority { font-size: 0.78rem; }

/* Modal types list */
.rv2-types-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rv2-type-item { background: var(--v2-bg); border-radius: 8px; padding: 12px; display: flex; justify-content: space-between; align-items: center; }
.rv2-type-item-info { display: flex; align-items: center; gap: 10px; }
.rv2-type-item-name { color: var(--v2-text); font-weight: 600; font-size: 0.85rem; }
.rv2-type-item-desc { color: var(--v2-text-secondary); font-size: 0.75rem; }
.rv2-delete-btn { padding: 4px 8px; font-size: 0.75rem; color: var(--v2-red); }
.rv2-modal-divider { border-top: 1px solid var(--v2-card-border); padding-top: 16px; }
.rv2-add-type-section { }
.rv2-add-type-label { font-size: 0.82rem; color: var(--v2-text-secondary); margin-bottom: 8px; font-weight: 600; }
.rv2-add-type-form { display: flex; flex-direction: column; gap: 8px; }
.rv2-add-type-row { display: flex; gap: 8px; }
.rv2-icon-input { width: 50px !important; text-align: center; font-size: 1.1rem; flex: none; }
.rv2-flex { flex: 1; }
.rv2-import-btn { background: var(--v2-accent); }

/* Active Research */
.rv2-active-list { display: flex; flex-direction: column; gap: 8px; }
.rv2-active-card { padding: 12px 16px; background: var(--v2-bg); border: 1px solid var(--v2-card-border); border-radius: 8px; }
.rv2-active-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rv2-active-params { color: var(--v2-text-secondary); font-size: 0.8rem; margin-bottom: 4px; }
.rv2-active-time { color: var(--v2-text-secondary); font-size: 0.72rem; opacity: 0.7; }
.rv2-dispatch-delete { background: none; border: none; cursor: pointer; font-size: 0.85rem; opacity: 0.6; padding: 2px 6px; margin-left: 6px; border-radius: 4px; }
.rv2-dispatch-delete:hover { opacity: 1; background: rgba(255,0,0,0.15); }
.rv2-pulse { animation: rv2-pulse-anim 1.5s ease-in-out infinite; }
@keyframes rv2-pulse-anim { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.v2-badge.blue { background: rgba(59,130,246,0.15); color: #60a5fa; }

/* Light mode */
body.v2.v2-light .rv2-type-btn { background: var(--v2-bg); border-color: var(--v2-card-border); }
body.v2.v2-light .rv2-type-selected { background: rgba(26,127,55,0.08); border-color: var(--v2-accent) !important; }
body.v2.v2-light .rv2-type-item { background: var(--v2-bg); }
body.v2.v2-light .rv2-table thead { background: var(--v2-bg); }
body.v2.v2-light .rv2-table tr:hover { background: rgba(0,0,0,0.02); }

/* Responsive */
@media (max-width: 640px) {
  .rv2-projects-grid { grid-template-columns: 1fr; }
  .rv2-leads-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .rv2-section-header { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* Mobile "Ask AI" FAB */
.v2-fab-ai {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: bottom 0.2s ease;
}
body.v2-read-only .v2-fab-ai { bottom: 50px; }
@media (max-width: 640px) {
  .v2-fab-ai { display: block; }
}

/* ========== Import Wizard ========== */
.rv2-import-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 12px 0; border-bottom: 1px solid var(--v2-card-border); }
.rv2-import-step { display: flex; align-items: center; gap: 6px; color: var(--v2-text-muted); font-size: 0.85rem; font-weight: 500; }
.rv2-import-step-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--v2-card-border); color: var(--v2-text-muted); font-size: 0.75rem; font-weight: 700; }
.rv2-import-step-active { color: var(--v2-accent); }
.rv2-import-step-active .rv2-import-step-num { background: var(--v2-accent); color: #fff; }
.rv2-import-step-done { color: var(--v2-text-secondary); }
.rv2-import-step-done .rv2-import-step-num { background: var(--v2-accent); color: #fff; opacity: 0.6; }
.rv2-import-step-arrow { color: var(--v2-text-muted); font-size: 0.8rem; }
.rv2-import-panel { }
.rv2-import-upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rv2-import-file-label { cursor: pointer; }
.rv2-import-file-name { color: var(--v2-text-secondary); font-size: 0.85rem; }
.rv2-import-or { text-align: center; color: var(--v2-text-muted); font-size: 0.8rem; margin: 8px 0; }
.rv2-import-subtitle { color: var(--v2-text-secondary); font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.rv2-import-mapping { display: flex; flex-direction: column; gap: 6px; }
.rv2-import-map-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.03); border: 1px solid var(--v2-card-border); }
.rv2-import-map-matched { border-color: var(--v2-accent); background: rgba(46,160,67,0.08); }
.rv2-import-map-source { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rv2-import-map-col { font-weight: 600; font-size: 0.85rem; color: var(--v2-text); }
.rv2-import-map-sample { font-size: 0.75rem; color: var(--v2-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv2-import-map-select { flex-shrink: 0; width: 240px; }
.rv2-import-nav { display: flex; gap: 8px; margin-top: 16px; }
.rv2-import-ready { padding: 12px; border-radius: 8px; background: rgba(46,160,67,0.1); border: 1px solid var(--v2-accent); color: var(--v2-text); font-size: 0.9rem; margin-bottom: 12px; }

/* ── Learning Page ── */
.learning-container { padding: 1.5rem; }
.learning-header { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.learning-header h2 { font-size: 1.5rem; margin-bottom: 0.25rem; color: var(--v2-text); }
.learning-subtitle { color: var(--v2-text-muted); font-size: 0.9rem; }
.learning-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.learning-filter { padding: 0.4rem 0.8rem; border-radius: 20px; border: 1px solid var(--v2-card-border); background: transparent; color: var(--v2-text-muted); cursor: pointer; font-size: 0.8rem; font-family: inherit; transition: all 0.2s; }
.learning-filter:hover { border-color: var(--v2-accent); color: var(--v2-text); }
.learning-filter.active { background: var(--v2-accent); border-color: var(--v2-accent); color: #fff; }
.learning-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.learning-card { background: var(--v2-card); border: 1px solid var(--v2-card-border); border-radius: 12px; overflow: hidden; transition: all 0.3s ease; }
.learning-card:hover { border-color: var(--v2-accent); transform: translateY(-4px); box-shadow: 0 8px 30px rgba(108,99,255,0.15); }
.learning-thumbnail { width: 100%; height: 180px; position: relative; overflow: hidden; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.learning-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.learning-card:hover .learning-thumbnail img { transform: scale(1.05); }
.learning-thumbnail-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; opacity: 0.5; }
.learning-play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; background: rgba(0,0,0,0.7); border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.learning-card:hover .learning-play-overlay { opacity: 1; }
.learning-play-overlay::after { content: '▶'; color: white; font-size: 1.5rem; margin-left: 4px; }
.learning-content { padding: 1rem; }
.learning-category { display: inline-block; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 4px; margin-bottom: 0.5rem; font-weight: 500; }
.learning-category.videos { background: rgba(255,0,0,0.2); color: #ff6b6b; }
.learning-category.articles { background: rgba(0,150,255,0.2); color: #5dade2; }
.learning-category.courses { background: rgba(76,175,80,0.2); color: #4caf50; }
.learning-category.tools { background: rgba(255,152,0,0.2); color: #ff9800; }
.learning-title { font-size: 1.1rem; font-weight: 600; color: var(--v2-text); margin-bottom: 0.5rem; line-height: 1.3; }
.learning-notes { font-size: 0.85rem; color: var(--v2-text-muted); line-height: 1.4; }
.learning-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--v2-card-border); display: flex; justify-content: flex-end; }
.learning-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.8rem; text-decoration: none; background: var(--v2-accent); color: #fff; transition: all 0.2s; }
.learning-link:hover { opacity: 0.85; }
.learning-empty { text-align: center; padding: 3rem; color: var(--v2-text-muted); }
.podcast-player { background: var(--v2-card); border: 1px solid var(--v2-card-border); border-radius: 12px; margin-bottom: 1.5rem; overflow: hidden; }
.podcast-player .card-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--v2-card-border); font-weight: 600; color: var(--v2-text); }
.podcast-player .card-body { padding: 16px; }
.podcast-list { list-style: none; padding: 0; margin: 0; }
.podcast-list li { padding: 8px 0; border-bottom: 1px solid var(--v2-card-border); color: var(--v2-text); }
.podcast-player-embed.hidden { display: none; }
@media (max-width: 768px) { .learning-grid { grid-template-columns: 1fr; } }
