: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 page ---------- */
.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;
}

/* ---------- Dashboard ---------- */
.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); }

.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;
}

/* live status row */
.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; }

/* level meter */
.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 button */
.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; }

/* recordings list */
.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 */
.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 */
.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;
}
