/* ========================================================================
   VCG Investor Portal — Prototype Design System
   Aesthetic: Institutional fund management. Editorial gravitas.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Palette — deep navy + warm parchment + brass accent */
  --ink: #0d1b2a;
  --ink-soft: #1b2a3d;
  --ink-line: #2a3a52;
  --parchment: #f4ede0;
  --parchment-soft: #ebe2d1;
  --paper: #fbf8f1;
  --brass: #b08d57;
  --brass-deep: #8a6a3d;
  --moss: #4a6741;
  --burgundy: #6b2c2f;
  --rust: #9c4221;

  /* Typography */
  --display: 'Fraunces', Georgia, serif;
  --body: 'Geist', -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;

  /* Scale */
  --shadow-sm: 0 1px 2px rgba(13, 27, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(13, 27, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(13, 27, 42, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-weight: 400;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* ─── LAYOUT ───────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* ─── SIDEBAR ──────────────────────────────────────────── */

.sidebar {
  background: var(--ink);
  color: var(--parchment);
  padding: 2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ink-line);
}

.brand {
  padding: 0 2rem 2rem;
  border-bottom: 1px solid var(--ink-line);
}

.brand-mark {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}

.brand-mark em {
  color: var(--brass);
  font-style: italic;
  font-weight: 400;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--parchment-soft);
  opacity: 0.65;
  margin-top: 0.75rem;
}

.nav {
  padding: 1.5rem 0;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--parchment);
  opacity: 0.4;
  padding: 1rem 2rem 0.5rem;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 2rem;
  color: var(--parchment);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.75;
}

.nav a:hover {
  opacity: 1;
  background: rgba(176, 141, 87, 0.08);
}

.nav a.active {
  opacity: 1;
  border-left-color: var(--brass);
  background: linear-gradient(90deg, rgba(176, 141, 87, 0.12), transparent);
  color: var(--paper);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--ink-line);
  font-size: 0.8rem;
}

.user-tag {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brass), var(--brass-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
}

.user-role {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.55;
  margin-top: 2px;
}

/* ─── MAIN CONTENT ─────────────────────────────────────── */

.main {
  background: var(--paper);
  min-height: 100vh;
  position: relative;
}

.main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(13, 27, 42, 0.025) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.main > * { position: relative; z-index: 1; }

.topbar {
  padding: 1.5rem 3rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
}

.topbar-crumb {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.55;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(13, 27, 42, 0.12);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}

.icon-btn:hover {
  border-color: var(--ink);
  background: var(--parchment);
}

.icon-btn svg { width: 18px; height: 18px; }

/* ─── NOTIFICATION BELL ────────────────────────────────── */

.notif-wrap {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--rust);
  color: white;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  max-height: 480px;
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: none;
  z-index: 200;
  overflow: hidden;
  flex-direction: column;
}

.notif-wrap.open .notif-dropdown {
  display: flex;
}

.notif-dropdown-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--parchment-soft);
}

.notif-dropdown-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}

.notif-mark-all {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brass-deep);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
}

.notif-mark-all:hover {
  background: rgba(176, 141, 87, 0.08);
}

.notif-dropdown-body {
  overflow-y: auto;
  flex: 1;
  max-height: 420px;
}

.notif-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--ink-soft);
  opacity: 0.6;
}

.notif-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.05);
  cursor: pointer;
  transition: background 0.15s;
  align-items: flex-start;
}

.notif-item:hover {
  background: var(--parchment-soft);
}

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

.notif-item.unread {
  background: rgba(176, 141, 87, 0.04);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--parchment);
  color: var(--brass-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-item-icon svg {
  width: 16px;
  height: 16px;
}

.notif-item-content {
  min-width: 0;
}

.notif-item-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.notif-item-body {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-item-time {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0.6;
}

.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass);
  flex-shrink: 0;
  margin-top: 6px;
}

@media (max-width: 600px) {
  .notif-dropdown {
    width: 100vw;
    right: -1rem;
    border-radius: 0;
  }
}

/* ─── PAGE HEADER ──────────────────────────────────────── */

.page {
  padding: 3rem 3rem 5rem;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(13, 27, 42, 0.1);
  padding-bottom: 2rem;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
  color: var(--ink);
}

.page-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--brass-deep);
}

.page-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--brass-deep);
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--brass), transparent);
  max-width: 100px;
}

