/* ─────── Common styles shared across all dashboard pages ─────── */

:root {
  --bg: #fbf7ee;
  --bg2: #ffffff;
  --bg3: #f3ede0;
  --row-a: #e7eef4;
  --row-a-hover: #c8d6e3;
  --row-b: #f5e8cf;
  --row-b-hover: #e6cf9f;
  --border: #e8e1d0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent2: #ea580c;
  --text: #1c1917;
  --text2: #44403c;
  --text3: #78716c;
  --art-size: 100px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
}

/* ── Top header bar ── */
.header {
  padding: 28px 40px 0;
  border-bottom: 1px solid var(--border);
  background: #dde7ef;
  display: flex;
  align-items: flex-end;
  gap: 32px;
}

.header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.5px;
  padding-bottom: 18px;
  flex-shrink: 0;
}

.content-tabs {
  display: flex;
  gap: 0;
  flex: 1;
}

.content-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 20px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}

.content-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.content-tab:hover:not(.active) { color: var(--text2); }

.time-filter {
  display: flex;
  gap: 2px;
}

.time-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px 18px;
  cursor: pointer;
  transition: color 0.15s;
}

.time-btn:hover { color: var(--text2); }

.time-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.user-filter {
  border: 1px solid var(--accent);
  border-radius: 3px;
  background-color: transparent;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 5px 26px 5px 10px;
  margin-bottom: 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='%232563eb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  transition: background-color 0.15s;
}

.user-filter:hover { background-color: rgba(37, 99, 235, 0.08); }

/* ── Sub-header bar (Back button row on detail pages) ── */
.sub-header {
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
}

.back-link {
  background: none;
  border: none;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0;
}

.back-link:hover { color: var(--accent); }

/* ── Utility classes ── */
.hidden { display: none !important; }
.is-clickable { cursor: pointer; }

/* ── Inline links to artist/album/track pages ── */
.artist-link { color: inherit; text-decoration: none; }
.artist-link:hover { color: var(--accent); text-decoration: underline; }

.track-link { color: inherit; text-decoration: none; }
.track-link:hover { color: var(--accent); text-decoration: underline; }

/* ── Detail-page genre line + shared stat-link affordance ── */
.stat-genre {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text3);
  letter-spacing: 0.03em;
}
.stat-link {
  color: inherit;
  cursor: pointer;
  transition: color 0.1s;
}
.stat-link:hover { color: var(--accent); }

/* ── Column pagination controls ── */
.col-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text2);
}

.col-pag-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 5px 11px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s;
}

.col-pag-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.col-pag-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Loading / error states ── */
.loading {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  padding: 20px 8px;
  letter-spacing: 0.05em;
}

.error {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #8b3030;
  padding: 20px 8px;
}

/* ── Mobile header rules (apply to every page) ── */
@media (max-width: 720px) {
  .header {
    padding: 14px 16px 0;
    flex-wrap: wrap;
    gap: 8px 20px;
  }
  .header-title { font-size: 22px; padding-bottom: 10px; }
  .content-tabs {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .content-tab {
    padding: 8px 14px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
  .time-filter {
    order: 2;
    padding-bottom: 10px;
    flex-wrap: wrap;
  }
  .time-btn { padding: 8px 8px 4px; font-size: 10px; }
  .user-filter {
    order: 2;
    margin-bottom: 8px;
    padding: 4px 22px 4px 8px;
    font-size: 10px;
  }
  .sub-header { padding: 10px 16px; }
}
