@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #12151C;
  --surface: #1A1F29;
  --surface-alt: #222836;
  --border: #2B3242;
  --text: #E9ECF3;
  --muted: #838EA3;
  --radio: #F0A93B;
  --tv: #35B7E0;
  --live: #FF5A4E;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: inherit; }

/* --- Layout --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255,90,78,0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,90,78,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255,90,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,90,78,0); }
}

.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

.logout-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem;
}
.logout-btn:hover { color: var(--text); border-color: var(--muted); }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.card h3 {
  margin: 0 0 14px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.stat-value { font-size: 2rem; font-weight: 600; font-family: 'IBM Plex Mono', monospace; }
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* --- Signature: waveform indicator --- */
.waveform { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.waveform span {
  width: 3px; background: var(--radio); border-radius: 1px;
  animation: wave 1.1s ease-in-out infinite;
}
.waveform.tv span { background: var(--tv); }
.waveform span:nth-child(1) { height: 40%; animation-delay: 0s; }
.waveform span:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.waveform span:nth-child(3) { height: 60%; animation-delay: 0.3s; }
.waveform span:nth-child(4) { height: 85%; animation-delay: 0.45s; }
.waveform.idle span { animation: none; height: 25% !important; background: var(--border); }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
.badge.on-air { background: rgba(255,90,78,0.12); color: var(--live); }
.badge.offline { background: rgba(131,142,163,0.12); color: var(--muted); }
.badge.radio { background: rgba(240,169,59,0.12); color: var(--radio); }
.badge.tv { background: rgba(53,183,224,0.12); color: var(--tv); }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Forms --- */
input {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  width: 100%;
}
input:focus { outline: 2px solid var(--tv); outline-offset: 1px; }
label { font-size: 0.8rem; color: var(--muted); display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }

.btn {
  background: var(--tv); color: #0B1016; border: none;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
.btn:hover { filter: brightness(1.08); }
.btn-danger { background: transparent; border: 1px solid var(--live); color: var(--live); padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; cursor: pointer; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.88rem; }
.alert-error { background: rgba(255,90,78,0.1); border: 1px solid rgba(255,90,78,0.3); color: #FFA79C; }
.alert-success { background: rgba(80,200,120,0.1); border: 1px solid rgba(80,200,120,0.3); color: #7EDB99; }

/* --- Login --- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 36px 32px;
}
.login-card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.login-card p.sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 24px; }
