@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

:root {
  --bg: #070b16;
  --card: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
  --muted: rgba(255,255,255,0.7);
  --text: #ffffff;
  --purple: #7c3aed;
  --purple2: #4f46e5;
  --shadow: 0 12px 35px rgba(0,0,0,0.45);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: radial-gradient(circle at top, #131f40, var(--bg));
  color: var(--text);
}

.app {
  max-width: 1100px;
  margin: auto;
  padding: 25px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.title h1 {
  font-size: 28px;
  font-weight: 800;
}

.title p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.btn {
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: .2s;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.time {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.kpi-card.purple {
  border-left: 4px solid var(--purple);
}

.kpi-card .label {
  font-size: 13px;
  color: var(--muted);
}

.kpi-card .value {
  font-size: 30px;
  font-weight: 800;
  margin: 10px 0;
}

.kpi-card .sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card h2 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 800;
}

.loading {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.result {
  padding: 18px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
}

.result pre {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}

.error {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.18);
  font-weight: 600;
}

.footer {
  text-align: center;
  margin-top: 25px;
  padding: 18px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

/* Responsivo */
@media (max-width: 900px) {
  .topbar { flex-direction: column; }
  .actions { align-items: flex-start; }
  .kpis { grid-template-columns: 1fr; }
}
