/* === DASHBOARD === */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-card-placeholder {
  border: 1px dashed var(--border);
  border-radius: 12px;
  min-height: 80px;
  background: transparent;
  cursor: default;
}

.dashboard-card-placeholder:hover {
  border-color: var(--border);
  box-shadow: none;
}

.dashboard-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.dashboard-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-card-value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-card-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

/* === CHART CARDS === */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.chart-canvas-wrap {
  height: 150px;
  flex-shrink: 0;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0.5rem;
  min-height: 70px;
  overflow: hidden;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.chart-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-legend-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.5rem;
}

.chart-info-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  min-width: 24px;
  min-height: 24px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.chart-info-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.chart-card-placeholder {
  border-style: dashed;
}

.chart-card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--border);
  font-size: 2rem;
}

/* === CHART INFO POPUP === */
.chart-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-info-popup {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  min-width: 320px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.chart-info-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chart-info-popup-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chart-info-popup-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.chart-info-popup-close:hover {
  color: var(--text-primary);
  background: var(--bg-body);
}

.chart-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.chart-info-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.chart-info-table th:last-child,
.chart-info-table td:last-child {
  text-align: right;
}

.chart-info-table th:nth-child(2),
.chart-info-table td:nth-child(2) {
  text-align: right;
}

.chart-info-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.chart-info-table tr:last-child td {
  border-bottom: none;
  font-weight: 600;
}

/* === BOTTOM PANELS === */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-charts {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-grid,
  .dashboard-charts {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}
