:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --accent: #0f766e;
  --accent-2: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #dbeafe 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #ccfbf1 0%, transparent 45%),
    var(--bg);
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.chart-toolbar {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-search {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
  font-size: 0.92rem;
}

.chart-search-status {
  min-height: 20px;
  margin-top: 6px;
}

.toggle-btn {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-btn[aria-pressed="true"] {
  background: #dbeafe;
  border-color: #93c5fd;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 320px 220px;
  gap: 14px;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

input,
select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.95rem;
}

.stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  background: #ffffffcc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.stat .label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat .value {
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 700;
}

.chart-wrap {
  position: relative;
  height: 480px;
}

.table-wrap {
  overflow: auto;
  max-height: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #ecfeff;
}

tbody tr.selected {
  background: #cffafe;
}

@media (max-width: 960px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .chart-wrap {
    height: 360px;
  }
}