.page-subtitle {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-top: 0.875rem;
  letter-spacing: -0.01em;
  max-width: 600px;
}

/* ─── BUTTONS ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--ink);
  color: var(--parchment);
}

.btn-primary:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--parchment);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: rgba(13, 27, 42, 0.15);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn svg { width: 16px; height: 16px; }

/* ─── DASHBOARD METRICS ─────────────────────────────────── */

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

.metric {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  padding: 1.75rem 1.5rem;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--brass);
  transform: scaleX(0.15);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.metric:hover::before { transform: scaleX(1); }
.metric:hover { box-shadow: var(--shadow-md); }

.metric-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin-bottom: 1.25rem;
}

.metric-value {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
  color: var(--ink);
}

.metric-value em {
  font-style: italic;
  font-weight: 300;
  color: var(--brass-deep);
}

.metric-trend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.875rem;
  font-size: 0.78rem;
  color: var(--moss);
}

.metric-trend.down { color: var(--rust); }

.metric-trend-arrow { width: 12px; height: 12px; }

/* ─── DASHBOARD MAIN GRID ──────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.panel {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.panel-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel-action {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brass-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 2px;
}

.panel-body { padding: 1.75rem; }

/* ─── FUND PROGRESS HERO ───────────────────────────────── */

.fund-hero {
  background: var(--ink);
  color: var(--parchment);
  padding: 2.5rem 2.5rem 2rem;
  border-radius: 4px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.fund-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 50%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(176, 141, 87, 0.18), transparent 70%);
  pointer-events: none;
}

.fund-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}

.fund-hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--brass);
  margin-bottom: 1rem;
}

.fund-hero-title {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
}

.fund-hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--brass);
}

.fund-hero-meta {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  opacity: 0.75;
  margin-top: 0.75rem;
}

.fund-hero-figure {
  text-align: right;
}

.fund-hero-figure-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.fund-hero-figure-value {
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
}

.fund-hero-figure-of {
  font-family: var(--mono);
  font-size: 0.78rem;
  opacity: 0.5;
  margin-top: 0.4rem;
}

.progress-track {
  margin-top: 1.75rem;
  height: 6px;
  background: rgba(244, 237, 224, 0.1);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--brass), #d4ad6c);
  width: 28%;
  border-radius: 100px;
  position: relative;
}

.progress-marker {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ─── PIPELINE STATUS ──────────────────────────────────── */

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.stage {
  padding: 1.5rem 1.25rem;
  border-right: 1px solid rgba(13, 27, 42, 0.08);
  background: var(--paper);
  position: relative;
  transition: background 0.2s;
}

.stage:last-child { border-right: none; }
.stage:hover { background: var(--parchment); }

.stage-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-bottom: 1rem;
  display: inline-block;
}

.stage-marker.cold { background: #4a6b8a; }
.stage-marker.warm { background: var(--brass); }
.stage-marker.hot { background: var(--rust); }

.stage-count {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
}

.stage-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin-top: 0.75rem;
}

.stage-meta {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* ─── ACTIVITY FEED ────────────────────────────────────── */

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px dotted rgba(13, 27, 42, 0.12);
  align-items: start;
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass);
  margin-top: 7px;
}

.activity-dot.green { background: var(--moss); }
.activity-dot.red { background: var(--rust); }

.activity-text { font-size: 0.9rem; color: var(--ink); }
.activity-text strong { font-weight: 600; }

.activity-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  opacity: 0.6;
}

.activity-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  opacity: 0.55;
  white-space: nowrap;
}

/* ─── INVESTOR TABLE ───────────────────────────────────── */

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

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-wrap input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid rgba(13, 27, 42, 0.15);
  border-radius: 6px;
  font-family: var(--body);
  font-size: 0.9rem;
  background: var(--paper);
  transition: all 0.2s;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.06);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.4;
  pointer-events: none;
}

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

.pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.55rem 0.875rem;
  border: 1px solid rgba(13, 27, 42, 0.15);
  border-radius: 100px;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink-soft);
  transition: all 0.2s;
}

.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.active { background: var(--ink); color: var(--parchment); border-color: var(--ink); }

.investor-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.investor-table thead {
  background: var(--parchment);
}

.investor-table th {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-align: left;
  padding: 1rem 1.25rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(13, 27, 42, 0.1);
}

