/* Portal-specific styles. Loads after colors_and_type.css */

/* ---------- Top bar ---------- */
.vct-topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--vct-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--vct-border);
}
.vct-topbar__inner {
  max-width: var(--vct-max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.vct-topbar__brand { display: flex; align-items: center; gap: 10px; }
.vct-topbar__word  { font-size: 15px; font-weight: 600; color: #1A1A1A; letter-spacing: -0.02em; }
.vct-topbar__right { display: flex; align-items: center; gap: 14px; }
.vct-daterange {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 13px; color: #1A1A1A; font-weight: 500;
  background: transparent; border: 1px solid var(--vct-border);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
  transition: background 120ms var(--vct-ease-out), border-color 120ms var(--vct-ease-out);
}
.vct-daterange:hover { background: rgba(27,67,50,0.04); border-color: var(--vct-border-strong); }
.vct-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--vct-accent-light); color: var(--vct-accent);
  font-size: 11px; font-weight: 600;
  border: 0; cursor: pointer;
  display: grid; place-items: center;
}

/* ---------- Page shell ---------- */
.vct-page {
  max-width: var(--vct-max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex; flex-direction: column; gap: 40px;
}
.vct-page__head { display: flex; align-items: baseline; justify-content: space-between; }
.vct-page__head h1 { font-size: 22px; }
.vct-page__head .meta { font-size: 12px; color: var(--vct-fg-tertiary); }

.vct-section { display: flex; flex-direction: column; gap: 16px; }
.vct-section__title { display: flex; align-items: baseline; justify-content: space-between; }
.vct-section__title h2 { font-size: 17px; }
.vct-section__title .meta { font-size: 12px; color: var(--vct-fg-tertiary); }

/* ---------- Hero strip ---------- */
.vct-hero {
  background: #fff;
  border: 1px solid var(--vct-border);
  border-radius: 12px;
  box-shadow: var(--vct-shadow-card);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.vct-hero__cell {
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
}
.vct-hero__cell + .vct-hero__cell::before {
  content: ''; position: absolute; left: 0; top: 18px; bottom: 18px;
  width: 1px; background: var(--vct-border);
}
@media (max-width: 1024px) {
  .vct-hero { grid-template-columns: repeat(3, 1fr); }
  .vct-hero__cell:nth-child(3n+1)::before { display: none; }
}
@media (max-width: 768px) {
  .vct-hero { grid-template-columns: 1fr; }
  .vct-hero__cell + .vct-hero__cell::before { display: none; }
  .vct-hero__cell + .vct-hero__cell { border-top: 1px solid var(--vct-border); }
}

/* ---------- Card with head ---------- */
.vct-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.vct-chart { width: 100%; height: auto; display: block; }

/* ---------- Trend chart tooltip ---------- */
.vct-tooltip {
  position: absolute; top: 8px;
  transform: translateX(-50%);
  background: #fff; border: 1px solid var(--vct-border);
  border-radius: 8px; padding: 8px 10px;
  box-shadow: var(--vct-shadow-modal);
  pointer-events: none;
  min-width: 180px;
  font-size: 12px;
}
.vct-tooltip__date { color: var(--vct-fg-tertiary); font-size: 11px; margin-bottom: 6px;
  letter-spacing: 0.06em; text-transform: uppercase; }
.vct-tooltip__row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.vct-tooltip__swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.vct-tooltip__name { color: var(--vct-fg-secondary); flex: 1; }
.vct-tooltip__val  { color: #1A1A1A; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Table ---------- */
.vct-table-card { padding: 24px 0 0; overflow: hidden; }
.vct-table-card .vct-card__head { padding: 0 24px; margin-bottom: 12px; }
.vct-table-wrap { overflow-x: auto; }
.vct-table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.vct-th {
  background: var(--vct-bg-secondary);
  color: var(--vct-fg-secondary);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 10px 14px;
  text-align: right;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--vct-border);
}
.vct-th--left { text-align: left; }
.vct-th--sub  { background: #EAE7E1; padding-left: 10px; padding-right: 10px; font-size: 10px; }
.vct-th--expand { color: var(--vct-accent); }
.vct-th__inner { display: inline-flex; align-items: center; gap: 4px; }
.vct-th__chev { display: inline-flex; }
.vct-table thead th:first-child { padding-left: 24px; }
.vct-table thead th:last-child  { padding-right: 24px; }

.vct-td {
  padding: 11px 14px;
  text-align: right;
  color: #1A1A1A;
  white-space: nowrap;
}
.vct-td--first { text-align: left; font-weight: 500; padding-left: 24px; }
.vct-td--sub   { background: #FBFAF6 !important; font-size: 12px; }
.vct-table tbody tr:nth-child(odd)  td { background: #FFFFFF; }
.vct-table tbody tr:nth-child(even) td { background: #FAFAF7; }
.vct-table tbody tr.is-hover td { background: rgba(216,243,220,0.30); }
.vct-table tbody tr td:last-child { padding-right: 24px; }
.vct-table tfoot td { background: var(--vct-bg-secondary); font-weight: 600; color: #1A1A1A;
  border-top: 1px solid var(--vct-border); padding-top: 13px; padding-bottom: 13px; }

/* ---------- Insights ---------- */
.vct-insights { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .vct-insights { grid-template-columns: 1fr; } }
.vct-insight {
  background: #fff;
  border: 1px solid var(--vct-border);
  border-radius: 12px;
  box-shadow: var(--vct-shadow-card);
  display: flex;
  overflow: hidden;
  position: relative;
}
.vct-insight__accent { width: 4px; flex: none; }
.vct-insight__icon { padding: 18px 0 0 16px; }
.vct-insight__body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.vct-insight__title { font-size: 13px; font-weight: 600; color: #1A1A1A; letter-spacing: -0.01em; }
.vct-insight__desc { font-size: 13px; color: var(--vct-fg-secondary); line-height: 1.55; }
.vct-insight__desc b { font-variant-numeric: tabular-nums; color: #1A1A1A; font-weight: 600; }

/* ---------- Chart legend ---------- */
.vct-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.vct-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--vct-fg-secondary); }
.vct-legend__swatch { width: 16px; height: 2px; border-radius: 1px; }

/* Negative cell */
.vct-negative { color: var(--vct-negative); }

/* ---------- Dropdown menus ---------- */
.vct-dropdown {
  position: absolute; top: calc(100% + 6px);
  background: #fff; border: 1px solid #E8E6E1; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100; overflow: hidden;
}
.vct-dropdown__section { display: flex; flex-direction: column; }
.vct-dropdown__item {
  display: block; width: 100%; text-align: left;
  padding: 9px 16px; font-size: 13px; color: #1A1A1A;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.vct-dropdown__item:hover { background: #F2F0EB; }
.vct-dropdown__divider { height: 1px; background: #E8E6E1; }

/* ---------- Primary button ---------- */
.vct-btn--primary {
  background: #1B4332; color: #fff; border: none; border-radius: 6px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.vct-btn--primary:hover { background: #2D6A4F; }

/* ---------- Loading bar animation ---------- */
@keyframes loading {
  0% { width: 10%; margin-left: 0; }
  50% { width: 40%; margin-left: 30%; }
  100% { width: 10%; margin-left: 90%; }
}

/* ---------- Tabs ---------- */
.vct-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  border-bottom: 1px solid #E8E6E1;
}
.vct-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: #6B6B60; background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.vct-tab:hover { color: #1A1A1A; }
.vct-tab.is-active {
  color: #1B4332; border-bottom-color: #1B4332;
}

/* ---------- Waterfall tooltip ---------- */
.vct-wf-tooltip {
  position: absolute; top: 8px;
  background: #fff; border: 1px solid #E8E6E1; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 12px 16px; min-width: 200px; z-index: 50;
  font-size: 13px; pointer-events: none;
}
.vct-wf-tooltip__title {
  font-weight: 600; color: #1A1A1A; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid #E8E6E1;
}
.vct-wf-tooltip__row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 3px 0; color: #6B6B60;
}
.vct-wf-tooltip__val {
  font-weight: 500; color: #1A1A1A;
  font-variant-numeric: tabular-nums;
}
