/**
 * SunMonitor — Customer Portfolio overview CSS (Sprint 3)
 *
 * Wordt getoond in #cust-overview-portfolio container wanneer scope = portfolio.
 * Bevat: hero (titel + subtekst + 4 KPI's), aandacht-sectie, sortable tabel.
 *
 * JS counterpart: js/customer/portfolio.js
 */

/* ─── Portfolio-mode hint (gebruikt in Storingen + Rapport tabs) ───── */
.cust-portfolio-hint {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  background: var(--color-info-soft, rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: var(--radius-md);
  font-size: var(--fs-12);
  color: var(--text-primary);
  line-height: var(--lh-snug);
}
.cust-portfolio-hint-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.cust-portfolio-hint strong { font-weight: var(--fw-semibold); }

/* ─── Mode-switch (data-mode op #cust-overview tab-pane) ──────────── */
/* Portfolio-mode: alleen portfolio container zichtbaar, alle andere
   directe kinderen (greeting, KPIs, charts, perf-card, etc.) verborgen. */
#cust-overview[data-mode="portfolio"] > *:not(#cust-overview-portfolio) {
  display: none !important;
}
/* Site-mode (default): portfolio container verborgen */
#cust-overview[data-mode="site"] > #cust-overview-portfolio,
#cust-overview:not([data-mode]) > #cust-overview-portfolio {
  display: none;
}

/* ─── Hero (titel + actieknop) ──────────────────────────────────── */
.pf-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.pf-hero-headline {
  font-size: var(--fs-22);
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: var(--space-2);
}
.pf-hero-sub {
  font-size: var(--fs-12);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}
.pf-hero-actions {
  display: flex;
  gap: var(--space-3);
}

/* ─── KPI rij (4 tegels) ────────────────────────────────────────── */
.pf-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}
.pf-kpi {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6) var(--space-5);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-base);
}
.pf-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kc, var(--sun));
}
.pf-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-gray-300);
}
.pf-kpi-icon {
  position: absolute;
  right: var(--space-5);
  top: var(--space-5);
  font-size: var(--fs-16);
  font-weight: var(--fw-bold);
  color: var(--kc, var(--sun));
  opacity: 0.30;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.pf-kpi-value {
  font-size: var(--fs-28);
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}
.pf-kpi-label {
  font-size: var(--fs-11);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─── Attention sectie ──────────────────────────────────────────── */
.pf-attention {
  background: rgba(254, 243, 199, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}
.pf-attention-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  color: #92400e;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.pf-attention-icon {
  font-size: var(--fs-14);
}
.pf-attention-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pf-attn-item {
  display: grid;
  grid-template-columns: 24px 1fr auto 18px;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  text-align: left;
  font-size: var(--fs-12);
  color: var(--text-primary);
  transition: var(--transition-fast);
}
.pf-attn-item:hover {
  background: #fff;
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
  transform: translateX(2px);
}
.pf-attn-icon { font-size: 14px; text-align: center; }
.pf-attn-name {
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-attn-reason {
  font-size: var(--fs-11);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.pf-attn-arrow {
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}

/* ─── Sites tabel ───────────────────────────────────────────────── */
.pf-table-wrap {
  background: var(--surface-card);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-12);
}
.pf-th {
  background: var(--color-gray-50, #f8fafc);
  border-bottom: 1px solid var(--color-gray-200);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-10);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  user-select: none;
}
.pf-sortable {
  cursor: pointer;
  transition: color 0.15s ease;
}
.pf-sortable:hover {
  color: var(--text-primary);
}
.pf-sort-arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--color-brand);
  font-size: 10px;
}

.pf-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
  outline: none;
}
.pf-row:hover {
  background: var(--color-gray-50, #f8fafc);
}
.pf-row:focus-visible {
  background: var(--color-brand-soft);
  box-shadow: inset 0 0 0 2px var(--color-brand);
}
.pf-row > td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-gray-100, #f1f5f9);
  vertical-align: middle;
}
.pf-row:last-child > td {
  border-bottom: none;
}

.pf-align-left   { text-align: left;   }
.pf-align-right  { text-align: right;  font-variant-numeric: tabular-nums; }

.pf-site-name {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.pf-last-update {
  font-size: var(--fs-10);
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}
.pf-last-stale {
  color: var(--color-warning-active, #d97706);
}
.pf-loc {
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}
.pf-num-strong {
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

/* Status pill */
.pf-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-10);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.pf-status-dot { font-size: 10px; }
.pf-status-ok       { background: var(--color-success-soft); color: var(--color-success-active); }
.pf-status-warn     { background: rgba(217, 119, 6, 0.12);   color: #9a6700;                     }
.pf-status-offline  { background: var(--color-danger-soft);  color: var(--color-danger-active);  }

/* Alerts kolom */
.pf-alerts {
  display: inline-block;
  font-size: var(--fs-11);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}
.pf-alerts-zero   { color: var(--text-muted); }
.pf-alerts-active {
  color: var(--color-danger-active);
  background: var(--color-danger-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .pf-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
  .pf-kpi {
    padding: var(--space-5);
  }
  .pf-kpi-value {
    font-size: var(--fs-22);
  }
}

@media (max-width: 640px) {
  .pf-table-wrap {
    overflow-x: auto;
  }
  .pf-table {
    min-width: 720px;
  }
  .pf-hero {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .pf-kpi-row {
    grid-template-columns: 1fr;
  }
}