.investor-table td {
  padding: 1.125rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.06);
  color: var(--ink);
  vertical-align: middle;
}

.investor-table tr:last-child td { border-bottom: none; }
.investor-table tr:hover { background: rgba(244, 237, 224, 0.4); }

.investor-name {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.investor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.investor-avatar.alt1 { background: var(--brass-deep); }
.investor-avatar.alt2 { background: var(--moss); }
.investor-avatar.alt3 { background: var(--burgundy); }

.investor-firm {
  font-weight: 500;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: -0.005em;
}

.investor-contact {
  font-size: 0.78rem;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-top: 2px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  background: var(--parchment);
  color: var(--ink-soft);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.cold { background: rgba(74, 107, 138, 0.12); color: #4a6b8a; }
.status-badge.warm { background: rgba(176, 141, 87, 0.18); color: var(--brass-deep); }
.status-badge.hot { background: rgba(156, 66, 33, 0.12); color: var(--rust); }
.status-badge.committed { background: rgba(74, 103, 65, 0.12); color: var(--moss); }

.check-size {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.row-action {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid rgba(13, 27, 42, 0.12);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.2s;
}

.row-action:hover { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.row-action svg { width: 14px; height: 14px; }

/* ─── OUTREACH PAGE ────────────────────────────────────── */

.compose-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}

.editor {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.editor-toolbar {
  padding: 1rem 1.25rem;
  background: var(--parchment);
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.editor-input {
  width: 100%;
  border: none;
  padding: 1rem 1.5rem;
  font-family: var(--body);
  font-size: 1rem;
  background: var(--paper);
  border-bottom: 1px dotted rgba(13, 27, 42, 0.15);
}

.editor-input.subject { font-family: var(--display); font-size: 1.4rem; font-weight: 400; letter-spacing: -0.01em; }
.editor-input:focus { outline: none; background: var(--parchment-soft); }

.editor-body {
  width: 100%;
  border: none;
  padding: 1.75rem 1.5rem;
  font-family: var(--body);
  font-size: 0.95rem;
  line-height: 1.7;
  min-height: 400px;
  resize: vertical;
  background: var(--paper);
}

.editor-body:focus { outline: none; }

.template-card {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  padding: 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.75rem;
}

.template-card:hover {
  border-color: var(--ink);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.template-card.active {
  border-color: var(--brass);
  background: linear-gradient(to right, rgba(176, 141, 87, 0.06), transparent);
}

.template-stage {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brass-deep);
  margin-bottom: 0.5rem;
}

.template-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  letter-spacing: -0.005em;
}

.template-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
  opacity: 0.75;
  line-height: 1.45;
}

/* ─── DOCUMENT LIBRARY ─────────────────────────────────── */

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

.doc-card {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: pointer;
}

.doc-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.doc-preview {
  aspect-ratio: 5 / 6;
  background: linear-gradient(135deg, var(--parchment), var(--parchment-soft));
  position: relative;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.doc-preview::before {
  content: '';
  position: absolute;
  inset: 1.5rem;
  border: 1px solid rgba(13, 27, 42, 0.1);
  background: var(--paper);
  box-shadow: inset 0 -40px 0 var(--parchment);
}

.doc-mark {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variation-settings: 'opsz' 144;
}

.doc-mark em { font-style: italic; color: var(--brass-deep); }

.doc-meta {
  padding: 1.25rem 1.25rem 1.5rem;
}

.doc-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brass-deep);
  margin-bottom: 0.6rem;
}

.doc-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.doc-info {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  opacity: 0.6;
  letter-spacing: 0.05em;
  display: flex;
  gap: 0.875rem;
}

/* ─── ANALYTICS PAGE ───────────────────────────────────── */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-canvas {
  height: 280px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 1rem 0.5rem 0;
  gap: 0.5rem;
}

.bar {
  flex: 1;
  background: linear-gradient(to top, var(--ink), var(--ink-soft));
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 32px;
}

.bar:hover { background: linear-gradient(to top, var(--brass-deep), var(--brass)); }

.bar-label {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0.6;
  white-space: nowrap;
}

.bar-value {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.2s;
}

.bar:hover .bar-value { opacity: 1; }

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 280px;
}

.donut {
  width: 200px;
  height: 200px;
  position: relative;
  flex-shrink: 0;
}

.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 28; }

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center-value {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
}

.donut-center-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.55;
  margin-top: 0.3rem;
}

