/* SOH (State of Health) Dashboard Styles */
.soh-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
  color: #1e293b;
}

.soh-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
}

.soh-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.soh-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.soh-btn-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.soh-btn {
  background: #ffffff;
  border: none;
  border-right: 1px solid #cbd5e1;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.soh-btn:last-child {
  border-right: none;
}

.soh-btn:hover {
  background: #f1f5f9;
}

.soh-btn.active {
  background: #2563eb;
  color: #ffffff;
}

.soh-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
}

.soh-kpi-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.soh-kpi-card {
  flex: 1;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.soh-kpi-title {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 4px;
}

.soh-kpi-val {
  font-size: 20px;
  font-weight: 700;
}

.kpi-total { color: #0f172a; }
.kpi-ok { color: #16a34a; }
.kpi-warn { color: #d97706; }
.kpi-err { color: #dc2626; }

/* Chart Area */
.soh-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
}

.soh-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.soh-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.soh-canvas-wrap {
  width: 100%;
  height: 520px;
  position: relative;
}

#soh-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.soh-legend-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  max-height: 50px;
  overflow-y: auto;
  padding: 4px;
  font-size: 11px;
}

.soh-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.soh-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Tooltip */
.soh-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  display: none;
}

/* Table Area */
.soh-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.soh-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.soh-search-input {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 200px;
}

.soh-table-wrap {
  overflow-x: auto;
  max-height: 260px;
}

.soh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.soh-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.soh-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.soh-table tr:hover {
  background: #f8fafc;
}

/* Badges */
.soh-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-warn { background: #fef3c7; color: #b45309; }
.badge-err { background: #fee2e2; color: #b91c1c; }

/* Station Multi-select Modal/Dropdown */
.soh-sta-modal {
  display: none;
  position: absolute;
  top: 38px;
  left: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  padding: 12px;
  width: 320px;
  max-height: 400px;
  flex-direction: column;
  gap: 8px;
}

.soh-sta-modal.active {
  display: flex;
}

.soh-sta-list {
  overflow-y: auto;
  max-height: 280px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.soh-sta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}
