/* ============================================================================
   Galactiv8 Control Room — visual design
   "Frequency Alchemy" theme: deep-space glass surfaces, purple/pink glow
   accent, Sora + Maven Pro typography. Re-themed from the original warm/teal
   palette — all components below still consume these same CSS variables, so
   the rest of the file (panels, cards, tasks, calendar, modals) just inherits
   the new look without per-component edits.
   ============================================================================ */

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

:root {
  --bg: #080810;
  --bg-elev: #11111c;
  --bg-elev-2: #181826;
  --border: rgba(255,255,255,0.12);
  --border-soft: rgba(255,255,255,0.07);
  --text: rgba(242,240,255,0.95);
  --text-dim: rgba(242,240,255,0.62);
  --text-faint: rgba(242,240,255,0.38);
  --accent: #b865ff;
  --accent-soft: #b865ff22;
  --accent-2: #e060c8;
  --accent-2-soft: #e060c822;
  --good: #5fd1a8;
  --warn: #e0b860;
  --danger: #ef5e8a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0,0,0,0.45);
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-2));
  --font-display: 'Sora', sans-serif;
  --font-body: 'Maven Pro', sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  /* --hero-photo holds the project's RAW hero image URL (set from JS, see
     applyHeroBackground() in app.js) or `none`. The image is loaded the same
     way the dashboard cards load it — a plain CSS url() — so it is NOT subject
     to the cross-origin fetch()/canvas restrictions that blocked the old
     data-URL approach. The blur + darkening is done in CSS on body::before
     below, not by pre-blurring on a canvas. */
  --hero-photo: none;
  background-image: radial-gradient(ellipse at 12% 0%, rgba(184,101,255,0.10) 0%, transparent 50%),
                     radial-gradient(ellipse at 88% 12%, rgba(224,96,200,0.08) 0%, transparent 45%),
                     radial-gradient(ellipse at 50% 90%, rgba(150,60,220,0.06) 0%, transparent 55%);
  background-size: auto, auto, auto;
  background-position: 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed;
}

/* Blurred, darkened project hero photo, painted as its own fixed layer behind
   all app content (.app-shell is z-index:1). Kept on a real painted element
   rather than the body's own background so blur() composites correctly under
   the sidebar's backdrop-filter. Hidden entirely when --hero-photo is `none`,
   because url(none) is invalid and would otherwise show a broken layer. */
body::before {
  content: "";
  position: fixed;
  inset: -40px; /* overscan so blurred edges don't reveal the page background */
  z-index: 0;
  pointer-events: none;
  background-image: var(--hero-photo);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(32px) brightness(0.55);
  display: none;
}
body.has-hero-photo::before { display: block; }

h1, h2, h3 { font-family: var(--font-display); }

a { color: var(--accent-2); text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 60px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  color: var(--text);
  transition: 0.2s;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 4px 16px -2px var(--accent-soft), 0 0 14px var(--accent-soft);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #0c0612;
  box-shadow: 0 0 18px var(--accent-soft);
}
.btn-primary:hover { filter: brightness(1.1); background: var(--gradient-accent); box-shadow: 0 6px 22px -2px var(--accent-soft), 0 0 24px var(--accent-soft); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--accent-soft); box-shadow: none; transform: translateY(-1px); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); }
.btn-danger.btn-primary { background: var(--danger); color: #2a0a10; box-shadow: 0 0 18px rgba(239,94,138,0.35); }
.btn-danger.btn-primary:hover { filter: brightness(1.1); background: var(--danger); box-shadow: 0 6px 22px -2px rgba(239,94,138,0.4), 0 0 24px rgba(239,94,138,0.35); }

/* ---------- Layout ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  background: rgba(8,8,16,0.72);
  border-right: 1px solid var(--border-soft);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow: 0 0 14px var(--accent);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s;
}
.nav-item:hover { background: var(--accent-soft); color: var(--text); box-shadow: 0 0 12px -2px var(--accent-soft); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.nav-group-toggle { width: 100%; cursor: pointer; }
.nav-group-arrow { margin-left: auto; font-size: 10px; color: var(--text-faint); }
.nav-group { display: flex; flex-direction: column; gap: 4px; padding-left: 16px; }

.nav-draggable { display: flex; align-items: center; gap: 2px; }
.nav-draggable[draggable="true"] { cursor: default; } /* only the handle grabs — nav items/toggles stay clickable */
.nav-draggable-content { flex: 1; min-width: 0; }
.nav-drag-handle {
  color: var(--text-faint);
  cursor: grab;
  font-size: 12px;
  flex-shrink: 0;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.nav-draggable:hover .nav-drag-handle { opacity: 1; }
.nav-drag-handle:active { cursor: grabbing; }
.nav-draggable.dragging { opacity: 0.4; }
.nav-draggable.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.nav-draggable.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

.search-trigger {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  cursor: pointer;
  margin-top: 4px;
}

.shortcuts-help-btn {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.2s;
}
.shortcuts-help-btn:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px -2px var(--accent-soft); }

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-faint);
}

.main {
  padding: 28px 36px 80px;
  max-width: 1760px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; }
.page-header p { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ---------- Timer bar ---------- */
.timer-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(20,20,30,0.72);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 22px;
  font-size: 13px;
}
.timer-bar .clock { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.timer-bar .label { color: var(--text-dim); }
.timer-bar .spacer { flex: 1; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--good);
  animation: pulse 2s infinite;
}
.pulse-dot.paused { background: var(--text-faint); animation: none; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.35;} }

/* ---------- Timer sessions popover ---------- */
.timer-sessions-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: rgba(16,16,24,0.96);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 8px;
  z-index: 90;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}
.timer-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}
.timer-session-row.running { background: rgba(120,200,140,0.08); }
.timer-session-row .timer-session-name { flex: 1; font-size: 13px; }
.timer-session-row .timer-session-clock { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 12px; }
.timer-session-empty { padding: 10px; color: var(--text-dim); font-size: 13px; text-align: center; }

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  background: rgba(10,10,18,0.62);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: 0.2s;
}
.card:hover { background: rgba(14,14,24,0.72); border-color: var(--accent); box-shadow: 0 4px 24px -4px var(--accent-soft), var(--shadow); transform: translateY(-2px); }

