/* Tenant Overview — single-screen ops board. KPIs sit in the hero. */

.app-shell:has(#view-overview.active) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.app-shell:has(#view-overview.active) .app-footer {
  display: none;
}

.app-shell:has(#view-overview.active) .app-content {
  overflow: hidden;
  padding-top: 10px;
  padding-bottom: 10px;
}

#view-overview.view.active {
  overflow: hidden;
  min-height: 0;
}

#view-overview .overview-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 8px;
}

#view-overview .overview-panels {
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 8px;
}

#view-overview .overview-panels .panel-card,
#view-overview .overview-panels .overview-panel {
  min-height: 0;
  height: 100%;
}

#view-overview .workspace-hero.ov-hero {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px 14px;
  padding: 10px 12px;
  margin-bottom: 0;
}

.ov-hero-ident {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#view-overview .ov-hero .admin-banner-title {
  font-size: 14px;
  letter-spacing: 0.06em;
}

#view-overview .ov-hero .admin-banner-sub {
  font-size: 11px;
  margin-top: 3px;
}

#view-overview .ov-hero .workspace-meta {
  margin-top: 3px;
  font-size: 10px;
}

#view-overview .workspace-hero-actions {
  display: none;
}

.ov-pulse {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  min-height: 0;
}

.ov-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ov-chip b {
  color: var(--text);
  font-weight: 700;
}

.ov-chip.is-hot {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.ov-chip.is-hot b { color: var(--amber); }

.ov-chip.is-ok {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.ov-chip.is-ok b { color: var(--green); }

.ov-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-self: stretch;
}

.ov-kpi-grid .stat-card {
  min-height: 52px;
  height: 100%;
  padding: 8px 10px 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
}

.ov-kpi-grid .stat-kicker,
.ov-kpi-grid .stat-hint {
  display: none;
}

.ov-kpi-grid .stat-label {
  margin-bottom: 2px;
  font-size: 9px;
  color: var(--muted);
}

.ov-kpi-grid .stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-top: 0;
}

.stat-card.stat-tone-prt.stat-hot {
  border-left-color: var(--green);
  background: var(--green-bg);
}
.stat-card.stat-tone-prt.stat-hot .stat-value { color: var(--green); }

.stat-card.stat-tone-whfb.stat-hot {
  border-left-color: var(--purple);
  background: var(--purple-bg);
}
.stat-card.stat-tone-whfb.stat-hot .stat-value { color: var(--purple); }

.stat-card.stat-tone-ga.stat-hot {
  border-left-color: var(--amber);
  background: var(--amber-bg);
}
.stat-card.stat-tone-ga.stat-hot .stat-value { color: var(--amber); }

.stat-card.stat-tone-revoked.stat-hot {
  border-left-color: #fb7185;
  background: var(--red-bg);
}
.stat-card.stat-tone-revoked.stat-hot .stat-value { color: #fb7185; }

.ov-rack {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding: 6px 12px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.ov-rack .panel-card-title {
  margin-bottom: 0;
  font-size: 10px;
}

.ov-rack-sub {
  display: none;
}

.ov-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 16px;
}

.ov-meter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  min-width: 0;
}

.ov-meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ov-meter-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ov-meter-track {
  height: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.ov-meter-fill {
  height: 100%;
  width: 0;
  background: var(--text);
  transition: width 0.35s ease;
}

.ov-meter.is-active .ov-meter-fill { background: var(--blue); }
.ov-meter.is-prt .ov-meter-fill { background: var(--green); }
.ov-meter.is-whfb .ov-meter-fill { background: var(--purple); }
.ov-meter.is-ga .ov-meter-fill { background: var(--amber); }

.ov-meter-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#view-overview .overview-panel {
  padding-top: 8px;
  padding-bottom: 0;
}

#view-overview .overview-panel .section-header {
  margin-bottom: 4px;
  flex-shrink: 0;
  min-height: 22px;
}

#view-overview .overview-table-wrap {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

#view-overview .overview-table {
  flex: 1;
  height: 100%;
  border-collapse: collapse;
}

#view-overview .overview-table tbody tr {
  height: 1%;
}

#view-overview .overview-table tbody tr:last-child td {
  border-bottom: none;
}

#view-overview .overview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface2);
  box-shadow: 0 1px 0 var(--border);
}

#view-overview .overview-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

#view-overview .overview-table th,
#view-overview .overview-table td {
  padding: 6px 8px;
}

#view-overview .overview-table .col-ov-id { width: 44px; }
#view-overview .overview-table .col-ov-status { width: 96px; }
#view-overview .overview-table .col-ov-bot { width: 48px; }
#view-overview .overview-table .col-ov-code { width: 92px; }
#view-overview .overview-table .col-ov-source { width: 96px; }
#view-overview .overview-table .col-ov-geo { width: 40px; }
#view-overview .overview-table .col-ov-when { width: 44px; text-align: right; }
#view-overview .overview-table .ov-when { text-align: right; }

.ov-haul {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-left: calc(-1 * var(--panel-pad-x));
  margin-right: calc(-1 * var(--panel-pad-x));
  width: calc(100% + (var(--panel-pad-x) * 2));
}

.ov-haul-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  flex: 1 1 0;
  min-height: 36px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.ov-haul-row:last-child {
  border-bottom: none;
}

.ov-haul-row:hover,
.ov-haul-row:focus-visible {
  background: var(--row-hover);
  outline: none;
}

.ov-haul-row.is-whfb { border-left-color: var(--purple); }
.ov-haul-row.is-prt,
.ov-haul-row.is-res { border-left-color: var(--green); }
.ov-haul-row.is-ga { border-left-color: var(--amber); }
.ov-haul-row.is-revoked { border-left-color: var(--red); }
.ov-haul-row.is-oauth { border-left-color: var(--blue); }

.ov-haul-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-haul-mail {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-haul-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
}

.ov-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--muted);
}

.ov-pill.whfb { color: var(--purple); border-color: var(--purple-border); background: var(--purple-bg); }
.ov-pill.prt { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.ov-pill.res { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.ov-pill.ga { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.ov-pill.revoked { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.ov-pill.oauth { color: var(--blue); border-color: var(--blue-border); background: var(--blue-bg); }
.ov-pill.fail { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }

.ov-haul-when {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--dim);
}

.ov-empty {
  padding: 20px 16px;
  font-size: 12px;
  font-style: italic;
  color: var(--dim);
  text-align: center;
}

.overview-table .col-ov-geo,
.overview-table .col-ov-when {
  width: 52px;
}

.overview-table .ov-cc {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.overview-table .ov-when {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  #view-overview .workspace-hero.ov-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell:has(#view-overview.active),
  .app-shell:has(#view-overview.active) .app-content,
  #view-overview.view.active,
  #view-overview .overview-layout {
    height: auto;
    max-height: none;
    overflow: auto;
  }
  #view-overview .workspace-hero.ov-hero {
    grid-template-columns: 1fr;
  }
  .ov-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-rack {
    grid-template-columns: 1fr;
  }
  .ov-meters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .ov-haul-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .ov-haul-meta { align-items: flex-start; flex-direction: row; }
}