.donut-legend { flex: 1; }

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px dotted rgba(13, 27, 42, 0.1);
  font-size: 0.88rem;
}

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

.legend-label { display: flex; align-items: center; gap: 0.65rem; }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-value {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
}

/* ─── DEAL ROOM ────────────────────────────────────────── */

.dealroom-hero {
  background: var(--ink);
  color: var(--parchment);
  padding: 4rem 3rem;
  border-radius: 4px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.dealroom-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(135deg, rgba(176, 141, 87, 0.12) 0%, transparent 40%),
    radial-gradient(ellipse at top right, rgba(176, 141, 87, 0.18), transparent 50%);
  pointer-events: none;
}

.dealroom-hero-inner { position: relative; z-index: 1; max-width: 720px; }

.dealroom-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--brass);
  margin-bottom: 1.5rem;
}

.dealroom-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 144;
  margin-bottom: 1.5rem;
}

.dealroom-title em { font-style: italic; font-weight: 300; color: var(--brass); }

.dealroom-quote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.25rem;
  opacity: 0.85;
  border-left: 2px solid var(--brass);
  padding-left: 1.5rem;
  max-width: 580px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.highlight {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
}

.highlight-value {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
  color: var(--ink);
}

.highlight-value em { font-style: italic; color: var(--brass-deep); }

.highlight-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.65;
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* ─── BANNER ───────────────────────────────────────────── */

.banner {
  background: linear-gradient(to right, rgba(176, 141, 87, 0.08), rgba(176, 141, 87, 0.02));
  border-left: 3px solid var(--brass);
  padding: 1rem 1.5rem;
  border-radius: 4px;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2.5rem;
  font-size: 0.88rem;
}

.banner-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--brass-deep);
}

.banner-text { flex: 1; color: var(--ink-soft); }
.banner-text strong { color: var(--ink); font-weight: 600; }

/* ─── ANIMATION ON LOAD ────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page > *:not(.tab-pane) { animation: rise 0.5s ease forwards; opacity: 0; }
.page > *:not(.tab-pane):nth-child(1) { animation-delay: 0.05s; }
.page > *:not(.tab-pane):nth-child(2) { animation-delay: 0.12s; }
.page > *:not(.tab-pane):nth-child(3) { animation-delay: 0.19s; }
.page > *:not(.tab-pane):nth-child(4) { animation-delay: 0.26s; }
.page > *:not(.tab-pane):nth-child(5) { animation-delay: 0.33s; }
.tab-pane { opacity: 1; }

/* ─── RESPONSIVE ───────────────────────────────────────── */

@media (max-width: 1024px) {
  .app { grid-template-columns: 220px 1fr; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .compose-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .highlights-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .page { padding: 2rem 1.5rem; }
  .topbar { padding: 1rem 1.5rem; }
  .metrics-row { grid-template-columns: 1fr; }
  .pipeline-stages { grid-template-columns: 1fr; }
  .stage { border-right: none; border-bottom: 1px solid rgba(13, 27, 42, 0.08); }
  .fund-hero-inner { grid-template-columns: 1fr; }
  .fund-hero-figure { text-align: left; }
  .highlights-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ────────────────────────────────────────────────────────
   MEDIA LIBRARY PAGE
   ──────────────────────────────────────────────────────── */

.tab-strip {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(13, 27, 42, 0.1);
  margin-bottom: 2.5rem;
}

.tab {
  padding: 0.875rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.55;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  position: relative;
}

.tab:hover { opacity: 0.85; color: var(--ink); }

.tab.active {
  opacity: 1;
  color: var(--ink);
  border-bottom-color: var(--brass);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: rise 0.4s ease; }

/* Library Layout (folders + grid) */
.library-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
}

.folder-rail {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 1rem;
  position: sticky;
  top: 6rem;
}

.folder-rail-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.55;
  padding: 0.5rem 0.75rem 0.875rem;
}

.folder {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: var(--ink);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.folder:hover { background: var(--parchment); }

.folder.active {
  background: var(--ink);
  color: var(--parchment);
}

.folder svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }

.folder-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  opacity: 0.65;
}

.folder-divider {
  height: 1px;
  background: rgba(13, 27, 42, 0.08);
  margin: 0.75rem 0.5rem;
}