.card.creative { border-color: #2c4a55; background: linear-gradient(155deg, rgba(76,160,200,0.08), rgba(255,255,255,0.03)); }

.card.dragging { opacity: 0.4; }
.card.drop-before { box-shadow: inset 2px 0 0 var(--accent); }
.card.drop-after { box-shadow: inset -2px 0 0 var(--accent); }

/* Cards / List view toggle */
.view-toggle { display: inline-flex; gap: 4px; }

/* Compact list view: one row per project, dense alternative to the card grid. */
.project-list { display: flex; flex-direction: column; gap: 6px; }
.project-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--bg-elev-1, var(--bg-elev-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.15s;
}
.project-row:hover { border-color: var(--accent-soft); background: var(--bg-elev-2); }
.project-row.dragging { opacity: 0.4; }
.project-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.project-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.project-row-grip { color: var(--text-faint); cursor: grab; flex-shrink: 0; font-size: 12px; }
.project-row-thumb {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.project-row-thumb-empty { background: var(--gradient-accent); opacity: 0.5; }
.project-row-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row-kind { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.project-row-tasks { font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; }
.project-row-progress { display: flex; align-items: center; gap: 8px; width: 130px; flex-shrink: 0; }
.project-row-progress .progress-track { flex: 1; }
.project-row-pct { font-size: 11px; color: var(--text-dim); width: 32px; text-align: right; }
/* On narrow widths, drop the type + task count so name + progress still fit. */
@media (max-width: 1100px) {
  .project-row-kind, .project-row-tasks { display: none; }
}

/* Compact list rows for the Products and Clients pages (mirror .project-row). */
.product-row, .client-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--bg-elev-1, var(--bg-elev-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.15s;
}
.product-row:hover, .client-row:hover { border-color: var(--accent-soft); background: var(--bg-elev-2); }
.product-row-thumb {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.product-row-thumb-empty { background: var(--gradient-accent); opacity: 0.5; }
.product-row-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-row-owner { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.product-row-price { font-size: 12px; color: var(--text-dim); flex-shrink: 0; width: 60px; text-align: right; }
.client-row-name { font-weight: 600; font-size: 13.5px; flex: 0 0 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row-type { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }
.client-row-working { font-size: 12px; color: var(--text-dim); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row-tasks { font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; }
.customer-row-email { font-size: 12px; color: var(--text-dim); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-row-purchases { font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; }
@media (max-width: 1100px) {
  .product-row-owner, .client-row-working { display: none; }
}

.card-drag-handle {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--text-faint);
  cursor: grab;
  font-size: 14px;
  line-height: 1;
}
.card-drag-handle:active { cursor: grabbing; }

.card-hero {
  height: 110px;
  margin: -18px -18px 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background-size: cover;
  background-position: center;
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0; }
.card-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-active { background: var(--good); color: #06210e; }
.badge-paused { background: var(--warn); color: #2a1d00; }
.badge-done { background: var(--text-faint); color: #0c0a14; }
.badge-blocked { background: var(--danger); color: #2a0613; }
.badge-fork { background: var(--accent-2-soft); color: var(--accent-2); border: 1px solid var(--accent-2); }
.badge-creative { background: #1f3a4a; color: #7fd4f0; }
.badge-seed { background: #1f3a2a; color: #7fe0a0; }

.progress-track {
  height: 6px;
  border-radius: 99px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--gradient-accent); border-radius: 99px; box-shadow: 0 0 8px var(--accent-soft); }

.card-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); flex-wrap: wrap; }
.card-meta span { display: flex; align-items: center; gap: 4px; }

.card-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 0; }

.sibling-link {
  font-size: 12px;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--accent-2-soft);
  border-radius: var(--radius-sm);
}

.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }

/* ---------- Section ---------- */
.section { margin-bottom: 34px; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Project detail ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-grid-3 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1000px) { .detail-grid-3 { grid-template-columns: 1fr; } }

/* Course detail: three balanced columns (left fundamentals, middle cohort
   management, right reference/admin). Each column stacks its panels. */
.detail-grid-course {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1200px) { .detail-grid-course { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .detail-grid-course { grid-template-columns: 1fr; } }

/* ---------- Notes column ---------- */

.note-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }

.note-list { display: flex; flex-direction: column; gap: 10px; }

.note-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.note-folder-row:hover { background: var(--bg-elev-3, var(--bg-elev-2)); outline: 1px solid var(--border); }
.note-folder-arrow { width: 12px; color: var(--text-faint); flex-shrink: 0; font-size: 11px; }
.note-folder-name { flex: 1; }
.note-folder-count { color: var(--text-faint); font-size: 11px; }
/* Per-folder action buttons stay quiet until you hover the row. */
.note-folder-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.note-folder-row:hover .note-folder-actions { opacity: 1; }
/* Folder drag handle — grab to reorder folders. Quiet until row hover. */
.note-folder-drag {
  cursor: grab; color: var(--text-faint); flex-shrink: 0;
  font-size: 12px; line-height: 1; user-select: none; -webkit-user-select: none;
  opacity: 0.35; transition: opacity 0.12s;
}
.note-folder-row:hover .note-folder-drag { opacity: 1; }
.note-folder-drag:active { cursor: grabbing; }
.note-folder-row.folder-dragging { opacity: 0.5; }
.note-folder-row.folder-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.note-folder-row.folder-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
/* Children sit flush under their parent (no big gap), indentation comes from
   inline padding/margin set per depth in the markup. */
.note-folder-children { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.note-card {
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: 0.2s;
}
.note-card:hover { border-color: var(--accent-soft); box-shadow: 0 0 14px -4px var(--accent-soft); transform: translateY(-1px); }
.note-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-card-top strong { flex: 1; }
/* Collapsed (body hidden) — tighter padding and no bottom margin on the title
   row, since there's no body/meta below it to space away from. */
.note-card-collapsed { padding-top: 8px; padding-bottom: 8px; }
.note-card-collapsed .note-card-top { margin-bottom: 0; }
/* Drag handle — grip cursor, quiet until row hover. */
.note-drag-handle {
  cursor: grab; color: var(--text-faint); flex-shrink: 0;
  font-size: 13px; line-height: 1; padding: 2px; user-select: none;
  opacity: 0.45; transition: opacity 0.12s;
}
.note-card:hover .note-drag-handle { opacity: 1; }
.note-drag-handle:active { cursor: grabbing; }
.note-card.dragging { opacity: 0.45; }
/* Drop indicators: a line above/below the card being dropped near. */
.note-card.drop-before { box-shadow: 0 -2px 0 0 var(--accent); }
.note-card.drop-after { box-shadow: 0 2px 0 0 var(--accent); }
/* Folder row (and the explicit Root row) highlighted as a move-into target. */
.note-folder-row.note-drag-over,
.note-root-drop-row.note-drag-over { outline: 1px dashed var(--accent); background: var(--accent-soft); }
/* Explicit "move to root" drop row at the top of the notes tree. */
.note-root-drop-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 12.5px; color: var(--text-dim);
}
.note-root-drop-hint { margin-left: auto; font-size: 10.5px; color: var(--text-faint); }
.note-card-body { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; max-height: 90px; overflow: hidden; }
.note-card-body img { max-width: 100%; border-radius: 6px; margin-top: 4px; }
.note-card-body p { margin: 0 0 6px; }
.note-card-tasks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note-task-pill { font-size: 10.5px; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 99px; }

/* Rich text editor */
.rt-toolbar { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.rt-editor {
  min-height: 140px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
.rt-editor:focus { border-color: var(--accent); outline: none; }
.rt-editor img { max-width: 100%; border-radius: 6px; }
.rt-editor h1 { font-size: 20px; margin: 10px 0 6px; font-family: var(--font-display); }
.rt-editor h2 { font-size: 16px; margin: 9px 0 5px; font-family: var(--font-display); }
.rt-editor h3 { font-size: 14px; margin: 6px 0; }
.rt-editor a { text-decoration: underline; }
.rt-editor blockquote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev-2); color: var(--text-dim);
}
.rt-editor ul, .rt-editor ol { padding-left: 22px; margin: 6px 0; }
/* Visual divider between toolbar groups. */
.rt-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 2px; }
.rt-font-picker { width: auto; padding: 4px 8px; font-size: 12.5px; }
/* Text-colour picker swatches in the rich-text toolbars. */
.rt-color-row { display: inline-flex; align-items: center; gap: 4px; }
.rt-color-swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
}
.rt-color-swatch:hover { border-color: var(--text); }
/* The lesson editor gets more vertical room than the compact notes editor. */
.rt-editor-lesson { min-height: 240px; max-height: none; }
#curriculum-focus-overlay .rt-editor-lesson { min-height: 320px; }

.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-swatch.selected { border-color: var(--text); }

.task-link-list { display: flex; flex-direction: column; gap: 6px; max-height: 140px; overflow-y: auto; }
.task-link-option { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.task-link-option input { width: auto; }

/* ---------- Calendar ---------- */
.cal-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-grid-header { margin-bottom: 6px; }
.cal-weekday { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-faint); text-align: center; padding-bottom: 4px; }

.cal-cell {
  min-height: 92px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.empty-cell { background: transparent; border: none; }
.cal-cell.is-today { border-color: var(--accent); }
.cal-daynum { font-size: 11.5px; color: var(--text-faint); font-weight: 600; }
.cal-cell.is-today .cal-daynum { color: var(--accent); }
.cal-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-event {
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-more { font-size: 10px; color: var(--text-faint); }
.cal-dots { display: none; }

.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; font-size: 12px; color: var(--text-dim); }
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-item .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.cal-cell.heat-cell { min-height: 56px; transition: background 0.15s; }
.heat-hours { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; margin-top: auto; }

.intention-log { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.intention-log-row { display: flex; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.intention-log-row:last-child { border-bottom: none; padding-bottom: 0; }
.intention-log-date { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; padding-top: 1px; }
.intention-log-text { font-size: 13px; color: var(--text); }

.session-log-list { display: flex; flex-direction: column; gap: 0; max-height: 360px; overflow-y: auto; margin-top: 10px; }
.session-log-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 60px auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.session-log-row:last-child { border-bottom: none; }
.session-log-date { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.session-log-project { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-log-task { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-log-duration { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.session-log-actions { display: flex; gap: 4px; justify-self: end; }

@media (max-width: 760px) {
  .session-log-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 760px) {
  .cal-cell { min-height: 64px; }
  .cal-event { font-size: 9px; }
}

.panel {
  background: rgba(10,10,18,0.62);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel h3 { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); margin: 0 0 14px; }

.dashboard-note-panel { background: linear-gradient(155deg, rgba(224,184,96,0.07), rgba(255,255,255,0.03)); border-color: rgba(224,184,96,0.18); }
.dashboard-note-input {
  width: 100%;
  min-height: 110px;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.dashboard-note-input:focus { border-color: transparent; box-shadow: none; }

/* ---------- Tasks ---------- */
.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--text-faint);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.task-check.done { background: var(--good); border-color: var(--good); color: #06210e; }
.task-title { flex: 1; font-size: 13.5px; cursor: pointer; }
.task-title:hover { color: var(--accent); }
.task-title.done { color: var(--text-faint); text-decoration: line-through; }
.task-title.done:hover { color: var(--accent); }
.task-due { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.task-due.overdue { color: var(--danger); font-weight: 600; }
.task-due.soon { color: var(--warn); font-weight: 600; }

.add-task-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-task-row input[type="text"] { flex: 1 1 100%; min-width: 160px; }
.add-task-row input[type="date"] { flex: none; width: 130px; }
.add-task-row select { flex: none; width: 110px; }

/* ---------- Task priority + subtasks ---------- */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.subtask-pill {
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ---------- Task groups / drag-and-drop ---------- */
.task-group { margin-bottom: 6px; }
.task-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 4px;
}
.task-group-body { min-height: 10px; border-radius: var(--radius-sm); transition: background 0.15s; }
/* Subtle drop-zone hint while dragging a task into a group — a faint outline
   rather than tinting every row's background dark. */
.task-group.drag-over .task-group-body { box-shadow: inset 0 0 0 1px var(--accent-soft); }
.task-row[draggable="true"] { cursor: default; }
/* The task being moved stays clearly visible (only slightly lifted), so it reads
   as "the one I'm holding" rather than dimming out. */
.task-row.dragging { opacity: 0.85; box-shadow: 0 2px 10px -2px rgba(0,0,0,0.5); }

.group-drag-handle {
  color: var(--text-faint);
  cursor: grab;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}
.group-drag-handle:active { cursor: grabbing; }
.task-group[draggable="true"] { cursor: default; } /* only the handle grabs — header buttons/group body stay clickable */
.task-group.dragging { opacity: 0.4; }

/* Collapse/expand a task group from its header. */
.group-collapse-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 11px; line-height: 1;
  padding: 2px 4px; flex-shrink: 0;
  transition: transform 0.15s, color 0.15s;
}
.group-collapse-toggle.open { transform: rotate(90deg); color: var(--text-dim); }
.group-collapse-toggle:hover { color: var(--accent); }
.task-group-name { cursor: pointer; }
.task-group-name:hover { color: var(--text); }
.task-group.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.task-group.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Folder refs ---------- */
.folder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
}
.folder-row:last-child { border-bottom: none; }
.folder-row .path { flex: 1; color: var(--text-dim); font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.folder-row .ftype { color: var(--text-faint); font-size: 11px; text-transform: uppercase; }

.session-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.session-row { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-soft); }
.session-row-top { display: flex; align-items: center; justify-content: space-between; }
.session-date { font-size: 13px; font-weight: 600; color: var(--accent-2); }

/* ---------- Lesson plans ---------- */
.lesson-plan { margin-bottom: 18px; }
.lesson-plan:last-child { margin-bottom: 0; }
.lesson-plan-archived { opacity: 0.7; }
.lesson-plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lesson-plan-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.lesson-plan-progress { font-size: 11.5px; color: var(--text-faint); margin-left: 10px; }
.plan-week-list { display: flex; flex-direction: column; gap: 6px; }
.plan-week-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.02);
}
.plan-week-check {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--text-faint);
  background: transparent;
  color: #06210e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.plan-week-row.plan-week-done .plan-week-check { background: var(--good); border-color: var(--good); }
.plan-week-row.plan-week-skipped .plan-week-check { background: var(--text-faint); border-color: var(--text-faint); color: #0c0a14; }
.plan-week-body { flex: 1; min-width: 0; cursor: pointer; }
.plan-week-num { font-size: 11px; color: var(--text-faint); margin-right: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.plan-week-topic { font-size: 13px; color: var(--text-dim); }
.plan-week-row.plan-week-done .plan-week-topic { color: var(--text-faint); }
.plan-week-row.plan-week-skipped .plan-week-topic { color: var(--text-faint); text-decoration: line-through; }
.plan-week-skip { flex: 0 0 auto; color: var(--text-faint); }
.plan-week-skip:hover { color: var(--warn); }
.plan-week-drag-handle {
  color: var(--text-faint);
  cursor: grab;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
  line-height: 1;
}
.plan-week-drag-handle:active { cursor: grabbing; }
.plan-week-row[draggable="true"] { cursor: default; } /* only the handle grabs — checkbox/body/skip stay clickable */
.plan-week-row.dragging { opacity: 0.4; }
.plan-week-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.plan-week-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Course curriculum (sections + items) ---------- */
.course-section-list { display: flex; flex-direction: column; gap: 12px; }
.course-section {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.02);
}
.course-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.course-section-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 0; }
.course-item-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.course-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.015);
}
.course-item.course-item-done .plan-week-check { background: var(--good); border-color: var(--good); }
.course-item.course-item-in_progress .plan-week-check { background: var(--warn); border-color: var(--warn); color: #2a1c00; }
.course-item-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.course-item-type { font-size: 12px; color: var(--text-faint); flex: 0 0 auto; }
.course-item-name { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-item.course-item-done .course-item-name { color: var(--text-faint); }
.course-item-hasnote { font-size: 11px; color: var(--text-faint); flex: 0 0 auto; }

/* Lesson asset editor rows (inside the course-content modal) */
#ci-assets-list { display: flex; flex-direction: column; gap: 8px; }
.asset-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,0.02);
}
.asset-row input, .asset-row select { width: 100%; }
.asset-row-2 { display: flex; gap: 6px; align-items: center; }
.asset-row-2 .asset-type { flex: 0 0 110px; }
.asset-row-2 .asset-product { flex: 1; min-width: 0; }
.asset-row-2 .asset-remove { flex: 0 0 auto; }
.course-badge {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 1px 6px; border-radius: 6px; flex: 0 0 auto; font-weight: 600;
}
.course-badge-free { background: rgba(95,209,168,0.16); color: var(--good); }
.course-badge-draft { background: rgba(224,184,96,0.16); color: var(--warn); }

/* Course community sessions */
.course-session-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,0.02);
  cursor: pointer; margin-bottom: 6px;
}
.course-session-row:hover { border-color: var(--accent-soft); }
.course-session-date { flex: 0 0 96px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.course-session-upcoming { color: var(--good); }
.course-session-body { flex: 1; min-width: 0; }
.course-session-links { display: flex; gap: 10px; margin-top: 4px; }

/* Grouping labels inside larger modals */
.modal-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-faint); font-weight: 600;
  margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}

/* ---------- Reflection / wellbeing ---------- */
.reflect-card {
  background: linear-gradient(155deg, rgba(184,101,255,0.07), rgba(255,255,255,0.03));
  border: 1px solid var(--accent-soft);
}
.reflect-prompt { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.mood-row { display: flex; gap: 8px; margin-bottom: 10px; }
.mood-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 18px;
  text-align: center;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  transition: 0.2s;
}
.mood-btn:hover { color: var(--text); border-color: var(--accent-soft); }
.mood-btn.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.history-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.history-row:last-child { border-bottom: none; }
.history-row .hmood { font-size: 15px; color: var(--accent); }
.history-row .hdate { color: var(--text-faint); }
.history-row .htext { flex: 1; margin: 0 10px; color: var(--text-dim); }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: rgba(17,17,28,0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow-y: auto;
}
.modal h2 { font-family: var(--font-display); margin: 0 0 16px; font-size: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; font-weight: 600; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Auth screen (Supabase-backend login gate) ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-modal { max-width: 380px; }
.auth-subtitle { color: var(--text-dim); font-size: 13px; margin: -8px 0 18px; }
.auth-error { color: var(--danger, #e06060); font-size: 12.5px; margin-top: 4px; }

/* ---------- Music Player: artist credit rows, toggles, tag grid, track table ---------- */
.artist-credit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.artist-credit-row .artist-name { flex: 2; }
.artist-credit-row .artist-role { flex: 1; }
.toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.ftog.on, .ttog.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.tag-grid { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }
.track-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.track-table th { text-align: left; font-size: 11px; color: var(--text-faint); padding: 4px 8px; }
.track-table td { padding: 6px 8px; border-top: 1px solid var(--border); }
.track-table tr:hover td { background: var(--accent-soft); }

/* ---------- Full-screen task focus overlay ----------
   Summoned from the Tasks panel ("Focus view"). Gives tasks a roomy two-pane
   stage — wide tasks on the left, notes on the right for cross-referencing.
   z-index 80 sits above the app (.app-shell is 1) but below modals (100), so
   editing a task from inside the overlay still layers correctly on top. */
.task-focus-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(10px);
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.task-focus-frame {
  width: 100%; max-width: 1400px;
  height: 100%; max-height: 92vh;
  background: rgba(17,17,28,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.task-focus-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.task-focus-bar h2 { font-family: var(--font-display); font-size: 15px; margin: 0; }
.task-focus-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 22px;
  padding: 22px;
  overflow: hidden;
}
/* Curriculum overlay: even 50/50 split — the content editor is form-heavy and
   wants as much room as the curriculum list. */
#curriculum-focus-overlay .task-focus-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* Each pane scrolls independently so long task lists and long notes don't
   fight over the same scrollbar. */
.task-focus-tasks, .task-focus-notes { overflow-y: auto; min-height: 0; }
/* Panels already bring their own card chrome; drop their margin so they sit
   flush to the top of each pane. */
.task-focus-body .panel { margin-bottom: 16px; }
.task-focus-body .panel:last-child { margin-bottom: 0; }
/* The "Focus view" buttons only make sense on the page, not inside the overlay
   (which reuses the same panel markup). */
.task-focus-overlay .task-expand-btn,
.task-focus-overlay .curriculum-expand-btn { display: none; }
/* Highlight the curriculum item currently loaded in the editor pane. */
.course-item-selected { outline: 1px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
/* Stop the page behind from scrolling while the overlay is open. */
body.task-focus-active { overflow: hidden; }
body.finances-focus-active { overflow: hidden; }
@media (max-width: 900px) {
  .task-focus-body { grid-template-columns: 1fr; overflow-y: auto; }
  .task-focus-tasks, .task-focus-notes { overflow: visible; }
}

/* ---------- Styled prompt / confirm modals (replace native dialogs) ---------- */
.prompt-modal { max-width: 420px; }
.prompt-title { font-size: 14px; color: var(--text); margin: 0 0 12px; line-height: 1.45; }
.prompt-modal #prompt-input { width: 100%; }
.confirm-modal .prompt-title { margin-bottom: 4px; }
.prompt-subtext { font-size: 12px; color: var(--text-dim); margin: 0 0 14px; line-height: 1.5; }

/* ---------- Global search ---------- */
.search-backdrop { align-items: flex-start; padding-top: 12vh; }
.search-modal { max-width: 560px; padding: 0; overflow: hidden; }
.search-modal #search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  padding: 16px 20px;
  font-size: 15px;
  background: transparent;
  box-shadow: none;
}
.search-modal #search-input:focus { box-shadow: none; border-color: var(--accent-soft); }
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); padding: 10px 10px 4px; }
.search-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.15s;
}
.search-result-row:hover { background: var(--accent-soft); color: var(--text); }
.search-result-context { margin-left: auto; color: var(--text-faint); font-size: 11.5px; }

/* ---------- Keyboard shortcuts modal ---------- */
.shortcuts-list { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

/* Preferences modal: show/hide feature toggles */
.prefs-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 6px; }
.prefs-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
}
.prefs-row:hover { background: rgba(255,255,255,0.02); border-color: var(--border-soft); }
.prefs-toggle { flex: 0 0 auto; padding-top: 1px; }
.prefs-toggle input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--accent); }
.prefs-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prefs-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.prefs-desc { font-size: 12px; color: var(--text-faint); }
.shortcut-keys {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.shortcut-desc { color: var(--text-dim); font-size: 13px; text-align: right; }

/* ---------- Recurrence ---------- */
.recur-pill { font-size: 13px; color: var(--accent); opacity: 0.85; }

/* ---------- Stats panel ---------- */
.stats-row { display: flex; gap: 10px; }
.stat-block {
  flex: 1;
  text-align: center;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
}
.stat-number { font-family: var(--font-display); font-size: 22px; color: var(--accent); line-height: 1; }
.stat-label { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.stats-breakdown { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.stats-breakdown-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--border-soft); }
.stats-breakdown-row:last-child { border-bottom: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev-2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 200;
  opacity: 0;
  transition: 0.25s;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Task row: wrap, drag handle, disclosure, energy, time-track ---------- */
.task-row-wrap { border-bottom: 1px solid var(--border-soft); }
.task-row-wrap:last-child { border-bottom: none; }
.task-row-wrap .task-row { border-bottom: none; }

/* Wide, full-height grab strip on the left of each task row, so it's easy to
   hit (not a tiny glyph). The ⠿ is centred in it. user-select:none so a
   press-drag here starts a drag instead of selecting text. */
.drag-handle {
  color: var(--text-faint);
  cursor: grab;
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0 4px;
  user-select: none;
  -webkit-user-select: none;
}
.drag-handle:hover { color: var(--text-dim); }
.drag-handle:active { cursor: grabbing; }

.disclosure-arrow {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-faint);
  transition: transform 0.15s;
  padding: 2px;
}
.disclosure-arrow.open { transform: rotate(90deg); color: var(--text-dim); }

.energy-pill {
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.time-track-pill {
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.time-track-pill.ticking { color: var(--accent-2); background: var(--accent-2-soft); }

.timer-toggle-btn { flex-shrink: 0; }
.timer-toggle-btn.active { color: var(--accent-2); }

.inline-subtasks {
  padding: 4px 0 8px 46px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inline-subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.inline-subtask-row span.done { color: var(--text-faint); text-decoration: line-through; }
.task-check.sm { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- Task drag-to-reorder indicators ---------- */
.task-row-wrap.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.task-row-wrap.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.task-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.task-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Stale task indicator ---------- */
.task-row.stale .task-title { color: var(--warn); }
.task-row.stale::after {
  content: "stale";
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--warn);
  background: #e0b86022;
  padding: 2px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}

/* ---------- Calm completion feedback ---------- */
.task-complete-pulse {
  animation: complete-pulse 0.32s ease-out;
}
@keyframes complete-pulse {
  0% { background: var(--accent-soft); }
  100% { background: transparent; }
}
.focus-modal.task-complete-pulse { animation: complete-pulse-modal 0.32s ease-out; }
@keyframes complete-pulse-modal {
  0% { background: var(--accent-soft); }
  100% { background: var(--bg-elev); }
}

/* The task row that's gliding to the bottom on completion (FLIP animation,
   driven by playTaskFlip in app.js). Lifts it above its neighbours as it
   travels and gives a soft accent tint that fades as it settles. */
.task-row.task-flip-moving {
  position: relative;
  z-index: 5;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), background 0.5s ease;
}

/* Briefly flashes a task row after landing here from the dashboard's mini
   calendar or unfinished-tasks list, so it's easy to spot in a long list.
   The class is added/removed by JS (flashPendingHighlight(), ~2s hold); the
   transition here just makes the fade-out smooth instead of an abrupt cut. */
.task-row.task-row-highlight {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

/* ---------- Task panel header / controls ---------- */
.task-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
/* Inline product quick-edit (project page, under Details) */
.inline-product-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.inline-product-fields label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; color: var(--text-dim); font-weight: 600;
  flex: 1; min-width: 90px;
}
.inline-product-fields .inline-product-url { flex-basis: 100%; }
.inline-product-fields input { width: 100%; }

.task-controls { display: flex; gap: 8px; }
.task-controls select { width: auto; font-size: 12.5px; padding: 6px 9px; }
#unfinished-tasks-filter { width: auto; font-size: 12.5px; padding: 6px 9px; }

/* ---------- Timer bar: intention + focus button ---------- */
.intention-pill {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-task-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--good);
  background: rgba(95,209,168,0.12);
  padding: 4px 6px 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  max-width: 220px;
}
/* Pill showing which student/client the session is currently timing. */
.timer-client-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--accent-2);
  background: rgba(224,96,200,0.13);
  padding: 4px 11px; border-radius: 99px; white-space: nowrap;
}
.focus-task-pill span,
.focus-task-pill {
  overflow: hidden;
  text-overflow: ellipsis;
}
.focus-task-clear {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
.focus-task-clear:hover { opacity: 1; }

/* ---------- Focus mode overlay ---------- */
.focus-backdrop { background: rgba(8,8,10,0.82); }
.focus-modal {
  max-width: 460px;
  text-align: center;
  padding: 36px 32px;
}
.focus-eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.focus-title { font-size: 22px; margin: 0 0 16px; line-height: 1.3; }
.focus-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}
.focus-meta .priority-dot { margin-right: -2px; }
.focus-empty {
  font-size: 14px;
  color: var(--text-dim);
  padding: 20px 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto;
    flex-direction: row; justify-content: space-around;
    padding: 8px; border-right: none; border-top: 1px solid var(--border-soft);
    z-index: 50;
  }
  .brand, .sidebar-footer { display: none; }
  .nav-item { flex-direction: column; font-size: 10.5px; gap: 4px; padding: 6px 10px; }
  .main { padding: 18px 16px 90px; }
  body { padding-bottom: 60px; }
}

/* ---------- Timer bar: project select + quota pill ---------- */
.timer-project-select {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12.5px;
  max-width: 160px;
}
.quota-pill {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.quota-pill.warn { color: var(--warn); background: #e0b86022; }
.quota-pill.over { color: var(--danger); background: #ef5e8a22; }

/* ---------- Project card: quota usage ---------- */
.quota-track {
  height: 5px;
  border-radius: 99px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.quota-fill { height: 100%; background: var(--accent-2); border-radius: 99px; }
.quota-fill.warn { background: var(--warn); }
.quota-fill.over { background: var(--danger); }
.quota-label { font-size: 11px; color: var(--text-faint); margin-top: -4px; }

/* ---------- Task row: role pill (build/promote) ---------- */
.role-pill { font-size: 12px; flex-shrink: 0; line-height: 1; }

/* ---------- Task row: project tag (client page, tasks merged in from a linked project) ---------- */
.project-tag-pill {
  font-size: 10.5px;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Dashboard: calendar + time ranking row ---------- */
.dash-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1000px) { .dash-row { grid-template-columns: 1fr; } }

.cal-grid.compact { gap: 4px; }
.cal-grid.compact .cal-cell { min-height: 56px; padding: 4px; }
.cal-grid.compact .cal-events { display: none; }
.cal-grid.compact .cal-cell.is-today .cal-daynum { color: var(--accent); }
.cal-grid.compact .cal-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.1s;
}
.cal-dot:hover { transform: scale(1.6); }
.cal-dot-more {
  font-size: 8.5px;
  line-height: 5px;
  color: var(--text-faint);
  cursor: default;
}

/* ---------- Calendar: view switcher, drag-to-reschedule, hour-grid, year ---------- */
.cal-view-switcher { display: flex; gap: 6px; margin-bottom: 14px; }

.cal-event.dragging { opacity: 0.4; }
.cal-cell.cal-drag-over,
.cal-allday-cell.cal-drag-over,
.cal-hour-cell.cal-drag-over { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-event[draggable="true"] { cursor: grab; }

.cal-hourgrid { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; }
.cal-hourgrid-header,
.cal-allday-row,
.cal-hour-row {
  display: grid;
  grid-template-columns: 56px repeat(var(--cal-days), 1fr);
}
.cal-hourgrid-header { border-bottom: 1px solid var(--border-soft); padding-bottom: 6px; }
.cal-hourgrid-daylabel { font-size: 11.5px; color: var(--text-faint); text-align: center; padding: 4px 0; }
.cal-hourgrid-daylabel.is-today { color: var(--accent); font-weight: 600; }
.cal-hour-label { font-size: 10px; color: var(--text-faint); text-align: right; padding: 2px 8px 0 0; }
.cal-allday-row { border-bottom: 1px solid var(--border-soft); min-height: 32px; }
.cal-allday-cell,
.cal-hour-cell {
  border-left: 1px solid var(--border-soft);
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 28px;
}
.cal-hour-row { border-bottom: 1px solid var(--border-soft); }
.cal-hour-row:last-child { border-bottom: none; }
.cal-allday-cell.is-today,
.cal-hour-cell.is-today { background: rgba(255,255,255,0.025); }
.cal-hourgrid-body { max-height: 560px; overflow-y: auto; }
.cal-event-time { font-size: 9px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.cal-year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1100px) { .cal-year-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .cal-year-grid { grid-template-columns: repeat(2, 1fr); } }
.cal-mini-month-label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-mini-grid-header { margin-bottom: 2px; }
.cal-mini-weekday { font-size: 8.5px; color: var(--text-faint); text-align: center; }
.cal-mini-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
}
.cal-mini-cell:hover { background: rgba(255,255,255,0.05); }
.cal-mini-cell.empty-cell { cursor: default; }
.cal-mini-cell.empty-cell:hover { background: none; }
.cal-mini-cell.is-today .cal-mini-daynum { color: var(--accent); font-weight: 700; }
.cal-mini-daynum { font-size: 9px; color: var(--text-dim); }
.cal-mini-dot { position: absolute; bottom: 1px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }

/* ---------- Dashboard: time-allocation ranking ---------- */
.time-rank-list { display: flex; flex-direction: column; gap: 12px; }
.time-rank-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: center; }
.time-rank-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-rank-track { height: 8px; border-radius: 99px; background: var(--bg-elev-2); overflow: hidden; }
.time-rank-fill { height: 100%; border-radius: 99px; }
.time-rank-hours { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Monthly trend bar chart */
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 6px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; height: 100%; justify-content: flex-end; }
.trend-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.trend-bar { width: 100%; min-height: 2px; border-radius: 5px 5px 0 0; background: var(--accent-soft); transition: background 0.15s, height 0.2s; }
.trend-col:hover .trend-bar { background: var(--accent); }
.trend-col.current .trend-bar { background: var(--accent); }
.trend-hrs { font-size: 10.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; height: 13px; }
.trend-label { font-size: 10.5px; color: var(--text-faint); }
.trend-col.current .trend-label { color: var(--text); font-weight: 600; }

/* Finances income/outgoings grouped bar chart — two bars per month side by
   side with a zero baseline, distinct from .trend-chart (one bar per column,
   used by Analytics) so that chart's markup/behaviour stays untouched. */
.fin-trend-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 6px; }
.fin-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; cursor: pointer; }
.fin-trend-bars { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border-soft); }
.fin-trend-bar { width: 40%; min-height: 2px; border-radius: 3px 3px 0 0; transition: opacity 0.15s, height 0.2s; }
.fin-trend-col:hover .fin-trend-bar { opacity: 0.8; }
.fin-trend-label { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; height: 13px; line-height: 13px; }
.fin-trend-col.current .fin-trend-label { color: var(--text); font-weight: 600; }

/* ---------- Finances visual refresh ----------
   Card-based, soft-shadow look inspired by QuickBooks/Xero's dashboards,
   reinterpreted for this app's existing dark "Frequency Alchemy" palette —
   same CSS variables as the rest of the app, no new colors/fonts introduced.
   Everything below is scoped under .finances-page so it only affects the
   Finances section (overview, per-business page, and the focus overlay,
   which also carries this class — see syncFinancesFocusOverlay() in app.js). */

.finances-page .stat-block {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.finances-page .stat-block:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.finances-page .stat-number { font-size: 26px; font-weight: 700; }
.finances-page .stat-label { font-size: 11px; }

.finances-page .panel {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}
.finances-page .stats-row { margin-bottom: 16px; }

.finances-page .fin-trend-chart { gap: 6px; height: 170px; }
.finances-page .fin-trend-chart.is-daily .fin-trend-bars { gap: 1px; }
.finances-page .fin-trend-chart.is-daily .fin-trend-bar { width: 70%; }
.finances-page .fin-trend-bar { border-radius: 4px 4px 0 0; }
.finances-page .fin-trend-col:hover .fin-trend-bar { opacity: 1; filter: brightness(1.15); }
.finances-page .fin-trend-col.current .fin-trend-bar:nth-child(1) { box-shadow: 0 0 8px -1px var(--good); }
.finances-page .fin-trend-col.current .fin-trend-bar:nth-child(2) { box-shadow: 0 0 8px -1px var(--danger); }

.finances-page .note-card { background: var(--bg-elev-2); border-color: var(--border-soft); }
.finances-page .note-card:hover { border-color: var(--accent-soft); }

.finances-page .time-rank-track { background: var(--bg-elev); }

/* Weekday bars (when you work) */
.weekday-bars { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.weekday-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.weekday-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.weekday-bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent-2); opacity: 0.8; }
.weekday-label { font-size: 10.5px; color: var(--text-faint); }

/* ---------- Dashboard: neglected promotion nudge ---------- */
.nudge-panel { border-color: var(--accent-soft); }
.nudge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  font-size: 13px;
}
.nudge-row:last-child { border-bottom: none; }
.nudge-row:hover .nudge-product { color: var(--accent); }
.nudge-product { transition: color 0.15s; }
.nudge-count {
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ---------- Dashboard: main + sidebar layout ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 380px);
  gap: 24px;
  align-items: start;
}
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-sidebar { min-width: 0; }
@media (max-width: 1100px) { .dash-layout { grid-template-columns: 1fr; } }

