/* ==============================
   Ardenvale — Private Deal Pipeline
   ============================== */

/* ── Nav ─────────────────────── */
.nav-link {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--fg); }
.nav-link--active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Header ─────────────────── */
.pd-header {
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 3rem 0;
}
.pd-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2rem;
}
.pd-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}
.pd-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* View toggle */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.view-btn {
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.view-btn:last-child { border-right: none; }
.view-btn:hover { background: var(--bg-alt); color: var(--fg); }
.view-btn--active { background: var(--accent); color: var(--bg); }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.55rem 1.25rem;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.87; }
.btn-secondary {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--fg-muted); color: var(--fg); }

/* Save indicator */
.save-indicator {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.save-indicator--visible { opacity: 1; }

/* ── KPI strip ──────────────── */
.kpi-strip { background: var(--accent); padding: 1.5rem 3rem; }
.kpi-strip-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.kpi-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 2.5rem;
  border-right: 1px solid rgba(245,241,235,0.15);
  flex: 1;
}
.kpi-item:first-child { padding-left: 0; }
.kpi-item:last-child  { border-right: none; }
.kpi-label { font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(245,241,235,0.5); }
.kpi-value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--accent-warm); line-height: 1; }
.kpi-value--dim { color: rgba(245,241,235,0.6); }

/* ── Stale banner ───────────── */
.stale-banner {
  background: rgba(201,168,76,0.1);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  padding: 0.75rem 3rem;
}
.stale-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.83rem;
  color: #7a6020;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.stale-icon { font-size: 1rem; }
.stale-link { color: var(--accent); text-decoration: underline; margin-left: 0.3rem; cursor: pointer; }

/* ── Filters ────────────────── */
.pd-filters {
  padding: 1.25rem 3rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.pd-filters-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.filter-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.4rem 1.8rem 0.4rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6359'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}
.filter-select:focus { outline: none; border-color: var(--accent); }
.filter-reset { font-size: 0.78rem; color: var(--fg-muted); text-decoration: none; padding: 0.35rem 0.65rem; border: 1px solid var(--border); border-radius: 3px; }
.filter-reset:hover { color: var(--fg); }
.filter-count { margin-left: auto; font-size: 0.78rem; color: var(--fg-muted); }

/* ── Table view ─────────────── */
.pd-body { padding: 2rem 3rem 4rem; }
.pd-body-inner { max-width: 1400px; margin: 0 auto; }

.pd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}
.pd-table th {
  text-align: left;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  white-space: nowrap;
}
.pd-table th:first-child { padding-left: 1.25rem; }
.pd-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.pd-table td:first-child { padding-left: 1.25rem; }
.pd-table tbody tr:hover { background: var(--bg-alt); cursor: default; }
.pd-table tbody tr:last-child td { border-bottom: none; }
.deal-row--passed td { opacity: 0.55; }
.deal-row--stale td:first-child::before {
  content: '⚠ ';
  color: #c9a84c;
  font-size: 0.7rem;
}

/* Col widths */
.col-name   { min-width: 200px; }
.col-ac     { width: 120px; }
.col-stage  { width: 110px; }
.col-score  { width: 110px; }
.col-check  { width: 110px; white-space: nowrap; }
.col-irr    { width: 120px; }
.col-lockup { width: 70px; }
.col-next   { min-width: 180px; }
.col-action { width: 36px; text-align: center; }

.deal-name    { font-weight: 500; color: var(--fg); }
.deal-sponsor { font-size: 0.78rem; color: var(--fg-muted); margin-top: 0.15rem; }

