/* ═══════════════════════════════════════════
   BASE LAYOUT – body, header, main, footer, grids
   ═══════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(96,165,250,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(167,139,250,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(34,211,238,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
header {
  position: relative;
  z-index: 1;
  padding: 28px 24px 0;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-brand);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--glow-blue);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-secondary);
}

.clock span {
  color: var(--accent-cyan);
  font-weight: 500;
}

/* ── Main ── */
main {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Grid helpers ── */
.row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Section heading ── */
.section-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 30px 24px;
  color: var(--text-muted);
  font-size: 12px;
  position: relative;
  z-index: 1;
}

footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── Shared buttons ── */
.btn-primary {
  background: var(--gradient-brand);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-blue);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
}

.refresh-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: var(--glow-blue);
}

/* ── Status dots ── */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.dot-green  { background: var(--accent-green);  box-shadow: 0 0 6px rgba(52,211,153,0.6); animation: pulse-green 2s infinite; }
.dot-yellow { background: var(--accent-yellow); }
.dot-red    { background: var(--accent-red);    animation: pulse-red 1.5s infinite; }

/* ── Error message ── */
.error-msg {
  font-size: 12px;
  color: var(--accent-red);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ── API note ── */
.api-note {
  font-size: 11px;
  color: var(--text-muted);
}

.api-note a {
  color: var(--accent-blue);
  text-decoration: none;
}

.api-note a:hover { text-decoration: underline; }

/* ── Form inputs ── */
.field-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field-input:focus { border-color: var(--border-glow); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .row-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .row-2,
  .row-3,
  .row-4 { grid-template-columns: 1fr; }

  header { flex-direction: column; align-items: flex-start; }
}