/* ---------- Form checkbox row ---------- */
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: auto; }

/* ---------- Products column ---------- */
.product-list { display: flex; flex-direction: column; gap: 10px; }
/* Full-page Products view: roomy multi-column grid of the same product cards. */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.product-grid .product-card { padding: 16px 18px; }

/* Square product image above the card text (own image → linked project's → add). */
.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 12px;
  border: 1px solid var(--border-soft);
}
.product-image-empty {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border-soft);
  color: var(--text-faint);
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}
.product-image-empty:hover { border-color: var(--accent-soft); color: var(--accent-2); }
.product-card {
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: 0.2s;
}
.product-card:hover { border-color: var(--accent-soft); box-shadow: 0 0 14px -4px var(--accent-soft); transform: translateY(-1px); }
/* Cross-listed = same product owned by another project, shown here read-only
   via cross_list_project_ids. Dashed border distinguishes it at a glance from
   a product this project actually owns/can edit. */
.product-card-crosslisted { border-style: dashed; border-color: var(--border-soft); }
.product-crosslisted-tag {
  font-size: 10.5px;
  color: var(--text-faint);
  background: var(--bg-elev);
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
  white-space: nowrap;
}
.product-crosslist-controls { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.checkbox-list { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; }
.empty-inline { font-size: 12.5px; color: var(--text-faint); }
.product-url { font-size: 12px; color: var(--accent-2); margin-bottom: 6px; word-break: break-all; }
.product-linked-project {
  font-size: 12px;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  cursor: pointer;
}
.product-owner-link {
  font-size: 12px;
  color: var(--accent-2);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  cursor: pointer;
}
.product-owner-link:hover { color: var(--accent); }
.product-stats { display: flex; gap: 8px; margin-top: 4px; }
.product-stat {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg-elev);
  padding: 3px 9px;
  border-radius: 99px;
}
.product-upgrades {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  line-height: 1.5;
}