.folder-new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brass-deep);
  cursor: pointer;
  border: 1px dashed rgba(176, 141, 87, 0.4);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.folder-new:hover { background: rgba(176, 141, 87, 0.08); }

/* Upload dropzone */
.dropzone {
  border: 2px dashed rgba(13, 27, 42, 0.2);
  border-radius: 6px;
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--parchment-soft);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--brass);
  background: rgba(176, 141, 87, 0.06);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  color: var(--brass-deep);
  opacity: 0.65;
}

.dropzone-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  letter-spacing: -0.005em;
}

.dropzone-sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--ink-soft);
  opacity: 0.8;
}

.dropzone-formats {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.5;
  margin-top: 0.75rem;
}

/* Image grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.media-card {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
}

.media-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.media-thumb {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--parchment), var(--parchment-soft));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb-placeholder {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--brass-deep);
  font-variation-settings: 'opsz' 144;
}

.media-thumb-placeholder em { font-style: italic; }

.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 27, 42, 0.85), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  gap: 0.4rem;
}

.media-card:hover .media-overlay { opacity: 1; }

.media-action {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: rgba(244, 237, 224, 0.95);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s;
}

.media-action:hover { background: var(--brass); }
.media-action svg { width: 14px; height: 14px; }

.media-info {
  padding: 0.75rem 0.875rem 0.875rem;
}

.media-name {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.media-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0.6;
  display: flex;
  gap: 0.5rem;
}

.media-meta-tag {
  background: var(--parchment);
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.6rem;
}

/* AI Badge */
.ai-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--ink);
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 3px 7px;
  border-radius: 3px;
  z-index: 2;
}

/* Compose Panel */
.compose-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.post-canvas {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 2rem;
}

.image-slot {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--parchment), var(--parchment-soft));
  border: 2px dashed rgba(13, 27, 42, 0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.image-slot:hover { border-color: var(--brass); }

.image-slot.filled { border-style: solid; border-color: var(--ink-line); }
.image-slot.filled img { width: 100%; height: 100%; object-fit: cover; }

.image-slot-prompt {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--ink-soft);
  opacity: 0.7;
}

.caption-textarea {
  width: 100%;
  border: 1px solid rgba(13, 27, 42, 0.15);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-family: var(--body);
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 160px;
  resize: vertical;
  background: var(--paper);
}

.caption-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.06);
}

.char-count {
  display: flex;
  justify-content: flex-end;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  opacity: 0.6;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* Platform selector */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.platform {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(13, 27, 42, 0.12);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--paper);
}

.platform:hover { border-color: var(--ink); }

.platform input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
  margin: 0;
}

.platform.active {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}

.platform-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
}

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

/* Compose sidebar */
.compose-side {
  position: sticky;
  top: 6rem;
}

.compose-section {
  margin-bottom: 1.5rem;
}

.compose-section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin-bottom: 0.75rem;
}

.schedule-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(13, 27, 42, 0.15);
  border-radius: 4px;
  font-family: var(--body);
  font-size: 0.9rem;
  background: var(--paper);
}

.schedule-input:focus { outline: none; border-color: var(--ink); }

/* Schedule Calendar */
.calendar-wrap {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 1.5rem;
}

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

.calendar-month {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.cal-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: rgba(13, 27, 42, 0.08);
  border: 1px solid rgba(13, 27, 42, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.cal-day-name {
  background: var(--parchment);
  padding: 0.65rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-align: center;
}

.cal-day {
  background: var(--paper);
  min-height: 90px;
  padding: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-day:hover { background: var(--parchment-soft); }
.cal-day.muted { background: rgba(244, 237, 224, 0.3); }
.cal-day.muted .cal-day-num { opacity: 0.35; }
.cal-day.today .cal-day-num { background: var(--ink); color: var(--parchment); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; }

.cal-day-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink);
  opacity: 0.75;
}

.cal-event {
  display: block;
  margin-top: 0.35rem;
  padding: 3px 6px;
  font-size: 0.68rem;
  border-radius: 3px;
  background: var(--ink);
  color: var(--parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.cal-event.brass { background: var(--brass); color: var(--ink); }
.cal-event.moss { background: var(--moss); }
.cal-event.outline { background: transparent; color: var(--ink); border: 1px solid var(--ink-line); }

/* Upcoming list */
.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 2rem;
}

.upcoming-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.08);
  border-left: 3px solid var(--brass);
  border-radius: 4px;
}

