/* ═══════════════════════════════════════════════════════════════ */
/*  TELEMETRY DASHBOARD STYLES                                    */
/*  Light theme on Samizdat Beige — consistent with PageBody      */
/* ═══════════════════════════════════════════════════════════════ */

/* ─── Layout ──────────────────────────────────────────────────── */

.telem-panel {
  padding: var(--ds-space-lg) var(--ds-space-xl);
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

.telem-stats-row {
  display: flex;
  gap: var(--ds-space-md);
  flex-wrap: wrap;
  margin-bottom: var(--ds-space-xl);
}

.telem-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-lg);
  margin-bottom: var(--ds-space-xl);
}

.telem-charts-row--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.telem-chart-box {
  background: #fff;
  border: 1px solid var(--page-border);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-md) var(--ds-space-lg);
}

.telem-chart-box h4 {
  margin: 0 0 var(--ds-space-sm);
  font-size: 0.8em;
  font-weight: 600;
  color: var(--text-color-quiet);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.telem-full-width {
  grid-column: 1 / -1;
}

/* ─── Stat Cards ──────────────────────────────────────────────── */

.telem-stat-card {
  background: #fff;
  border: 1px solid var(--page-border);
  border-left: 3px solid var(--action-color);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-sm) var(--ds-space-lg);
  min-width: 120px;
  flex: 1;
}

.telem-stat-value {
  font-size: 1.8em;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--text-color);
}

.telem-stat-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-color-quiet);
  margin-top: 4px;
}

.telem-stat-sub {
  font-size: 0.7em;
  color: var(--text-color-quiet);
  margin-top: 2px;
}

/* ─── Dashboard Header ───────────────────────────────────────── */

.telem-dash-header {
  margin-bottom: var(--ds-space-lg);
}

.telem-dash-title {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}

.telem-dash-subtitle {
  font-size: 0.82em;
  color: var(--text-color-quiet);
  margin: 0;
}

/* ─── Section Titles ──────────────────────────────────────────── */

.telem-section-title {
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-color);
  margin: var(--ds-space-xl) 0 var(--ds-space-md);
  padding-bottom: var(--ds-space-xs);
  border-bottom: 2px solid var(--page-border);
}

.telem-section-sub {
  display: block;
  font-size: 0.75em;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-color-quiet);
  margin-top: 2px;
}

/* ─── Chart Legend Row ────────────────────────────────────────── */

.telem-chart-legend-row {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 0.75em;
  color: var(--text-color-quiet);
}

.telem-line-legend {
  display: flex;
  align-items: center;
  gap: 5px;
}

.telem-line-legend span {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

/* ─── No Data Placeholder ────────────────────────────────────── */

.telem-no-data {
  color: var(--text-color-quiet);
  font-style: italic;
  padding: 12px 0;
  font-size: 0.82em;
}

/* ─── Time Filter Bar ─────────────────────────────────────────── */

.telem-time-bar {
  display: flex;
  gap: var(--ds-space-xs);
  margin-bottom: var(--ds-space-xl);
}

.telem-time-btn {
  background: transparent;
  border: 1px solid var(--page-border);
  color: var(--text-color-quiet);
  border-radius: var(--ds-radius-full);
  padding: 4px 14px;
  height: 28px;
  font-size: 0.78em;
  text-transform: none;
  cursor: pointer;
  transition: var(--ds-transition-fast);
}

.telem-time-btn:hover {
  background: var(--page-action);
  color: var(--text-color);
}

.telem-time-btn--active {
  background: var(--action-color);
  border-color: var(--action-color);
  color: #fff;
}

.telem-time-btn--active:hover {
  background: var(--action-color-hilite);
}

/* ─── Data Tables ─────────────────────────────────────────────── */

.telem-table-wrapper {
  overflow-y: auto;
  border: 1px solid var(--page-border);
  border-radius: var(--ds-card-radius);
  background: #fff;
}

.telem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82em;
}

.telem-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.telem-table th {
  background: var(--bg-color);
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75em;
  letter-spacing: 0.5px;
  padding: var(--ds-space-sm) var(--ds-space-md);
  text-align: left;
  border-bottom: 2px solid var(--page-border);
}

.telem-table td {
  padding: var(--ds-space-sm) var(--ds-space-md);
  border-bottom: 1px solid var(--page-border);
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.telem-table tr:hover td {
  background: var(--page-action);
}

/* ─── Status Badges ───────────────────────────────────────────── */

.telem-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--ds-badge-radius);
  font-size: var(--ds-badge-font-size);
  font-weight: 600;
  text-transform: uppercase;
}

.telem-badge--green {
  background: rgba(var(--status-green-rgb), 0.15);
  color: #1a7a3a;
}

.telem-badge--orange {
  background: rgba(var(--status-orange-rgb), 0.15);
  color: #a06010;
}

.telem-badge--red {
  background: rgba(var(--status-red-rgb), 0.15);
  color: #b02020;
}

.telem-badge--blue {
  background: rgba(var(--status-blue-rgb), 0.15);
  color: #2040cc;
}

.telem-badge--gray {
  background: rgba(var(--status-gray-rgb), 0.12);
  color: #666;
}

/* ─── Inline Bar (mini horizontal bar in tables) ──────────────── */

.telem-inline-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: var(--action-color);
  opacity: 0.5;
  min-width: 2px;
  vertical-align: middle;
  margin-right: 6px;
}

/* ─── Loading state ───────────────────────────────────────────── */

.telem-loading {
  color: var(--text-color-quiet);
  font-size: 0.85em;
  padding: var(--ds-space-xl);
  text-align: center;
}

/* ─── Censorship grid ─────────────────────────────────────────── */

.telem-censor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--ds-space-md);
  margin-bottom: var(--ds-space-lg);
}

.telem-censor-card {
  background: #fff;
  border: 1px solid var(--page-border);
  border-radius: var(--ds-card-radius);
  padding: var(--ds-space-md) var(--ds-space-lg);
}

.telem-censor-card h4 {
  margin: 0 0 var(--ds-space-sm);
  font-size: 1em;
  font-weight: 600;
  color: var(--text-color);
}

.telem-censor-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82em;
  padding: 3px 0;
  color: var(--text-color);
}

.telem-censor-status {
  font-weight: 600;
}

/* ─── Horizontal Bar Chart ────────────────────────────────────── */

.telem-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.telem-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82em;
}

.telem-bar-label {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telem-bar-track {
  flex: 1;
  height: 18px;
  background: var(--page-action, #f0f0ec);
  border-radius: 3px;
  overflow: hidden;
}

.telem-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3051ff, #7c91ff);
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.telem-bar-value {
  width: 50px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
}

/* ─── Doughnut Chart ─────────────────────────────────────────── */

.telem-doughnut-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.telem-doughnut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.telem-doughnut-hole {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85em;
  color: var(--text-color);
}

.telem-doughnut-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78em;
  min-width: 0;
}

.telem-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telem-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.telem-legend-label {
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.telem-legend-value {
  font-weight: 600;
  color: var(--text-color-quiet);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ─── Search Cloud ───────────────────────────────────────────── */

.telem-search-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.telem-search-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--page-border);
  border-radius: 20px;
  color: var(--text-color);
  cursor: default;
  transition: var(--ds-transition-fast);
}

.telem-search-tag:hover {
  background: var(--action-color);
  color: #fff;
  border-color: var(--action-color);
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 900px) {
  .telem-charts-row,
  .telem-charts-row--three {
    grid-template-columns: 1fr;
  }

  .telem-panel {
    padding: var(--ds-space-md);
  }
}