/* Bundle marker + contents (on product cards and deliverable rows) */
.product-bundle-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
  color: var(--accent-2); background: rgba(224,96,200,0.14);
  padding: 1px 6px; border-radius: 6px; flex: 0 0 auto;
}
.product-bundle-contents { margin: 6px 0; font-size: 12px; color: var(--text-dim); }
.product-bundle-contents ul { margin: 4px 0 0; padding-left: 16px; }
.product-bundle-contents li { line-height: 1.5; }

/* Dashboard: All products master list */
.all-products-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; padding-right: 2px; }
.all-product-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,0.02);
  cursor: pointer;
}
.all-product-row:hover { border-color: var(--accent-soft); }
.all-product-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.all-product-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-product-meta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; font-size: 11.5px; color: var(--text-faint); }
.all-product-price { color: var(--text-dim); }

/* Course deliverables (delivery checklist) */
.deliverable-list { display: flex; flex-direction: column; gap: 6px; }
.deliverable-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,0.02);
}
.deliverable-row.deliverable-done .plan-week-check { background: var(--good); border-color: var(--good); }
.deliverable-body { flex: 1; min-width: 0; }
.deliverable-name { font-size: 13px; color: var(--text-dim); }
.deliverable-row.deliverable-done .deliverable-name { color: var(--text-faint); }
.deliverable-orphan { justify-content: space-between; align-items: center; opacity: 0.8; }