/* Asset class badges */
.ac-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--fg-muted);
  white-space: nowrap;
}
.ac-badge--PE            { background: rgba(26,58,42,0.08);  color: var(--accent);   border-color: rgba(26,58,42,0.2); }
.ac-badge--VC            { background: rgba(74,124,89,0.1);  color: #2e5e3a;          border-color: rgba(74,124,89,0.25); }
.ac-badge--private_credit{ background: rgba(201,168,76,0.1); color: #7a6020;          border-color: rgba(201,168,76,0.3); }
.ac-badge--real_assets   { background: rgba(120,90,50,0.1);  color: #5c3d1a;          border-color: rgba(120,90,50,0.25); }
.ac-badge--absolute_return{ background: rgba(80,80,100,0.08); color: #3a3a5a;         border-color: rgba(80,80,100,0.2); }

/* Stage pills */
.stage-pill {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  white-space: nowrap;
}
.stage-pill--sourced   { background: rgba(107,99,89,0.08);  color: var(--fg-muted); }
.stage-pill--screening { background: rgba(201,168,76,0.12); color: #7a6020; }
.stage-pill--diligence { background: rgba(74,124,89,0.15);  color: #2e5e3a; }
.stage-pill--IC-review { background: rgba(26,58,42,0.15);   color: var(--accent); }
.stage-pill--committed { background: rgba(26,58,42,0.2);    color: var(--accent); font-weight: 600; }
.stage-pill--funded    { background: rgba(26,58,42,0.3);    color: var(--accent); font-weight: 700; }
.stage-pill--passed    { background: rgba(180,60,60,0.08);  color: #8a3030; }

/* Score display */
.score-display { display: flex; flex-direction: column; gap: 0.3rem; }
.score-num { font-weight: 600; font-size: 1rem; color: var(--fg); line-height: 1; }
.score-bar-bg { height: 3px; background: var(--border); border-radius: 2px; width: 80px; }
.score-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.score-na { color: var(--fg-muted); font-size: 0.85rem; }

/* Metrics */
.metric-primary { font-size: 0.85rem; color: var(--fg); }

/* Lockup flags */
.lockup-val { font-size: 0.85rem; }
.flag-green  { color: var(--accent); }
.flag-yellow { color: #c9a84c; }
.flag-red    { color: #b44040; font-weight: 600; }

/* Next action cell */
.next-action-text { font-size: 0.83rem; color: var(--fg-muted); line-height: 1.4; }
.next-action-date { font-size: 0.75rem; color: var(--fg-muted); margin-top: 0.2rem; }
.overdue { color: #b44040 !important; font-weight: 600; }

/* Detail button */
.btn-detail {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background 0.15s, color 0.15s;
}
.btn-detail:hover { background: var(--bg-alt); color: var(--fg); }

/* Empty state */
.pd-empty { text-align: center; padding: 4rem 2rem; color: var(--fg-muted); }
.pd-empty-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent); margin-bottom: 0.5rem; }

/* ── Kanban ──────────────────── */
.kanban-wrapper { padding: 2rem 3rem 4rem; overflow-x: auto; }
.kanban-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  min-width: 900px;
}
.kanban-col {
  flex: 1;
  min-width: 180px;
  background: var(--bg-alt);
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.kanban-col--passed { opacity: 0.7; flex: 0 0 160px; }
.kanban-col-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-col-title {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.kanban-col-count {
  font-size: 0.72rem;
  color: var(--fg-muted);
  background: var(--border);
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
}
.kanban-cards {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.kanban-empty { font-size: 0.8rem; color: var(--fg-muted); text-align: center; padding: 0.75rem 0; }

.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kanban-card:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(26,58,42,0.08); }
.kanban-card--stale { border-color: rgba(201,168,76,0.4); }
.kanban-card--passed { background: var(--bg-alt); }

.kc-ac { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.kc-name { font-weight: 500; font-size: 0.85rem; color: var(--fg); line-height: 1.3; margin-bottom: 0.2rem; }
.kc-sponsor { font-size: 0.75rem; color: var(--fg-muted); margin-bottom: 0.35rem; }
.kc-meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--fg-muted); margin-top: 0.3rem; }
.kc-score { font-weight: 600; color: var(--accent); }
.kc-date { font-size: 0.7rem; color: var(--fg-muted); margin-top: 0.2rem; }
.kc-pass-note { font-size: 0.75rem; color: var(--fg-muted); line-height: 1.4; margin-top: 0.3rem; }
.stale-dot { color: #c9a84c; font-size: 0.8rem; }

/* ── Detail Drawer ───────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(20,18,15,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-overlay.active { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 95vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.active { transform: translateX(0); }

.drawer-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}
.drawer-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.drawer-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
  line-height: 1.2;
}
.drawer-subtitle {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 0.2rem;
}
.drawer-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
}
.drawer-close:hover { color: var(--fg); }

.drawer-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
}
.drawer-loading { color: var(--fg-muted); font-size: 0.85rem; text-align: center; padding: 2rem; }

.drawer-section { margin-bottom: 1.75rem; }
.drawer-section-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem 1rem;
}
.dm-item { display: flex; flex-direction: column; gap: 0.2rem; }
.dm-label { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.dm-value { font-size: 0.88rem; color: var(--fg); font-weight: 500; }
.dm-alert {
  grid-column: 1 / -1;
  background: rgba(180,64,64,0.08);
  border: 1px solid rgba(180,64,64,0.2);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #8a3030;
}

.drawer-score-bar { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 1rem; overflow: hidden; }
.drawer-score-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s; }

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.score-table th {
  text-align: left;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.score-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(var(--border-rgb, 215,210,200), 0.5); color: var(--fg); }
.score-table tr:last-child td { border-bottom: none; }

.drawer-text { font-size: 0.85rem; color: var(--fg); line-height: 1.6; margin: 0; }
.drawer-date { font-size: 0.78rem; color: var(--fg-muted); margin-top: 0.3rem; }
.drawer-decision-link { font-size: 0.82rem; color: var(--accent); text-decoration: none; }
.drawer-decision-link:hover { text-decoration: underline; }

.drawer-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

/* ── Modals ──────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,18,15,0.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  width: min(680px, 95vw);
  max-height: 88vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  z-index: 301;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.modal.active { opacity: 1; pointer-events: all; transform: translate(-50%, -50%); }

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
}
.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--fg); }

.modal-form {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* Form elements */
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 120px; margin-bottom: 1rem; }
.form-group--wide { flex: 2; min-width: 200px; }
.form-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.form-input, .form-select, .form-textarea {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6359'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}
.form-textarea { resize: vertical; line-height: 1.5; }

/* ── Responsive ─────────────── */
@media (max-width: 1000px) {
  .pd-header { padding: 2rem 1.5rem 0; }
  .kpi-strip  { padding: 1.25rem 1.5rem; }
  .kpi-strip-inner { flex-wrap: wrap; gap: 0.75rem; }
  .kpi-item { border-right: none; padding: 0; flex: 0 0 auto; }
  .pd-filters { padding: 1rem 1.5rem; }
  .pd-body { padding: 1.5rem 1.5rem 3rem; }
  .kanban-wrapper { padding: 1.5rem 1rem 3rem; }
  .col-irr, .col-lockup { display: none; }
}
