:root {
  color-scheme: light dark;
  --bg: #f7f7f8;
  --fg: #1c1c1e;
  --card: #ffffff;
  --border: #dcdce0;
  --accent: #0a6cd6;
  --accent-2: #22b8db;
  --muted: #6b6b70;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.brand-icon { height: 30px; width: 30px; display: block; }
.brand-text { font-size: 1.05rem; }
.brand-dg {
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sep {
  margin-left: 0.4rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85rem;
}
.topbar-right { color: var(--muted); font-size: 0.9rem; }
.topbar-right a { color: var(--accent); text-decoration: none; }

main {
  max-width: 1150px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.login-box {
  max-width: 320px;
  margin: 4rem auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}

.login-box form { display: flex; flex-direction: column; gap: 1rem; }
.login-box label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }

input[type=text], input[type=password], input[type=date] {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

button {
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}
button:hover { opacity: 0.9; }

.filters {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.filters label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.clear-link { align-self: center; color: var(--muted); font-size: 0.85rem; }

.result-count { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; }

table.recordings {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
table.recordings th, table.recordings td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}
table.recordings th { background: #f0f0f2; font-weight: 600; }
table.recordings td.empty { text-align: center; color: var(--muted); padding: 2rem; }
audio { height: 40px; width: 380px; max-width: 100%; }
td.play-cell { min-width: 380px; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.pagination a { color: var(--accent); text-decoration: none; }

.flashes { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; font-size: 0.9rem; }
.flash-error { background: #fdecea; color: #b3261e; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --fg: #ececec;
    --card: #131c2e;
    --border: #263248;
    --accent: #4fd1e8;
    --accent-2: #22b8db;
  }
  table.recordings th { background: #1a2438; }
  .flash-error { background: #3a1a18; color: #ff8b83; }
}
