:root {
  --brand-blue: #1560d4;
  --brand-blue-dark: #0c3a80;
  --brand-blue-darker: #082a5e;
  --brand-gold: #f0b429;
  --white: #ffffff;
  --off-white: #f4f7fc;
  --grey: #7c8aa0;
  --danger: #e8483a;
  --warn: #f0b429;
  --ok: #2fb865;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--off-white);
  color: #16233d;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--brand-blue-darker), var(--brand-blue));
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 340px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  text-align: center;
}

.login-card img { width: 96px; margin-bottom: 20px; }

.login-card h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-blue-dark);
  margin: 0 0 24px;
}

.login-card input {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  font-size: 14px;
}

.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--brand-blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
}

.login-card button:hover { background: var(--brand-blue-dark); }

.login-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

.topbar {
  background: linear-gradient(120deg, var(--brand-blue-darker), var(--brand-blue));
  color: white;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar img { width: 48px; }

.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; flex: 1; }

.topbar a.logout {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 14px;
  border-radius: 20px;
}
.topbar a.logout:hover { background: rgba(255,255,255,0.15); }

.subnav {
  background: var(--brand-blue-dark);
  padding: 0 28px;
  display: flex;
  gap: 4px;
}
.subnav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.subnav a:hover { color: white; }
.subnav a.active { color: white; border-bottom-color: var(--brand-gold); }

.container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(20,40,80,0.06);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  margin: 0 0 14px;
}

.clock-card { text-align: center; }
.clock-tz { font-size: 10px; text-transform: none; letter-spacing: 0; color: var(--grey); font-weight: 400; }
.clock-wrap { display: flex; justify-content: center; margin-bottom: 10px; }
.clock-face { width: 180px; height: 180px; }
.clock-face line { transition: transform 0.15s cubic-bezier(0.4, 2.3, 0.6, 1); }
.clock-digital {
  font-family: "Consolas", monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-blue-dark);
  letter-spacing: 0.04em;
}
.clock-date { font-size: 12px; color: var(--grey); margin-top: 2px; }

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grey); }
.status-dot.connected { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.disconnected { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.status-text { font-size: 13px; color: var(--grey); font-weight: 600; }

.meter-track { height: 26px; background: #101827; border-radius: 6px; overflow: hidden; position: relative; }
.meter-bar { height: 100%; width: 0%; background: var(--ok); transition: width 0.08s linear, background 0.15s linear; }

.listen-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: var(--brand-gold);
  color: #3a2900;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.listen-btn.active { background: var(--danger); color: white; }
.listen-note { font-size: 11px; color: var(--grey); text-align: center; margin: 6px 0 0; }

.date-group summary { cursor: pointer; font-weight: 600; padding: 8px 0; font-size: 14px; color: var(--brand-blue-dark); }
.hour-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 14px; }
.hour-item { display: flex; align-items: center; gap: 2px; }
.hour-btn {
  border: 1px solid #d6dee9;
  background: var(--off-white);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.hour-btn:hover { background: #e2ecfb; }
.hour-btn.selected { background: var(--brand-blue); color: white; border-color: var(--brand-blue); }
.dl-icon { color: var(--grey); text-decoration: none; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.dl-icon:hover { background: #e2ecfb; color: var(--brand-blue-dark); }

.player-box audio { width: 100%; }
.player-nav { display: flex; justify-content: space-between; margin-top: 10px; }
.player-nav button {
  background: var(--off-white);
  border: 1px solid #d6dee9;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}
.player-nav button:hover { background: #e2ecfb; }
.download-btn {
  background: var(--brand-gold);
  color: #3a2900;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  align-self: center;
}
.download-btn:hover { background: #e0a624; }
.now-playing { font-size: 13px; color: var(--grey); margin-bottom: 8px; }

.log-box {
  background: #0c1526;
  color: #b6c6e3;
  font-family: "Consolas", monospace;
  font-size: 12px;
  padding: 12px;
  border-radius: 8px;
  height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.adverts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adverts-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey);
  padding: 8px 10px;
  border-bottom: 2px solid var(--off-white);
}
.adverts-table td { padding: 10px; border-bottom: 1px solid var(--off-white); }
.adverts-table tr:hover td { background: var(--off-white); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill.active { background: #dff5e6; color: var(--ok); }
.pill.inactive { background: #f5e6e0; color: var(--danger); }
.pill.warn { background: #fdf1d6; color: #9a6b00; }
.pill.neutral { background: var(--off-white); color: var(--grey); }

.notice-box {
  background: #fdf1d6;
  color: #7a5400;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--brand-blue);
  color: white;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-btn:hover { background: var(--brand-blue-dark); }
