:root {
  --bg: #0e1116;
  --surface: #171c24;
  --surface2: #1f2630;
  --border: #2a3341;
  --text: #e8edf4;
  --muted: #8b98a9;
  --accent: #1db954;
  --accent-dim: #14833b;
  --danger: #e5484d;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-weight: 700; font-size: 17px; }
nav { display: flex; gap: 6px; }
nav button {
  background: none; border: none; color: var(--muted);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
nav button.active { background: var(--surface2); color: var(--text); font-weight: 600; }

main { max-width: 1100px; margin: 0 auto; padding: 24px; }

h1 { font-size: 22px; }
h2 { font-size: 16px; margin: 24px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

button {
  background: var(--accent); color: #fff; border: none;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
}
button:hover { background: var(--accent-dim); }
button.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--border); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; }
button.mini { padding: 3px 9px; font-size: 12px; }

input, select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.inline-form input, .inline-form select { min-width: 130px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat .l { font-size: 12px; color: var(--muted); }
.stat .v.pos { color: var(--accent); }
.stat .v.neg { color: var(--danger); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface2); }
td.num, th.num { text-align: right; }
.pos { color: var(--accent); }
.neg { color: var(--danger); }
.muted { color: var(--muted); }

/* обкладинки Spotify (не обрізати й не накладати нічого — вимога Spotify) */
.cover {
  width: 34px; height: 34px; border-radius: 6px; object-fit: cover;
  background: var(--surface2); flex: none;
}
.cover.round { border-radius: 50%; }
.cover.lg { width: 64px; height: 64px; border-radius: 10px; }
.cover.lg.round { border-radius: 50%; }
.cell-name { display: flex; align-items: center; gap: 10px; }
.title-row { display: flex; align-items: center; gap: 14px; }
.cover-ph {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px;
}

.ext-link { color: var(--accent); font-size: 13px; display: inline-block; margin-bottom: 6px; text-decoration: none; }
.ext-link:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.back { margin-bottom: 14px; }
.hidden { display: none !important; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.rate-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

#login-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
#login-form { display: flex; flex-direction: column; gap: 12px; width: 300px; }
#login-form h2 { text-align: center; }