.upcoming-date {
  text-align: center;
  padding: 0.5rem;
}

.upcoming-day {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}

.upcoming-month {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.6;
  margin-top: 0.25rem;
}

.upcoming-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.upcoming-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin-top: 4px;
}

.upcoming-platforms {
  display: flex;
  gap: 0.35rem;
}

.platform-chip {
  width: 28px;
  height: 28px;
  background: var(--ink);
  color: var(--parchment);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.75rem;
}

/* AI Generator Panel */
.ai-gen-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  align-items: start;
}

.gen-prompt {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 2rem;
}

.prompt-textarea {
  width: 100%;
  border: 1px solid rgba(13, 27, 42, 0.15);
  border-radius: 4px;
  padding: 1.25rem;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 140px;
  resize: vertical;
  background: var(--paper);
}

.prompt-textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.06); }

.style-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.preset {
  padding: 0.75rem 0.5rem;
  border: 1px solid rgba(13, 27, 42, 0.12);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  background: var(--paper);
  transition: all 0.15s;
}

.preset:hover { border-color: var(--ink); }

.preset.active { background: var(--ink); color: var(--parchment); border-color: var(--ink); }

.preset-name {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.ai-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(to right, rgba(176, 141, 87, 0.08), rgba(176, 141, 87, 0.02));
  border: 1px solid rgba(176, 141, 87, 0.3);
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.ai-toggle-text { display: flex; align-items: center; gap: 0.75rem; }

.ai-icon {
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--brass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
}

.ai-toggle-label {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

.ai-toggle-sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Toggle switch */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, 0.2);
  transition: 0.3s;
  border-radius: 100px;
  cursor: pointer;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider { background: var(--brass-deep); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* Generation preview */
.gen-preview {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: sticky;
  top: 6rem;
}

.gen-preview-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  opacity: 0.7;
}

.gen-preview-canvas {
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--parchment), var(--parchment-soft));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.gen-preview-icon {
  width: 56px;
  height: 56px;
  color: var(--brass-deep);
  opacity: 0.5;
}

.gen-preview-text {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--ink-soft);
  opacity: 0.7;
  max-width: 280px;
}

.gen-credit {
  padding: 1.25rem;
  border-top: 1px solid rgba(13, 27, 42, 0.08);
  background: var(--parchment);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
}

.gen-credit-value { font-weight: 600; color: var(--ink); }

.connect-banner {
  background: var(--ink);
  color: var(--parchment);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.connect-banner-text {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
}

.connect-banner-text strong {
  font-style: normal;
  font-weight: 500;
  color: var(--brass);
}

/* Responsive */
@media (max-width: 1024px) {
  .library-layout, .compose-layout, .ai-gen-layout {
    grid-template-columns: 1fr;
  }
  .folder-rail { position: relative; }
  .gen-preview { position: relative; }
}

/* ────────────────────────────────────────────────────────
   WORKFLOWS PAGE
   ──────────────────────────────────────────────────────── */

.workflow-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.workflow-stat {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  padding: 1.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.workflow-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--brass);
  flex-shrink: 0;
}

.workflow-stat-icon.moss { background: var(--moss); color: white; }
.workflow-stat-icon.brass { background: var(--brass); color: var(--ink); }
.workflow-stat-icon.rust { background: var(--rust); color: white; }

.workflow-stat-icon svg { width: 20px; height: 20px; }

.workflow-stat-value {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
}

.workflow-stat-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  opacity: 0.65;
  margin-top: 0.4rem;
}

/* Active workflows list */
.workflow-card {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.2s ease;
}

.workflow-card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.workflow-status-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 4px rgba(74, 103, 65, 0.15);
  flex-shrink: 0;
}

.workflow-status-light.paused {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.15);
}

.workflow-status-light.draft {
  background: var(--brass);
  box-shadow: 0 0 0 4px rgba(176, 141, 87, 0.15);
}

.workflow-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 0.3rem;
}

.workflow-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: var(--parchment);
  border-radius: 3px;
  font-size: 0.68rem;
  color: var(--ink);
  font-weight: 500;
}

