:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;

  --primary: #6d28d9;
  --primary-soft: rgba(109, 40, 217, 0.12);

  --success: #22c55e;
  --danger: #ef4444;

  --shadow: 0 10px 25px rgba(0,0,0,0.06);
  --radius: 16px;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ================= TOPBAR ================= */
.topbar {
  background: linear-gradient(135deg, #6a5acd, #a78bfa);
  color: white;
  padding: 18px 16px;
  box-shadow: 0 10px 25px rgba(106,90,205,0.25);
}

.topbar-inner {
  max-width: 900px;
  margin: auto;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.title {
  font-weight: 800;
}

.subtitle {
  font-size: 12px;
  opacity: 0.85;
}

/* ================= APP ================= */
.app {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 16px;
}

/* ================= CARD SYSTEM ================= */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

/* ================= SEARCH ================= */
.search-card {
  margin-top: 10px;
}

.search-card h2 {
  margin: 0;
  font-size: 16px;
}

.search-card p {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-box button {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ================= LOADING ================= */
.loading {
  text-align: center;
  margin: 20px 0;
  color: var(--primary);
  font-weight: 600;
}

.hidden {
  display: none;
}

/* ================= DASHBOARD ================= */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

/* ================= HERO ================= */
.hero .mid {
  font-size: 12px;
  color: var(--muted);
}

.hero .desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================= GRID ================= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* ================= INFO ================= */
.info .label {
  font-size: 11px;
  color: var(--muted);
}

.info .value {
  font-weight: 800;
  margin-top: 6px;
}

/* ================= SECTION ================= */
.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #4f46e5;
  margin-top: 6px;
}

/* ================= STD BOX ================= */
.std .label {
  font-size: 11px;
  color: var(--muted);
}

.std .value {
  font-size: 20px;
  font-weight: 900;
  margin-top: 6px;
}

.min {
  border: 1px solid rgba(34,197,94,0.25);
}

.max {
  border: 1px solid rgba(239,68,68,0.25);
}

/* ================= ACTIVE ================= */
.active {
  background: linear-gradient(135deg, #6d28d9, #a78bfa);
  color: white;
}

.active .label {
  font-size: 12px;
  opacity: 0.85;
}

.active .value {
  font-size: 22px;
  font-weight: 900;
  margin-top: 6px;
}

/* ================= BADGE ================= */
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.badge-purple {
  background: #7c3aed;
}

.badge-blue {
  background: #2563eb;
}

/* ================= NOTE ================= */
.note {
  background: #eef2ff;
  padding: 12px;
  border-radius: 14px;
  font-size: 13px;
  color: #374151;
}

/* ================= ERROR ================= */
.error-card {
  border: 1px solid rgba(239,68,68,0.2);
}

.error-title {
  font-weight: 800;
  color: var(--danger);
}

.error-msg {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ================= MOBILE ================= */
@media (max-width: 600px) {

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .search-box {
    flex-direction: column;
  }
}