/* ── Card ── */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  padding: 24px;
  transition: box-shadow 0.18s ease;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.06); }

/* ── Button ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 8px 16px; font-size: 14px;
  border-radius: var(--radius-sm); font-weight: 500; letter-spacing: 0.01em;
  transition: opacity 0.15s, background 0.15s, box-shadow 0.15s; border: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 6px 13px; font-size: 12px; min-height: 30px; }
.btn-md { padding: 8px 17px; font-size: 14px; min-height: 36px; }
.btn-lg { padding: 11px 22px; font-size: 15px; min-height: 42px; }
.btn-primary { background: var(--accent-primary); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--accent-primary); border: 1.5px solid var(--accent-primary); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent-primary) 6%, transparent); }
.btn-subtle { background: var(--gray-100); color: var(--text); border: 1px solid var(--border); }
.btn-subtle:hover { background: var(--gray-200); }
.btn-danger { background: transparent; color: var(--red); border: 1.5px solid color-mix(in srgb, var(--red) 27%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 6%, transparent); }

/* ── Input ── */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-sub); margin-bottom: 6px; letter-spacing: 0.01em; }
.form-input {
  width: 100%; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 14px; background: var(--input-bg); color: var(--text);
  outline: none; line-height: 1.4; box-sizing: border-box;
}
.form-input:focus { border-color: var(--accent-primary); }
.form-input.has-prefix { padding-left: 74px; }
.form-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-muted); pointer-events: none; user-select: none;
}
.form-helper { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--red); margin-top: -12px; margin-bottom: 12px; }
.form-select {
  width: 100%; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: 14px; background: var(--input-bg); color: var(--text);
  outline: none; box-sizing: border-box;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  border-radius: 5px; padding: 2px 8px;
  font-size: 0.75rem; font-weight: 600; line-height: 1.5; letter-spacing: 0.01em;
}

/* ── Country Chip ── */
.country-chip {
  display: inline-flex; align-items: center;
  background: var(--gray-100); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 7px;
  font-size: 11px; font-weight: 600; color: var(--text-sub);
  font-family: monospace; letter-spacing: 0.04em;
}

/* ── Status Dot ── */
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.ok { background: var(--green); }
.status-dot.warn { background: var(--orange); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── Section Title ── */
.section-title {
  font-size: 0.875rem; font-weight: 500; color: var(--text-sub);
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 14px;
}

/* ── KPI Card ── */
.kpi-card {
  text-align: center;
  padding: 16px 12px;
  background: var(--kpi-bg);
  border-radius: var(--radius-md);
  box-shadow: none;
  border: none;
}
.kpi-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); opacity: 1; color: var(--accent-primary);
  margin-bottom: 6px;
}
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value {
  font-size: 2rem; font-weight: 200; color: var(--text);
  line-height: 1; letter-spacing: -0.03em; margin-bottom: 4px;
}
.kpi-label {
  font-size: 0.7rem; font-weight: 300; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
}

/* ── Trend Badge ── */
.trend-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--radius-sm); padding: 2px 6px;
  margin-top: 4px;
}
.trend-badge.up { background: color-mix(in srgb, var(--green) 9%, transparent); }
.trend-badge.down { background: color-mix(in srgb, var(--red) 9%, transparent); }
.trend-badge span { font-size: 11px; font-weight: 600; }
.trend-badge.up span { color: var(--green); }
.trend-badge.down span { color: var(--red); }

/* ── Chart container ── */
.chart-container { position: relative; width: 100%; }

/* ── Page heading ── */
.page-eyebrow {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.12em; margin-bottom: 4px;
}
.page-title {
  margin: 0; font-size: 30px; font-weight: 600;
  color: var(--text); letter-spacing: -0.03em;
}
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── Drawer ── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  backdrop-filter: blur(3px);
}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 520px; background: var(--card); z-index: 201;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 60px rgba(0,0,0,0.3);
  border-left: 1px solid var(--border);
}
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.drawer-steps {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  flex-shrink: 0;
}

/* ── Stepper indicator ── */
.stepper { display: flex; align-items: flex-start; }
.stepper-step { display: flex; align-items: center; flex: 1; }
.stepper-circle {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); transition: all 0.2s;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
}
.stepper-circle.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.stepper-circle.done { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.stepper-label { font-size: 10px; font-weight: 500; color: var(--text-muted); white-space: nowrap; margin-top: 4px; }
.stepper-label.active { color: var(--accent-primary); }
.stepper-label.done { color: var(--text-sub); }
.stepper-line {
  flex: 1; height: 2px; background: var(--border);
  margin: 0 3px; margin-bottom: 14px; transition: background 0.3s;
}
.stepper-line.done { background: var(--accent-primary); }

@media (max-width: 767px) {
  .drawer { width: 100vw; }
  .page-title { font-size: 22px; }
  .kpi-value { font-size: 1.25rem; }
  .kpi-card { padding: 12px 8px; }
  .kpi-icon { width: 24px; height: 24px; }
  .kpi-icon svg { width: 12px; height: 12px; }
}