/* Course runs / cohorts + student enrolments */
.course-run-list, .enrollment-list { display: flex; flex-direction: column; gap: 6px; }
.course-run-row, .enrollment-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,0.02);
}
.course-run-row { cursor: pointer; }
.course-run-row:hover, .enrollment-row:hover { border-color: var(--accent-soft); }
.course-run-body, .enrollment-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1; }
.enrollment-body { cursor: pointer; }
.course-run-name, .enrollment-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.enrollment-actions { display: flex; gap: 4px; flex-shrink: 0; }
.run-status-badge {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
  padding: 1px 7px; border-radius: 6px;
}
.run-status-upcoming  { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.run-status-active    { background: rgba(95,209,168,0.16); color: var(--good); }
.run-status-completed { background: rgba(184,101,255,0.14); color: var(--accent); }
.enrollment-row.enrollment-withdrawn { opacity: 0.6; }

/* Client billing line (Hours & invoicing panel) */
.billing-line { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.billing-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(95,209,168,0.16); color: var(--good); flex-shrink: 0;
}

/* Course roster (enrolled students grouped by run) */
.roster-group { margin-bottom: 14px; }
.roster-group:last-child { margin-bottom: 0; }
.roster-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.roster-group-title { font-size: 13px; font-weight: 600; color: var(--text); }
.roster-group-head .btn { margin-left: auto; }
.roster-list { display: flex; flex-direction: column; gap: 4px; }
.roster-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 9px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,0.015);
}
.roster-student { display: flex; align-items: baseline; gap: 8px; min-width: 0; cursor: pointer; flex: 1; }
.roster-name { font-size: 13px; color: var(--text-dim); }
.roster-noemail {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
  color: var(--warn); background: rgba(224,184,96,0.14); padding: 1px 6px; border-radius: 6px;
}

/* ---------- Dashboard: unfinished tasks ---------- */
.unfinished-task-list { display: flex; flex-direction: column; gap: 2px; }
.unfinished-task-list.is-scrollable { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.unfinished-task-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  font-size: 13px;
}
.unfinished-task-row:last-child { border-bottom: none; }
.unfinished-task-row:hover .task-title { color: var(--accent); }
.unfinished-task-project {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
