/* Vantage portal visual system, adapted from the supplied UI references. */
:root {
  --ink: #1c1c1f;
  --deep: #1b1b1c;
  --deep2: #242426;
  --paper: #e8e7ed;
  --line: #dddce5;
  --muted: #85858f;
  --gold: #2563eb;
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --sans: Inter, Arial, sans-serif;
  --serif: Inter, Arial, sans-serif;
}

html, body { background: var(--paper); color: var(--ink); font-family: Inter, Arial, sans-serif; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .kanban-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-shell { grid-template-columns: 222px minmax(0, 1fr); }
.workspace { background: var(--paper); min-height: 100vh; }

/* Black navigation with the saturated active state from the references. */
.sidebar { background: #1b1b1c; padding: 23px 12px 17px; min-height: 650px; }
.brand-block { padding: 3px 7px 24px; margin-bottom: 15px; border-bottom: 1px solid #38383b; }
.wordmark { width: 141px; }
.client-card { margin: 0 2px 21px; padding: 10px; border: 1px solid #37373a; background: #272729; border-radius: 5px; }
.client-mark { background: var(--accent); color: #fff; }
.client-name strong { font-size: 12px; }
.client-name small { color: #aba8b1; }
.main-nav { gap: 5px; }
.nav-item { height: 39px; padding: 0 11px; border-radius: 4px; color: #b9b7bf; font-size: 12px; }
.nav-item .icon { width: 17px; height: 17px; }
.nav-item:hover { background: #323235; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 650; }
.nav-item.active .icon { stroke-width: 2; }
.nav-item em { background: #363638; color: #c6c4cc; }
.nav-item.active em { background: var(--accent-deep); color: #fff; }
.sidebar-footer { border-top: 1px solid #38383b; padding: 16px 8px 0; }
.sidebar-footer .avatar { background: var(--accent); color: #fff; }
.sidebar-footer strong { color: #eeeef0; }

/* The reference keeps the workspace one continuous pale surface. */
.topbar { height: 62px; padding-inline: clamp(22px, 3vw, 42px); border: 0; background: var(--paper); }
.breadcrumb { color: #797982; font-size: 11px; }
.breadcrumb strong { color: #26262a; font-weight: 650; }
.preview-label { border: 1px solid #d8d7e1; background: #f4f3f8; color: #777580; }
.preview-label span { background: var(--accent); }
main { max-width: 1800px; padding: 0 clamp(22px, 3vw, 42px) 58px; }
.page-heading { padding: 7px 0 22px; align-items: center; }
.page-heading h1 { font: 750 clamp(22px, 2vw, 27px)/1.2 var(--sans); letter-spacing: -.035em; }
.page-subtitle { margin-top: 5px; color: #777782; font-size: 12px; }
.primary-button, .outline-button { min-height: 37px; padding: 8px 14px; border-radius: 4px; font-size: 12px; font-weight: 570; }
.primary-button { border-color: var(--accent); background: var(--accent); color: #fff; }
.primary-button:hover { border-color: var(--accent-deep); background: var(--accent-deep); }
.outline-button { border-color: #d5d4df; background: #fff; color: #28282d; }
.outline-button:hover { background: #f6f5fa; }
.text-button { color: var(--accent-deep); font-size: 11px; font-weight: 650; }
.icon-button { color: #55555e; }
.icon-button:hover { background: #f0eff5; }
.subtle-button { border-color: #dddae5; color: #4e4c57; }
.panel { border: 0; border-radius: 7px; background: #fff; box-shadow: none; }
.panel-kicker { display: block; color: #9c9aa5; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.panel-heading h2, .calendar-head h2 { font: 680 16px/1.3 var(--sans); letter-spacing: -.02em; }

/* Overview: 4 compact metric cards per row, then two balanced panels. */
.overview-metrics { gap: 11px; margin-bottom: 15px; }
.metric-box { min-height: 108px; padding: 16px 18px; border: 0; border-radius: 7px; background: #fff; box-shadow: none; }
.metric-box span { color: #36353c; font-size: 12px; font-weight: 650; }
.metric-box strong { color: #1c1c1e; font-size: 29px; font-weight: 700; letter-spacing: -.04em; }
.dashboard-grid { gap: 11px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#page-dashboard .pipeline-panel, #page-dashboard .activity-panel { padding: 19px 20px 22px; border: 0; border-radius: 7px; background: #fff; }
#page-dashboard .panel-heading { margin-bottom: 22px; }
#page-dashboard .panel-kicker { margin-bottom: 4px; color: #aaa8b2; }
#page-dashboard .panel-heading h2 { font-size: 17px; }
#page-dashboard .chart-row { color: #55545f; }
#page-dashboard .chart-row strong { color: #24242a; }
.chart-track { height: 9px; background: #f0eff5; }
.chart-label::before { border-radius: 50%; }
.activity-item { border-color: #eeedf2; }
#page-dashboard .activity-date { border-color: #e9e7ee; background: #f7f6fa; }
.activity-content strong { color: #242429; }
.activity-content span, .activity-date small { color: #94929c; }

/* CRM: centered view switch, compact controls, dark column bars, white cards. */
.crm-view-switch { display: flex; justify-content: center; margin: -4px 0 16px; }
.crm-view-switch .segmented { width: min(100%, 410px); padding: 4px; border: 0; border-radius: 7px; background: #f6f5fa; }
.crm-view-switch .segmented button { justify-content: center; flex: 1; min-height: 35px; padding: 7px 12px; border-radius: 4px; color: #27272c; font-size: 12px; }
.crm-view-switch .segmented button.selected { background: #1c1c1e; color: #fff; box-shadow: none; }
.crm-view-switch .segmented .icon { width: 14px; height: 14px; }
.crm-summary { gap: 11px; margin-bottom: 12px; }
.crm-summary-card, .crm-summary-card:first-child, .crm-summary-card:last-child { min-height: 81px; padding: 14px 17px; border: 0; border-radius: 6px; background: #fff; }
.crm-summary-card strong { color: #2b2a31; font-size: 23px; }
.crm-summary-card:nth-child(2) strong { color: #4b8ef9; }
.crm-summary-card:nth-child(3) strong { color: var(--accent); }
.crm-summary-card small { color: #84838d; font-size: 11px; }
.crm-toolbar { margin-bottom: 12px; padding: 0; border: 0; background: transparent; }
.search-box, .select-wrap { height: 38px; border: 1px solid #e2e0e8; border-radius: 5px; background: #fff; color: #86838f; }
.search-box input, .select-wrap select { color: #3b3942; font-size: 11px; }
.search-box input::placeholder { color: #a19fa8; }
.crm-content { border: 0; border-radius: 7px; background: #fff; }
.crm-table th { background: #f7f6fa; }
.data-table th { color: #7f7d88; }
.data-table td { border-color: #e8e7ed; }
.data-table tbody tr:hover { background: #f9f7fc; }
.investor-logo { display: grid; border-radius: 50%; background: #e6d4fb; color: #7044a2; font-family: var(--sans); }
.investor-cell small, .muted-cell { color: #85838e; }
.stage-pill { background: #efe7fa; color: #7c4cba; }
.table-footer { color: #92909c; }
.board-tip { color: #777580; font-size: 11px; }
.pipeline-phase-nav { grid-template-columns: repeat(7, minmax(116px, 1fr)); margin-bottom: 22px; border: 0; border-radius: 6px; background: #fff; }
.pipeline-phase-nav button { min-height: 53px; padding: 10px 11px; border-top: 0; border-right: 1px solid #e6e4ed; background: #fff; color: var(--phase-color); font-size: 11px; line-height: 1.18; }
.pipeline-phase-nav button:hover, .pipeline-phase-nav button:focus-visible { background: #f8f5fd; }
.pipeline-phase-nav span { color: #8f8c9b; font-size: 9px; font-weight: 500; }
.kanban-phases { gap: 30px; }
.kanban-phase-heading { align-items: center; margin-bottom: 8px; }
.kanban-phase-heading h3 { color: #28272e; font-size: 14px; font-weight: 700; }
.kanban-phase-heading h3::before { width: 8px; height: 8px; border-radius: 50%; }
.kanban-phase-heading span { color: #8a8894; }
.phase-scroll { padding: 0 0 10px; margin: 0 0 -10px; }
.kanban { gap: 7px; }
.kanban-column { min-height: 205px; padding: 0 5px 6px; border: 0; border-radius: 6px; background: #d9d7e1; }
.column-head { min-height: 59px; margin: 0 -5px 5px; padding: 10px 10px 8px; border: 0; border-radius: 6px 6px 0 0; background: #1c1c1d; }
.column-head::before { display: none; }
.column-head strong { color: var(--stage-color); font-size: 12px; font-weight: 600; line-height: 1.22; }
.column-head small { margin-top: 3px; color: #fff; font-size: 10px; font-weight: 450; }
.column-head .column-count { min-width: 21px; height: 21px; background: #353539; color: #fff; font-size: 10px; }
.column-cards { min-height: 58px; }
.kanban-card { margin-bottom: 5px; padding: 12px 11px 10px; border: 0; border-radius: 5px; background: #fff; box-shadow: 0 1px 3px #1c1a2b14; }
.kanban-card-top { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-bottom: 14px; }
.kanban-card .investor-logo { width: 30px; height: 30px; background: color-mix(in srgb, var(--stage-color) 24%, #fff); color: #28242d; font-size: 10px; }
.kanban-card .kanban-name { display: block; margin: 0; color: #1f1e22; font-size: 12px; font-weight: 680; line-height: 1.25; }
.kanban-detail-row { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; margin-top: 4px; color: #33313a; font-size: 10px; line-height: 1.3; }
.kanban-detail-row span { flex: none; color: #77747e; }
.kanban-detail-row strong { overflow: hidden; color: #27262d; font-weight: 550; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.kanban-profile { display: flex; justify-content: space-between; margin-top: 12px; color: #25242a; font-size: 10px; font-weight: 600; }
.kanban-profile span { font-size: 13px; line-height: 1; }
.kanban-move { gap: 4px; margin-top: 11px; padding-top: 9px; border-top: 1px solid #eeedf2; color: #898691; font-size: 9px; }
.kanban-move select { height: 29px; border-color: #e5e3e9; background: #faf9fc; color: #55515e; font-size: 10px; }
.empty-column { color: #787580; }
.kanban-column.drop-target { outline: 2px solid var(--stage-color); outline-offset: -2px; border: 0; background: color-mix(in srgb, var(--stage-color) 14%, #e8e7ed); }

/* Calendar and data room use the same white surfaces and blue controls. */
.calendar-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 11px; }
.calendar-panel { padding: 17px 17px 18px; }
.calendar-head { padding: 0 0 14px; }
.calendar-head h2 { font-size: 18px; }
.weekday-row { border-color: #e7e5ed; background: #f9f8fc; }
.weekday-row span { color: #73717d; }
.calendar-grid { gap: 1px; background: #e8e6ed; }
.calendar-day { min-height: 97px; }
.calendar-day.outside { background: #faf9fc; }
.day-number { color: #45434d; }
.calendar-day.today .day-number { background: var(--accent); color: #fff; }
.calendar-event { border-color: var(--accent); background: #eaf2ff; color: #2556a6; }
.calendar-event.task { border-color: #4e8ef9; background: #eaf2ff; color: #3d70be; }
.calendar-event.deadline { border-color: #ffb344; background: #fff3dd; color: #a27425; }
.calendar-event.internal { border-color: #9b79e0; background: #f2edff; color: #7856b6; }
.calendar-sidebar { gap: 11px; }
.tasks-panel, .agenda-panel { padding: 17px 17px 18px; }
.tasks-panel .panel-heading, .agenda-panel .panel-heading { margin-bottom: 12px; }
.task-count { color: #92909b; }
.task-item { padding: 10px 9px; margin-bottom: 5px; border: 0; border-left: 3px solid var(--accent); border-radius: 4px; background: #f6f5fa; }
.task-item:nth-child(even) { border-left-color: #518df6; }
.task-check { border-color: #c5c2cf; }
.task-item.done .task-check { border-color: var(--accent); background: var(--accent); }
.task-details strong { color: #28272e; }
.task-details small, .task-due { color: #888592; }
.agenda-item { border-color: #eeedf2; }
.agenda-date strong { color: #2b292f; }
.agenda-body small { color: #93909c; }
.agenda-key { border-color: #efedf3; color: #85828f; }
.key-dot.meeting { background: var(--accent); }
.key-dot.task { background: #518df6; }
.room-toolbar { gap: 10px; margin-bottom: 11px; }
.room-tabs { gap: 0; background: #fff; border-radius: 5px; }
.room-tabs button { padding: 9px 10px; color: #7e7b88; }
.room-tabs button.selected { border-color: var(--accent); color: var(--accent-deep); }
.files-panel { border: 0; border-radius: 7px; }
.files-head { background: #f8f7fb; color: #8c8996; }
.file-row { border-color: #ebe9f0; }
.file-icon, .file-icon.xlsx, .file-icon.docx { background: #f1e6ff; color: #8f54cc; }
.file-name strong { color: #2a292f; }
.file-name small, .file-row > span { color: #8a8793; }
.file-access { color: #5d5470; }
.file-access i { background: var(--accent); }
.files-foot { color: #8d8a96; }

/* White forms and simple dialogs mirror the supplied task and CRM screens. */
.drawer-backdrop, .modal-backdrop { background: #1e1d23a8; }
.detail-drawer, .modal-card { background: #fff; }
.drawer-inner { padding: 25px; }
.drawer-kicker { color: var(--accent-deep); }
.drawer-top h2, .modal-head h2 { color: #25242a; }
.drawer-subtitle, .modal-description, .drawer-section p { color: #77747f; }
.drawer-section { border-color: #eeecf2; }
.drawer-section h3, .investor-form-group h3, .investor-file-fieldset legend { color: #7b7886; }
.drawer-field span { color: #96929f; }
.drawer-field strong { color: #29272f; }
.drawer-field a { color: var(--accent-deep); }
.drawer-section select, .drawer-section input, .modal-form input, .modal-form select, .modal-form textarea { border-color: #e8e6ed; background: #f6f5f9; color: #2b2930; }
.drawer-section label, .modal-form label { color: #4b4852; font-size: 11px; }
.modal-card { border-radius: 7px; }
.preview-note { background: #f5f1fb; color: #76688a; }
.investor-file-option { background: #f7f6fa; }
.investor-file-option input { accent-color: var(--accent); }
.calendar-kind-switch { background: #eae8f0; }
.calendar-kind-switch button.selected { background: #1c1c1e; color: #fff; box-shadow: none; }
.access-person { border-color: #edeaf2; }
.access-person .avatar { background: #e7d5fc; color: #7044a2; }
.toast { background: #242326; }

.detail-drawer.investor-detail-mode {
  inset: 50% auto auto 50%;
  width: min(920px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 54px));
  transform: translate(-50%, -50%);
  border-radius: 7px;
  box-shadow: 0 24px 90px #11101845;
}
.investor-detail-inner { display: grid; grid-template-columns: 34% minmax(0, 1fr); padding: 0; }
.investor-detail-header { grid-column: 1 / -1; padding: 22px 26px 17px; border-bottom: 1px solid #eceaf0; }
.investor-detail-header .drawer-top h2 { margin-top: 6px; }
.investor-detail-header .drawer-subtitle { margin: 4px 0 0; }
.investor-profile-pane { min-width: 0; padding: 25px 24px; background: #f4f3f8; }
.investor-detail-pane { min-width: 0; padding: 24px 29px; }
.investor-profile-avatar { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 15px; border-radius: 50%; background: #e5d1fa; color: #7b45b0; font-size: 20px; font-weight: 700; }
.investor-profile-pane .investor-edit-button { margin-bottom: 18px; }
.investor-profile-pane .drawer-fields { grid-template-columns: 1fr; gap: 12px; }
.investor-detail-inner .drawer-section:first-child { border-top: 0; padding-top: 0; }
.investor-detail-pane .drawer-section > strong { color: #29272f; font-size: 13px; }
.investor-detail-pane .investor-shared-file { background: #f6f5fa; border-color: #eae8ef; }

@media (max-width: 1050px) {
  .calendar-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .pipeline-phase-nav { grid-template-columns: repeat(7, minmax(112px, 1fr)); }
}
@media (max-width: 900px) {
  .dashboard-grid, .calendar-layout { grid-template-columns: 1fr; }
  .calendar-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .detail-drawer.investor-detail-mode { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .investor-detail-inner { grid-template-columns: 1fr; }
  .investor-detail-header { grid-column: 1; }
  .investor-profile-pane, .investor-detail-pane { padding: 20px; }
  .sidebar { width: 238px; }
  .topbar { padding-inline: 18px; }
  main { padding-inline: 18px; }
  .page-heading { padding-top: 13px; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-phase-nav { display: flex; }
  .pipeline-phase-nav button { flex: 0 0 130px; }
  .calendar-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .page-heading { padding-top: 16px; }
  .metric-box { min-height: 86px; padding: 13px; }
  .metric-box strong { font-size: 23px; }
  .crm-view-switch { margin-top: 0; }
  .crm-toolbar { align-items: stretch; flex-wrap: wrap; }
  .crm-toolbar .search-box { width: 100%; }
  .toolbar-right { width: 100%; }
  .toolbar-right .select-wrap { flex: 1; }
  .calendar-panel { padding: 12px; }
  .calendar-day { min-height: 69px; }
}

/* Keep the pipeline in a single row. Each lane owns its vertical scroll. */
#crm-board-view .kanban-strip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 12px;
}
#crm-board-view .kanban-column {
  flex: 1 0 clamp(210px, 18vw, 280px);
  min-width: 0;
  min-height: 0;
  max-width: 340px;
}
#crm-board-view .column-cards {
  max-height: clamp(220px, calc(100dvh - 300px), 720px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 2px;
}
#crm-board-view .column-cards:focus-visible,
#crm-board-view .kanban-strip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