.flow-chip.trigger { background: rgba(176, 141, 87, 0.2); color: var(--brass-deep); }
.flow-chip.action { background: rgba(13, 27, 42, 0.08); color: var(--ink); }
.flow-chip.wait { background: rgba(176, 141, 87, 0.08); color: var(--ink-soft); border: 1px dashed rgba(176, 141, 87, 0.4); }

.flow-arrow {
  width: 12px;
  height: 12px;
  opacity: 0.4;
}

.workflow-metrics {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0.7;
  text-align: right;
  line-height: 1.7;
}

.workflow-metrics strong { color: var(--ink); font-weight: 600; }

.workflow-controls {
  display: flex;
  gap: 0.4rem;
}

.workflow-control {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(13, 27, 42, 0.12);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.2s;
}

.workflow-control:hover { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.workflow-control svg { width: 14px; height: 14px; }

/* Builder canvas */
.builder-canvas {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 2.5rem;
  background-image: radial-gradient(circle at 1px 1px, rgba(13, 27, 42, 0.05) 1px, transparent 0);
  background-size: 20px 20px;
  min-height: 600px;
  position: relative;
}

.builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--paper);
  padding: 1rem 1.5rem;
  border: 1px solid rgba(13, 27, 42, 0.08);
  border-radius: 4px;
}

.builder-title-input {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
  border: none;
  background: transparent;
  letter-spacing: -0.01em;
  flex: 1;
}

.builder-title-input:focus { outline: none; }

/* Workflow node */
.node {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.15);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  max-width: 480px;
  margin: 0 auto 0;
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 1rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.node-icon {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--parchment);
}

.node-icon.trigger { background: var(--brass); color: var(--ink); }
.node-icon.condition { background: var(--moss); color: white; }
.node-icon.action { background: var(--ink); color: var(--parchment); }
.node-icon.wait { background: var(--paper); color: var(--ink-soft); border: 2px dashed rgba(13, 27, 42, 0.2); }

.node-icon svg { width: 22px; height: 22px; }

.node-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--brass-deep);
  margin-bottom: 0.25rem;
}

.node-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.node-sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

.node-edit {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid rgba(13, 27, 42, 0.12);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.node-edit:hover { background: var(--ink); color: var(--parchment); }
.node-edit svg { width: 14px; height: 14px; }

.node-connector {
  width: 2px;
  height: 32px;
  background: linear-gradient(to bottom, rgba(13, 27, 42, 0.2), rgba(13, 27, 42, 0.4));
  margin: 0 auto;
  position: relative;
}

.node-connector::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(13, 27, 42, 0.4);
  border-bottom: 2px solid rgba(13, 27, 42, 0.4);
  transform: translateX(-50%) rotate(45deg);
}

.node-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px dashed rgba(176, 141, 87, 0.5);
  background: var(--paper);
  color: var(--brass-deep);
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.2s;
}

.node-add:hover {
  background: rgba(176, 141, 87, 0.08);
  border-color: var(--brass);
  transform: scale(1.05);
}

.node-add svg { width: 20px; height: 20px; }

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

.template-tile {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.template-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brass);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.template-tile:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.template-tile:hover::before { transform: scaleY(1); }

.template-tile-cat {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brass-deep);
  margin-bottom: 0.75rem;
}

.template-tile-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.template-tile-desc {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.template-tile-flow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.template-tile-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dotted rgba(13, 27, 42, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  opacity: 0.65;
}

.template-cta {
  color: var(--brass-deep);
  font-weight: 500;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 1px;
}

/* Trigger picker (side panel) */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

.builder-side {
  background: var(--paper);
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  padding: 1.25rem;
  position: sticky;
  top: 6rem;
}

.builder-side-header {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

.action-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(13, 27, 42, 0.1);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  background: var(--paper);
  transition: all 0.15s;
}

.action-block:hover {
  border-color: var(--ink);
  background: var(--parchment);
  transform: translateX(2px);
}

.action-block-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-block-icon svg { width: 14px; height: 14px; }

.action-block-name {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.action-block-sub {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.55;
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .workflow-summary { grid-template-columns: repeat(2, 1fr); }
  .workflow-card { grid-template-columns: auto 1fr; }
  .workflow-card > .workflow-metrics, .workflow-card > .workflow-controls {
    grid-column: 1 / -1;
  }
  .builder-layout { grid-template-columns: 1fr; }
  .builder-side { position: relative; }
}
